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

using namespace std;

int main()
{
    ios_base :: sync_with_stdio(0);
    cin.tie(0), cout.tie(0);

    int n;
    cin>>n;
    if(n%2==0)
    {
        cout<<n<<endl;
    }
    else
    {
      n = n*2;
      cout<<n<<endl;
    }
}



Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define max(p,q) ((p)>(q)?(p):(q))
#define min(p,q) ((p)<(q)?(p):(q))
#define chmax(a,b) ((a)=(a)>(b)?(a):(b))
#define chmin(a,b) ((a)=(a)<(b)?(a):(b))
#define abs(p) ((p)>=(0)?(p):(-(p)))
#define MOD 1000000007
ll powll(ll a,ll b){ll r=1;rep(i,b){r*=a;}return r;}
#define swap(a,b) do{ll w=(a);(a)=(b);(b)=w;}while(0)
#define swapd(a,b) do{double w=(a);(a)=(b);(b)=w}while(0)
//your code here!
int main(void){
    ll N, ans=1, alph[30]={0}, i=0;
    char S[100100];
    scanf("%lld %s", &N, S);
    while(S[i]!='\0') alph[S[i++]-'a']++;
    rep(i, 30) if(alph[i]>0) ans = (ans*(alph[i]+1)) % MOD;
    printf("%lld\n", --ans);
    return 0;
}


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

