akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

#define INF 1001001001
#define LINF 1001001001001001001
#define MOD 1000000007
#define MOD2 998244353

template<class T,class U>bool chmax(T &a, const U &b){if(a<b){a=b;return 1;}return 0;}
template<class T,class U>bool chmin(T &a, const U &b){if(b<a){a=b;return 1;}return 0;}

#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define rep1(i,a,b) for(int a_=(a),b_=(b),i=a_;i<b_;++i)
#define repr(i,n) for(int _i=(n),i=_i;i>0;--i)

#define db(x) cerr<<#x<<" = "<<x<<" ";
#define db2(x,y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<") ";
#define db3(x,y,z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = ("<<x<<", "<<y<<", "<<z<<") ";
#define ln cout<<endl;

#define all(a)  (a).begin(),(a).end()
#define dig(n)  to_string(n).length()

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define se second
#define fi first

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pii,pii> ppii;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return (a*b)/gcd(a,b);}

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main(){
    int inv=0;

    list<char>sl;
    string s;
    int q;
    cin>>s>>q;

    for(auto sc:s)sl.emplace_back(sc);


    rep(i,q){
        int t;
        cin>>t;

        if(t==1)inv=(inv+1)%2;
        else{
            int f;
            char c;
            cin>>f>>c;

            if(inv==1)f=(f+1)%2;

            if(f==1){
                sl.emplace_front(c);
            }else{
                sl.emplace_back(c);
            }
        }
    }


    if(inv==1)reverse(all(sl));
    
    for(auto it=sl.begin();it!=sl.end();++it)cout<<*it;
    ln;

    //if(flag)cout << "Yes" <<endl;
    //else cout << "No" <<endl;
    
    return 0;
}


Measured memory_bytes: 9984
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define sz(a) a.size()
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;


string to_string(string s) {
	return '"' + s + '"';
}

string to_string(const char* s) {
	return to_string((string) s);
}

string to_string(bool b) {
	return (b ? "true" : "false");
}

string to_string(char ch) {
	return string("'")+ch+string("'");
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
	return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <class InputIterator>
string to_string (InputIterator first, InputIterator last) {
	bool start = true;
	string res = "{";
	while (first!=last) {
		if (!start) {
			res += ", ";
		}
		start = false;
		res += to_string(*first);
		++first;
	}
	res += "}";
	return res;
}

template <typename A>
string to_string(A v) {
	bool first = true;
	string res = "{";
	for (const auto &x : v) {
		if (!first) {
			res += ", ";
		}
		first = false;
		res += to_string(x);
	}
	res += "}";
	return res;
}

void debug_out() { cerr << endl; }

template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
	cerr << " " << to_string(H);
	debug_out(T...);
}

template <typename A, typename B>
istream& operator>>(istream& input,pair<A,B>& x){
	input>>x.F>>x.S;
	return input;
}

template <typename A>
istream& operator>>(istream& input,vector<A>& x){
	for(auto& i:x)
		input>>i;
	return input;
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif



const int mod=998244353;

int mul(int a,int b)
{
	return (a*1ll*b)%mod;
	}
	
void add(int &a,int b)
{
	a+=b;
	if(a>=mod)a-=mod;
	}
int powz(int a,int b)
{
	int res=1;
	while(b)
	{
		if(b&1)res=mul(res,a);
		b/=2;
		a=mul(a,a);
		}
	return res;
	}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const int N=300005;

   
void solve(){
ll r,d,x;
cin>>r>>d>>x;
ll prev=x,cur;
for(int i=0;i<10;i++)
{
	cur=prev*r-d;
	cout<<cur<<"\n";
	prev=cur;
	}
}
	

int main()
{   
    ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int tc=1;
	//cin>>tc;
	
    for(int i=0;i<tc;i++)
	{
		//cout<<"Case #"<<i+1<<": "; 
        solve();
		}
	
	}
/* Intuition > Logic 
 * If you are not confident please dont submit
 * When you feel like Quitting: Remember why you started
 * Game Theory == Skip
 * If n== 1e18 apply binary or Matrix expo

 *  I see those tears in your eyes
   I feel so helpless inside
   Oh love, there's no need to hide
   Just let me love you when your heart is tired
   Cold hands, red eyes
   Packed your bags at midnight
   They've been there for weeks
   You don't know what goodbye means
   Just roll up a cigarette
   Just forget about this mess
   Waiting on the sidelines
   From the sidelines
 */


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

signed main()
{
    int N; cin>>N;
    deque<int> b;
    REP(i,N){
        int a; cin>>a;
        if(i%2==0) b.push_back(a);
        else b.push_front(a);
    }
    if(N%2==1) reverse(ALL(b));
    REP(i,N) cout<<b[i]<<' ';
}


Measured memory_bytes: 3840
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ull unsigned long long
#define ii pair<int,int>
#define iii pair<ii, int>

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ep emplace_back
#define sz(a) (int) a.size()
#define cl(a) a.clear()

#define vi vector<int>
#define vii vector<ii>

#define FOR(x,a,b) for (int x=a;x<=b;x++)
#define FOD(x,a,b) for (int x=a;x>=b;x--)
#define REP(x,a,b) for (int x=a;x<b;x++)
#define RED(x,a,b) for (int x=a;x>b;x--)

const int N = 1e5 + 10;
const int M = 1e4 + 10;
const int MOD = 1e9 + 7;
const int inf = 1e9;
const double pi = acos(-1.0);
const double eps = 1e-6;

int dx[] = {0 , -1 , 0 , 1};
int dy[] = {1 , 0 , -1 , 0};
int n;
int a[N];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.txt", "r" , stdin);
    cin >> n;
    FOR(i, 1, n)
        cin >> a[i];

    int res = 0;
    FOR(i, 1, n)
    {
        if (a[a[i]] == i)
            res++;
    }


    cout << res/2;
	return 0;
}


