akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <queue>
#include <string>
#include <map>
#include <stdio.h>
#include <iomanip>
#include <math.h>
#include <vector>
#include <stack>
#include <algorithm>
#include <string.h>
#include <set>
#include <cstdlib>
#include <iostream>
#include <bits/stdc++.h>
#define sz(x)       x.size()
#define pii         pair<int,int> 
#define ll          long long int 
#define sl(n)       scanf("%lld",&n)
#define s(n)        scanf("%d",&n)
#define f(i,n)      for(int i=0;i<n;++i)
#define fo(i,n)     for(int i=1;i<=n;++i)
#define fnm(n,m)    for(ll i=n;i<m+1;++i)
#define pb          push_back
#define pf          printf
#define F           first
#define S           second
#define srt(v)      sort(v.begin(),v.end());
#define srtc(v,cmp) sort(v.begin(),v.end(),cmp);
#define srta(v,n)   sort(v,v+n);
const ll            LL_INF=0x3f3f3f3f3f3f;
const ll            MOD=1073741824;


using namespace std;


int T;
// int n,m,k;
// int inp;
// int arr[100005];
set<char>mp;
string str,sec;


    
void gen(){
    
}

void solve(){
    cin>>str>>sec;
    
    if(sec.substr(0,sz(sec)-1)==str)cout<<"Yes\n";
    else pf("No\n");
    
}


int main(){
    // pf("\t\t\t***************************************************************************\n\n");
    // pf("\t\t\t***************************************************************************\n\n");
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
    // s(T);
    T=1;
    f(i,T)solve();
    // pf("\n");

    return 0;
} 

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

using namespace std;