int main() {
    int n, k;
    cin >> n >> k;
    int a[n+1] = {0};
    rep(i,n) {
        int m;
        cin >> m;
        a[m]++;
    }
    sort(a, a+n+1, greater<>());
    int64_t ans = 0;
    for (int i = k; i < n; i++) {
        ans += a[i];
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;

int main(void) {
	int n;
	cin >> n;
	
	int alice = 0;
	int bob = 0;
	vector<int> a(n);
	for(int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	
	sort(a.rbegin(), a.rend());
	
	for(int i = 0; i < n; ++i) {
		if( i % 2 == 0 ) alice += a[i];
		else bob += a[i];
	}
	
	cout << alice - bob << endl;
	
	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 1005
#define inf 1e9
#define pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

inline ll read()
{
	ll x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}
int main()
{
    map<string,int>mp;
    int n=read();
    rep(i,1,n)
    {
        string s;
        cin>>s;
        mp[s]++;
    }
    printf("%s x %d\n","AC",mp["AC"]);
    printf("%s x %d\n","WA",mp["WA"]);
    printf("%s x %d\n","TLE",mp["TLE"]);
    printf("%s x %d\n","RE",mp["RE"]);
}


Measured memory_bytes: 3520
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String[] sarr = new String[]{"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"};
        for (int i = sarr.length - 1; i >= 0; i--) {
            if (s.equals(sarr[i])) {
                System.out.println(sarr.length - i);
            }
        }
    }

}


Measured memory_bytes: 21844
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
using namespace std;

#define X first
#define Y second
#define N 100010
#define M 11

typedef long long ll;
const int INF=1<<30;

deque<int> Q;

int main()
{
	//freopen("in.in","r",stdin);
	//freopen("out.out","w",stdout);
	
	ll n; int a[60]; int m=0;
	cin >> n ;n++;
	while (n)
	{
		a[m++]=n&1;
		n>>=1;
	}
	int k=0;
	for (int i=m-2;i>=0;i--)
	{
		Q.push_back(++k);
		if (a[i]) Q.push_front(++k);
	}
	for (int i=1;i<=k;i++) Q.push_back(i);
	printf("%d\n",(int)Q.size());
	for (int i=0;i<Q.size();i++) printf("%d%c",Q[i],i==Q.size()-1? '\n':' ');
	return 0;
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var n int
	var ans float64

	fmt.Scan(&n)

	for i := 0; i < n; i++ {
		var a int
		fmt.Scan(&a)

		ans += 1.0 / float64(a)
	}

	fmt.Printf("%f\n", 1.0/ans)

}


Measured memory_bytes: 512
#import math
#import itertools
import numpy as np
#from collections import deque
# sys.setrecursionlimit(10 ** 6)
MOD = 998244353
#INF = 10 ** 9
#PI = 3.14159265358979323846

INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

def do():
    n,k=INTM()
    lrs=[]
    for i in range(k):
        lrs.append(LIST())
    pt=np.array([0]*((2*n)+1))
    rui=np.array([0]*((2*n)+1))
    pt[n-1]=1
    rui[n-1]=1
    for i in range(n):
        nt=n-1+i
        for l,r in lrs:
            pt[nt]=(pt[nt]-rui[nt-r-1]+rui[nt-l])%MOD
        rui[nt]=(rui[nt-1]+pt[nt])%MOD
    print(pt[2*n-2]%MOD)
    #print(pt)
    #print(rui)

    
    #print(pt[n-1]%MOD)


if __name__=='__main__':
    do()

Measured memory_bytes: 35868
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, begin, end) for (int i = begin; i < (int)(end); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1000000007;

int main()
{
    int N, M;
    cin >> N >> M;
    vector<int> ac(N, 0), pena(N, 0);
    rep(i, 0, M)
    {
        int a;
        string s;
        cin >> a >> s;
        if (s == "AC")
        {
            ac.at(a - 1)++;
        }
        else if (ac.at(a - 1) == 0)
        {
            pena.at(a - 1)++;
        }
    }
    int ac_count = 0;
    int pen_count = 0;
    rep(i, 0, N)
    {
        if (ac.at(i) != 0)
        {
            ac_count++;
            pen_count += pena.at(i);
        }
    }
    cout << ac_count << ' ' << pen_count << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main() {
	int N, M;
	vector<string> B;
	vector<string> R;
	vector<string> All;
	string v;
	int i;
	cin >> N;
	for (i = 0; i < N; i++) {
		cin >> v;
		B.push_back(v);
		All.push_back(v);
	}
	cin >> M;
	for (i = 0; i < M; i++) {
		cin >> v;
		R.push_back(v);
		All.push_back(v);
	}
	int ret = 0;
	int ma = 0;
	for (auto v : All) {
		for (auto b : B) ma += v == b;
		for (auto r : R) ma -= v == r;
		ret = max(ret,ma);
		ma = 0;
	}
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cmath>
#include <iomanip>
#include <string>
#include <queue>

typedef long long ll;
using namespace std;
const int mod = 1000000007;

int main() {

    ll H; cin >> H;

    ll x = 1;
    int cnt = 0;
    while (x <= H) {
        cnt++;
        x *= 2;
    }
    cout << ll(pow(2, cnt)) - 1 << '\n';
}



Measured memory_bytes: 256
# coding: utf-8
# Your code here!
n=int(input())
card=[[False for i in range(13)] for j in range(4)]

for i in range(n):
    mark,suit=input().split()
    if mark=="S":
        mark_num=0
    elif mark=="H":
        mark_num=1
    elif mark=="C":
        mark_num=2
    elif mark=="D":
        mark_num=3
    card[mark_num][int(suit)-1]=True

for j in range(4):
    for i in range(13):
        if card[j][i]==False:
            if j==0:
                print("S",i+1)
            elif j==1:
                print("H",i+1)
            elif j==2:
                print("C",i+1)
            elif j==3:
                print("D",i+1)


Measured memory_bytes: 5616
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main() {
	int n, m; cin >> n >> m;
	vector<int> d(n);
	for (int i = 0; i < n-1; ++i) {
		cin >> d[i+1];
	}
	for (int i = 1; i < n; ++i) {
		d[i] += d[i-1];
	}
	int ans = 0;
	int now = 0;
	for (int i = 0; i < m; ++i) {
		int a; cin >> a;
		int next = now + a;
		ans = (ans + (int)abs(d[next] - d[now])) % 100000;
		now = next;
	}
	cout << ans << endl;
}

Measured memory_bytes: 1532
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<utility>
#include<set>
#include<stack>
#include<queue>
#include<deque>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<bitset>
#include<sstream>
#include<list>
#include<climits>

using namespace std;
#define rep(i,i0,n) for(int i=(i0);i<(int)(n);++i)
typedef vector<int> vi; typedef pair<int,int> pii; typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vii;
typedef long long ll;


int main(){
    int n;cin>>n;
    vi a(n),b(n);
    rep(i,0,n){
        cin>>a[i];
        b[i]=a[i];
    }
    sort(a.begin(),a.end());
    int l=a[n/2-1],r=a[n/2];
    rep(i,0,n){
        int t = b[i]<=l? r:l;
        cout<<t<<endl;
    }
	return 0;
}



Measured memory_bytes: 3712
#include<stdio.h>
#include<stdlib.h>

int asc(const void *a, const void *b) {
  return (*(const int **)a)[0] - (*(const int **)b)[0];
}

int memo[200000];
int** br;
int note[200000];

int findIndex(int N,int index){
  int start=0,end=N-1;
  if(br[0][0]==index){return 0;}
  if(br[N-2][0]<index){return N-1;}
  while(end-start > 1){
    if(br[(start+end)/2][0] >= index){end = (start+end)/2;}
    if(br[(start+end)/2][0] < index){start = (start+end)/2;}
  }return end;
}

int main() {
  int N,i,j,v1,v2,w,current,st=0,ed=0,index;
  br = (int**)malloc(sizeof(int*)*200000);
  for(i = 0;i < 200000;i++){
    br[i] = (int*)malloc(sizeof(int)*3);
  }
  scanf("%d",&N);
  for(i = 0;i < N-1;i++){
    scanf("%d %d %d",&v1,&v2,&w);v1--;v2--;
    br[i*2][0]=v1;br[i*2][1]=v2;br[i*2][2]=w;
    br[i*2+1][0]=v2;br[i*2+1][1]=v1;br[i*2+1][2]=w;
  }
  
  qsort(br, N*2-2, sizeof(int*), asc);
  
  memo[0]=1;current=0;index = 0;st=1;
  while(st != ed){
    index = findIndex(N*2-2,current);
    for(i = 0;br[i+index][0] == current;i++){
      if(memo[br[i+index][1]]==0){
        if(br[i+index][2]&1){memo[br[i+index][1]] = 3-memo[current];}
        else{memo[br[i+index][1]]=memo[current];}
        note[st] = br[i+index][1];st++;
      }
    }
    ed++;current=note[ed];
  }
  for(i = 0;i < N;i++){
    printf("%d\n",memo[i]-1);
  }return 0;
}

Measured memory_bytes: 9596
#include<bits/stdc++.h>
#define FOR(i,a,b)for(int i=(a),_b=(b);i<=_b;i++)
#define FORN(i,b,a)for(int i=(b);_a=(a);i>=_a;i--)
#define REP(i,n)for(int i=0,_n=n;i<n;i++)
#define ll long long
#define pii pair<int,int>
#define re return
#define vi vector<int>
#define pb push_back
#define si set<int>
#define in insert
#define fl float
#define db double
#define ld long double
#define X first
#define Y second
#define st string
#define ull unsigned long long
#define size(s) s.size()
#define mod 1000000007
using namespace std;
inline void read(int &x)
{
	short negative=1;
    x=0;
    char c=getchar();
    while(c<'0' || c>'9')
    {
		if(c=='-')
			negative=-1;
		c=getchar();
	}
    while(c>='0' && c<='9')
        x=(x<<3)+(x<<1)+(c^48),c=getchar();
    x*=negative;
}
int main()
{
	string s;
	cin>>s;
	REP(i,size(s))
		cout<<"x";
	cout<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <numeric>
#define MOD 1000000007

using namespace std;

int main() {
    int N,K;
    cin >> N >> K;
    int m = N;
    vector<int> a,b;
    while(m--){
        int x;
        cin >> x;
        a.push_back(x);
        b.push_back(0);
    }
    //sort(a.begin(),a.end());
    for(int i=0;i<a.size();i++){
        b[a[i]-1]++;
    }
    sort(b.begin(),b.end(),greater<int>());//逆順
    int ans = 0;
    for(int i=K;i<b.size();i++){
        ans+=b[i];
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 2036
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

int main()
{
    string S;
    cin >> S;
    for (int i = 0; i < 3; i++)
    {
        if (S[i] == '7')
        {
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 3592
#include <iostream>

using namespace std;

int main() {
    int a,b,c;
    cin>>a>>b>>c;
    int u,v,w;
    u=a-b;
    v=b-c;
    w=c-a;
    if(u==0||v==0||w==0)
    {
        if(u==0&&v==0&&w==0)
        {
            cout<<"No"<<endl;
        }
        else
        {
            cout<<"Yes"<<endl;
        }
    }
    else
    {
        cout<<"No"<<endl;
    }
}

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

using namespace std;

#define prec(n) fixed << setprecision(n)
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int>>
#define PI 3.14159265
#define pb push_back
#define bits(n) __builtin_popcount(n)
#define ll long long int

void solve()
{
    int n;
    cin>>n;
    string s;
    cin>>s;
    int c=0;
    for(int i=0;i<n-2;i++)
    {
        if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C')
        c++;
    }    
    cout<<c;
}

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input1.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output1.txt", "w", stdout);
#endif

    int t=1;
    //cin >> t;
    while(t--)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 3580
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <map>
#include <algorithm>

int main()
{
    int n, q;
    std::cin >> n >> q;

    std::queue<std::pair<std::string, int>> queue;

    for (int i = 0; i < n; ++i) {
        std::string name;
        int t;
        std::cin >> name >> t;
        queue.push(std::make_pair(name, t));
    }

    int elapsed = 0;
    while (true) {
        if (queue.empty()) {
            break;
        }

        std::pair<std::string, int> p = queue.front();
        if (p.second <= q) {
            elapsed += p.second;
            p.second = 0;
            queue.pop();
            std::cout << p.first << " " << elapsed << std::endl;
        } else {
            p.second -= q;
            elapsed  += q;
            queue.pop();
            queue.push(p);
        }
    }

    return 0;
}


Measured memory_bytes: 6212
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

int dpX[4001][16001];
int dpY[4001][16001];

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    S.push_back('T');
    int x, y;
    cin >> x >> y;
    int i = 0;
    while(S[i] == 'F'){
        x--;
        i++;
    }
    int X[8000] = {};
    int Y[8000] = {};
    int turn = 1;
    int tmp = 0;
    int ycnt = 0;
    int xcnt = 0;
    rep(j, S.length() - i) {
        if (S[j+i] == 'F') tmp++;
        else {
            turn = 1 - turn; 
            if (tmp != 0) {
                if (turn == 1) Y[ycnt++] = tmp;
                else X[xcnt++] = tmp;
                tmp = 0;
            }
        }
    }

    dpX[0][8000] = 1;
    dpY[0][8000] = 1;
    rep(i, 4000) {
        for(int j = 0; j <= 16000; j++) {
            if(dpX[i][j] == 1) {
                dpX[i+1][j-X[i]] = 1;
                dpX[i+1][j+X[i]] = 1;
            }
            if(dpY[i][j] == 1) {
                dpY[i+1][j-Y[i]] = 1;
                dpY[i+1][j+Y[i]] = 1;
            }
        }
    }
    /*
    rep(i,16000) if (dpX[4000][i] != 0) {
        cout << "dpX[" << i-8000 << "] = " << dpX[4000][i] << endl;
    }
    */
    if(dpX[4000][8000+x] == 1 && dpY[4000][8000+y] == 1) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 499200
package main

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

func main() {
	In := readLineInt()
	N, D := In[0], In[1]

	i := 1
	for {
		if 2*D*i+i >= N {
			fmt.Println(i)
			return
		}
		i++
	}
}

/////////////////////////////////////////

func readLineInt() []int {
	result := make([]int, 0)
	for _, v := range strings.Split(readLine(), " ") {
		i, _ := strconv.Atoi(v)
		result = append(result, i)
	}
	return result
}

var reader = bufio.NewReaderSize(os.Stdin, 1e6)

func readLine() string {
	result := make([]byte, 0, 1e6)
	for {
		line, remains, e := reader.ReadLine()
		if e != nil {
			panic(e)
		}
		result = append(result, line...)
		if !remains {
			break
		}
	}
	return string(result)
}


Measured memory_bytes: 640
#include <iostream>
#include <cstdio>

using namespace std;
int n,d;
void solve()
{
	cin >> n >> d;
	int res=(n-1)*127;
	if (n%2==0) res+=(127^d);
	else res+=d;
	cout << res << '\n';
}
int main()
{
	ios_base::sync_with_stdio(0);
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	int t;
	cin >> t;
	for (int i=1; i<=t; i++)
		solve();
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){

  string S;
  cin>>S;
  int Ncount=0;
  int Scount=0;
  int Ecount=0;
  int Wcount=0;
  for(size_t i=0;i<=S.length()-1;i++){
  
    if(S[i]=='N')Ncount++;
    if(S[i]=='S')Scount++;
    if(S[i]=='E')Ecount++;
    if(S[i]=='W')Wcount++;
  }
  if((Ncount==0&&Scount!=0)||(Ncount!=0&&Scount==0)){
  
    cout<<"No";
    return 0;
  }
  if((Ecount==0&&Wcount!=0)||(Ecount!=0&&Wcount==0)){
  
    cout<<"No";
    return 0;
  }
  cout<<"Yes";
  return 0;
}

Measured memory_bytes: 3640
#include<stdio.h>
int main()
{
	int n,i,i2,i3,i4,a;
	
	while(scanf("%d",&n)!=EOF){
		a=0;
		for(i=0;i<10;i++){
			for(i2=0;i2<10;i2++){
				for(i3=0;i3<10;i3++){
					for(i4=0;i4<10;i4++){
						if(n==i+i2+i3+i4){
							a++;
						}
					}
				}
			}
		}
		printf("%d\n",a);
	}
	return 0;
}

Measured memory_bytes: 596
def gcd(a,b):
    while b:
        a, b = b, a % b
    return a
N,X = map(int,input().split())
x = [int(i) for i in input().split()]
ans = abs(X-x[0])
now = X
for i in x:
    ans = gcd(ans, abs(now-i))
    now = i

print(ans)

Measured memory_bytes: 14252
N, M = map(int, input().split())
adj = [[] for _ in range(N)]
for _ in range(M):
  i,j = map(int, input().split())
  adj[i-1].append(j-1)
  adj[j-1].append(i-1)

ans = 0
def dfs(path):
  if len(path) == N:
    global ans
    ans += 1
  for next in adj[path[-1]]:
    if next not in path:
      dfs(path+[next])
dfs([0])
print(ans)

Measured memory_bytes: 3064
#define _USE_MATH_DEFINES 
#include<iomanip> 
#include<cmath>  
#include<iostream>
#include<fstream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<bitset>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<queue>
#include<deque>
#include<stack>
using namespace std;
typedef long long ll;
#define repi(i,a,b) for(ll i = (ll)(a) ; i < (ll)(b) ; i++)
#define repd(i,a,b) for(ll i = (ll)(a) ; i > (ll)(b) ; i--)
#define rd(x) cin >> x
#define wr(x)  cout << x
#define wrln(x) cout << x << endl
#define wl() cout << endl
const ll MAX_10p5 = 100010;
const ll MAX_10p9 = 1000000010;
const ll MAX_10p18 = 1000000000000000010;
const ll MOD = 1000000007;
const ll m4x[4] = { 1,0,-1,0 };
const ll m4y[4] = { 0,1,0,-1 };
const ll m8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const ll m8y[8] = { 0,1,1,1,0,-1,-1,-1 };
const ll m9x[9] = { 1,1,0,-1,-1,-1,0,1,0 };
const ll m9y[9] = { 0,1,1,1,0,-1,-1,-1,0 };

struct edge {
	ll from, to, cost;
	bool operator<(const edge& right) const {
		return cost < right.cost;
	}
};
struct point {
	ll x, y;
	bool operator<(const point& right) const {
		return x == right.x ? y < right.y : x < right.x;
	}
};

///////////////////////////////////////////////////////////////////////////////////////

int main() {
	map<string, ll> MP;
	ll N, M;
	string s;
	rd(N);
	repi(i, 0, N) {
		rd(s);
		if (MP.find(s) != MP.end()) MP[s]++;
		else MP[s] = 1;
	}
	rd(M);
	repi(i, 0, M) {
		rd(s);
		if (MP.find(s) != MP.end()) MP[s]--;
	}
	ll ans = 0;
	for (auto itr = MP.begin(); itr != MP.end(); itr++) {
		ans = max(ans, itr->second);
	}
	wrln(ans);
	return 0;
}


Measured memory_bytes: 256
// Aizu Vol-1 0152: Bowling
// 2017.8.9

#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>

char *gets(char *);
char buf[100], *p;

int getInt(void)
{
	int n = 0;
	while (isspace(*p)) p++;
	if (!*p) return -1;
	while (isdigit(*p)) n = 10 * n + (*p++ - '0');
	return n;
}

typedef struct { int n, s; } T;
T d[42]; int n;
int tbl[23], m;

int cmp(T *a, T*b)
{
	int k = b->s - a->s;
	if (!k) k = a->n - b->n;
	return k;
}

int main()
{
	int i, k, f, s, sum;

	while (1) {
		gets(p = buf); if ((n = getInt()) == 0) return 0;
		for (i = 0; i < n; i++) {
			gets(p = buf);
			d[i].n = getInt();
			m = -1;	while ((tbl[++m] = getInt()) >= 0);
			for (sum = k = 0, f = 1; ; f++) {
				if (f == 10) {
					sum += (tbl[k] + tbl[k + 1]);
					if (tbl[k] == 10 || tbl[k] + tbl[k+1] == 10) sum += tbl[k + 2];
					break;
				}
				if ((s = tbl[k]) == 10) sum += 10 + tbl[k + 1] + tbl[k + 2], k++;
				else {
					s += tbl[++k], sum += s, k++;
					if (s == 10) sum += tbl[k];
				}
			}
			d[i].s = sum;
		}
		qsort(&d, n, sizeof(T), cmp);
		for (i = 0; i < n; i++) printf("%d %d\n", d[i].n, d[i].s);
	}
	return 0;
}

Measured memory_bytes: 524
#include <stdio.h>
int main(){
  int a,b,c,x,i;
  scanf("%d %d %d",&a,&b,&c);
  for(x=a;x<=b;x++){
    c%x;
    if(c%x==0) i++;
  }
  printf("%d\n",i);
 
  return 0;
}

Measured memory_bytes: 596
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x) x
#define rep(...) MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c) c.begin(),c.end()
#define mp make_pair
#define write(x) cout<<(x)<<"\n"
using namespace std; typedef long long ll;
typedef vector<int> vi; typedef vector<ll> vll; template<class T>using vv = vector<vector<T>>;
template<class T>vv<T> vvec(size_t n, size_t m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T>bool chmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }
template<class T>bool chmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 28, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); }; }aaaa;

int main() {
    int H, W;
    cin >> H >> W;
    vector<string> S(H);
    rep(h, H) {
        cin >> S[h];
    }

    vv<int> hor = vvec(H, W, 0), vert = vvec(H, W, 0);
    int ans = 0;
    rep(h, H) {
        rep(w, W) {
            if (S[h][w] == '#') continue;

            if (w == 0 || S[h][w - 1] == '#') {
                int cnt = 0;
                for (int l = w - 1; l >= 0 && S[h][l] == '.'; --l)
                    cnt++;
                for (int r = w; r < W && S[h][r] == '.'; ++r)
                    cnt++;
                hor[h][w] = cnt;
            }
            else hor[h][w] = hor[h][w - 1];

            if (h == 0 || S[h - 1][w] == '#') {
                int cnt = 0;
                for (int u = h - 1; u >= 0 && S[u][w] == '.'; --u)
                    cnt++;
                for (int d = h; d < H && S[d][w] == '.'; ++d)
                    cnt++;
                vert[h][w] = cnt;
            }
            else vert[h][w] = vert[h - 1][w];

            ans = max(ans, hor[h][w] + vert[h][w] - 1);
        }
    }
    write(ans);
}

Measured memory_bytes: 35968
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
#define forn(i,a,b)for(int i=(a),_b=(b);i<=_b;i++)
#define fore(i,b,a)for(int i=(b),_a=(a);i>=_a;i--)
#define rep(i,n)for(int i=0,_n=n;i<n;i++)
#define ll long long
#define pii pair<int,int>
#define vi vector<int>
#define vpii vector<pii>
#define m_p make_pair
#define re return
#define pb push_back
#define si set<int>
#define ld long double
#define X first
#define Y second
#define st string
#define ull unsigned long long
#define mod 1000000007
#define INF 1000000007
#define x1 XZVJDFADSPFOE
#define y1 GASDIJSLDAEJF
#define x2 DFDAJKVOHKWIW
#define y2 PSFSAODSXVNMQ
#define LLINF 0x3f3f3f3f3f3f3f3fLL
using namespace std;
inline void read(int &x)
{
	short negative=1;
    x=0;
    char c=getchar();
    while(c<'0' || c>'9')
    {
		if(c=='-')
			negative=-1;
		c=getchar();
	}
    while(c>='0' && c<='9')
        x=(x<<3)+(x<<1)+(c^48),c=getchar();
    x*=negative;
}
ll quickpower(ll n,ll k){
	ll ans=1;
	while(k){
		if(k%2){
			ans*=n;
			ans%=mod;
		}
		n*=n;
		n%=mod;
		k/=2;
	}
	return ans;
}
string int_to_string(int n)
{
	string s="";
	while(n)
	{
		int now=n%10;
		s+=now+'0';
		n/=10;
	}
	reverse(s.begin(),s.end());
	return s;
}
int string_to_int(string s)
{
	int n=0;
	rep(i,s.size())
	{
		n*=10;
		n+=s[i]-'0';
	}
	return n;
}
ll a[100100];
int main()
{
	ios::sync_with_stdio(0);
	//think twice,code once
	int n;
  cin>>n;
  ll ans=1;
  rep(i,n)
  	cin>>a[i];
	rep(i,n)
	{
  	if(a[i]==0)
  	{
  	  cout<<0<<endl;
	  return 0;	
	}
  }
  rep(i,n)
  {
  	if((double)(ans)>(double)(1e18)/(double)a[i])
  	{
  		cout<<-1<<endl;
  		return 0;
	}
	ans*=a[i];
  }
  if(ans>(ll)1e18)
  {
  	cout<<-1<<endl;
  	return 0;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 4436
package main

import (
        "fmt"
)

func solution(a, b, c, x int) int {
        out := 0
        for i := 0; i <= a; i++ {
                for j := 0; j <= b; j++ {
                        for k := 0; k <= c; k++ {
                                if x == 500*i+100*j+50*k {
                                        out++
                                }
                        }
                }
        }
        return out
}

func main() {
        var a, b, c, x int
        fmt.Scan(&a, &b, &c, &x)
        fmt.Println(solution(a, b, c, x))
}

Measured memory_bytes: 512
#include<iostream>
#include<string>
using namespace std;
int main() {
    int b = 0;
	string a;
	cin >> a;
    size_t size = a.length();
    b = size;
    if (a[b-1]=='s') {
        cout << a << "es" << endl;
    }
    else {
        cout << a << "s" << endl;
    }
    return 0;
}

Measured memory_bytes: 3628
// #pragma GCC target("avx2")
#pragma GCC optimize("O3", "unroll-loops")

// #include <bits/extc++.h>
// using namespace __gnu_pbds;

#include <bits/stdc++.h>
using namespace std;

#define int long long
#define double long double
// template <typename T>
// using pbds_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
using pii = pair<int, int>;
template<typename T>
using prior = priority_queue<T, vector<T>, greater<T>>;
template<typename T>
using Prior = priority_queue<T>;

#define X first
#define Y second
#define ALL(x) (x).begin(), (x).end()
#define eb emplace_back
#define pb push_back

#define fastIO() ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define RANDOM() random_device __rd; \
                 mt19937 __gen = mt19937(__rd()); \
                 uniform_int_distribution<int> __dis(0, 1); \
                 auto rnd = bind(__dis, __gen);

const int INF = 1E18;
const int mod = 1E9 + 7;

int32_t main() {
    fastIO();
    
    int n, fl = 0;
    char ch;
    cin >> n;
    while (n--) cin >> ch, fl |= ch == 'Y';
    
    cout << (fl ? "Four" : "Three") << "\n";
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#include <set>
#include <map>
 
using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n==0) ? 1 : 10*TEN(n-1); }
 
int h, w, n, md;
bool g[51][51] = {};
 
void answer() {
    ll res = 0;
    ll base = 1;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (g[i][j]) res = (res+base) % md;
            base = 2*base % md;
        }
    }
    cout << "! " << res << endl;
}
 
using T = tuple<int, int, int, int>;
map<T, int> buf;
int que(int ax, int ay, int bx, int by) {
    bx--; by--;
    if (buf.count(T(ax, ay, bx, by))) return buf[T(ax, ay, bx, by)];
    cout << "? " << ay << " " << ax << " " << by << " " << bx << endl;
    int p;
    cin >> p;
    return buf[T(ax, ay, bx, by)] = p;
}


ll rand_int(ll l, ll r) { //[l, r]
    using D = uniform_int_distribution<ll>;
    static random_device rd;
    static mt19937 gen(rd());
    return D(l, r)(gen);
}

int dfs(int y, int l, int r, int nm = -1) {
    if (nm == -1) {
        nm = que(l, y, r, y+1);
    }
    if (nm == 0) return 0;
    if (nm == r-l) {
        for (int i = l; i < r; i++) {
            g[y][i] = true;
        }
        return nm;
    }
    int md = (l+r)/2;
    if (rand_int(0, 1) == 0) {
        int buf = dfs(y, l, md);
        if (nm != buf) dfs(y, md, r, nm-buf);
    } else {
        int buf = dfs(y, md, r);
        if (nm != buf) dfs(y, l, md, nm-buf);
    }
    return nm;
}
 
int main() {
    ios::sync_with_stdio(0);
    cin >> h >> w >> n >> md;
    for (int i = 0; i < h; i++) {
/*        for (int j = 0; j < w; j++) {
            g[i][j] = (que(j, i, j+1, i+1) != 0);
        }*/
        dfs(i, 0, w);
    }
    answer();
    return 0;
}
 

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

using namespace std;

int cnt[30],n,m,nx,ny;
int mps[200][200];
int main()
{
	memset(mps,-1,sizeof mps);
	scanf("%d%d",&n,&m);
	nx=1,ny=1;
	for(int i=1;i<=n;i++)
	{
		char sd[200]; scanf("%s",sd);
		for(int j=0;j<m;j++) 
			cnt[sd[j]-'a']++;
	}
	for(int j=0;j<26;j++)
	{
		if(cnt[j]&1)
		{
			if(n%2==0||m%2==0)
			{
				puts("No\n");
				return 0;
			}
			if(mps[n/2+1][m/2+1]!=-1)
			{
				puts("No\n");
				return 0;
			}
			mps[n/2+1][m/2+1]=j;
			cnt[j]--;
		}
		if(cnt[j]%4==2)
		{
			if(n%2==0&&m%2==0) 
			{
				puts("No\n");
				return 0;
			}
			int fg=0; 
			if(m&1) for(int i=1;!fg&&i<=n/2;i++)
				if(mps[i][m/2+1]==-1) mps[i][m/2+1]=j,mps[n-i+1][m/2+1]=j,fg=1;
			if(n&1) for(int i=1;!fg&&i<=m/2;i++)
				if(mps[n/2+1][i]==-1) mps[n/2+1][i]=j,mps[n/2+1][m-i+1]=j,fg=1;
			if(!fg)
			{
				puts("No\n");
				return 0;
			}
			cnt[j]-=2;
		}
		for(int i=1;i<=cnt[j]/4;i++)
		{
			while(mps[nx][ny]!=-1)
			{
				ny++; if(ny==m/2+1)
				ny=1,nx++;
			}
			mps[nx][ny]=j;
			mps[n-nx+1][ny]=j;
			mps[nx][m-ny+1]=j;
			mps[n-nx+1][m-ny+1]=j;
		}
	}
	puts("Yes\n");
	return 0;
}



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

using namespace std;

int dfs(string S, vector<vector<int>> v, vector<int> p, int N){
  if(S.size() != N){
    return dfs(S + "1", v, p, N) + dfs(S+"0", v, p, N);
  }
  //cerr << S << endl;
  bool flg = true;
  for(int i = 0; i < v.size(); i++){
    int sum = 0;
    for(auto j : v.at(i)){
      sum += ( S[j] - '0' );
    }
    if(sum % 2 != p[i]){
      flg = false;
      break;
    }
  }
  if(flg) return 1;
  else return 0;
}

int main(){
  int N, M;
  cin >> N >> M;
  vector<vector<int>> v(M);
  vector<int> p;
  for(int i = 0; i < M; i++){
    int tmp1; 
    cin >> tmp1;
    for(int j = 0; j < tmp1; j++){
      int tmp2;
      cin >> tmp2;
      v.at(i).push_back(tmp2-1);
    }
  }
  for(int i = 0; i < M; i++){
    int tmp;
    cin >> tmp;
    p.push_back(tmp);
  }
  
  string S = "";
  cout << dfs(S, v, p, N) << endl;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <cstdio>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <iostream>
#include <queue>
#include <vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include <map>
#include <set>
#include <tuple>
using namespace std;
#define INF 1LL << 61
#define MAX 1LL << 30
#define MOD 1000000007
typedef long long ll;
//typedef pair<ll,ll> P;
//typedef pair<pair<int,int>,int> p;
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad) / 2 / M_PI) * 360)
struct edge{ll to,cost,val;};
template<class T,class U>bool chmin(T&a,const U&b){if(a<=b)return false;a=b;return true;}
template<class T,class U>bool chmax(T&a,const U&b){if(a>=b)return false;a=b;return true;}
//__builtin_popcount(S);
//C.erase(unique(C.begin(),C.end()),C.end());
//#define int ll
int dx[]={1,-1,0,0},dy[]={0,0,-1,1};


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

    int N,M;
    cin>>N>>M;
    if(N==M) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


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

using namespace std;
template <class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}

using ll = long long int;

int main(void) {
  int a, b, k;
  cin >> a >> b >> k;
  int small = min(a, b);
  int big = max(a, b);
  a = small;
  b = big;
  vector<int> v;
  for (int i = 1; i <= a; i++) {
    if (a % i == 0)
      v.push_back(i);
  }
  vector<int> vv;
  for (auto i = v.begin(); i != v.end(); i++) {
    if (b % (*i) == 0)
      vv.push_back(*i);
  }
  std::cout << *(vv.end()-k) << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
template<class T>inline bool chmax(T &a, const T &b){if(a < b){a = b; return 1;}return 0;}
template<class T>inline bool chmin(T &a, const T &b){if(a > b){a = b; return 1;}return 0;}
typedef long long ll;

struct UnionFind {
  vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

  UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
    for(int i = 0; i < N; i++) par[i] = i;
  }

  int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
    if (par[x] == x) return x;
    return par[x] = root(par[x]);
  }

  void unite(int x, int y) { // xとyの木を併合
    int rx = root(x); //xの根をrx
    int ry = root(y); //yの根をry
    if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
    par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
  }

  bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }
};

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, M; cin >> N >> M;
  UnionFind tree(M);
  set<int> q;
  REP(i, N){
    int K; cin >> K;
    int x; cin >> x; x--;
    q.insert(x);
    REP(j, K-1){
      int y; cin >> y; y--;
      q.insert(y);
      tree.unite(x, y);
      x = y;
    }
  }
  int a = tree.root(*(q.begin()));
  bool flag = true;
  for(auto i : q){
    if(a != tree.root(i)) flag = false;
  }
  if(flag){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 3584
#!/usr/bin/env ruby
k = ARGF.gets
n = ARGF.gets.split.map(&:to_i)
sum = 0
n.map!{|a| sum += a; [sum]}
n.map!{|a| [a[0], sum-a[0]]}
n.map!{|a| (a[0] - a[1]).abs}
puts n.min



Measured memory_bytes: 30084
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;


//      DEEP

using namespace std;
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define all(v) v.begin(),v.end()
#define pb push_back
#define endl '\n'
#define mp make_pair

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int,int> pi;
typedef pair<long long,long long> pll;
typedef set<int> si;


/*
typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
*/
/*
typedef tree<
pair<int, int>,
null_type,
less<pair<int, int>>,
rb_tree_tag,
tree_order_statistics_node_update> ordered_set;
*/

const ll mod = 1e9 + 7;
const ll modl=998244353;
const double pie=3.1415926535;
                                                    //power
ull power(ull x,ull y){
   if(y==0) return 1;
   else{
     if(y%2==0) return power(x*x,y/2);
     else return x*power(x*x,(y-1)/2);
   }
}

                        //                    Modular Exponentiation

ll mod_power(ll x, ll y, ll m)
{
    ll r = 1;     // Initialize result

    x = x % m; // Update x if it is more than or equal to m

    if (x == 0) return 0; // In case x is divisible by m;

    while (y > 0)
    {
        // If y is odd, multiply x with result
        if (y & 1)
            r = (r*x) % m;

        // y must be even now
        y = y/2;
        x = (x*x) % m;
    }
    return r;
}

                                                      //GCD
ll gcd(ll x,ll y){
   if(y==0)return x;
   return gcd(y,x%y);
}
                                              // SIEVE

/*
bool isPrime[100001];
void sieve(int N) {

        for(int i = 0; i <= N;++i) {
            isPrime[i]=true;
        }
        isPrime[0]=false;
        isPrime[1]=false;

        for(int i = 2; i * i <= N; ++i) {
             if(isPrime[i] == true) {
                 for(int j = i * i; j <= N ;j += i)
                     isPrime[j] = false;
            }
        }
    }
*/

int main(){
    boost;
    int TESTS=1;
    //cin>>TESTS;
    while(TESTS--){
     int h,n;
     cin>>h>>n;
     int sum=0;
     for(int i=0;i<n;i++){
        int x;
        cin>>x;
        sum+=x;
     }
     if(sum>=h)cout<<"Yes"<<endl;
     else cout<<"No"<<endl;
 }
}















Measured memory_bytes: 3616
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;

int main()
{
    int a, c, h ;
    cin >> h >> a ;
    
    while ( h > 0 )
    {
        
        h = h - a ;
        c++ ;
        
    }
    
    cout << c ;

    return 0;
}


Measured memory_bytes: 256
// Template from https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// input macro for competive-programming from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, bytes) => {
        read_value!($iter, String).into_bytes()
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    use std::io::Read;
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();

    println!("{}", solve(&s));
}

macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

test! {
// r#"2018 218"# => "Yes",
// r#"2763 0"# => "No",
r#"1 6 3"# => "5",

}

fn solve(src: &str) -> String {
    input! {
        source = src,
        r: usize,
    }
    if r >= 2800 {
        "AGC"
    } else if r >= 1200 {
        "ARC"
    } else {
        "ABC"
    }.to_string()
}

Measured memory_bytes: 4352
import java.util.*;

public class Main {
    final static int MOD = 1000000007;
    
    public static void main(String[] args) {
        MyScanner in = new MyScanner();
        int n = in.nextInt();
        String ans = "No";
        
        for (int i = 1; i < 10; i++) {
            int b = n / i;
            if (b * i == n && b < 10) {
                ans = "Yes";
            }
        }
        System.out.println(ans);
        
    }
    
    static class MyScanner {
        static Scanner sc = new Scanner(System.in);
        
        String next() {
            return sc.next();
        }
        
        String nextLine() {
            return sc.nextLine();
        }
        
        int nextInt() {
            return Integer.parseInt(sc.next());
        }
        
        double nextDouble() {
            return Double.parseDouble(next());
        }
        
        long nextLong() {
            return Long.parseLong(next());
        }
        
        int[] nextIntArray(int n) {
            int[] array = new int[n];
            for (int i = 0; i < n; i++) {
                array[i] = nextInt();
            }
            return array;
        }
        