Measured memory_bytes: 640
#include<stdio.h>
int main(void)
{
	int N,K;
	char S[10],a;
	scanf("%d", &N);
	scanf("%s",S);
	scanf("%d", &K);
	for (int i = 0; i < N; i++) {
		if (S[i] == S[K-1])
			printf("%c", S[i]);
		else
			printf("*");
	}
	
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i < n+1; i++)
#define sort(A) sort(A.begin(),A.end())
#define reverse(A) reverse(A.begin(),A.end());
#define vecmin(A) *min_element(A.begin(),A.end());
#define vecmax(A) *max_element(A.begin(),A.end());
typedef long long ll;

int main(){
  int x,a,b;
  cin >> x >> a >> b;
  if(abs(x-a)<abs(x-b)) cout << 'A' << endl;
  else cout << 'B' << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        // 標準入力からデータを読み込む準備
        Scanner sc = new Scanner(System.in);

        int n, s;
        while ((n = sc.nextInt()) != 0) {
            int max = 0, min = 1000, sum = 0;// 比較に寄り更新させる
            for (int i = 0; i < n; i++) {
                s = sc.nextInt(); // ここで全て+=にて代入す
                sum += s;
                if (s > max) {
                    max = s;
                }
                if (s < min) {
                    min = s;
                }
            }
            System.out.println((sum - max - min) / (n - 2));
        }
    }
}

// 最高点と最低点は除外する．(必ず2つのデータは除外)
// もし最高点をつけた審判が複数いた ら，そのうちのひとつだけを無視する
// 最低点についても同様である
// 平均点 には端数があるかもしれないが，それは切り捨てて最終的な点数は整数値


Measured memory_bytes: 29016
#include <bits/stdc++.h>
using namespace std;

int main(){
   int k;
   string s;
   cin >> k >> s;
   if(s.size()<=k){
      cout << s << endl;
   }else{
      for(int i=0; i<k; i++){
         cout << s[i];
      }
      cout << "..." << endl;
   }
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define ll long long
#define MAXN 200005
#define INF 0x3f3f3f3f
#define ld long double
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    #define int ll
    int a,b,n;
    cin>>a>>b>>n;
    int i=min(b-1,n);
     int   tp=(a*i)/b-a*(i/b);
    cout<<tp<<endl;

    return 0;
}


Measured memory_bytes: 3656
#!/usr/bin/env python3
import sys


def solve(A: int, B: int, C: int, D: int):
    left = A + B
    right = C + D

    if left > right:
        print('Left')
    elif left == right:
        print('Balanced')
    elif left < right:
        print('Right')

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    solve(A, B, C, D)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#ifdef BUILT_LOCAL

#include "niklib.h"

#endif

#include <iostream>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <string>
#include <cstdio>
#include <map>
#include <cmath>
#include <set>
#include <list>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef __int128 lll;
constexpr ll mod = 1000000007;

#define bs(n) (1ull<<(ull)(n))
#define rep(i, n) for(ll (i) = 0;(i) < (n);(i)++)


int main() {
    ll s = 0, n, m, a[100];
    cin >> n >> m;
    rep(i, n) {
        cin >> a[i];
        s += a[i];
        a[i] *= 4 * m;
    }
    int c = 0;
    rep(i, n) {
        if (a[i] >= s) {
            c++;
        }
    }
    if (c >= m) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#define REP(i, t, n)  for (int i = t; i < n; i++)
#define ALL(n)        (n).begin(),(n).end()
#include <limits.h>
#include <stdio.h>
#include <cmath>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <deque>
#include <functional>
#include <algorithm>
#include <cstring>
#include <unordered_map>
#include <numeric>

using namespace std;

typedef bool               BOOL;
typedef short              WORD;
typedef unsigned short     U_WORD;
typedef long               DWORD;
typedef unsigned long      U_DWORD;
typedef long long          QWORD;
typedef unsigned long long U_QWORD;

#define N_MAX (100000)

typedef struct distance_x {
	DWORD dwTown;
	QWORD qwCost_X;
	bool operator > (const distance_x& e) const {
		return qwCost_X > e.qwCost_X;
	}
} DIST_X;

typedef struct distance_y {
	DWORD dwTown;
	QWORD qwCost_Y;
	bool operator > (const distance_y& e) const {
		return qwCost_Y > e.qwCost_Y;
	}
} DIST_Y;

typedef struct edge {
	DWORD	dwTo;
	QWORD	qwCost;
	bool operator > (const edge& e) const {
		return qwCost > e.qwCost;
	}
} EDGE;

typedef struct {
	QWORD qwX;
	QWORD qwY;
} POS;

POS  vPosList[N_MAX];
priority_queue<DIST_X, vector<DIST_X>, greater<DIST_X>> que_x;
priority_queue<DIST_Y, vector<DIST_Y>, greater<DIST_Y>> que_y;
priority_queue<EDGE, vector<EDGE>, greater<EDGE>> que_edge;
vector <EDGE> vList[N_MAX];


QWORD prim()
{
	BOOL bUsed[N_MAX] = {};
	
	QWORD qwAns = 0;

	que_edge.push(EDGE{0,0});

	while (!que_edge.empty()) {
		EDGE nowEdge = que_edge.top(); que_edge.pop();
		if (bUsed[nowEdge.dwTo]) continue;
		bUsed[nowEdge.dwTo] = true;
		qwAns += nowEdge.qwCost;

		for (auto iter : vList[nowEdge.dwTo]) {
			que_edge.push(iter);
		}
	}
	return qwAns;
}

void makeEdge()
{
	DWORD dwPreTown;
	dwPreTown = que_x.top().dwTown; que_x.pop();

	while (!que_x.empty()) {
		DIST_X tmpX = que_x.top(); que_x.pop();
		QWORD	qwCost = min(abs(vPosList[dwPreTown].qwX - vPosList[tmpX.dwTown].qwX), abs(vPosList[dwPreTown].qwY - vPosList[tmpX.dwTown].qwY));

		vList[tmpX.dwTown].push_back(EDGE{ dwPreTown , qwCost });
		vList[dwPreTown].push_back(EDGE{ tmpX.dwTown , qwCost });
		
		dwPreTown = tmpX.dwTown;
	}

	dwPreTown = que_y.top().dwTown; que_y.pop();
	while (!que_y.empty()) {
		DIST_Y tmpY = que_y.top(); que_y.pop();
		QWORD  qwCost = min(abs(vPosList[dwPreTown].qwX - vPosList[tmpY.dwTown].qwX), abs(vPosList[dwPreTown].qwY - vPosList[tmpY.dwTown].qwY));

		vList[tmpY.dwTown].push_back(EDGE{ dwPreTown , qwCost });
		vList[dwPreTown].push_back(EDGE{ tmpY.dwTown , qwCost });

		dwPreTown = tmpY.dwTown;
	}

}

void solve_main()
{
	DWORD N;
	cin >> N;


	REP(i, 0, N) {
		QWORD	qwX, qwY;
		cin >> qwX >> qwY;

		vPosList[i].qwX = qwX;
		vPosList[i].qwY = qwY;

		que_x.push(DIST_X{ i,  qwX});
		que_y.push(DIST_Y{ i,  qwY});
	}

	makeEdge();

	cout << prim() << endl;

}

int main()
{
#ifdef FOR_IDE
	ifstream in("input.txt");
	cin.rdbuf(in.rdbuf());
#endif

	solve_main();
	return 0;
}


Measured memory_bytes: 22628
import Text.Parsec
import Control.Applicative ((<$>))
import qualified Data.ByteString.Char8 as BC
import qualified Data.ByteString.Lazy.Char8 as BLC

separators = " ,."

words' :: Parsec BC.ByteString u [BLC.ByteString]
words' = (BLC.pack <$> many (noneOf separators)) `sepEndBy` oneOf separators

valid :: BLC.ByteString -> Bool
valid s = let l = BLC.length s in
    3 <= l && l <= 6

listWords :: BC.ByteString -> [BLC.ByteString]
listWords src = case parse words' "" src of
                    Left _ -> []
                    Right wrds -> filter valid wrds

main = BC.getLine >>= BLC.putStrLn . BLC.unwords . listWords

Measured memory_bytes: 4220
import java.util.Scanner;

public class Main{
    public static void main (String[] args){
    Scanner sc = new Scanner(System.in);
        while(true){
            String s = sc.next();
            if(s.equals("0")){
                break;
            }

            int a = 0;
            for(int i=0;i<s.length();i++){
                a += s.charAt(i) - '0';
            }
            System.out.println(a);
   
        }
    
    }   
}


Measured memory_bytes: 26472
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0; (i)<(n); (i)++)
#define ll long long
#define pp pair<int,int> 
const int INF = 1001001001;
//int 2×10の9乗
//vector<vector<int>> a(n, vector<int>(m));
  //rep(i,n) rep(j,m) cin >> a[i][j]; 
