akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <climits>
#include <complex>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

// using
using namespace std;

// typedef
typedef long long ll;

// define
#define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c))
#define REP(i, n) FOR(i, 0, n, 1)
#define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define RREP(i, n) RFOR(i, n, 0, 1)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REVERSE(c) reverse(ALL(c))
#define UNIQ(c) unique(ALL(c))
#define LB(c, x) lower_bound(c.begin(), c.end(), x)
#define UB(c, x) upper_bound(c.begin(), c.end(), x)
#define LI(c, x) distance(c.begin(), LB(c, x))
#define UI(c, x) distance(c.begin(), UB(c, x))

// functions
template <class T> T ceil(T a, T b) {
    return (a + b - 1) / b;
}
template <class T> T round(T a, T b) {
    return (a + b / 2) / b;
}
template <class T> T gcd(T a, T b) {
    return b ? gcd(b, a % b) : a;
}
template <class T> T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}
template <class T> bool amax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool amin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

// main
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    char b;
    cin >> b;

    if (b == 'A') {
        cout << 'T' << endl;
    } else if (b == 'C') {
        cout << 'G' << endl;
    } else if (b == 'G') {
        cout << 'C' << endl;
    } else {
        cout << 'A' << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#define N 100000
using namespace std;

int main() {
        int n, h;
        cin >> n >> h;
        int a[N], b[N];
        for (int i = 0; i < n; i++) {
                cin >> a[i] >> b[i];
        }
        sort(a, a+n, greater<int>());
        sort(b, b+n, greater<int>());

        int att = 0, thr = 0;
        while (h > 0) {
                if (thr == n || a[0] > b[thr]) {
                        att += ceil(h / (double)a[0]);
                        break;
                } else {
                        h -= b[thr++];
                        att++;
                }
        }
        cout << att << endl;
        return 0;
}


Measured memory_bytes: 1024
#include <iostream>


typedef long long int ll;

using namespace std;

int main()
{

  ll a , b , c;
  cin >> a >> b >> c;
  ll m = c - a - b;
  ll y = 4LL * a * b;

  ll x = m * m;

  if ( y < x and m > 0)
	  cout << "Yes";
  else 
	 cout << "No";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
  int X, Y, a, b;
  cin >> X >> Y;
  for(int i=0;i<X+1;i++) {
    if(2*i+4*(X-i)==Y) {
      cout << "Yes" << endl;
      break;
    }
    if(2*i+4*(X-i)!=Y&&i==X) {
      cout << "No" << endl;
    }
  }
}
  

Measured memory_bytes: 3632
#include<bits/stdc++.h>
//cervello|Phoenix
using namespace std;
#define ll long long int
#define eb emplace_back
#define mk make_pair
#define all(x) x.begin(),x.end()
#define mod 1000000007

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  ll d,t,s; cin>>d>>t>>s;
  if(d<=s*t)
    cout<<"Yes\n";
  else
    cout<<"No\n";
  return 0;
}

Measured memory_bytes: 3648
def digit(N,n):#nは正の整数、N進法での桁数、許容は１０＾１０００
    if n<N:
        return 1
    else:
        return 1+digit(N,n//N)

X,Y=map(int,input().split())

m=Y//X
print(digit(2,m))


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

int main(){
    string a,b,c;
    cin >> a >> b >> c;
    if(a[a.length() - 1] == b[0] && b[b.length() - 1] == c[0]){
      cout << "YES" << endl;
    }else{
      cout << "NO" << endl;
     }
}


Measured memory_bytes: 256
// AOJ ITP 1_7_A
#include<cstdio>

int main()
{
	int m, f, r;
	while( scanf( "%d%d%d", &m, &f, &r ), !(m == -1 && f == -1 && r == -1) )
	{
		int s = m+f;
		if( m*f < 0 )
			puts("F");
		else if( s >= 80 )
			puts("A");
		else if( s >= 65 )
			puts("B");
		else if( s >= 50 )
			puts("C");
		else if( s >= 30 )
			puts( r >= 50 ? "C" : "D" );
		else
			puts("F");
	}

	return 0;
}

Measured memory_bytes: 1012
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayDeque;
import java.util.Queue;

/**
 * The Number of Island
 */
public class Main {

    final static int LAND = 1;
    final static int VISITED = -1;
    static Queue<Integer> xs, ys;
    static int count;

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = "";

        while (true) {

            // load map
            int[][] map = new int[14][14];
            xs = new ArrayDeque<Integer>();
            ys = new ArrayDeque<Integer>();

            for (int i = 1; i < 13; i++) {
                line = br.readLine();
                for (int j = 1; j < 13; j++) {
                    map[i][j] = line.charAt(j - 1) - '0';
                }
            }

            // solve
            count = 0;
            for (int i = 1; i < 13; i++) {
                for (int j = 1; j < 13; j++) {
                    if (map[i][j] == LAND) {
                        xs.add(i);
                        ys.add(j);
                        while (!xs.isEmpty() && !ys.isEmpty()) {
                            visit(map);
                        }
                        count++;
                    }
                }
            }
            // output
            System.out.println(count);

            // next map
            line = br.readLine();
            if (line == null) {
                break;
            } else {
                continue;
            }
        }
    }

    public static void visit(int[][] map) {

        final int[] V = { 1, -1, 0, 0 };
        final int[] H = { 0, 0, 1, -1 };

        int x, y;
        x = xs.remove();
        y = ys.remove();

        if (map[x][y] == LAND) {
            map[x][y] = VISITED;

            // next choices
            for (int i = 0; i < 4; i++) {
                int xv, yh;
                xv = x + V[i];
                yh = y + H[i];
                if (map[xv][yh] == LAND) {
                    xs.add(xv);
                    ys.add(yh);
                }
            }
        }
    }
}