        double[] nextDoubleArray(int n) {
            double[] array = new double[n];
            for (int i = 0; i < n; i++) {
                array[i] = nextDouble();
            }
            return array;
        }
        
        long[] nextLongArray(int n) {
            long[] array = new long[n];
            for (int i = 0; i < n; i++) {
                array[i] = nextLong();
            }
            return array;
        }
        
        String[] nextLineArray(int n) {
            String[] array = new String[n];
            for (int i = 0; i < n; i++) {
                array[i] = nextLine();
            }
            return array;
        }
        
        int[][] nextIntMatrix(int n, int m) {
            int[][] matrix = new int[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    matrix[i][j] = nextInt();
                }
            }
            return matrix;
        }
        
        double[][] nextDoubleMatrix(int n, int m) {
            double[][] matrix = new double[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    matrix[i][j] = nextDouble();
                }
            }
            return matrix;
        }
        
        long[][] nextLongMatrix(int n, int m) {
            long[][] matrix = new long[n][m];
            for (int i = 0; i < n; i++) {
                for (int j = 0; j < m; j++) {
                    matrix[i][j] = nextLong();
                }
            }
            return matrix;
        }
    }
}

Measured memory_bytes: 22740
#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define bit(x) (1L << (x))
using ll = long long;
using namespace std;