//cout << fixed << setprecision(10);
//int gcd(int x, int y){
  //if(y==0) return x;
  //return gcd(y, x%y);
//}
 
int main(){
  int t,x;
  cin >> t >> x;
  cout << (double)t/x << endl;
  }    

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #define int long long int
    int a,b,m,ans=INT_MAX;
    cin>>a>>b>>m;
    int p[a],q[b];
    int x,y,c;
    for(int i=0;i<a;i++)cin>>p[i];
    for(int i=0;i<b;i++)cin>>q[i];
    for(int i=0;i<m;i++)
    {
        cin>>x>>y>>c;
        ans=min(p[x-1]+q[y-1]-c,ans);
    }
    int ans1=INT_MAX;

    sort(p,p+a);
    sort(q,q+b);

    cout<<min(p[0]+q[0],ans)<<endl;

    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;

const int MOD = 1e9 + 7; // change if needed

struct Modint {
  ll val;
  
  Modint (ll _val = 0)
    : val(_val % MOD) {}

  Modint operator+ (Modint other) const {
    return Modint(val + other.val);
  }

  void operator+= (Modint other) {
    val += other.val;
    val %= MOD;
  }

  Modint operator- () const {
    return Modint(MOD - val);
  }

  Modint operator- (Modint other) const {
    return Modint(val + MOD - other.val);
  }

  void operator-= (Modint other) {
    val += MOD - other.val;
    val %= MOD;
  }

  Modint operator* (Modint other) const {
    return Modint(val * other.val);
  }

  void operator*= (Modint other) {
    val *= other.val;
    val %= MOD;
  }

  bool operator== (Modint other) const {
    return val == other.val;
  }

  bool operator!= (Modint other) const {
    return val != other.val;
  }
};

Modint exp (Modint a, ll k) {
  if (k == 0) {
    return Modint(1);
  } else if (k % 2 == 0) {
    Modint half = exp(a, k / 2);
    return half * half;
  } else {
    return a * exp(a, k - 1);
  }
}

Modint inv (Modint a) {
  return exp(a, MOD - 2);
}

ostream& operator<< (ostream& out, Modint p) {
  out << p.val;
  return out;
}

const int MAX_N = 105;

int arr [MAX_N];

int depc [MAX_N][MAX_N];
// depc[i][j] should be the # of deps at position i
// that started at >= j

Modint dp [MAX_N][MAX_N];

int main () {
  ios::sync_with_stdio(false);
  
  int n;
  cin >> n;

  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }

  vector<pair<int, int>> stk; // <i, h>
  stk.push_back(make_pair(1, 0));
  int curh = arr[1];

  for (int i = 2; i <= n; i++) {
    if (arr[i] > curh) {
      stk.push_back(make_pair(i, curh));
      curh = arr[i];
    }

    if (arr[i] < curh) {
      while (stk.back().second >= arr[i]) {
        depc[i - 1][stk.back().first] += curh - stk.back().second;
        curh = stk.back().second;
        stk.pop_back();
      }

      depc[i - 1][stk.back().first] += curh - arr[i];
      curh = arr[i];
    }
  }

  while (!stk.empty()) {
    depc[n][stk.back().first] += curh - stk.back().second;
    curh = stk.back().second;
    stk.pop_back();
  }
  depc[n][1]--;
  
  for (int i = 1; i <= n; i++) {
    for (int j = MAX_N - 2; j >= 0; j--) {
      depc[i][j] += depc[i][j + 1];
    }
  }
  
  dp[1][0] = Modint(2) * exp(Modint(2), depc[1][1]);
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i; j++) {
      // put in the opposite color
      dp[i + 1][j] += dp[i][j] * exp(Modint(2), depc[i + 1][j + 1]);
      // put in the same color
      dp[i + 1][i] += dp[i][j] * exp(Modint(2), depc[i + 1][i + 1]);
    }
  }
  
  Modint ans (0);
  for (int j = 0; j < n; j++) {
    ans += dp[n][j];
  }

  cout << ans << endl;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