Measured memory_bytes: 24148
#include <stdio.h>
#include <iostream>
#include <assert.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
using namespace std;
#define ll long long
const int N = 1e5+15;
const int mod = 1e9 + 7;
int add(int x, int y) {
	int ret = (x + y) % mod;
	if (ret < 0) {
		ret += mod;
	}
	return ret;
}
int mul(int x, int y) {
	return (ll)x*y%mod;
}
int mypow(int x, int c) {
	int ret = 1;
	while (c > 0) {
		if (c & 1) {
			ret = mul(ret, x);
		}
		x = mul(x, x);
		c /= 2;
	}
	return ret;
}
int fac[N], A[N], pre[N];
void solve() {
	int n;
	scanf("%d ", &n);
	fac[0] = 1;
	pre[0] = 0;
	for (int i = 1; i <= n; ++i) {
		scanf("%d ", &A[i]);
		pre[i] = add(pre[i-1], A[i]);
		fac[i] = mul(fac[i - 1], i);
		pre[i] = add(pre[i - 1], mypow(i, mod - 2));
	}
	int ret = 0;
	for (int i = 1; i <= n; ++i) {
		int tmp = pre[i];
		tmp = add(tmp, pre[n - i + 1]);
		tmp = add(tmp, -1);
		tmp = mul(tmp, A[i]);
		ret = add(ret, tmp);
	}
	ret = mul(ret, fac[n]);
	cout << ret << endl;
}

int main(){
	//freopen("input.txt", "r", stdin);
	solve();
}

Measured memory_bytes: 1408
A,B = map(int,input().split())
 