template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
 
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
    return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}

int main() {
    int n; cin >> n;
    vector<int> a(n+1), b(n+1);
    FOR(i, 1, n+1) cin >> a[i];

    for(int i=n; i>=1; i--) {
        int s = a[i];
        for(int j=2; i * j <= n; j++) s ^= b[i * j];

        b[i] = s;
    }
    
    cout << count_if(b.begin(), b.end(), [](int x) { return x == 1; }) << endl;
    FOR(i, 1, n+1) {
        if(b[i]) cout << i << " ";
    }

    return 0;
}


Measured memory_bytes: 2432
#include <iostream>      // cout, endl, cin
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vpii = vector<pair<int, int>>;

int main()
{
  ll x, k, d;
  cin >> x >> k >> d;
  x = abs(x);
  ll a = x / d;
  ll b = x % d;
  if (a > k)
  {
    cout << x - k * d << endl;
  }
  else if (a <= k)
  {
    if ((k - a) % 2 != 0)
    {
      cout << abs(b - d) << endl;
    }
    else
    {
      cout << b << endl;
    }
  }
}

Measured memory_bytes: 3592
#include<iostream>
std::string m[12];
void d(int x,int y){if(x&&m[y][x-1]-48)m[y][x-1]=48,d(x-1,y);if(x<11&&m[y][x+1]-48)m[y][x+1]=48,d(x+1,y);if(y&&m[y-1][x]-48)m[y-1][x]=48,d(x,y-1);if(y<11&&m[y+1][x]-48)m[y+1][x]=48,d(x,y+1);return ;}
main(){while(1){int y=12,r=0;for(;y;y--)std::cin>>m[y-1];if(std::cin.eof())return 0;for(;y<12;y++)for(int x=0;x<12;x++)if(m[y][x]-48)r++,m[y][x]=48,d(x,y);std::cout<<r<<'\n';}}

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

int main()
{
    int a;
    cin >> a;
    
    int h,m,s;
    s = a % 60;
    m = (a-s) % (60*60) ;
    h = (a - s - m) ;

    cout << h/ (60*60) << ":"<< m/ 60 << ":"<< s << endl;

    return 0;
}


Measured memory_bytes: 3084
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>

using namespace std;

// conversion
//------------------------------------------
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T> inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

// math
//-------------------------------------------
template <class T> inline T sqr(T x) { return x * x; }

// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c)                                                             \
  for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())

// repetition
//------------------------------------------
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);

// clear memory
#define CLR(a) memset((a), 0, sizeof(a))

// debug
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x)                                                               \
  cerr << #x << " = " << (x) << " (L" << __LINE__ << ")"                       \
       << " " << __FILE__ << endl;

void solve(std::string S, std::string T) {
  int cnt =0;
  for(int i=0; i<3; i++){
    if(S[i]==T[i])cnt++;
  }
  cout<<cnt<<endl;
}

int main() {
  std::string S;
  std::cin >> S;
  std::string T;
  std::cin >> T;
  solve(S, T);
  return 0;
}


Measured memory_bytes: 256