/////////////////////////////////////////////////////////////
map<ll, ll> prime_factorization(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; ++i) {
    while (n % i == 0) {
      res[i] += 1;
      n /= i;
    }
  }
  if (n != 1) res[n] = 1;
  return res;
}
/////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////
class CombinationModulo {
 public:
  static const ll MOD = (ll)(1e9 + 7);

  vector<ll> fact;
  vector<ll> inv;
  vector<ll> fact_inv;

  CombinationModulo(int n) {
    this->fact = vector<ll>(n + 1, 0LL);
    this->inv = vector<ll>(n + 1, 0LL);
    this->fact_inv = vector<ll>(n + 1, 0LL);
    init(n);
  }

  void init(int n) {
    inv[1] = fact[0] = fact_inv[0] = 1LL;
    for (int i = 2; i <= n; i++) {
      inv[i] = (MOD - (MOD / i) * inv[MOD % i] % MOD) % MOD;
    }
    for (int i = 1; i <= n; i++) {
      fact[i] = fact[i - 1] * i % MOD;
    }
    for (int i = 1; i <= n; i++) {
      fact_inv[i] = fact_inv[i - 1] * inv[i] % MOD;
    }
  }

  ll comb(int n, int r) {
    if (r > n) return 0LL;
    return fact[n] * fact_inv[r] % MOD * fact_inv[n - r] % MOD;
  }
};
/////////////////////////////////////////////////////////////

const ll MOD = (ll)(1e9 + 7);

int n;
ll m;

ll ans;

int main(void) {
  // Here your code !
  scanf("%d %lld", &n, &m);

  auto prime_map = prime_factorization(m);

  int max_sholder = -1;

  for (auto &e : prime_map) {
    max_sholder = max(max_sholder, (int)(e.second));
  }

  CombinationModulo cm(n + max_sholder + 3);

  ans = 1LL;

  for (auto &e : prime_map) {
    ll cur = cm.comb(n + (int)(e.second) - 1, (int)(e.second));
    ans *= cur;
    ans %= MOD;
  }

  printf("%lld\n", ans);

  return 0;
}


Measured memory_bytes: 2560
#include<iostream>
using namespace std;
int main(){
  int a;
  int b;
  cin >>a>>b;
  if (a==2&&b==2) cout <<"Yes"<<endl; 
  else if ((a==4|a==6|a==9|a==11)&&(b==4|b==6|b==9|b==11)) cout <<"Yes"<<endl; 
  else if ((a!=4&&a!=6&&a!=9&&a!=11&&a!=2)&&(b!=4&&b!=6&&b!=9&&b!=11&&b!=2)) cout <<"Yes"<<endl;
  else cout<<"No";
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(ll)n;i++)


int main(){
    int n,k; cin >> n >> k;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];
    rep(i,n-k){
        if(a[i] < a[i+k]) cout << "Yes" << endl;
        else cout << "No" << endl; 
    }
}

Measured memory_bytes: 4844
#include <cstdio>

int main()
{

    int count[26];
    for (int i = 0; i < 26; i++)
    {
        count[i] = 0;
    }
    char s[1300];
    while (fgets(s, 1300, stdin) != NULL)
    {
        for (int i = 0; s[i] != '\0'; i++)
        {
            if (s[i] >= 'A' && s[i] <= 'Z') //sに文字列が入っているので
            {
                count[s[i] - 'A']++; //ここで数える
            }
            if (s[i] >= 'a' && s[i] <= 'z') //
            {
                count[s[i] - 'a']++;
            }
        }
    }
    for (int i = 0; i < 26; i++)
    {
        printf("%c : %d\n", 'a' + i, count[i]);
    }
    return 0;
}


Measured memory_bytes: 2684
#include <bits/stdc++.h>
#define ll long long int
#define mp make_pair
#define pb push_back
#define ff first 
#define ss second
#define mod 1000000007
#define lim 100005
#define nfs_mw ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

ll dp[1<<21][22] = {};

int main()
{
	nfs_mw;
	int i,j,n,comp[21] = {},v,mask;
	cin>>n;
	for(i=1; i<=n; i++)
		for(j=0; j<n; j++){
			cin>>v;
			comp[i] |= (v<<j);
		}

	for(i=0; i<22; i++)
		for(mask=0; mask<(1<<21); mask++)
			dp[mask][i] = 0;
	
	dp[0][0] = 1;
	
	for(i=1; i<=n; i++)
		for(mask=1; mask<(1<<n); mask++){
			if(__builtin_popcount(mask) != i) continue;
			int p = mask&comp[i];
			while(p){
				int match = p&(-p);
				dp[mask][i] = (dp[mask][i] + dp[mask^match][i-1])%mod;
				p ^= match;
			}
		}

	cout<<dp[(1<<n)-1][n];
}

Measured memory_bytes: 360704
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,a,b) for(ll i=a;i<b;i++)
#define mod 1000000007
#define ii pair<ll,ll>
#define vii vector<ii>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define mod 1000000007
ll modpow(ll base, ll exp, ll modulus) {base %= modulus;ll result = 1;while (exp > 0) {if (exp & 1) result = (result * base) % modulus;base = (base * base) % modulus;exp >>= 1;}return result;}
int main()
{
    ll n,k;cin>>n>>k;
    ll a[n];
    f(i,0,n)cin>>a[i];
     ll dp[n]={0};ll mn;
     f(i,1,n)
     {
         mn=dp[i-1]+abs(a[i]-a[i-1]);
         for(ll j=i-1;j>=max(0LL,i-k);j--)
         mn=min(mn,dp[j]+abs(a[i]-a[j]));
         dp[i]=mn;
     }
     cout<<dp[n-1];


    return 0;

}


Measured memory_bytes: 1792
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Queue;
import java.util.Scanner;
 