long long int Gcd(long long int a , long long int b)
{
    if (b == 0)
        return a;


    return Gcd( b, a%b );
}
int main()
{
   long long int a , b ;
    cin>>a>>b;
    cout<<(a*b)/Gcd( max(a,b) , min(a,b) )<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
int a[100005];
ll dp[100005];
int main(void){
    int n,m; cin>>n>>m;
    for(int i=0;i<n;i++){
        dp[i]=1;
    }
    for(int i=0;i<m;i++){
        cin>>a[i];
        dp[a[i]-1]=0;
    }
    if(dp[1]==1){
        dp[1]=1+dp[0];
    }
    for(int i=2;i<n;i++){
        if(dp[i]==1){
            dp[i]=(dp[i-1]+dp[i-2])%1000000007;
        }
    }
    //for(int i=0;i<n;i++){
    //    cout<<dp[i]<<endl;
    //}
    cout<<dp[n-1]<<endl;
    
}


Measured memory_bytes: 1408
#pragma GCC optimize(2)
#pragma G++ optimize(2)
#include<bits/stdc++.h>
#define si(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define sd(a) scanf("%lf",&a)
#define ss(a) scanf("%s",a)
#define ms(a) memset(a,0,sizeof(a))
#define repi(i,a,b) for(register int i=a;i<=b;++i)
#define repd(i,a,b) for(register int i=a;i>=b;--i)
#define reps(s) for(int i=head[s],v=e[i].to;i;i=e[i].nxt,v=e[i].to)
#define ce(i,r) i==r?'\n':' '
#define pb push_back 
#define all(x) x.begin(),x.end()
#define fi first
#define se second
//#define pr(x) cout<<#x<<": "<<x<<endl
using namespace std;
typedef long long ll;
const int N = 1e3 + 10;

int w,h,sw,sh,ew,eh;
char maze[N][N];
char vis[N][N];
int cnt[N][N];
int mv[2][4] = {{1,0,-1,0},{0,1,0,-1}};
queue<pair<int,int> > q1,q2,q3,q4;

int main(){
	si(w),si(h);
	si(sw),si(sh);
	si(ew),si(eh);
	getchar();
	repi(i,1,w){
		repi(j,1,h){
			scanf("%c",&maze[i][j]);
			vis[i][j] = '*';
			cnt[i][j] = -1;
		}
		getchar();
	}
	q1.push({sw,sh});
	int cntt = 0;
	int flag = 0;
	while(1){
		while(!q1.empty()){
			auto p = q1.front();
			q1.pop();
			int x = p.fi,y = p.se;
//			cout<<1<<':'<<x<<' '<<y<<' '<<maze[x][y]<<endl;
			if(vis[x][y] == '!')
				continue;
			q2.push({x,y});
			while(!q2.empty()){
				auto p = q2.front();
				q2.pop();
				int x = p.fi,y = p.se;
//				cout<<2<<':'<<x<<' '<<y<<' '<<maze[x][y]<<endl;
				vis[x][y] = '!';
				cnt[x][y] = cntt;
				int flag1 = 0;
				repi(k,0,3){
					int i = x + mv[0][k],j = y + mv[1][k];
					if(i > 0 && i <= w && j > 0 && j <= h  && vis[i][j] == '*'){
						if(maze[i][j] == '.'){
							vis[i][j] = '!';
							cnt[i][j] = cntt;
							if(i == ew && j == eh){
								flag = 1;
								break;
							}
							q2.push({i,j});
						}
						else{
							flag1 = 1;
						}
					}
					if(flag)
						break;
				}
				if(flag1)
					q3.push({x,y});
				if(flag)
					break;
			}
			if(flag)
				break;
			while(!q3.empty()){
				auto p = q3.front();
				q3.pop();
				int x = p.fi,y = p.se;
//				cout<<3<<':'<<x<<' '<<y<<' '<<maze[x][y]<<endl;
				repi(i,x - 2,x + 2){
					repi(j,y - 2,y + 2){ 
						if(i > 0 && i <= w && j > 0 && j <= h  && vis[i][j] == '*' && maze[i][j] == '.'){                                                       
							q4.push({i,j});
						} 
					}
				}
			}
			if(flag)
				break;
		}
		if(q4.empty() || flag)
			break;
		q1 = q4;
		while(!q4.empty())
			q4.pop();
		cntt++;
	}
	cout<<cnt[ew][eh]<<endl;
	return 0;
}

Measured memory_bytes: 9920
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Main {

     static Scanner scanner;

     public static void main(String[] args) {
         scanner = new Scanner(System.in);

         int N=gi();
         int[] a=new int[N];
         int[] b=new int[N];
         int[] c=new int[N];
         List<Integer> lp=new ArrayList<Integer>();
         List<Integer> lm=new ArrayList<Integer>();

         long sa=0;
         for (int i=0; i<N;i++) {
             a[i]=gi();
             sa+=a[i];
         }
         long sb=0;
         for (int i=0; i<N;i++) {
             b[i]=gi();
             sb+=b[i];
         }
         if(sa<sb) {
        	 System.out.println(-1);
        	 return;
         }
         int p=0;
         int m=0;
         for (int i=0; i<N;i++) {
             c[i]=a[i]-b[i];
             if(c[i]<0) {
            	 m++;
            	 lm.add(c[i]);
             } else {
            	 lp.add(c[i]);
             }
         }
         if (m==0) {
             System.out.println(0);
             return;
         }

         Collections.sort(lp, Collections.reverseOrder());
         int ind=0;
         for (int i=0; i<lm.size(); i++) {
        	 int v=lm.get(i);
             while (v<0) {
            	 int pv=lp.get(ind);
            	 if(pv+v<=0) {
            		 ind++;
            		 v+=pv;
            	 } else {
            		 lp.set(ind, pv+v);
            		 v=0;
            	 }
             }
         }

             System.out.println(m+ind+1);

     }

     // 文字列として入力を取得
     public static String gs() {
          return scanner.next();
     }

     // intとして入力を取得
     public static int gi() {
          return Integer.parseInt(scanner.next());
     }

     // longとして入力を取得
     public static long gl() {
          return Long.parseLong(scanner.next());
     }

     // doubleとして入力を取得
     public static double gd() {
          return Double.parseDouble(scanner.next());
     }
}

Measured memory_bytes: 60884
import java.util.*;
import java.io.*;

public class Main {

	static void solve (Scanner in, PrintWriter out, Methods ms) {
		
		//2 3 4 6  9
		
		//2 5 9 15 ?
		
		while (true) {
			
			int n = in.nextInt();
			if (n == 0) return;
			
			int[] a = new int[n];
			for (int i = 0; i < n; i++) a[i] = in.nextInt();
			Arrays.sort(a);
			
			for (int i = 1; i < n; i++) {
				a[i] += a[i - 1];
			}
			
			long ans = 0;
			for (int i = 0; i < n - 1; i++) ans += a[i];
			
			out.println(ans);
			
		}
		
	}


	public static void main (String[] args) {

		Scanner in = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		Methods ms = new Methods();
		solve(in, out, ms);
		in.close();
		out.close();

	}

	static class Methods {

		public void print (Object... ar) {System.out.println(Arrays.deepToString(ar));}

		public int max (int... ar) {Arrays.sort(ar); return ar[ar.length-1];}

		public int min (int... ar) {Arrays.sort(ar); return ar[0];}

		public long gcd (long a, long b) {return b > 0 ? gcd(b,a%b) : a;}

		public long lcm (long a, long b) {return a / gcd(a,b) * b;}

		public long factorial (int i) {
			if (i == 1) return 1;
			else return i * factorial(i-1);
		}

		public int manhat (int x1, int y1, int x2, int y2) {
			return Math.abs(x1 - x2) + Math.abs(y1 - y2);
		}

		public double euclid (double x1, double y1, double x2, double y2) {
			return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
		}

		public boolean isPrime (int n) {
			if (n == 2) return true;
			if (n < 2 || n % 2 == 0) return false;
			for (int i = 3; i <= Math.sqrt(n); i += 2) if(n % i == 0) return false;
			return true;
		}

	}

}


Measured memory_bytes: 47172
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
const long long INF=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long,long>> vpll;
typedef vector<pair<int,int>> vpii;
int main() {
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	
	double n;
	in(n);
	double l = n/3;
	double b = l;
	double h = l;
	double tmp = l * b * h;
	printf("%.12f\n", tmp);
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    int W, H, x, y, r;
    
    scanf("%d %d %d %d %d",&W, &H, &x, &y, &r);
    if(x<r || y<r || x+r>W || y+r>H){
        printf("No\n");
    }else{
        printf("Yes\n");
    }
    return 0;
}



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

using namespace std;
using i64 = long long;
using f64 = double;

#define FOR(i, s, n) for (size_t i = (s); i < (size_t)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(v) (v).begin(), (v).end()

template <typename T, typename U>
inline bool chmax(T &a, U b)
{
  return a < b ? (a = b, true) : false;
}

template <typename T, typename U>
inline bool chmin(T &a, U b)
{
  return a > b ? (a = b, true) : false;
}

bool golf(int k, int a, int b)
{
  FOR(x, a, b + 1)
  {
    if (x % k == 0)
    {
      return true;
    }
  }

  return false;
}

int main()
{
  int k, a, b;
  cin >> k >> a >> b;
  cout << (golf(k, a, b) ? "OK" : "NG");
  return 0;
}


Measured memory_bytes: 3592
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>

using namespace std;


int main(){
  int n, k;
  char a;
  string s;
  cin >> n >> s >> k;
  a = s[k - 1];


  for(int i = 0; i < n; ++i){
    if(s[i] != a){
      s[i] = '*';
    }
  }
  cout << s << endl;
}


Measured memory_bytes: 256
fn divisors(a: i64, x: i64) -> i64 {
    if a < 0 {
        0
    } else {
        a / x + 1
    }
}

fn solve(a: i64, b: i64, x: i64) -> i64 {
    divisors(b, x) - divisors(a - 1, x)
}

fn main() {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    let mut iter = s.split_whitespace().map(|w| w.trim().parse().ok().unwrap());
    let a = iter.next().unwrap();
    let b = iter.next().unwrap();
    let x = iter.next().unwrap();
    let ans = solve(a, b, x);
    println!("{}", ans);
}


Measured memory_bytes: 4352
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

print('red' if ri()<3200 else rr())

















Measured memory_bytes: 27164
#include <malloc.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

//ABC118D
int compare_int(const void *a, const void *b) {//sort
  return *(int*) a - *(int*) b;
}

int main(void) {
  int minb=10, n, m, k, i, j, cou=0, tmp, b[]={2, 5, 5, 4, 5, 6, 3, 7, 6};
  scanf(" %d %d", &n, &m);
  int a[m], dp[n+1];
  for(i=0; i<m; i++){
    scanf(" %d", &a[i]);
    minb=minb>b[a[i]-1] ? b[a[i]-1] : minb;
    //printf("minb=%d\n", minb);
  }
  qsort(a, m, sizeof(int), compare_int);//sort
  dp[0]=0;

  //printf("dp[%d]=%d\n", 0, dp[0]);

  for(i=1; i<=n; i++){
    dp[i]=-1e9;
    for(j=0; j<m; j++){
      if(i-b[a[j]-1]>=0&&dp[i-b[a[j]-1]]!=-1e9&&dp[i]<dp[i-b[a[j]-1]]+1){
        dp[i]=dp[i-b[a[j]-1]]+1;
      }
    }
    //printf("dp[%d]=%d\n", i, dp[i]);
  }
  //printf("%d\n\n", dp[n-1]);

  tmp=n;
  for(i=0;i<m;i++){
    while(dp[n]>0){
      //printf("dp[%d]-dp[%d]=%d-%d\n",n,tmp-b[a[m-i-1]-1],dp[n],dp[tmp-b[a[m-i-1]-1]]);
      if(tmp-b[a[m-i-1]-1]>=0&&dp[n]-dp[tmp-b[a[m-i-1]-1]]==1){
        dp[n]--;
        printf("%d",a[m-i-1]);
        tmp-=b[a[m-i-1]-1];
      }else break;
    }
  }
}

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

//buttan 5 a1=5 a2=4 a3=3 a4=4 a5=3
//buttan2 Light
//①そもそもボタン２は光る？→a1,a2,…＝２か判定
//②a1=1、a3=3.a4=4…でないか、その場合無理

//解法
//whileを使って　注目番地のAnを求める→注目番地＝Anとして　試行回数+1
//if an=nなら　return -1
//
//
//n=1
//解法2 list buttan=[5,4,3,2,3]
//while:n!=2:
// n=buttan[n]
// kaisuu++

// if n==buttan:
//    kaisuu=0;
//    break
//
//print(kaisuu)

int main(){
    int N,kaisuu=0,number=1;
    cin>>N;
    //N個の配列を宣言
    vector<int> buttan(N);
    vector<int> test(N);

    for (int i=0; i<N; i++){
        cin >> buttan.at(i);
    }

    while(number!=2){
        number=buttan.at(number-1);
        kaisuu++;
        test.at(number-1)+=1;


        if (test.at(number-1)==2){
            kaisuu=-1;
            break;
        }


    }

    cout<<kaisuu<<endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n, sum=0;
  cin >> n;
  
  for(int i=0; i<n; i++){
	int l, r;
    cin >> l >> r;
    sum += 1+(r-l);  
  }
  
  cout << sum << endl;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main{
	
	public static void main(String[] args) throws Exception{
		pw=new PrintWriter(System.out);
		sc = new MScanner(System.in);
		int n=sc.nextInt(),m=sc.nextInt();
		int[]in=sc.intArr(n);
		LinkedList<Integer>[]adj=new LinkedList[n];
		for(int i=0;i<n;i++)adj[i]=new LinkedList<>();
		for(int i=0;i<m;i++) {
			int x=sc.nextInt()-1,y=sc.nextInt()-1;
			adj[x].add(y);
			adj[y].add(x);
		}
		int ans=0;
		for(int i=0;i<n;i++) {
			boolean yes=true;
			for(int j:adj[i]) {
				if(in[j]>=in[i]) {
					yes=false;break;
				}
			}
			
			ans+=yes?1:0;
		}
		pw.println(ans);
		
		pw.flush();
	}
	static PrintWriter pw;
	static MScanner  sc;
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] intArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public long[] longArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public int[] intSortedArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public long[] longSortedArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public Integer[] IntegerArr(int n) throws IOException {
	        Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public Long[] LongArr(int n) throws IOException {
	        Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
	static void shuffle(int[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			int tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
	static void shuffle(long[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			long tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
}


Measured memory_bytes: 65072
import java.util.Scanner;
import java.util.regex.*;
import java.math.*;

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();
		// 文字列の入力
		//String s = sc.next();
		//1文字ずつ
		//s.atChar(i);
		// 出力
		//System.out.println("");
		//double countx=0;

		int R=sc.nextInt();
		
		if(R<1200){
			System.out.println("ABC");
		}else if(R<2800){
			System.out.println("ARC");
		}else{
			System.out.println("AGC");
		}
	
	}
}

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

int main() {
	lint N, X, M;
	cin >> N >> X >> M;
	vector<int> v(M);
	vector<int> w(M);
	v.at(X) = 1;
	w.at(0) = X;
	lint a=X, b=N-1, c=0, x, y, z;
	rep(i, N-1) {
		X *= X;
		X %= M;
		if (v.at(X) != 0) {
			if (X == 0) {
				std::cout << a << '\n';
			} else if (X == 1) {
				std::cout << a + b << '\n';
			} else {
				x = i + 2 - v.at(X);
				y = a;
				rep(j, v.at(X)-1) {
					y -= w.at(j);
				}
				a += y * (b/x);
				b %= x;
				rep(j, b) {
					a += X;
					X *= X;
					X %= M;
				}
				std::cout << a << '\n';
			}
			return 0;
		} else {
			v.at(X) = i+2;
			w.at(i+1) = X;
			a += X;
			b--;
		}
	}
	std::cout << a << '\n';
}


Measured memory_bytes: 4044
#include <bits/stdc++.h>
#define ll long long
#define MX 1e18
using namespace std;

int main() {
    ll n;
    cin>>n;
    double m;
  	cin>>m;
  	m=m*100+0.5;
  	int mm=m;
  	printf("%lld\n",n*mm/100);
}


Measured memory_bytes: 3776
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    x=parseInt(readline())
    if x<600
        println(8)
    elseif x<800
        println(7)
    elseif x<1000
        println(6)
    elseif x<1200
        println(5)
    elseif x<1400
        println(4)
    elseif x<1600
        println(3)
    elseif x<1800
        println(2)
    elseif x<2000
        println(1)
    end
end
main()

Measured memory_bytes: 156240
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main(){
 string s,t;
 cin>>s>>t;
 ll cng = INT_MAX;
 ll len_t = t.size();
 ll len_s = s.size();
 for(int i=0;i<=len_s-len_t;i++){
 	ll curr = 0;
	for(int j=0;j<len_t;j++){
 		if(s[i+j]==t[j]){
 			continue;  
		}
		curr++;	
	}
	cng = min(cng,curr);
 }
 cout<<cng;
  return 0;
}

Measured memory_bytes: 3624
N = int(input())
a = [int(input()) - 1 for _ in range(N)]

used = [False] * N

cur = 0
ans = 0
while not used[cur]:
    if cur == 1:
        print(ans)
        exit()

    used[cur] = True
    cur = a[cur]
    ans += 1

print(-1)

Measured memory_bytes: 76688
N=int(input())
a=list(map(int,input().split()))
cnt2=0
cnt4=0
for i in range(N):
    if a[i]%4==0:
        cnt4+=1
    elif a[i]%2==0:
        cnt2+=1
if cnt2==0:
    if cnt4>=N-cnt4-1:
        print('Yes')
    else:
        print('No')
else:
    if cnt4>=N-cnt4-cnt2:
        print('Yes')
    else:
        print('No')

Measured memory_bytes: 14252
#include<bits/stdc++.h>
#define int long long
#define rep(i,a,b) for(int i=a;i<b;i+=1)
#define reps(i,a,b) for(int i=a;i>=b;i-=1)
#define vi vector<int>
#define pb push_back
#define pi pair<int, int>
#define mp make_pair
#define ff first
#define ss second
#define in(x) int x; cin>>x;
#define inn(x, y) int x, y; cin>>x>>y;
#define mi unordered_map<int,int>
#define mem(x) memset(x, 0, sizeof(x))
#define IOS ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
using namespace std;

int32_t main(void){
	IOS;
	
	inn(n, a);
	inn(b, c);
	string s[n+1];
	vector<char> ans;
	rep(i, 0, n) cin>>s[i];
	s[n] = "AB";
	rep(i, 0, n)
	{
		if(s[i] == "AB")
		{
			if(a < b) 
			{
				a+=1;
				b-=1;
				ans.pb('A');
			}
			else if(b < a)
			{
				b+=1;
				a-=1;
				ans.pb('B');
			}
			else
			{
				if(s[i+1] == "AC")
				{
					ans.pb('A');
					a += 1;
					b -= 1;
				}
				else
				{
					ans.pb('B');
					b += 1;
					a -= 1;
				}
			}
		}
		if(s[i] == "AC")
		{
			if(a < c) 
			{
				a+=1;
				c-=1;
				ans.pb('A');
			}
			else if(c < a)
			{
				c += 1;
				a -= 1;
				ans.pb('C');
			}
			else
			{
				if(s[i+1] == "AB")
				{
					ans.pb('A');
					a += 1;
					c -= 1;
				}
				else
				{
					ans.pb('C');
					c += 1;
					a -= 1;
				}
			}
		}
		if(s[i] == "BC")
		{
			if(c < b) 
			{
				c+=1;
				b-=1;
				ans.pb('C');
			}
			else if(c > b)
			{
				b+=1;
				c-=1;
				ans.pb('B');
			}
			else
			{
				if(s[i+1] == "AB")
				{
					ans.pb('B');
					b += 1;
					c -= 1;
				}
				else
				{
					ans.pb('C');
					c += 1;
					b -= 1;
				}
			}
		}
		if(a<0 || b<0 || c<0)
		{
			cout<<"No";
			return 0;
		}
	}
	
	cout<<"Yes"<<'\n';
	rep(i, 0, n) cout<<ans[i]<<'\n';
}

Measured memory_bytes: 6920
#include <iostream>
#include <sstream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <cstdio>
#include <cmath>
using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
#define ALL(a)  (a).begin(),(a).end()
#define REP(i,n) for(int i=0;i<(n);++i)
const double EPS = 1e-10;
const double PI  = acos(-1.0);
#define dump(x) cerr << "  (L" << __LINE__ << ") " << #x << " = " << (x) << endl;
#define dumpv(x) cerr << "  (L" << __LINE__ << ") " << #x << " = "; REP(q,(x).size()) cerr << (x)[q] << " "; cerr << endl;
template<typename T1, typename T2>
ostream& operator<<(ostream& s, const pair<T1, T2>& d) {return s << "(" << d.first << "," << d.second << ")";}


int main() {
  VI a(5);
  REP(i, a.size()) cin >> a[i];
  sort(a.rbegin(), a.rend());
  REP(i, a.size()) cout << (i == 0 ? "" : " ") << a[i];
  cout << endl;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<n;i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl; 
#define INF 1000000000
#define mod 1000000007
typedef long long ll;
const ll LINF = 1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
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 main(){
    ll n,q,k;
    cin>>n>>k>>q;
    vector<ll> a(q),cnt(n);
    rep(i,q){
        cin>>a[i];
        a[i]--;
        cnt[a[i]]++;
    }
    vector<ll> ans(n,k);
    rep(i,n){
        ans[i]-=q-cnt[i];
    }
    rep(i,n){
        if(ans[i]>0) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    return 0;
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
#define null NULL
#define mp make_pair
#define pb(a) push_back(a)
#define sz(a) ((int)(a).size())
#define all(a) a.begin() , a.end()
#define fi first
#define se second
#define relaxMin(a , b) (a) = min((a),(b))
#define relaxMax(a , b) (a) = max((a),(b))
#define SQR(a) ((a)*(a))
#define PI 3.14159265358979323846
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

int k;
vi in;

void No(){
  printf("-1\n");
  exit(0);
}

ll Fd(ll a, ll b, ll d){
  ll cand = (a / d) * d;
  while(cand < a) cand += d;
  if(cand > b) return -1;
  else return cand;
}

ll Ld(ll a, ll b, ll d){
  ll cand = (b / d) * d + d;
  while(cand > b) cand -= d;
  if(cand < a) return -1;
  else return cand;
}

int main(){
  scanf("%d", &k);
  in.resize(k);
  for(int& e : in) scanf("%d", &e);

  if(in.back() != 2) No();

  ll lo = 2, hi = 3;
  for(int i = sz(in) - 2;i >= 0;--i){
    ll x = Fd(lo, hi, in[i]);
    ll y = Ld(lo, hi, in[i]);
    if(x == -1 || y == -1) No();
    lo = x;
    hi = y + in[i] - 1;
  }

  cout << lo << ' ' << hi << '\n';

  return 0;
}


Measured memory_bytes: 640
#include <iostream>  
#include <cstdio>  
#include <algorithm>  
#include <set>  
#include <string>  
#include <cstring>  
#include <cmath>  
#include <map>  
#define N 505  
using namespace std;  
typedef long long ll;  
int c[505]; //到一个车站的花费时间  
int s[505]; //一个车站出发的等待时间  
int f[505];  //一个车站每f秒出发一个车  
int main()  
{  
    int n;  
    scanf("%d",&n);  
    for(int i=1;i<=n;i++)  
        scanf("%d%d%d",&c[i],&s[i],&f[i]);  
    for(int i=1;i<=n;i++){  
        int ans=0;  
        for(int j=i;j<n;j++){  
            if(ans<s[j])   //小于等待时间重新赋值  
                ans=s[j];  
            if(ans%f[j]!=0)    //是否处于间隔时间  
                ans=ans+f[j]-ans%f[j];  
            ans+=c[j];  
        }  
        printf("%d\n",ans);  
    }  
}  

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

const int MAXN = 100001;
int dp[MAXN];

int rec_bank(int n) {
  int ret = n;
  if (n == 0)
    return 0;
  if (dp[n] != -1)
    return dp[n];

  for (int pow6 = 1; pow6 <= n; pow6 *= 6)
    ret = min(ret, rec_bank(n - pow6) + 1);
  for (int pow9 = 1; pow9 <= n; pow9 *= 9)
    ret = min(ret, rec_bank(n - pow9) + 1);
  return dp[n] = ret;
}

int main() {
  int N;
  cin >> N;
  for (int i = 0; i < MAXN; i++)
    dp[i] = -1;
  cout << rec_bank(N) << endl;
  return 0;
}


Measured memory_bytes: 5376
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let line = read_as_vec::<i32>();
    let (d, n) = (line[0], line[1]);
    let mut base = 1;
    for i in 0..d{
        base *=100;
    }
    if n == 100{
        println!("{}", (n+1)*base);
    }else{
        println!("{}", n*base);
    }
}


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

ll gcd(ll a, ll b) {
  if(a % b == 0) {
    return(b);
  } else{ 
    return(gcd(b, a % b));
  }
}

int main() {
 
  ll a, b;
  cin >> a >> b;

  ll tmp = gcd(a, b);
  ll ans = a * b / tmp;
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> bool cmin(T &a, const S &b) { if (a > b){a = b; return true;}return false; }
template<class T, class S> bool cmax(T &a, const S &b) { if (a < b){a = b; return true;}return false;}
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
int main(){
    int n;
    while(cin>>n,n){
        vector<ll>dp(300,0);
        dp[1]=1;
        dp[2]=2;
        dp[3]=4;
        ll ans=0;
        for(int i=1;i<=n;i++){
            if(i>=4)dp[i]=dp[i-1]+dp[i-2]+dp[i-3];
        }
        ans=dp[n];
        cout<<ans/3650+(ans%3650?1:0)<<endl;
    }
}

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

inline int read()
{
	int x = 0, f = 1; char ch = getchar();
	for (; ch < '0' || ch > '9'; ch = getchar()) if (ch == '-') f = -1;
	for (; ch >= '0' && ch <= '9'; ch = getchar()) x = (x << 1) + (x << 3) + ch - '0';
	return x * f;
}

const int N = 505;
const int P = 1e9 + 7;

int dfn[N], low[N], idx;
stack<pair<int, int> > stk;
int edge_num[N], point_num[N], block[N], tot;
vector<int> G[N];

void Tarjan(int u, int fa)
{
	dfn[u] = low[u] = ++idx;
	
	for (int v : G[u]) if (v != fa)
	{
		if (!dfn[v]) 
		{
			stk.push({u, v});
			
			Tarjan(v, u);
			low[u] = min(low[u], low[v]);
			
			if (dfn[u] <= low[v])
			{
				++tot;
				while (1)
				{
					int x = stk.top().first;
					int y = stk.top().second;
					stk.pop();
					
					++edge_num[tot];
					if (block[x] != tot) 
					{
						block[x] = tot;
						++point_num[tot];
					}
					if (block[y] != tot)
					{
						block[y] = tot;
						++point_num[tot];
					}
					
					if (x == u && y == v) break;
				}
			}
		}
		else if (dfn[v] < dfn[u])
		{
			stk.push({u, v});
			low[u] = min(low[u], dfn[v]);
		}
	}
}

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

int Pow(int x, int t)
{
	int res = 1;
	for (; t; t >>= 1, x = 1LL * x * x % P)
		if (t & 1) res = 1LL * res * x % P;
	return res;
}

int fac[N], ifac[N];

int C(int n, int m){ return 1LL * fac[n] * ifac[m] % P * ifac[n - m] % P; }

int main()
{
	int n = read(), m = read(), k = read();
	
	fac[0] = 1;
	for (int i = 1; i <= m + k; ++i)
		fac[i] = 1LL * fac[i - 1] * i % P;
	ifac[m + k] = Pow(fac[m + k], P - 2);
	for (int i = m + k; i >= 1; --i)
		ifac[i - 1] = 1LL * ifac[i] * i % P;
	
	for (int i = 1; i <= m; ++i)
	{
		int u = read(), v = read();
		G[u].push_back(v);
		G[v].push_back(u);
	}
	
	for (int i = 1; i <= n; ++i)
		if (!dfn[i]) Tarjan(i, 0);
	
	int ans = 1;
	for (int i = 1; i <= tot; ++i)
	{
		if (edge_num[i] == 1) 
			ans = 1LL * ans * k % P;
		else if (edge_num[i] == point_num[i])
		{
			int sum = 0;
			for (int j = 0; j < edge_num[i]; ++j)
				(sum += Pow(k, gcd(point_num[i], j))) %= P;
			ans = 1LL * ans * sum % P * Pow(edge_num[i], P - 2) % P;
		}
		else
			ans = 1LL * ans * C(edge_num[i] + k - 1, k - 1) % P;
	}
	
	printf("%d\n", ans);
	
	return 0;
}


Measured memory_bytes: 3732
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <iterator>
#include <cmath>
#include <set>
#include <deque> 
#include <string>


using namespace std;

std::map<int, int> afterNumSet;

int n;
int a[200010];
int nextNum[200010];

int main()
{
	scanf("%d", &n);
	for (int i = 0 ; i < n ; i++)
	{
		scanf("%d", &(a[i]));
		nextNum[i] = -1;
	}
	
	afterNumSet.clear();
	for (int i = n - 1 ; i >= 0 ; i--)
	{
		std::map<int, int>::iterator lowerBound = afterNumSet.lower_bound(a[i]);
		if ((lowerBound == afterNumSet.end()) || (lowerBound->second == 0))
		{
			nextNum[i] = -1;
			afterNumSet[a[i]]++;
			continue;
		}
		
		if (lowerBound->first == a[i])
		{
			lowerBound++;
			if ((lowerBound == afterNumSet.end()) || (lowerBound->second == 0))
			{
				nextNum[i] = -1;
				afterNumSet[a[i]]++;
				continue;
			}
		}
		nextNum[i] = lowerBound->first;
		afterNumSet[a[i]]++;
		lowerBound->second--;
		if (lowerBound->second == 0)
			afterNumSet.erase(lowerBound);
	}
	
	int count = 0;
	for (int i = 0 ; i <= n ; i++)
	{
		if (nextNum[i] == -1)
			count++;
	}
	
	printf("%d\n", count);


	return 0;
}
	

Measured memory_bytes: 5632
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func out(x ...interface{}) {
	//	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

// Node :
type Node struct {
	from []int
	to   []int
	n    int
}

func main() {
	sc.Split(bufio.ScanWords)

	N, M := getInt(), getInt()

	node := make([]Node, N)
	for i := 0; i < M; i++ {
		from, to := getInt()-1, getInt()-1
		node[from].to = append(node[from].to, to)
		node[to].from = append(node[to].from, from)
	}

	var s []int

	for i := 0; i < N; i++ {
		l := len(node[i].to)
		node[i].n = l
		if l == 0 {
			s = append(s, i)
		}
	}

	out(N, M, node)

	out(s)

	pos := 0
	for i := 0; i < N; i++ {
		out(pos)
		idx := s[pos]
		for j := 0; j < len(node[idx].from); j++ {
			f := node[idx].from[j]
			node[f].n--
			out(i, j, "f", f)
			if node[f].n == 0 {
				s = append(s, f)
			}
		}
		pos++
	}
	out(s)

	m := 0
	dp := make([]int, N)
	for i := 0; i < N; i++ {
		idx := s[i]
		out("---", i)
		if len(node[idx].to) != 0 {
			for _, v := range node[idx].to {
				out(v)
				dp[idx] = max(dp[idx], dp[v]+1)
			}
		}
		if dp[idx] > m {
			m = dp[idx]
		}
	}

	out(dp)
	fmt.Println(m)
}


Measured memory_bytes: 15360
#include<iostream>
#include<vector>
using namespace std;
int main(){
    int n,i,k;
    int minn=1000000005,maxn=-1000000005;
    vector<int> nums;
    cin>>n;
    for(i=0;i<n;i++){
        cin>>k;
        nums.push_back(k);
    }
    minn=nums[0];
    for(i=1;i<nums.size();i++){
        maxn=max(maxn,nums[i]-minn);
        minn=min(minn,nums[i]);
    }
    cout<<maxn<<endl;
    return 0;
}



Measured memory_bytes: 3940
/**
*　　　　　　　　┏┓　　 　┏┓
* 　　　　　　　┏┛┗━━━━━━━┛┗━━━┓
* 　　　　　　　┃　　　　　　　┃ 　
* 　　　　　　　┃　　　━　　 　┃
* 　　　　　　　┃　＞　　　＜　┃
* 　　　　　　　┃　　　　　　　┃
* 　　　　　　　┃...　⌒　... 　┃
* 　　　　　　　┃　　　　　　　┃
* 　　　　　　　┗━┓　　　┏━┛
* 　　　　　　　　　┃　　　┃　　　　　　　　　　
* 　　　　　　　　　┃　　　┃
* 　　　　　　　　　┃　　　┃　　　　　　　　　　　
* 　　　　　　　　　┃　　　┃  　　　　　　
* 　　　　　　　　　┃　　　┃
* 　　　　　　　　　┃　　　┃　　　　　　　　　　　
* 　　　　　　　　　┃　　　┗━━━┓
* 　　　　　　　　　┃　　　　　　　┣┓
* 　　　　　　　　　┃　　　　　　　┏┛
* 　　　　　　　　　┗┓┓┏━┳┓┏┛
* 　　　　　　　　　　┃┫┫　┃┫┫
* 　　　　　　　　　　┗┻┛　┗┻┛
*/
#include<iostream>  
#include<cstdio>  
#include<fstream>  
#include<iomanip>
#include<algorithm>  
#include<cmath>  
#include<deque>  
#include<vector>
#include<bitset>
#include<queue>  
#include<string>  
#include<cstring>  
#include<map>  
#include<stack>  
#include<set>
#include<cassert>
#include<functional>

#define pii pair<int, int>
#define mod 1000000007
#define mp make_pair
#define pi acos(-1)
#define eps 0.000000001
#define mst(a,i) memset(a,i,sizeof(a))
#define all(n) n.begin(),n.end()
#define lson(x) ((x<<1))  
#define rson(x) ((x<<1)|1) 
#define inf 0x3f3f3f3f
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
const int maxn = 1e5 + 5;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
#ifdef DEBUG
	freopen("old_data.json", "r", stdin);
	freopen("1.out", "w", stdout);
#endif // DEBUG clang++ checker.cpp --target=i686-pc-mingw32 -o checker.exe
	int n, m;
	double ans = 0;
	cin >> n >> m;
	ll tans = 100 * (n - m) + m * 1900;
	double tp = 1;
	for (int i = 1; i <= m; ++i)tp /= 2;
	double curr = tp;
	tp = 1.0 - tp;
	for (int i = 1; i <= 100000; ++i) {
		ans += curr * i;
		curr *= tp;
	}
	ans += eps;
	cout << ans * tans << endl;
	return 0;
}

Measured memory_bytes: 256
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations,accumulate # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict,Counter
import decimal
import re
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#
# my_round_int = lambda x:np.round((x*2 + 1)//2)
# 四捨五入
import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
h,w = readInts()
S = ""
for i in range(h):
    S += input()
LIST = Counter(S)
if h%2 == 0 and w%2 == 0:
    for k,v in LIST.items():
        if v%4:
            print('No')
            exit()
elif (h%2 == 0 and w%2) or (h%2 and w%2 == 0):
    two = 0
    for k,v in LIST.items():
        if v%2 or v%4 == 3:
            print('No')
            exit()
        if v%4 == 2:
            two += 1
    if h%2 == 0:
        if two > h//2:
            print('No')
            exit()
    else:
        if two > w//2:
            print('No')
            exit()
else:
    odd = 0
    two = 0
    for k,v in LIST.items():
        if v%4 == 1:
            odd += 1
        if v%4 == 2:
            two += 1
        if v%4 == 3:
            print('No')
            exit()
    if odd != 1:
        print('No')
        exit()
    if two > ((h-1)//2 + (w-1)//2):
        print('No')
        exit()
print('Yes')


Measured memory_bytes: 10380
#![allow(non_snake_case)]

#[allow(unused_macros)]
macro_rules! input { (source = $s:expr, $($r:tt)*) => { let mut iter = $s.split_whitespace(); let mut next = || { iter.next().unwrap() }; input_inner!{next, $($r)*} }; ($($r:tt)*) => { let stdin = std::io::stdin(); let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock())); let mut next = move || -> String{ bytes.by_ref().map(|r|r.unwrap() as char).skip_while(|c|c.is_whitespace()).take_while(|c|!c.is_whitespace()).collect() }; input_inner!{next, $($r)*} }; }
macro_rules! input_inner { ($next:expr) => {}; ($next:expr, ) => {}; ($next:expr, $var:ident : $t:tt $($r:tt)*) => { let $var = read_value!($next, $t); input_inner!{$next $($r)*} };}
macro_rules! read_value { ($next:expr, ( $($t:tt),* )) => { ( $(read_value!($next, $t)),* ) }; ($next:expr, [ $t:tt ; $len:expr ]) => { (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>() }; ($next:expr, chars) => { read_value!($next, String).chars().collect::<Vec<char>>() }; ($next:expr, bytes) => { read_value!($next, String).into_bytes() }; ($next:expr, usize1) => { read_value!($next, usize) - 1 }; ($next:expr, $t:ty) => { $next().parse::<$t>().expect("Parse error") }; }

fn main() {
    input!{
        N: usize,
        a: [usize; N]
    }
    let mut a = a;
    a.sort();
    println!("{}", a.last().unwrap() - a.first().unwrap())
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
 
#define BOOST        ios::sync_with_stdio(false);  cin.tie(NULL); cout.tie(NULL);
#define AZ(x)        x.begin(),x.end()
#define fi           first
#define se           second
#define pb           push_back
#define emp          emplace_back
#define mp           make_pair
#define mt           make_tuple 
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); degub(_it, args); }
#define For(i,a,n)   for(auto i = a; i < n; i++)
#define int          long long
 
template<typename T> using V = vector<T>;
template<typename T, typename U> using P = pair<T,U>;
 
typedef long long ll;
typedef long double ld;
 
 
template<typename T>
// for super_map add a parameter Y above and replace "null_type" with "Y"
 
// set with two additional super powers
    // find_by_order(int k) - returns k'th smallest element (0-indexed)
    // order_of_key(int k) - returns number of elements strictly smaller than k.
using super_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
 
void degub(istream_iterator<string> it) {cerr << endl;}
template<typename T, typename... Args>
void degub(istream_iterator<string> it, T a, Args... args) {
    cerr << "[" << *it << " : " << a << "] ";
    degub(++it, args...);
}
 
 
ll power(ll a,ll b)
{
    // a = a;
    ll result = 1;
 
    while(b)
    {
        if(b&1)
            result = (result*a);
        b >>= 1, a = (a*a);
    }
    return result;
}
 
ll super_rand(ll n) // Random number from set [0,n-1]
{
    uniform_int_distribution<ll> uid(0, n - 1);
    return uid(rng);
}
 
 
 
/*
 
 
1. Make sure you're taking all the inputs.
2. In case of nested loops, remember to use different variables.
3. If in doubt, do int -> ll
4. Don't fight the question, try solving the next one.
5. ffs (positon of first set bit), clz (leading 0s, max->32), ctz (trailing 0s), popcount (set bits). Don't use any of these on 0;
 
 
*/
 
 
 
// Don't code anything above this //
 
 
 
 
 
 
const int mod = 1e9+7, N = 1e5 + 5;
const ll INF = (ll)1e18 + 7LL;
 
int32_t main()
{
    BOOST
    
    // #ifndef ONLINE_JUDGE
    // // for getting input from input.txt
    // freopen("input.txt", "r", stdin);
    // // for writing output to output.txt
    // freopen("output.txt", "w", stdout);
    // cout << "OUTPUT \n";
    // #endif


    int n;
    cin >> n;

    map<string, int> s;
    int val = 0;
    for(int i = 0; i < n; i++)
    {
        string tmp;
        cin >> tmp;
        val = max(val, ++s[tmp]);
    }

    for(auto i : s)
    {
        if(i.se == val)
            cout << i.fi << "\n";
    }
    return 0;
}

Measured memory_bytes: 23808
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClassLibrary1
{
    public class ListNode
    {
        public int val;
        public ListNode next;
        public ListNode(int x) { val = x; }
    }


    public class Class1
    {
        static int[][] mtx ;
        static List<int>[] tm;
        static int n;
        static int[] results;
        static List<string> cons = new List<string>();
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int n = int.Parse(s[0]);
            int k = int.Parse(s[1]);
            string[] s2 = Console.ReadLine().Split(' ');
            int cnt = 0;
            for(int i=0; i<n; i++)
            {
                if (int.Parse(s2[i]) >= k) cnt++;
            }

            Console.WriteLine( cnt);

        }


        static int rec(int[] n, int i, int j, int x)
        {
            if (i+1 == j)
            {
                return Math.Min(n[j], x);
            }
            return rec(n, i + 1, j, n[i]) + rec(n, i, j - 1, n[j]);
        }
    }

}

Measured memory_bytes: 15456
#include <iostream>
using namespace std;

int N,D,a;

int main(){
    cin >> N >> D;
    int res = 0;
    for(int i=1;i<=N;i++){
        cin >> a;
        a--;
        a %= D+1;
        res ^= a;
    }
    cout << (res? "First":"Second") << endl;
}



Measured memory_bytes: 3136
#import sys
MOD = 10 ** 9 + 7
#input = sys.stdin.readline
import math

import itertools

#import bisect

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default


#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]
def main():
    a,b,k=map(int,input().split())
    taka=a-k
    if taka<0:
        taka=0
    noko=k-a
    if noko<0:
        noko=0
    ao=b-noko
    if ao<0:
        ao=0
    print(taka,ao)











if __name__ == "__main__":
    main()

Measured memory_bytes: 3444
#include<stdio.h>
int main(){
  int p[1010]={0};
  int d[1010]={0};
  int i,a,b,c=0,v=0,n,m;
  scanf("%d %d",&n,&m);
  while(m--){
    scanf("%d %d",&a,&b);
    for(;p[a];a=p[a]);
    for(;p[b];b=p[b]);
    if(a==b)continue;
    if(d[a]> d[b])p[b]=a;
    if(d[a]<=d[b])p[a]=b;
    if(d[a]==d[b])d[b]++;
  }
  for(i=1;i<=n;i++){
    //printf("%d %d %d\n",i,p[i],d[i]);
    if(p[i])continue;
    d[i]?c++:v++;
  }
  printf("%d\n",abs(c-v));    
  return 0;
}

Measured memory_bytes: 608
//hail to jwalaji
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main(){
    lli n;
    cin>>n;
    vector<vector<lli>> ass(n,vector<lli>(3,0));
    for(lli i=0;i<n;i++){
        cin>>ass[i][0]>>ass[i][1]>>ass[i][2];
    }
    vector<vector<lli>> arr(n,vector<lli>(3,0));
    arr[0][0]=ass[0][0];
    arr[0][1]=ass[0][1];
    arr[0][2]=ass[0][2];
    for(lli i=1;i<n;i++){
        for(lli j=0;j<3;j++){
            for(lli k=0;k<3;k++){
                if(j==k){continue;}
                arr[i][j]=max(arr[i][j],arr[i-1][k]+ass[i][j]);
            }
        }
    }
   /* for(lli i=0;i<n;i++){
        for(lli j=0;j<3;j++){
            cout<<arr[i][j]<<" ";
        }cout<<endl;
    }*/
    cout<<max(arr[n-1][0],max(arr[n-1][1],arr[n-1][2]));
    return 0;
}


Measured memory_bytes: 14008
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14,
     1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(l[k-1])


Measured memory_bytes: 38256
def minimumCostSort(arr, arr_size):
    cost = 0
    sortarr = sorted(arr)
    cyclecontainer = []
    for i in range(arr_size):
        cycle = [arr[i]]
        next = sortarr.index(arr[i])
        while arr[next] != arr[i]:
            cycle += [arr[next]]
            next = sortarr.index(arr[next])
        cycle = sorted(cycle)
        if cycle not in cyclecontainer:
            cyclecontainer.append(cycle)
            if len(cycle) == 1:
                pass
            elif len(cycle) == 2:
                cost += sum(cycle)
            elif len(cycle) >= 3:
                cost += min(sum(cycle)+((len(cycle)-2)*min(cycle)), sum(cycle)+min(cycle)+((len(cycle)+1)*min(arr)))
    return cost
n = int(input())
w = list(map(int, input().split()))
print(minimumCostSort(w, n))


Measured memory_bytes: 5720
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using ld = long double;
#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 REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define REPS(c, s) for (char c : s)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REV(c) reverse(ALL(c))
#define sz(v) (int)v.size()
#define endl '\n'
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;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
 
void solve();
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

void solve() {
    int d;
    cin >> d;
    string ans = "Christmas";
    REP(i, 25 - d) ans += " Eve";
    cout << ans << endl;
}



Measured memory_bytes: 256