aa,bb = 0,0
if (A-1) % 2 == 0:
    if ((A-1) //2) % 2 == 0:
        aa = (A-1)^1
    else:
        aa = (A-1)
else:
    if ((A+1) //2) % 2 == 0:
        aa = 1
 
if B % 2 == 0:
    if (B//2) % 2 == 0:
        bb = B^1
    else:
        bb = B
else:
    if ((B+1) //2) % 2 == 0:
        bb = 1
 
print(aa^bb)

Measured memory_bytes: 38384
#include<bits/stdc++.h>
using namespace std;
#define M ((ll)(1e9)+7)
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
void solve()
{
    int n;
    cin>>n;
    string s;
    cin>>s;int c=0;
    for(int i=0;i+2<n;i++)
    {
        if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C')
        c++;
    }
    cout<<c<<endl;
}
int main()
{
    
    solve();
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
using namespace std;
pair<long long,long long> tree[444444],lazy[444444];
long long to,from,n,m,ans;
void update(int beg,int en,int l,int r,int node,long long xs,long long cs)
{
	if (l>=beg && r<=en)
	{
		lazy[node].first+=xs;
		lazy[node].second+=cs;
		return;
	}
	else if (l>en || r<beg) return;
	int mid=(l+r)/2;
	update(beg,en,l,mid,node*2,xs,cs);
	update(beg,en,mid+1,r,node*2+1,xs,cs);
	int leng=min(en,r)-max(beg,l)+1;
	tree[node].first+=(xs*leng);
	tree[node].second+=(cs*leng);
}
pair<long long,long long> sum(int beg,int en,int l,int r,int node)
{
	if (l>=beg && r<=en)
	{
		return make_pair(lazy[node].first*(r-l+1)+tree[node].first,lazy[node].second*(r-l+1)+tree[node].second);
	}
	else if (l>en || r<beg) return make_pair(0,0);
	int leng=min(en,r)-max(beg,l)+1;
	pair<long long,long long> res=make_pair(lazy[node].first*leng,lazy[node].second*leng),res1,res2;
	int mid=(l+r)/2;
	res1=sum(beg,en,l,mid,node*2);
	res2=sum(beg,en,mid+1,r,node*2+1);
	res.first+=(res1.first+res2.first);
	res.second+=(res1.second+res2.second);
	return res;
}
long long query(long long i)
{
	pair<long long,long long> res=sum(i,i,1,m,1);
	return res.first*i+res.second;
}
int main()
{
	scanf("%lld%lld%lld",&n,&m,&from);
	for (int i=2;i<=n;i++)
	{
		scanf("%lld",&to);
		if (from<to)
		{
			update(1,from,1,m,1,0,to-from);
			update(from+1,to,1,m,1,-1,to+1);
			update(to+1,m,1,m,1,0,to-from);
		}
		else
		{
			update(1,to,1,m,1,-1,to+1);
			update(to+1,from,1,m,1,0,to-from+m);
			update(from+1,m,1,m,1,-1,to+m+1);
		}
		from=to;
	}
	ans=1e18;
	for (long long i=1;i<=m;i++)
	{
		ans=min(ans,query(i));
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 10496
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
int gcd(int a, int b) { return a ? gcd(b%a, a) : b; }
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/









int N, X, x[101010];
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N >> X;
    rep(i, 0, N) cin >> x[i];

    int ans = 0;
    rep(i, 0, N) ans = gcd(ans, abs(x[i] - X));
    cout << ans << endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
#define ll long long
#define N 100010
int read()
{
    int x=0,f=1;char c=getchar();
    while (c<'0'||c>'9') {if (c=='-') f=-1;c=getchar();}
    while (c>='0'&&c<='9') x=(x<<1)+(x<<3)+(c^48),c=getchar();
    return x*f;
}
int n,m,a[N];
ll s[N],f[N];
int findmax(int x,int k)
{
    int l=1,r=n;
    while (l+1<r)
    {
        int mid=l+r>>1;
        if (mid+k-1>n) r=mid;
        else if (x-a[mid]>a[mid+k-1]-x) l=mid;
        else r=mid;
    }
    int ans=l;
    for (int i=l+1;i<=r;i++)
    if (r+k-1<=n&&max(x-a[i],a[i+k-1]-x)<max(x-a[ans],a[ans+k-1]-x)) ans=i;
    return a[ans+k-1];
}//和x最接近的数中取k个后最大的
bool check(int k,int x)
{
    if (k*2-1>n) return 0;
    return findmax(x,k-1)<a[n-k+1];
}
int main()
{
    n=read(),m=read();
    for (int i=1;i<=n;i++) a[i]=read();
    sort(a+1,a+n+1);
    s[1]=a[1];
    for (int i=2;i<=n;i++) s[i]=s[i-2]+a[i];
    for (int i=n;i>=1;i--) f[i]=f[i+1]+a[i];
    for (int i=1;i<=m;i++)
    {
        int x=read();
        int l=1,r=n,t=0;
        while (l<=r)
        {
            int mid=l+r>>1;
            if (check(mid,x)) t=mid,l=mid+1;
            else r=mid-1;
        }
        ll ans=f[n-t+1];int y=n-t*2;
        if (y>0) ans+=s[y];
        printf("%lld\n",ans);
    }
}


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

typedef long long ll;
typedef long double ld;
#define size(a) int((a).size())
#define present(c, x) (c.find(x) != c.end()) 

template <class T>
void printArray(vector<T> arr) {for (T a: arr) cout << a << " ";cout << '\n';}
void printVerdict(bool verdict) {cout << (verdict ? "YES": "NO") << '\n';}
void printDecimal(double d) {printf("%.9f\n", d);}
bool inrange(int val, int start, int end) {return val >=start && val <= end;}
template <class T1, class T2, class T3> 
void printTuple(tuple<T1, T2, T3> t) {cout << get<0>(t) << " " << get<1>(t) << " " << get<2>(t) << '\n';}
template <class T1, class T2>
void printPair(pair<T1, T2> p) {cout << p.first << " " << p.second << '\n';}

int main() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(0);
	int a,b; cin >> a >> b;
	if (a <= 5) cout << 0 << '\n';
	else if (a <= 12) cout << b/2 << '\n';
	else cout << b << '\n';
}



Measured memory_bytes: 3560
n = gets.to_i
s = gets.chomp

i = j = a = 0
while j < n - 1
    #p [i, j, j + j - i + 1, s[j+1..-1][s[i..j]]]
    if j + j - i + 1 >= n
        i == j ? i = j += 1 : i += 1
    elsif s[j+1..-1][s[i..j]]
        a = [a, j - i + 1].max
        j += 1
    else
        i == j ? i = j += 1 : i += 1
    end
end
p a

Measured memory_bytes: 17160
h, w = map(int, input().split())
src = [input() for i in range(h)]
ans = []
for row in src:
    ans.append(list(row))
dxy = [(-1, 0), (0, 1), (1, 0), (0, -1)]
for y in range(h):
    for x in range(w):
        for dx, dy in dxy:
            if y + dy < 0 or y + dy > h - 1 or x + dx < 0 or x + dx > w - 1: continue
            if src[y][x] == '#' and src[y+dy][x+dx] == '#':
                ans[y][x] = 'b'
                ans[y+dy][x+dx] = 'b'

cnt = 0
for row in ans:
    if row.count('#') > 0:
        cnt += 1 
        
if cnt > 0:
    print('No')
else:
    print('Yes')

Measured memory_bytes: 3064
import java.io.*;
import java.math.*;
import java.util.*;
public class Main { //USE LONGS TO AVOID OVERFLOW THEN CAST
 
	public static void main(String[] args) { 
		FastScanner input = new FastScanner();
		PrintWriter w = new PrintWriter(System.out);
		int N = input.nextInt();
		int K = input.nextInt();
		long S = input.nextLong();
		int L = 1;
		long inf = (long)(1e9);
		if (S==inf) inf=1;
		for (int i = 1; i <= K; i++) {
			w.print(S+" ");
			w.flush();
			L=i+1;
		}
		for (int i = L; i <= N; i++) {
			w.print(inf+" ");
			w.flush();
		}
	}
	public static long GCD(long a, long b) {
		if (a==0||b==0) return Math.max(a,b);
		return GCD(Math.min(a, b),Math.max(a, b)%Math.min(a, b));
	}
	public static long FastExp(long base, long exp, long mod) {
		long ans=1;
		while (exp>0) {
			if (exp%2==1) ans*=base;
			exp/=2;
			base*=base;
			base%=mod;
			ans%=mod;
		}
		return ans;
	}
	public static long ModInv(long num,long mod) {return FastExp(num,mod-2,mod);}
	static class FastScanner {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens())
				try {
					st=new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}
		
		int nextInt() {
			return Integer.parseInt(next());
		}
		int[] readArray(int n) {
			int[] a=new int[n];
			for (int i=0; i<n; i++) a[i]=nextInt();
			return a;
		}
		long nextLong() {
			return Long.parseLong(next());
		}
	}
}

Measured memory_bytes: 45696
#include <vector>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>
#include <ctime>
#include <map>
#include <stack>
#include <sstream>
#include <set>
#include <cmath>
#include <functional>

using namespace std;

int main(void)
{
	priority_queue <int> que;
	int sum = 0, l , n, k;

	cin >> n >> k;

	for (int i = 0; i < n; i++)
	{
		cin >> l;
		que.push(l);
	}

	for (int i = 0; i < k; i++)
	{
		sum += que.top();
		que.pop();
	}

	cout << sum << endl;
	return 0;

}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int n;
main()
{
	while(cin>>n,n)
	{
		string s;int flag=0,r=0,l=0,cnt=0;
		for(int i=0;i<n;i++)
		{
			cin>>s;
			if(s=="lu")
			{
				l=1;
				if(flag==0&&r==l)cnt++,flag=1;
			}
			else if(s=="ru")
			{
				r=1;
				if(flag==0&&r==l)cnt++,flag=1;
			}
			else if(s=="ld")
			{
				l=0;
				if(flag==1&&r==l)cnt++,flag=0;
			}
			else
			{
				r=0;
				if(flag==1&&r==l)cnt++,flag=0;
			}
		}
		cout<<cnt<<endl;
	}
}



Measured memory_bytes: 3160
N , K = map(int,input().split())
max_K = (N - 1) * (N - 2) // 2
if K > max_K:
	print(-1)
else:
	ans = []
	temp_K = max_K
	for i in range(N - 1):
		ans.append([1,2+i])
	if temp_K == K:
		print(len(ans))
		for ans_ in ans:
			print(ans_[0],ans_[1])
	else:
		i = 2
		while temp_K > K:
			j = i + 1
			while temp_K > K and j <= N:
				temp_K -= 1
				ans.append([i,j])
				j += 1
			i += 1
		print(len(ans))
		for ans_ in ans:
			print(ans_[0],ans_[1])
				
		
		
	

Measured memory_bytes: 4120
def numba_compile(numba_config):
    import os, sys
    if sys.argv[-1] == "ONLINE_JUDGE":
        from numba import njit
        from numba.pycc import CC
        cc = CC("my_module")
        for func, signature in numba_config:
            vars()[func.__name__] = njit(signature)(func)
            cc.export(func.__name__, signature)(func)
        cc.compile()
        exit()
    elif os.name == "posix":
        exec(f"from my_module import {','.join(func.__name__ for func, _ in numba_config)}")
        for func, _ in numba_config:
            globals()[func.__name__] = vars()[func.__name__]
    else:
        from numba import njit
        for func, signature in numba_config:
            globals()[func.__name__] = njit(signature, cache=True)(func)
        print("compiled!", file=sys.stderr)


import sys
import numpy as np

def solve(K, Q, D, NXM):
    Ans = np.empty(Q, dtype=np.int64)
    for q in range(Q):
        n, x, m = NXM[q]
        D_mod = D % m
        cnt_D0 = (D_mod==0).sum()
        sum_D = D_mod.sum()
        t, rem = divmod(n-1, K)
        ans = n-1
        # print(ans)
        ans -= t * cnt_D0
        # print(f"ans={ans},t={t},rem={rem}")

        progress = sum_D * t
        x1 = x%m + progress
        for i in range(rem):
            d = D_mod[i]
            if d == 0:
                ans -= 1
            x1 += d
        # print(f"D={D_mod}")
        # print(f"progress={progress},x1={x1}")

        ans -= x1 // m
        Ans[q] = ans
    return Ans

numba_compile([
    [solve, "i8[:](i8,i8,i8[:],i8[:,:])"]
])

def main():
    K, Q = map(int, input().split())
    D = np.array(input().split(), dtype=np.int64)
    NXM = np.array(sys.stdin.read().split(), dtype=np.int64).reshape(Q, 3)
    Ans = solve(K, Q, D, NXM)
    print("\n".join(map(str, Ans.tolist())))
main()


Measured memory_bytes: 28812
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
typedef pair<int,int> P;

int main(){
    string s;
    cin >> s;
    bool flag = false;
    int n = s.size();
    rep(i, n - 1){
        for (int j = i; j < n; j++){
            string sub = s.substr(0, i) + s.substr(j,n - j);
            if (sub == "keyence") flag = true;
        }
    }
    if (flag) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

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

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

  // ここにプログラムを追記
  
  for (int i = 0; i < N; i++) {
    string S;
    cin >> S;
    
    if (S == "Y") {
      cout << "Four" << endl;
      break;
    }
    
    if (i == N - 1) {
      cout << "Three" << 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=sc.nextInt();
        int old=0,ans=0;
        int m=0;
        for(int i=0;i<n;i++){
            m=sc.nextInt();
            if(old>m){
                ans+=old-m;
            }
            old=m;
        }
        System.out.println(ans+m);
    }
}


Measured memory_bytes: 23764
#include <bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef pair<int , int> P2;
typedef pair<pair<int , int> , int> P3;
typedef pair<pair<int , int> , pair<int , int> > P4;
#define PB(a) push_back(a)
#define MP(a , b) make_pair((a) , (b))
#define M3P(a , b , c) make_pair(make_pair((a) , (b)) , (c))
#define M4P(a , b , c , d) make_pair(make_pair((a) , (b)) , make_pair((c) , (d)))
#define repp(i,a,b) for(int i = (int)(a) ; i < (int)(b) ; ++i)
#define repm(i,a,b) for(int i = (int)(a) ; i > (int)(b) ; --i)

string S;
string a = "AKIHABARA+ox";

int main(){
	cin >> S;
	S += "+";
	int x = 0;
	for(auto c : S){
		if(c == a[x]) ++x;
		else if(a[x] == 'A' && a[x+1] == c) x += 2;
		else x = 11;
	}
	cout << (a[x]=='o'?"YES":"NO") << endl;
	return 0;
}


Measured memory_bytes: 764
#include<iostream>
using namespace std;
int main(){
    string s,t;
    cin>>s>>t;
    bool no=false;
    if(s[s.size()-1]!=t[0]){
        no=true;
    }
    int n=s.size();
    for(int i=0;i<n;i++)
    {
        no=false;
        for(int j=0;j<n;j++)
        {
            if(s[(j+i)%(s.size())]!=t[j]){
                no=true;
                break;
            }
            else
            {
            }
        }
        if(!no){
            break;
        }
    }
    if(no){
        cout<<"No\n";
    }
    else{
        cout<<"Yes\n";
    }
}

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


void solve(long long N, long long D){
    int count = 0;
    while (N > 0) {
        N -= 2 * D + 1;
        count++;
    };
    cout << count << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    long long D;
    scanf("%lld",&D);
    solve(N, D);
    return 0;
}


Measured memory_bytes: 256
#include<cmath>
#include<iostream>
#include<cstdio>
#include<iomanip>
using namespace std;

void call(int n) {
	int i = 1;
	do {
		//CHECK_NUM:
		int x = i, f = 0;
		if (x % 3 == 0) {
			cout << " " << i;
			f = 1;
		}
		do{
	//INCLUDE3:
		if (x % 10 == 3 && f == 0) {
			cout << " " << i;
			f = 1;
		}
		x /= 10;
		} while (x&&f == 0); //goto INCLUDE3;
	//END_CHECK_NUM:
	} while (++i <= n); //goto CHECK_NUM;

	cout << endl;
}

int main() {
	int n;
	cin >> n;
	call(n);
	return 0;
}

Measured memory_bytes: 1160
import sys
sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
def resolve():
    N = sr()
    for i in range(len(N)):
        if N[i] == '7':
            print('Yes')
            return
    print('No')
    return
resolve()

Measured memory_bytes: 9116
#include <iostream>
#include <sstream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <iomanip>
#include <string>
using namespace std;

//関数getinputdata宣言
vector<vector<string>> getinputdata();
vector<vector<int>> getinputdata2();
vector<vector<double>> getinputdata3();

void abc119_b(vector<vector<string>> v) {

    int n = atoi(v[0][0].c_str());

    double mysum = 0;

    for (int i = 1; i <= n; i++) {

        mysum+=(v[i][1]=="JPY" ? atof(v[i][0].c_str()) : atof(v[i][0].c_str()) *   380000);
    }

    cout << mysum << endl;

}

int main() {

    vector<vector < string>> vec_arr_result;
    //    vector<vector<int>> vec_arr_result;
    vec_arr_result = getinputdata();

    abc119_b(vec_arr_result);

    return 0;
}

//関数getinputdata実装

vector<vector<double>> getinputdata3() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector<double>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<double> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(atof(ret.c_str()));
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;
}

//関数getinputdata実装

vector<vector<int>> getinputdata2() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector<int>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<int> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(atoi(ret.c_str()));
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;


}

//関数getinputdata実装

vector<vector < string >> getinputdata() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector < string>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<string> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(ret);
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(x) x.begin(), x.end()
using ll = long long;
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<pair<int, int>> v(n);
  rep(i, n){
    int x, y;
    cin >> x >> y;
    v.at(i) = {x, y};
  }
  sort(v.begin(), v.end());
  double sum = 0;
  int co = 0;
  do{
    double add = 0;
    rep2(i, 1, n){
      add += hypot(v.at(i).first - v.at(i-1).first, v.at(i).second - v.at(i-1).second);
    }
    sum += add;
    co++;
  }while(next_permutation(v.begin(), v.end()));
  sum /= co;
  printf("%.10f\n", sum);
  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 REP(i,n) for(int i = 1; i < n; i++)
#define per(i,n) for(int i = n; i >= 0; i--)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\n" : "No\n")
#define endl '\n'
#define fi first
#define se second
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;
using vs = vector<string>;
using vb = vector<bool>;
using vc = vector<char>;
using vcc = vector<vc>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
const int inf = (1<<30)-1;
const ll infll = (1LL<<62)-1;
ll ceil(const ll &a, const ll &b){return ((a)+(b)-1)/b;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }



int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  char b;
  cin >> b;
  if(b == 'A') cout << 'T' << endl;
  if(b == 'T') cout << 'A' << endl;
  if(b == 'G') cout << 'C' << endl;
  if(b == 'C') cout << 'G' << endl;
}

Measured memory_bytes: 256
# from pprint import pprint
# import math
# import collections

s = input()
# n = int(input())
# n, k = map(int, input().split(' '))
# a = list(map(int, input().split(' ')))
s_l = list(s)

res = [None] * len(s_l)

for i, _s in enumerate(s_l):
    if _s == 'L' and i > 0:
        # 左がLのLは0
        if s_l[i - 1] == 'L':
            res[i] = 0
        # 左がRのL
        else:
            # print('L/')
            res[i] = 1

            # 左のR
            j = 2
            cnt = 0
            while 0 <= i - j:
                if s_l[i - j] == 'R':
                    if j % 2 == 0:
                        cnt += 1
                else:
                    break
                j += 1
            # print('l_cnt', cnt)
            res[i] += cnt

            # 右のL
            j = 1
            cnt = 0
            while i + j < len(s_l):
                if s_l[i + j] == 'R':
                    break
                else:
                    if j % 2 == 0:
                        cnt += 1
                j += 1
            # print('r_cnt', cnt)
            res[i] += cnt

        # print('L', res[i])

    if _s == 'R' and i < len(s_l) - 1:
        # 右がRのRは0
        if s_l[i + 1] == 'R':
            res[i] = 0
        # 右がLのR
        else:
            # print('R/')
            res[i] = 1

            # 左のR
            j = 1
            cnt = 0
            while 0 <= i - j:
                if s_l[i - j] == 'L':
                    break
                else:
                    if j % 2 == 0:
                        cnt += 1
                j += 1
            # print('l_cnt', cnt)
            res[i] += cnt

            # 右のL
            j = 2
            cnt = 0
            while i + j < len(s_l):
                if s_l[i + j] == 'L':
                    if j % 2 == 0:
                        cnt += 1
                else:
                    break
                j += 1
            # print('r_cnt', cnt)
            res[i] += cnt

        # print('R', res[i])

res = [str(r) for r in res]

print(' '.join(res))


Measured memory_bytes: 17788
#include <bits/stdc++.h>
using namespace std;
#define itn int
#define nibu(K,x) binary_search(K.begin(),K.end(),x)
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) x.begin(),x.end()
#define sz(x) x.size()
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define out(x) cout<<x<<endl
#define put(x) out(x)
#define in(x) cin>>x
#define maxx(a,b,c) max(a,max(b,c))
#define minn(a,b,c) min(a,min(b,c))
using ll = long long;
using vl = vector<ll>;
using vs = vector<string>;
const double pi = 3.14159265358979;

int main() {
 ll N;
  in(N);
  vl A(N);
  rep(i,N)  in(A[i]);
  int now =1;
  int kai=1;
  bool f=false;
  while(kai<=N&&A[now-1]!=2){
   kai++;
    now = A[now-1];
  }
  if(kai<=N) out(kai);
  else out(-1);
}


Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<stdio.h>
#include <cstdint>
#include <stdlib.h> 
#include <time.h>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) REP(i,1,n+1)
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define RNG(x, a, n) &((x)[a]), &((x)[n])
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
typedef long long ll;
typedef pair<ll, ll> Pll;
typedef pair<int, int> PII;
typedef vector<ll> Vl;
typedef vector<int> VI;
typedef tuple<int, int, int> TT;
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define dmt(x, y, z) make_tuple(x, y, z)
#define pb(x) push_back(x)
#define pf(x) push_front(x)
const int MAX = 5100000;
const int inf = 1e9 + 7;
const int mod = 1e9 + 7;
const ll longinf = 1LL << 60;
const long double PI = (acos(-1));
const long double EPS = 0.0000000001;


int x, y, ans, a, b, c;

//二項係数nCrの計算
long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		finv[i] = finv[i - 1] * inv[i] % mod;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}

int main() {

	cin >> x >> y;

	COMinit();

	if (x < y) swap(x, y);

	if ((x + y) % 3 != 0 || x - (y * 2) > 0)cout << 0 << endl;
	else {
		a = (2 * x - y) / 3;
		b = x - 2 * a;
		cout << COM(a + b, a) << endl;
	}

	return 0;
}

Measured memory_bytes: 119808
import math

N = int(input())
P_list = list(map(int, input().split()))
Q_list = list(map(int, input().split()))
N_list = list(range(1, N + 1))

current_permutation = [0] * N
current_index = 0
A = 0
B = 0
def dfs(i, current_permutation):

    # 終了条件
    if i >= N:
        global current_index
        current_index += 1
        global A
        global B
        if current_permutation == P_list:
            A = current_index
        if current_permutation == Q_list:
            B = current_index

        if A != 0 and B != 0:
            print(abs(A - B))
            exit()

        return

    for j in range(N):
        if (N_list[j] in current_permutation) == False:
            current_permutation[i] = N_list[j]
            dfs(i + 1, current_permutation)
            current_permutation[i] = 0

dfs(0, current_permutation)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

ll mod=1000000007,p=1010;

int main()
{
	//freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
	ll a[169],i,j,k=0,n,s,ans=1,t;
	bool b[p];
	fill(b,b+p,true);
	for (i=2;i<p;i++){
		if (b[i]==true){
			a[k]=i;
			k++;
			for (j=i*i;j<p;j+=i){
				b[j]=false;
			}
		}
	}
	cin>>n;
	for (i=0;a[i]<=n;i++){
		t=a[i];
		s=0;
		while (n>=t){
			s+=(ll)n/t;
			t*=a[i];
		}
		ans=(ans*(s+1))%mod;
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;                                                                                 
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
#define VS vector<string>

int main(void) {
    string s,t;
    int max=0;
    while(cin >> s >> t) {
        vector<vector<int>> dp(s.size()+1, vector<int>(t.size()+1, 0));
        REP(i,s.size()) {
            REP(j,t.size()) {
                dp[i][j] = -1;
            }
        }
        REP(i,s.size()) {
            dp[i][0] = 0;
        }
        REP(i,t.size()) {
            dp[0][i] = 0;
        }

        FOR(i,1,s.size()+1) {
            FOR(j,1,t.size()+1){
                if(s[i-1] != t[j-1]) dp[i][j] = 0;
                else dp[i][j] = dp[i-1][j-1] + 1;
                max = fmax(max, dp[i][j]);
            }
        }
        cout << max << endl;
        max = 0;
    }
}

Measured memory_bytes: 65716
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <regex>
#include <queue>
#include <math.h>
typedef long long ll;
using namespace std;


int main(void){
  ll x, y;
  cin >> x >> y;
  queue<ll> que;
  ll cnt = 1;
  while(x <= y){
    x *= 2;
    que.push(x);
  }
  cout << que.size() << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>

#define INF 1000000000
#define LINF 9000000000000000000
#define mod 1000000007

#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair

using namespace std;

/*
   cin.tie(0);
   ios::sync_with_stdio(false);
   */

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<long long>vll;
typedef pair<int,int> pi;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
bool debug=false;

/*---------------------------------------------------*/

bool dp[505][505];

int main(){
  string s;
  cin>> s;
  
  REP(i,3,s.size()+1){
    REP(left,0,s.size()){
      if((int)s.size()<left+i-1)break;
      int right=left+i-1;
      REP(center,left+1,right){
	if(s[left]=='m'&&s[center]=='e'&&s[right]=='w'){
	  if(!dp[center+1][right-1] &&center!=right-1)continue;
	  if(!dp[left+1][center-1] && center-1!=left)continue;
	  //cout<<"ok: "<<left<<" "<<center<<" "<<right<<endl;
	  dp[left][right]=true;
	}
      }
    }
  }
  /*
  rep(i,s.size()){
    rep(j,s.size())cout<<dp[i][j];
    cout<<endl;
  }
  */
  if(dp[0][s.size()-1])cout<<"Cat"<<endl;
  else cout<<"Rabbit"<<endl;
  return 0;
}



Measured memory_bytes: 3412
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>
#include <ctime>
using namespace std;

void solve()
{
    int N; cin>>N;
    const int MOD=1000000007;
    map<int,int> M;
    for (int i = 2; i <= N; ++i) {
        int tmp=i;  
        for (int j = 2; j <= tmp ; ++j){
            while(tmp%j==0){
                M[j]++; tmp/=j;
            }
        }
    }
    long long ans=1;
    for(auto m:M){
        ans=(ans*(m.second+1))%MOD;
    }
    cout<<ans<<endl;
}

int main()
{
    cin.tie();
    ios::sync_with_stdio(false);
    // int ti = clock();
    // input();
    solve();
    // printf("Execution Time: %.4lf sec\n", 1.0 * (clock() - ti) / CLOCKS_PER_SEC);
    return 0;
}

Measured memory_bytes: 3596
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque> 
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype> 
using namespace std;

int main(){
    int K, S;
    cin >> K >> S;
    int cnt=0;
    for (int i=0; i<K+1; i++) {
        for (int j=0; j<K+1; j++) {
            int z=S-i-j;
            if (z>=0 && z<=K) cnt++;
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define N 100000

int head, tail, qi[N];

char qc[N][10];

void enqueue(char *s, int x){

  int i = 0;

  if(isFull()){
    fprintf(stderr,"オーバーフロー\n");
    exit(2);
  }

  qi[tail] = x;

  strcpy(qc[tail],s);

  if(tail + 1 == N){
    tail = 0;
  }

  else{
    tail++;
  }

}

int dequeue(){

  int x;

  if(isEmpty()){
    fprintf(stderr,"アンダーフロー\n");
    exit(1);
  }

  x = head;

  if(head + 1 == N){
    head = 0;
  }

  else{
    head++;
  }

  return x;

}

int isEmpty(){

  return head == tail;

}

int isFull(){

  return head == (tail + 1) % N;

}

void roundschedule(int n, int q){

  int i,num,a;

  int total = 0;

  char p[10];

  for(i=0;i<n;i++){
    scanf("%s%d",p,&num);

    enqueue(p,num);
  }

  while(!isEmpty()){

    num = dequeue();

    if(q>=qi[num]){
      total += qi[num];
      printf("%s %d\n",qc[num],total);
    }

    else{
      a = qi[num] - q;
      total += q;
      enqueue(qc[num],a);
    }

  }

}


int main(){

  int n,q;
  scanf("%d%d",&n,&q);
  roundschedule(n,q);
  
  return 0;

}





Measured memory_bytes: 3044
// atcoder/code-festival-2017-qualb/B/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; for (auto& i: v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { for (auto& i: v) is >> i; return is; }
template<typename T> ostream& operator << (ostream& os, set<T> s) { os << "#{"; for (auto& i: s) os << i << ","; os << "}"; return os; }
template<typename K, typename V> ostream& operator << (ostream& os, map<K, V> m) { os << "{"; for (auto& i: m) os << i << ","; os << "}"; return os; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

using lli = long long int;
using ull = unsigned long long;
using point = complex<double>;
using str = string;
template<typename T> using vec = vector<T>;

constexpr array<int, 8> di({0, 1, -1, 0, 1, -1, 1, -1});
constexpr array<int, 8> dj({1, 0, 0, -1, 1, -1, -1, 1});
constexpr lli mod = 1e9 + 7;

int main(int argc, char *argv[])
{
  std::ios_base::sync_with_stdio(0);
  std::cin.tie(0);
  std::cout.setf(std::ios_base::fixed);
  std::cout.precision(15);

  int n, m;
  while (cin >> n) {
    vec<int> a(n);
    cin >> a >> m;
    vec<int> b(m);
    cin >> b;

    map<int, int> x;
    each (i, a) ++x[i];
    each (i, b) --x[i];

    bool f = true;
    each (i, x) {
      f = f && (0 <= i.second);
    }
    cout << (f ? "YES" : "NO") << endl;
  }

  return 0;
}


Measured memory_bytes: 11264
#include <iostream>

int main(){
    int l, r, d;
    std::cin >> l >> r >> d;
    
    int count = 0;
    for (int i = l; i <= r; i++)
    {
        if (i % d == 0)
        {
            count++;
        }   
    }
    std::cout << count << std::endl;
    
    return 0;
}

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

int main(){
 int N;
 std::cin>>N;
 int* A=new int[N];
 int* B=new int[N];

 for(int i=0;i<N;i++){
  std::cin>>A[i]>>B[i];
 }

 std::sort(A,A+N);
 std::sort(B,B+N);

 long long ans=0;
 if(N%2==0){
  double min=(A[N/2]+A[N/2-1])/2.0;
  double max=(B[N/2]+B[N/2-1])/2.0;
  ans=(long long)((max-min)*2);
  ans++;
 }else{
  int min=A[N/2];
  int max=B[N/2];
  ans=B[N/2]-A[N/2]+1;
 }

 std::cout<<ans<<std::endl;
}

Measured memory_bytes: 5216
#include<bits/stdc++.h>
#define ull unsigned long long
# define ll long long
# define mod 1000000007LL 
using namespace std;
int main()
{
     ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,d;
    cin>>n>>d;
    ll ans=0;
    while(n--)
    {
        ll x,y;
        cin>>x>>y;
        long double temp=sqrt(x*x+y*y);
        if(temp<=d)
        ans++;

    }
    cout<<ans;
    


    
    return 0;
}

Measured memory_bytes: 3668
# coding: utf-8
# Your code here!
N=int(input())

if int(N/(10**5))>=1:
    print((10-1)+(10**3-10**2)+(10**5-10**4))
elif int(N/(10**4))>=1:
    print((10-1)+(10**3-10**2)+(N+1-10**4))
elif int(N/(10**3))>=1:
    print((10-1)+(10**3-10**2))
elif int(N/(10**2))>=1:
    print((10-1)+(N+1-10**2))
elif int(N/10)>=1:
    print(10-1)
else:
    print(N+1-1)

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

int main() {
  int N;
  cin>>N;
  bool color[7]={false};
  int j=0, k=0;
  for(int i=0; i<N; i++) {
    int a;
    cin>>a;
    if(a<3200) {
      if(!color[a/400]) {
        color[a/400]=true;
        j++;
      }
    }
    else {
      k++;
    }
  }
  k=j+k;
  j=max(1, j);
  cout<<j<<" "<<k;
  return 0;
}

Measured memory_bytes: 256
N, M = map(int, input().split())

L_limit = 1
R_limit = N
for _ in range(M):
    L, R = map(int, input().split())
    L_limit = max(L_limit, L)
    R_limit = min(R_limit, R)
    
print(max(R_limit - L_limit + 1, 0))

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
LL n;
vector<int>ans;
int main() {
  ios::sync_with_stdio(false);
  cin>>n;
  while(n){
  	n--;
  	ans.pb(n%26);
  	n/=26;
  }
  reverse(ans.begin(),ans.end());
  for(auto k:ans)cout<<(char)(k+'a');
 	return 0;
}

Measured memory_bytes: 3664
#include<bits/stdc++.h>
using namespace std;
using P = pair<int, int>;
const int M = 1000000007;

using Point = pair<double, double>;
using Segment = pair<Point, Point>;

const double eps = 1e-9;

double norm(Point a) {
    return sqrt(a.first * a.first + a.second * a.second);
}
Point normalize(Point vec) {
    double d = norm(vec);
    return d < eps ? vec : Point(vec.first / d, vec.second / d);
}
Point normalize(Point vec, double len) {
    Point a = normalize(vec);
    return Point(a.first * len, a.second * len);
}
Point getvert(Point v) {
    return Point(-v.second, v.first);
}
Point getv(Point frm, Point to) {
    return Point(to.first - frm.first, to.second - frm.second);
}
Point getv(Segment a) {
    return getv(a.first, a.second);
}
double dist(Point a, Point b) {
    return norm(getv(a, b));
}
double getlen(Segment a) {
    return dist(a.first, a.second);
}

double cross(Point v, Point w) {
    return v.first * w.second - v.second * w.first;
}
bool iscross(Segment a, Segment b) {
    return cross(getv(a), getv(a.first, b.first)) * cross(getv(a), getv(a.first, b.second)) < eps && cross(getv(b), getv(b.first, a.first)) * cross(getv(b), getv(b.first, a.second)) < eps;
}

Segment getcrosses(Point a, double ra, Point b, double rb) {
    double c = dist(a, b);
    double d = (c * c + ra * ra - rb * rb) / (2 * c);
    Point p = normalize(getv(a, b), d);
    Point ctr = Point(p.first + a.first, p.second + a.second);
    double h = sqrt(ra * ra - d * d);
    Point pp = normalize(getvert(getv(a, b)), h);
    return Segment(Point(ctr.first + pp.first, ctr.second + pp.second), Point(ctr.first - pp.first, ctr.second - pp.second));
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    vector<Point> p(n);
    vector<int> c(n);
    for (int i = 0; i < n; ++i) {
        cin >> p[i].first >> p[i].second >> c[i];
    }
    double ng = 0, ok = 1e7;
    for (int _ = 0; _ < 100; ++_) {
        double t = (ng + ok) / 2;
        vector<Point> ps;
        for (int i = 0; i < n; ++i) {
            ps.push_back(p[i]);
        }
        for (int i = 0; i < n; ++i) {
            for (int j = i + 1; j < n; ++j) {
                if (dist(p[i], p[j]) < t / c[i] + t / c[j] && dist(p[i], p[j]) > abs(t / c[i] - t / c[j])) {
                    Segment s = getcrosses(p[i], t / c[i], p[j], t / c[j]);
                    ps.push_back(s.first);
                    ps.push_back(s.second);
                }
            }
        }
        bool f = false;
        for (auto& i : ps) {
            int cnt = 0;
            for (int j = 0; j < n; ++j) {
                if (dist(i, p[j]) < t / c[j] + eps) {
                    ++cnt;
                }
            }
            if (cnt >= k) {
                f = true;
                break;
            }
        }
        if (f) {
            ok = t;
        }
        else {
            ng = t;
        }
    }
    cout << setprecision(12) << ok << '\n';

    return 0;
}


Measured memory_bytes: 384