public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static         Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);   cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static int K,N;
	static long mod =1000000007;
	public static void main(String[] args) {
		int N=sc.nextInt();
		int K=sc.nextInt();
		long Mmin=0,Mmax=0;
		long ans=0;
		
		Mmax=(long)(2*N-K+1)*K/2;
		Mmin=(long)(K-1)*K/2;
		ans=Mmax-Mmin+1;
		int min=K;
		int max=N-K;
		for(int a=K+1;a<=N+1;a++) {
			Mmin+=min;
			Mmax+=max;
			ans=(ans+Mmax-Mmin+1)%mod;
			if(ans<0)break;
			//System.out.println(ans);
			min++;max--;
			
		}
		p(ans);
		
	}

	
	//static ArrayList<Integer> cc = new ArrayList<>(10001);
	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	public static int gcd(int a, int b) {
        return b == 0 ? a: gcd(b, a % b);
	}
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
}
	


Measured memory_bytes: 35856
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<string>
#include<queue>
#include<utility>
#include<cmath>
#include<sstream>
#include<istream>

using namespace std;


int main()
{
  int A, B;
  cin >> A >> B;

  cout << 6-A-B << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vd=vector<double>;
using vvd=vector<vd>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using vs=vector<string>;
#define rep(i,n) range(i,0,n)
#define range(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define LINF    	((ll)1ll<<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI			3.141592653589793

template<class S,class T>ostream& operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s; a=0;} return os;}

vl a,b;
ll solve(ll n, ll x){
    if(n==0){
        return x;
    }
    if(x<=1)return 0;
    if(x<=a[n-1]) return solve(n-1,x-1);
    if(x==1+a[n-1]) return b[n-1];
    if(x==2+a[n-1]) return b[n-1]+1;
    if(x!=a[n])return b[n-1]+1+solve(n-1,x-a[n-1]-2);
    return b[n];
}

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	
	ll n,x;
	cin>>n>>x;
	a=vl(n+1,0); a[0]=1;
	b=vl(n+1,0); b[0]=1;
	range(i,1,n+1){
	    a[i]=a[i-1]*2+3;
	    b[i]=b[i-1]*2+1;
	}
	cout<<solve(n,x)<<endl;
	return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int output=0;
        int x=0;
        sc.nextInt();
        String s=sc.next();
        for(int i=0;i<s.length();i++){
            if(s.charAt(i)=='I'){
                x++;
                if(output<x){
                    output=x;
                }
            }else{
                x--;
            }
        }
        System.out.println(output);
    }

}

Measured memory_bytes: 22740
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
const int inf=1e8;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
using namespace std;
int main(){
	int n;
	cin>>n;
	vector<string>in(n);
	vector<bool>h(n);
	rep(i,n){
		cin>>in[i];
		if(in[i]=="goto"){
			cin>>in[i];
			h[i]=true;
		}
		in[i][in[i].size()-1]=':';
	}
	vvi cost(n+1,vi(n+1,inf));
	rep(i,n)if(h[i])rep(j,n)if(in[i]==in[j]&&h[j]==0)cost[i][j]=0;
	rep(i,n-1)if(h[i]){
		if(h[i+1]==0&&in[i]==in[i+1])cost[i][i+1]=0;
		else cost[i][i+1]=1;
	}else cost[i][i+1]=0;
	if(!h[n-1])cost[n-1][n]=0;
	else cost[n-1][n]=1;
	//rep(i,n+1){rep(j,n+1)cout<<cost[i][j]<<" ";cout<<endl;}
	rep(k,n+1)rep(i,n+1)rep(j,n+1)
		cost[i][j]=min(cost[i][j],cost[i][k]+cost[k][j]);
	cout<<cost[0][n]<<endl;
}

Measured memory_bytes: 1284
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = pow(10, 9) + 7;
//const ll MOD = 998244353;
//const ll MOD = ;
ll mod(ll A, ll M) {return (A % M + M) % M;}
const ll INF = 1LL << 60;
template<class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
ll divceil(ll A, ll B) {return (A + (B - 1)) / B;}
ll myctoi(char C) {return C - '0';}
char myitoc(ll N) {return '0' + N;}
#define FINALANS(A) {cout << (A) << endl; exit(0);}

int main()
{
  ll N;
  cin >> N;

  cout << N * (N - 1) / 2 << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <bitset>
using namespace std;

int N;

using pint = pair<int,int>;
vector<vector<pint>> v;

/* vector<int> IntToVec (int bit, int N){
    vector<int> S;
    for ( int i = 0; i < N; ++i){
        if ( bit & ( 1 << N )){
            S.push_back(i);
        }
    }
    return S;
} */


bool judge ( int bit ){
    bool flg = true;
    vector<int> S;
    //S = IntToVec(bit, N);
    
    // i番目の人の証言をcheckする
    for ( int i = 0; i < N; ++i ){
        bool flg = true;
        if ( !(bit & (1 << i)) ) continue;
        /*if ( ! ( bit & (1<<i) ) ) {
            continue;
        }*/
        for ( pint xy: v[i]){
            int x = xy.first; // xが
            int y = xy.second; // y = 1 正直　:: y = 0 不誠実
            
            // y = 1 かつ 不誠実　だと false
            // y = 0 かつ 誠実　だと false
            if ( y == 1 && !( bit & (1<<x) ) ){
                return false;
            } else if ( y == 0 && ( bit & (1<<x)) ) {
                return false;
            }
            /*// y = 1 なのに「不親切」だったらダメ
            if (y == 1 && !(bit & (1 << x))) return false;

            // y = 0 なのに「正直者」だったらダメ
            if (y == 0 && (bit & (1 << x))) return false;*/
        }
        
    }
    return flg;
}
/*bool judge(int bit) {
    
    // i 人目の証言を検証する
    for (int i = 0; i < N; ++i) {
        
        // i 人目が「不親切」だったら、証言はすべて無意味
        if ( !(bit & (1 << i)) ) continue;

        // それぞれ確認
        for (pint xy : v[i]) {
            int x = xy.first; // x が
            int y = xy.second; // y = 1: 正直、y = 0: 不親切

            // y = 1 なのに「不親切」だったらダメ
            if (y == 1 && !(bit & (1 << x))) return false;

            // y = 0 なのに「正直者」だったらダメ
            if (y == 0 && (bit & (1 << x))) return false;
        }
    }
    return true;
}*/


int main() {
    cin >> N;
    v.resize(N);
    for ( int i = 0; i < N; ++i){
        int A;
        cin >> A;
        v[i].resize(A);
        for ( int j = 0; j < A; ++j){
            cin >> v[i][j].first >> v[i][j].second;
            v[i][j].first = v[i][j].first - 1;
        }
    }
    
    int res = 0;
    for ( int bit = 0; bit < (1<<N); ++bit){
        if ( judge(bit) ){
            int count = 0;
            for ( int i = 0; i < N; ++i){
                if ( bit & (1<<i) ){
                    count = count + 1;
                }
            }
            res = max(res,count);
        }
    }
    cout << res << endl;
    
    return 0;
}



Measured memory_bytes: 256
// Last Change: 03/24/2019 21:02:54.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

namespace NS {
void LoopUntilZeroInpput() {
  int hogegegege = 0;
  while (cin >> hogegegege && hogegegege != 0) {
  }
}
} // namespace NS

int main() {
  char b;
  cin >> b;

  map<char, char> base;
  base['A'] = 'T';
  base['T'] = 'A';
  base['G'] = 'C';
  base['C'] = 'G';

  cout << base[b] << endl;

  //NS::LoopUntilZeroInpput();
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

N = int(input())
t, x, y = 0, 0, 0

for _ in range(N):
    nt, nx, ny = map(int, input().split())
    d = abs(nx-x)+abs(ny-y)
    
    if nt-t<d or d%2!=(nt-t)%2:
        print('No')
        exit()
    
    t, x, y = nt, nx, ny

print('Yes')

Measured memory_bytes: 41836
#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define ALL(a) (a).begin(),(a).end()
#define INF 1000000001
#define MOD 10000
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
const ull B=100000007;
int dp[200][200];//0,up:::1,down
int main(){
      int n,d,t[200],a[200],b[200],c[200];
      cin>>n>>d;
      REP(i,n)cin>>t[i];
      REP(i,d){
            cin>>a[i]>>b[i]>>c[i];
      }
      memset(dp,-1,sizeof(dp));
      REP(i,d){
            if(a[i]<=t[1]&&t[1]<=b[i]){
//                  cout<<a[i]<<" "<<b[i]<<endl;
                  REP(j,d){
                        if(a[j]<=t[0]&&t[0]<=b[j]){
//                              cout<<i<<" "<<j<<endl;
                              dp[1][i]=max(dp[1][i],abs(c[i]-c[j]));
                        }
                  }
            }
      }
//      REP(i,d)cout<<dp[1][i]<<" ";
//      cout<<endl;
      for(int i=2;i<=n;i++){
            REP(j,d){
                  if(t[i]<a[j]||b[j]<t[i])continue;
                  REP(k,d){
                        dp[i][j]=max(dp[i][j],dp[i-1][k]+abs(c[k]-c[j]));
                  }
            }
      }
      int ans=0;
      REP(i,d)ans=max(ans,dp[n-1][i]);
      cout<<ans<<endl;
}

Measured memory_bytes: 1328
#include <bits/stdc++.h>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)     (a).begin(),(a).end()
#define VI         vector<int>
#define MOD 1000000007

using ll = long long int;
using P = pair<int,int>;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

const ll INF=(ll)1e19;
//const int INF=(1<<30);

map<ll, int > prime_factor(ll n) {
  map<ll, int > ret;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}

int main(){
  ll n;
  cin >> n;

  map<ll,int> pf;
  FOR(i,1,n+1){
    map<ll,int> mp = prime_factor(i);
    for(auto v: mp){
      pf[v.first] += v.second;
    }
  }

  int cnt74,cnt24, cnt14, cnt4, cnt2;
  cnt74 = cnt24 = cnt14 = cnt4 = cnt2 = 0;
  for(auto v: pf){
    if(v.second >= 2)cnt2++;
    if(v.second >= 4)cnt4++;
    if(v.second >= 14)cnt14++;
    if(v.second >= 24)cnt24++;
    if(v.second >= 74)cnt74++;
  }

  int ans = 0;
  ans += cnt74;
  ans += cnt24 * (cnt2 - 1);
  ans += cnt14 * (cnt4 - 1);
  ans += cnt4 * (cnt4-1) / 2 * (cnt2 - 2);

  cout << ans << endl;
}

// 75 = 5 * 5 * 3, 25 * 3, 15 * 5

Measured memory_bytes: 256
#include<iostream>
#include <algorithm>
#include <string>
#define syso(s) std::cout<<s<<endl;
#define sc(i) std::cin>>i;
using namespace std;
int main() {
	string str;
	sc(str);
	for (int i = 0; i < str.size(); i++) {
		string ch=str.substr(i,1);
		if (ch == ",") {
		ch=" ";
		}
		cout<<ch;
	}
	cout<<""<<endl;
	return 0;
}

Measured memory_bytes: 256
MAX_VAL = 9999999999
MIN_VAL = 0
n = int(input())
abc = []
for i in range(n):
    abc.append(list(map(int, input().split())))
c0 = [[x, MIN_VAL, MIN_VAL] for x in abc[0]]
for i in range(1, n):
    c1 = [max(x) for x in c0]
    for j in range(3):
        for k in range(3):
            if j != k:
                c0[j][k] = abc[i][j] + c1[k]
            else:
                c0[j][k] = MIN_VAL
print(max([max(x) for x in c0]))


Measured memory_bytes: 32628
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include <array>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include<numeric>

using namespace std;

int main() {
    bool flag=true;
    set <string> STR;
    int N,ans;
    string W[100];
    cin>>N;
    for(int i=0;i<N;i++){
        cin>>W[i];
        STR.insert(W[i]);
    }
    if(STR.size()!=N){
        flag=false;
    }
    for(int k=0;k<N-1;k++){
        if(W[k][W[k].size()-1]!=W[k+1][0]) flag=false;
    }
    if(flag)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <complex>
#include <string>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <functional>
#include <iostream>
#include <map>
#include <set>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define SORT(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define EQ(a,b) (abs((a)-(b))<eps)
int main()
{
	while(1)
	{
		int n;
		cin >> n;
		if(n==0)break;
		vector<ll> p(n),joi(n-1);
		for(int i=0;i<n;i++)cin >> p[i];
		for(int i=0;i<n-1;i++)cin >> joi[i];
		sort(joi.begin(),joi.end());
		ll ans = 0ll,sum;
		for(int i=0;i<n;i++)ans += p[i];
		sum = ans;
		ans *= n;
		for(int i=n-1;i>=1;i--)
		{
			sum += joi[i-1];
			ans = max(ans,sum*i);
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 2060
from collections import deque
k = int(input())
q=[1,2,3,4,5,6,7,8,9]
q=deque(q)
for i in range(k):
    x=q.popleft()
    if x%10!=0:
        q.append(10*x+(x%10)-1)
    q.append(10*x+(x%10))
    if x%10!=9:
        q.append(10*x+(x%10)+1)
print(x)

Measured memory_bytes: 40816
h, w = map(int, input().split())
lst = [[0] for _ in range(h)]
for i in range(h):
    tmp = list(input())
    lst[i] = tmp

H = [[0] * w for _ in range(h)]
W = [[0] * w for _ in range(h)]

for i in range(h):
    done = [0] * w
    for j in range(w):
        if lst[i][j] == '#':
            continue
        if done[j]:
            continue
        k = 0
        while lst[i][j+k] != '#':
            done[j+k] = 1
            k += 1  # kが照らせるマスの長さ
            if j+k > w-1:
                break
        for l in range(k):
            H[i][j+l] = k


for j in range(w):
    done = [0] * h
    for i in range(h):
        if lst[i][j] == '#':
            continue
        if done[i]:
            continue
        k = 0
        while lst[i+k][j] != '#':
            done[i+k] = 1
            k += 1  # kが照らせるマスの長さ
            if i+k > h-1:
                break
        for l in range(k):
            W[i+l][j] = k

ans = 0
for i in range(h):
    for j in range(w):
        if lst[i][j] != '#':
            ans = max(ans, H[i][j] + W[i][j] - 1)

print(ans)

Measured memory_bytes: 250760
#include <iostream>
#include <algorithm>

#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

const string x[4] = {"dream", "dreamer", "erase", "eraser"};

string s;

bool judge(int n){
  if(!n){
    return true;
  }
  rep(i, 4){
    int m = x[i].size();
    if(n >= m && string(s, n - m, m) == x[i]){
      return judge(n - m);
    }
  }
  return false;
}

int main(){
  cin >> s;
  cout << (judge(s.size()) ? "YES" : "NO") << endl;
  return 0;
}

Measured memory_bytes: 2432
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)

	nums := make([]int, n)
	for i := range nums {
		fmt.Scan(&nums[i])
	}

	var max, cnt int
	for i := 0; i < n-1; i++ {
		tmp := nums[i]
		nxt := nums[i+1]

		if tmp >= nxt {
			cnt++
		} else {
			cnt = 0
		}

		if max < cnt {
			max = cnt
		}
	}
	fmt.Println(max)
}


Measured memory_bytes: 5504
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)  
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define RVSORT(v) sort(v.rbegin(), v.rend());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int gcd(int a,int b){return b?gcd(b,a%b):a;}

ll modpow(ll n,ll k){
  if(k == 1){
    return n;
  }else if(k == 0){
    return 1;
  }else if(k%2==0){
    ll memo = modpow(n,k/2)%MOD;
    return memo*memo%MOD;
  }else{
    return n * modpow(n,k-1)%MOD;
  }
}

int main(){

  ll h,n;cin>>h>>n;
  ll a[n],b[n];
  REP(i,n){
    cin>>a[i]>>b[i];
  }

  ll dp[h+1];
  REP(i,h+1){
    dp[i] = INF;
  }

  REP(i,n){
    ll damage,mp;
    damage = a[i];
    mp = b[i];
    REP(j,h+1){
      if(j==0){
        dp[j] = 0;
      }else if(j<damage){
        dp[j] = min(dp[j],mp);
      }else{
        dp[j] = min(dp[j],dp[j-damage]+mp);
      }
    }
  }

  cout<<dp[h]<<endl;

 

  return 0;
}

Measured memory_bytes: 384
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <stdbool.h>
#define LL long long
#define INF 1<<31-1
#define LNF 9223372036854775807
#define PI 3.14159265358979
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define FOR(i,a,n) for(i=a;i<n;i++)
#define MOD 998244353
#define NUM 100001

void swap(int* a,int* b){int tmp=*a;*a=*b;*b=tmp;}
int dup(int a,int d){if(a%d==0)return a/d;else return a/d+1;}
int mod(int a,int m){if(a<0)return a%m+m;else return a%m;}
int GCD(int a,int b){int c=1,tmp=MAX(a,b);b=MIN(a,b);a=tmp;while(c!=0){c=a%b;a=b;b=c;}return a;}
int LCM(int a,int b){return a*b/GCD(a,b);}
LL POW(LL a,LL n){LL ans=1;while(n>0){if(n&1)ans=ans*a%MOD;a=a*a%MOD;n>>=1;}return ans;}
int icmp(const void* a,const void* b){return *(int*)a-*(int*)b;}
int lcmp(const void* a,const void* b){return *(LL*)a-*(LL*)b;}
int ccmp(const void* a,const void* b){return *(char*)a-*(char*)b;}
int scmp(const void* a,const void* b){return strcmp(*(char**)a,*(char**)b);}
LL fac[NUM],finv[NUM],inv[NUM];
void comi(){int i;fac[0]=fac[1]=1;finv[0]=finv[1]=1;inv[1]=1;FOR(i,2,NUM){fac[i]=fac[i-1]*i%MOD;inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;finv[i]=finv[i-1]*inv[i]%MOD;}}
int com(int n,int k){if(n<k||n<0||k<0)return 0;return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;}

typedef struct{int n,num;}P;
int cmp(const void* a,const void* b){return ((P*)a)->n-((P*)b)->n;}
int cmpn(const void* a,const void* b){return ((P*)a)->num-((P*)b)->num;}

typedef struct{int s,e,c;}Edge;
int par[NUM];
int UF(){for(int i=0;i<NUM;i++)par[i]=-1;}
int Root(int x){if(par[x]<0)return x;else return par[x]=Root(par[x]);}
int Size(int x){return -par[Root(x)];}
bool Same(int x,int y){return Root(x)==Root(y);}
void Unite(int x,int y){x=Root(x);y=Root(y);if(x!=y){if(Size(x)<Size(y))swap(&x,&y);par[x]+=par[y];par[y]=x;}}

int main(){
  UF();
  int N,i,a=0,max=0,ans=0;
  scanf("%d",&N);
  P A[N],B[N],C[N];
  FOR(i,0,N)scanf("%d",&A[i].n);
  FOR(i,0,N)scanf("%d",&B[i].n);
  FOR(i,0,N)C[i].n=A[i].n,A[i].num=B[i].num=C[i].num=i;
  qsort(A,N,sizeof(P),cmp);qsort(B,N,sizeof(P),cmp);qsort(C,N,sizeof(P),cmp);
  FOR(i,0,N)if(C[i].n>B[i].n)ans=1;
  if(ans==0)FOR(i,0,N-1)if(C[i].n<=B[i].n&&C[i+1].n<=B[i].n)ans=2;
  if(ans==0){
    FOR(i,0,N)A[i].n=B[i].n=i;
    qsort(A,N,sizeof(P),cmpn);
    FOR(i,0,N)C[i].n=A[B[i].num].n;
    //FOR(i,0,N)if(C[i].n==i||C[C[i].n].n==i)ans=2;
    LL flag[N];
    FOR(i,0,N)Unite(C[i].n,B[i].n);
    FOR(i,0,N)flag[i]=0;
    FOR(i,0,N)if(flag[Root(i)]==0){
  		flag[Root(i)]=1;
  		ans++;
  	}
    if(ans==1)ans=1;
    else ans=2;
    //if(ans==0)ans=1;
  }

  //FOR(i,0,N)printf("%d",C[i].n);
  //printf("\n");
  //FOR(i,0,N)printf("%d",B[i].n);

  if(ans==1)printf("No");
  else printf("Yes");
	return 0;
}


Measured memory_bytes: 4464
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, a, b) for(int i = a; i < b; i++)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
using P = pair<int,int>;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int main(){
    int n;
    cin >> n;
    int ans = 1;
    while(ans <= n){
        ans *= 2;
    }
    cout << ans / 2 << endl;
    return 0;
}

Measured memory_bytes: 3604
#include <iostream>
#include <vector>
#include <algorithm>
#define REP(i, a, n) for(int i = ((int) a); i < ((int) n); i++)
using namespace std;
typedef long long ll;

int N, X[104], Y[104], CXL, CYL, CXR, CYR;
int w, h;
vector<ll> vx, vy;

int compress(int n, int *p, vector<ll> &s) {
  REP(i, 0, n) s.push_back(p[i]);
  sort(s.begin(), s.end());
  s.erase(unique(s.begin(), s.end()), s.end());
  return s.size();
}

bool isin(int x, int y) {
  return CXL <= x && x <= CXR && CYL <= y && y <= CYR;
}

bool ok(int xl, int yl, int xr, int yr) {
  if(isin(xl, yl) && isin(xr, yr)) return false;
  int x = xl + xr, y = yl + yr;
  int cx = 0, cy = 0;
  REP(i, 0, N) {
    int c = i, n = (i + 1) % N;
    int x1 = 2 * min(X[c], X[n]), x2 = 2 * max(X[c], X[n]);
    int y1 = 2 * min(Y[c], Y[n]), y2 = 2 * max(Y[c], Y[n]);
    if(y1 == y2 && y < y1 && x1 < x && x < x2) cx++;
    if(x1 == x2 && x < x1 && y1 < y && y < y2) cy++;
  }
  return cx % 2 == 1 && cy % 2 == 1;
}

int main(void) {
  while(cin >> N, N) {
    REP(i, 0, N) cin >> X[i] >> Y[i];
    REP(i, 0, 4) cin >> X[N + i] >> Y[N + i];
    CXL = min(X[N], min(X[N + 1], min(X[N + 2], X[N + 3])));
    CYL = min(Y[N], min(Y[N + 1], min(Y[N + 2], Y[N + 3])));
    CXR = max(X[N], max(X[N + 1], max(X[N + 2], X[N + 3])));
    CYR = max(Y[N], max(Y[N + 1], max(Y[N + 2], Y[N + 3])));
    vx.clear();
    vy.clear();
    w = compress(N + 4, X, vx);
    h = compress(N + 4, Y, vy);

    ll ans = 0;
    REP(i, 0, w - 1) REP(j, 0, h - 1) if(ok(vx[i], vy[j], vx[i + 1], vy[j + 1])) ans += (vx[i + 1] - vx[i]) * (vy[j + 1] - vy[j]);
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 3160
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
         Scanner sc = new Scanner(System.in);
         int A = sc.nextInt();
         int B = sc.nextInt();
         int C = sc.nextInt();
         int K = sc.nextInt();
         
         int ans = 0;
         
         if(K - A <= 0){
             ans = 1 * K;
         }else if(K - A - B <= 0){
             ans = 1 * A;
         }else{
             ans = 1 * A + (-1) * (K - A - B);
         }
         System.out.println(ans);
    }
}

Measured memory_bytes: 26984
var lines = [];

var readline = require('readline')
var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', (x) => {
    lines.push(x);
});

rl.on('close', () => {
    var x1 = Number(lines[0].split(" ")[0]);
    var y1 = Number(lines[0].split(" ")[1]);
    var x2 = Number(lines[0].split(" ")[2]);
    var y2 = Number(lines[0].split(" ")[3]);
    var ans = "";

    var x = x2; var y = y2;
    var dx = x2 - x1; var dy = y2 - y1;

    for (var i = 0; i < 2; i++) {
        var tmp = dx;
        dx = dy; dy = tmp;

        dx = (-1) * dx;
        x += dx;
        y += dy;
        ans += x + " " + y + " ";
    }
    console.log(ans);
});


Measured memory_bytes: 11596