akhauriyash/Code-Regression huggingface dataset:
# include <iostream>
# include <cmath>
# include <algorithm>
# include <stdio.h>
# include <cstdint>
# include <cstring>
# include <string>
# include <cstdlib>
# include <vector>
# include <bitset>
# include <map>
# include <queue>
# include <ctime>
# include <stack>
# include <set>
# include <list>
# include <random>
# include <chrono>
# include <deque>
# include <functional>
# include <iomanip>
# include <sstream>
# include <fstream>
# include <complex>
# include <numeric>
# include <cassert>
# include <array>
# include <tuple>
# include <cctype>
# include <unistd.h>
# include <unordered_map>
# include <unordered_set>
using namespace std;

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define fast_work {ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);}

const ll INF = 1e18 + 5, NMAX = 2e5 + 5, MOD = 998244353, N = 1e9 + 5, LOG = 25;
const ld EPS = 1e-8, pi = 3.14159265358979323846;

#define int long long

int t[4 * NMAX];

void update(int v, int tl, int tr, int l, int r, int x) {
    if(l > r) return;

    //cout << tl << " " << tr << " " << l << " " << r << "\n";

    if(l == tl && r == tr) {
        t[v] = (t[v] + x) % MOD;
        //cout << t[v] << "\n";
    } else {
        int tm = (tl + tr) / 2;
        update(v * 2, tl, tm, l, min(r, tm), x);
        update(v  * 2 + 1, tm + 1, tr, max(l, tm + 1), r, x);
    }
}

int get(int v, int tl, int tr, int pos) {
    if(tl == tr) return t[v];

    int tm = (tl + tr) / 2;

    //cout << tl << " " << tr << "\n";

    if(pos <= tm) return (t[v] + get(v * 2, tl, tm, pos)) % MOD;

    return (t[v] + get(v * 2 + 1, tm + 1, tr, pos)) % MOD;
}

signed main() {
    fast_work

    int n, k;
    cin >> n >> k;

    vector<pii> s(k);
    for(int i = 0; i < k; ++i) cin >> s[i].f >> s[i].s;

    update(1, 1, n, 1, 1, 1);

    //cout << "get: " << get(1, 1, n, 1) << "\n";

    for(int i = 1; i < n; ++i) {
        int add = get(1, 1, n, i);
        if(add == 0) continue;

        for(pii p : s) {
            int l = p.f, r = p.s;

            if(i + l > n) continue;
            if(i + r > n) r = n - i;

            update(1, 1, n, i + l, i + r, add);
        }
    }


    cout << get(1, 1, n, n);
}


Measured memory_bytes: 7704
#include <bits/stdc++.h>
#include <ext/pb_ds/priority_queue.hpp>
#define priority_queue __gnu_pbds::priority_queue
typedef long long LL;
typedef long double LD;
typedef unsigned int ui;
typedef unsigned long long ul;
#define ri register int
#define pb push_back
#define fi first
#define se second
#define mid ((l + r) >> 1)
#define ls (i << 1)
#define rs (i << 1 | 1)
#define enum(i, j, k) for(int i = j; i <= k; i ++)
#define FO(x) { freopen(#x".in", "r", stdin); freopen(#x".out", "w", stdout); }
using namespace std;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
typedef pair<int, LL> pil;
typedef pair<LL, int> pli;
typedef vector<int> vi;
#define ae(x) for(node *p = h[x]; p; p = p->nxt)
#define G \
	struct node { int v; node *nxt; } e[maxm], *h[maxn]; int z;\
	void adde(int u, int v) { e[++z].v = v; e[z].nxt = h[u]; h[u] = &e[z]; }\
	void addrev(int u, int v) { adde(u, v); adde(v, u); }
#define W \
	struct node { int v, w; node *nxt; } e[maxm], *h[maxn]; int z;\
	void adde(int u, int v, int w) { e[++z].v = v; e[z].w = w; e[z].nxt = h[u]; h[u] = &e[z]; }\
	void addrev(int u, int v, int w) { adde(u, v, w); adde(v, u, w); }
inline int _() // ret >= 0
{
	int ret = 0; char ch = getchar();
	while(ch < '0' || ch > '9') ch = getchar();
	do { ret = ret * 10 + ch - '0'; ch = getchar(); } while('0' <= ch && ch <= '9');
	return ret;
}
inline void _(int x) // x >= 0
{
	if(x < 10) { putchar(x + '0'); return ; }
	_(x / 10); putchar(x % 10 + '0');
}
void What_are_you_doing_at_the_end_of_the_world_Are_you_busy_Can_you_save_us()
{
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cout << fixed << setprecision(16);
}
/* Default Code Ends Here. */

#define maxn 100100

void yes()
{
	cout << "First";
	exit(0);
}
void no()
{
	cout << "Second";
	exit(0);
}

int n;
int a[maxn];

set<pii, greater<pii> > st;
int getd(int x)
{
	auto it = st.upper_bound(pii(x, INT_MAX));
//	cout << "D : " << x << ' ' << (it == st.end() ? n + 1 : (*it).second) << endl;
	return it == st.end() ? n + 1 : (*it).second;
}

bool calc(bool x, bool y)
{
//	cout << "C : " << x << ' ' << y << endl;
	return !x || !y;
}

int main()
{
	What_are_you_doing_at_the_end_of_the_world_Are_you_busy_Can_you_save_us();
	
	cin >> n;
	enum(i, 1, n)
		cin >> a[i];
	sort(a + 1, a + n + 1);
	reverse(a + 1, a + n + 1);
	
	if(a[n] >= n)
	{
		if((a[n] - n) & 1)
			yes();
		else
			no();
	}
	
	enum(i, 1, n)
		if(a[i] != a[i - 1])
		{
			st.insert(pii(a[i], i));
//			cout << "I : " << a[i] << ' ' << i << endl;
		}
			
	int cur = 1;
	while(a[cur] >= cur)
		cur ++;
	cur --;
	
//	cout << cur << endl;
	
	if(calc(a[cur] - cur + 1 & 1, getd(cur - 1) - cur & 1))
		yes();
	else
		no();
	
	return 0;
}

Measured memory_bytes: 4352
x,y = map(int,input().split())
Group1 = [1,3,5,7,8,10,12]
Group2 = [4,6,9,11]
Group3 = [2]

if x in Group1:
	if y in Group1:
		print("Yes")
	else:
		print("No")
elif x in Group2:
	if y in Group2:
		print("Yes")
	else:
		print("No")
elif x in Group3:
	if y in Group3:
		print("Yes")
	else:
		print("No")
else:
	print("No")

Measured memory_bytes: 3064
N=int(input())
A=list(map(int,input().strip().split()))
A.sort()

def gcd(a,b):
    while True:
        r=a%b
        if r==0:
            break
        a=b
        b=r
    return b

ans=A[0]
for n in range(N):
    ans=gcd(ans,A[n])

print(ans)

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

int main(void){
	int x,y,temp;

	while(1){
		cin >> x >> y;
		if(x == 0 && y == 0) break; 
		if( x > y){
			temp = x;
			x = y;
			y = temp;
		}
		cout << x << " " << y << endl;
	}
	return 0;
}

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

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define lfs <<fixed<<setprecision(10)<<
#define test cout<<"test"<<endl;
#define fi first
#define se second
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = n; i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = n - 1; i >= (ll)(m); i--)
using ll = long long;
using ld = long double;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
void chmin(T &a,T b){if(a>b)a=b;}
template<typename T>
void chmax(T &a,T b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
template<typename T>
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
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(){
  cin.tie(NULL);
  ios_base::sync_with_stdio(false);
  ll res=0,res1=INF,res2=-INF,buf=0;
  bool judge = true;
  ll n;cin>>n;
  string s;cin>>s;
  vector<set<ll>>idx(26);
  rep(i,0,n){
    idx[s[i]-'a'].insert(i);
  }
  ll q;cin>>q;
  while(q--){
    ll x;cin>>x;
    if(x==1){
      ll p;cin>>p;p--;
      char c;cin>>c;
      idx[s[p]-'a'].erase(p);
      idx[c-'a'].insert(p);
      s[p]=c;
    }
    else{
      ll l,r;cin>>l>>r;l--;r--;
      ll ret=0;
      rep(i,0,26){
        auto itr=idx[i].lower_bound(l);
        if(itr!=idx[i].end()&&*itr<=r)ret++;
      }
      cout<<ret<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 24220
# Vicfred
# https://atcoder.jp/contests/abc043/tasks/abc043_b
# simulation
s = input()

display = []

for ch in s:
    if ch == '0' or ch == '1':
        display.append(ch)
    else:
        if len(display) > 0:
            display.pop()

for ch in display:
    print(ch,end='')
print()



Measured memory_bytes: 2940
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<cstring>
#include<string>
#include<iomanip>
#include<map>
#include<fstream>
#include<queue>

using namespace std;


int main()
{
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	cout << max(a*b, c*d) << endl;
}

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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
using vvint = vector<vint>;
using vvvint = vector<vvint>;
using vll = vector<ll>;
using uint = unsigned int;
using ull = unsigned long long;

template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;

template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

template<typename T>
ostream& operator <<(ostream &os, vector<T> &v) {
	for (auto &u : v) os << u << el;
	return (os);
}

template<typename T>
istream& operator >>(istream &is, vector<T> &v) {
	for (auto &u : v) is >> u;
	return (is);
}

template<typename T1, typename T2>
istream& operator >>(istream &is, pair<T1, T2> &p) {
	return (is >> p.first >> p.second);
}

int main() {
	int N;
	cin >> N;
	vvint A(N, vint(N-1));
	auto output = [&]() {
		for (int i = 0; i < N; i++) {
			cout << A[i][0]+1;
			for (int j = 1; j < N-1; j++) {
				cout << " " << A[i][j]+1;
			}
			cout << el;
		}
	};
	if (N == 2) { cout << -1 << endl; return (0); }
	
	for (int i = 0; i < 2; i++) {
		for (int j = 0; j < 3; j++) {
			A[j][i] = (i+j+1)%3;
		}
		for (int j = 3; j < N; j++) A[j][i] = i;
	}
	if (N != 3) A[2][1] = 3;

	for (int i = 2; i < N-1; i++) {
		for (int j = 0; j < i; j++) {
			A[j][i] = i+1;
		}
		A[i][i] = i-1;
		A[i+1][i] = i;
		if (i != N-2) A[i+1][i] = i+2;
		for (int j = i+2; j < N; j++) {
			A[j][i] = i;
		}
	}
	
	output();
	return (0);
}

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

vector<int> prime_vector(int n) {
    int m = (int)sqrt(n - 1);

    vector<bool> q(n);
    for (int i = 2; i <= m; i++) {
        if (q[i]) continue;
        for (int j = i * i; j < n; j += i) {
            q[j] = true;
        }
    }

    vector<int> p; p.reserve(n / log(n * 0.329));
    for (int i = 2; i < n; i++) {
        if (!q[i]) p.push_back(i);
    }
    return p;
}

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

    constexpr int N = 100000;

    auto v = prime_vector(N + 1);

    vector<int> a(N + 1);
    for (auto& i : v) {
        a[i] = 1;
    }
    for (int i = N; i >= 0; i--) {
        if (a[(i + 1) / 2] == 0) a[i] = 0;
    }
    for (int i = 1; i <= N; i++) {
        a[i] += a[i - 1];
    }

    int q;
    cin >> q;

    for (int i = 0; i < q; i++) {
        int l, r;
        cin >> l >> r;

        cout << a[r] - a[l - 1] << '\n';
    }

    return 0;
}

Measured memory_bytes: 1152
using System;
using System.Text;
using System.Collections.Generic;
using System.Collections;
using static System.Math;
using System.Linq;
using static System.Array;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            //var K = long.Parse(Console.ReadLine());
            var c = Console.ReadLine();
            //var inp = Console.ReadLine().Split(' ').Select(x => double.Parse(x)).ToArray();

            if (Char.IsUpper(c[0]))
            {
                Console.WriteLine("A");
            }
            else
            {
                Console.WriteLine("a");
            }
            

        }
    }

}


Measured memory_bytes: 25780
#include<stdio.h>

int main(){
int h,w,i,j;

while(1){
  scanf("%d %d",&h,&w);
  if(h == 0 && w == 0)break;
  for(i=0;i<h;i++){
  for(j=0;j<w;j++){
    if(i%2 == 0){
      if(j%2 == 0)printf("#");
      if(j%2 == 1)printf(".");
    }
    if(i%2 == 1){
      if(j%2 == 0)printf(".");
      if(j%2 == 1)printf("#");
    }
  }
  printf("\n");
  }
  printf("\n");
}
return 0;
}

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

typedef long long ll;
typedef pair<int,int> ii;

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	string s; cin>>s;
	s[3]='8';
	cout << s << endl;
	return 0;
}


Measured memory_bytes: 256
while true
    n = gets.to_i
    break if n == 0
    teams = {}
    n.times{
        name, m1, s1, m2 ,s2, m3, s3, m4, s4 = gets.chomp.split.map(&:to_i)
        teams[name] = (m1 + m2 + m3 + m4) * 60 + (s1 + s2 + s3 + s4)
    }
    arr = teams.to_a.sort_by{|n, t| t}    
    puts arr[0][0]
    puts arr[1][0]
    puts arr[-2][0]
end


Measured memory_bytes: 9536
N = int(input())
D = list(map(int, input().split()))
M = int(input())
T = list(map(int, input().split()))


D.sort()
T.sort()

flag = True
if N < M:
    flag = False
else:
    d_ind = 0
    find = False
    for i in range(M):
        for j in range(d_ind, N):
            if T[i] == D[j]:
                find = True
                d_ind = j+1
                break
        if not find:
            flag = False
            break
        find = False

if flag:
    print('YES')
else:
    print('NO')

Measured memory_bytes: 35116
import java.util.Scanner;
//import java.util.Arrays;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String s = sc.next();
		int count = 0;
		for(int i=0; i<n-2; i++){
			if(s.substring(i, i+3).equals("ABC")){
				count++;
			}
		}
		System.out.println(count);
	}
}


Measured memory_bytes: 35724
import java.io.*;
 
class Main{
    public static void main(String[] args) throws Exception{
        int x, ans;
     
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        x = Integer.parseInt(br.readLine());
         
        ans = x*x*x;
        System.out.println(ans);
    }
}

Measured memory_bytes: 24136
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ARainySeason solver = new ARainySeason();
        solver.solve(1, in, out);
        out.close();
    }

    static class ARainySeason {
        public void solve(int testNumber, FastReader s, PrintWriter out) {
            String str = s.nextString();
            if (str.contains("RRR")) {
                out.println("3");
            } else if (str.contains("RR")) {
                out.println(2);
            } else if (str.contains("R")) {
                out.println(1);
            } else {
                out.println(0);
            }

        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public String nextString() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            StringBuilder res = new StringBuilder();
            do {
                if (Character.isValidCodePoint(c)) {
                    res.appendCodePoint(c);
                }
                c = read();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



Measured memory_bytes: 25528
#include <iostream>
#include <string>
#include <vector>
#include <sstream>

using namespace std;
 
 
int main() {
	int a, b;
	
	cin >> a >> b;
	
	string sa = "", sb = "";
	
	for(int i = 0; i < b; i++){
		sa += to_string(a) ;		
	}
  
	for(int i = 0; i < a; i++){
		sb += to_string(b) ;		
	}  
	
  	if(sa <= sb){
    	cout << sa << endl; 
      
    }else{
     	cout << sb << endl; 
    }
	
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {

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

		while(true){
			int n = sc.nextInt();
			if(n==0)break;
			String[] s = new String[n];
			String[] t = new String[n];
			for(int i=0;i<n;i++){
				s[i] = sc.next();
				t[i] = sc.next();
			}
			int m = sc.nextInt();
			boolean exit=true;
			for(int i=0;i<m;i++){
				String u = sc.next();
				exit=true;
				for(int j=0;j<n;j++){
					if(u.compareTo(s[j])==0){
						System.out.print(t[j]);
						exit=false;
						break;
					}
				}
				if(exit==true)System.out.print(u);
			}
			System.out.println();
		}
	}
}

Measured memory_bytes: 70084
gets
l=gets.split.map{|c|[c.to_i]}
i=0
l.sort.map{|a|a[0]=i+=1}
b=[s=0]*r=l.size+1
l.reverse_each{|n,|i=n;(s+=b[i];i&=i-1)while i>0;(b[n]+=1;n+=n&-n)while n<r}
p s

Measured memory_bytes: 32620
#include<iostream>
using namespace std;
int main()
{
  int a,b;
 cin >> a >> b;
  if(a!=1 && b!=1){
  cout << 1 << endl;
  }
  if(a!=2 && b!=2){
  cout << 2 << endl;
  }
  if(a!=3 && b!=3){
  cout << 3 << endl;
  }
  }



Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 

using namespace __gnu_pbds;
using namespace std;

// MACROS

#define ll long long
#define ull unsigned long long
#define ld long double

#define vi vector<int>
#define vll vector<ll>
#define vld vector<ld>
#define u_s unordered_set

#define pii pair<int,int>
#define pll pair<ll,ll>

#define FOR(i, n) for (ll i = 0; i < n; i++)
#define FORN(i, a, b) for (ll i = a; i < b; i++)
#define FORE(i, l) for (auto i : l)

#define pb push_back
#define pob pop_back
#define emp emplace
#define fi first
#define se second

#define all(n) n.begin(), n.end()
#define in(n) cin >> (n);
#define debug(n) cout << #n << ": " << n << '\n';

// FUNCTIONS

template< typename T >
inline T gcd(T a, T b) { if (b) return gcd(b, a % b); return a; }

template< typename T >
inline T ext_gcd(T a, T b, T & x, T & y) { if (a == 0) { x = 0; y = 1; return b; } T x1, y1; T g = ext_gcd(b % a, a, x1, y1); x = y1 - (b / a) * x1; y = x1; return g; }

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);	
    //cout << setprecision(15);
    ll n;
    cin >> n;
    map<string, ll> m;
    FOR(i, n)
    {
        string s;
        cin >> s;
        m[s]++;
    }
    cout << "AC x " << m["AC"] << '\n';
    cout << "WA x " << m["WA"] << '\n';
    cout << "TLE x " << m["TLE"] << '\n';
    cout << "RE x " << m["RE"] << '\n';
}



Measured memory_bytes: 3644
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

char s[110][110];
int H, W, f[110][110];

int main() {
    scanf("%d%d", &H, &W);
    for (int i = 1; i <= H; ++i) scanf("%s", s[i] + 1);

    f[1][1] = s[1][1] == '#';
    for (int i = 2; i <= W; ++i)
        f[1][i] = f[1][i - 1] + (s[1][i - 1] == '.' && s[1][i] == '#');
    for (int i = 2; i <= H; ++i)
        f[i][1] = f[i - 1][1] + (s[i - 1][1] == '.' && s[i][1] == '#');
    for (int i = 2; i <= H; ++i)
        for (int j = 2; j <= W; ++j)
            f[i][j] = min(f[i - 1][j] + (s[i - 1][j] == '.' && s[i][j] == '#'),
                          f[i][j - 1] + (s[i][j - 1] == '.' && s[i][j] == '#'));
    printf("%d\n", f[H][W]);
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-8;
const double inf=1e8;
int main(){
	int a,b;
	cin>>a>>b;
	a-=2;
	int out=a/11*5;
	a%=11;
	vi dp(5);
	dp[0]=9;
	dp[1]=10;
	dp[2]=0;
	dp[3]=1;
	dp[4]=2;
	rep(i,a){
		rep(j,5)if(b==9*dp[j]%11)out++;
		dp[4]=dp[0];
		for(int i=3;i>=0;i--){
			dp[i]=dp[i+1]-1;
			if(dp[i]==-1)dp[i]=10;
		}
	}
	cout<<out<<endl;
}









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

using namespace std;

#define vit vector<int>::iterator
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fr first
#define sc second
#define skip continue
#define PI 3.14159265

typedef unsigned long long ull;
typedef long long ll;
typedef unsigned int ui;
typedef long double ld;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<bool> vb;

const int INF = 1e9 + 5;
const int MAXN = 3e6 + 123;

void faster(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
bool cmp(const string& a, const string& b) {
	return (a + b) < (b + a);
}

vector<int> Reversed(const vector<int>& s){
   vector<int> d = s;
   reverse(all(d));
   return d;
}

int a[10];
void solve(){
    int n, k;
    cin >> n >> k;
    for(int i = 0, x; i < k; i++){
        cin >> x;
        a[x]++;
    }
    bool b = true;
    int l;
    for(int i = n; i <= 10 * n; i++){
        b = true;
        l = i;
        while(l){
            if(a[l%10] == 1){
                b = false;
                break;
            }
            l /= 10;
        }
        if(b == true){
            cout << i;
            break;
        }
    }
}

// ."ww"w"".ww"""...ww"".

int main(){
    //freopen("lepus.in","r",stdin);
    //freopen("lepus.out","w",stdout);
    //faster();
    int n=1;
    //cin>>n;
    while(n--){
    solve();
    //cout << endl;
    }
    //fclose(stdout);
}


Measured memory_bytes: 256
x,n = gets.chomp.split(" ").map!{|item| item.to_i}
p = gets.chomp.split(" ").map!{|item| item.to_i}
p.sort!
if n == 0
    puts x
    exit
end
a = p[0]-1
y = p.max 
for i in 0..p.max+1 do
    if y > (x-i).abs
        if p.include?(i)
        else
        y = (x-i).abs
        a = i
        end
    end
end
puts a

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

using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 9223372036854775807
#define all(x) (x).begin(), (x).end()

ll ts = 1000000007;

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

  ll n;
  cin >> n;

  if (n < 1000) {
    cout << "ABC"
         << "\n";
  } else {
    cout << "ABD"
         << "\n";
  }
}

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

int main() {
    long long N;
    cin >> N;
    map<string, long long> S;
    for (long long i=0; i<N; i++) {
        string s;
        cin >> s;
        S[s]++;
    }
    long long L=0;
    for(auto i = S.begin(); i != S.end(); i++) L = max(L, i->second);
    for(auto i = S.begin(); i != S.end(); i++) {
        if (L==i->second) cout << i->first << endl;
    }
}

Measured memory_bytes: 25216
#include <stdio.h>

int main(){
  int i,j,k,count,N,flag;
  int A[100];
    
    scanf("%d",&N);
    count=0;
    
    for(i=0;i<N;i++){
        scanf("%d",&A[i]);
    }
    flag=1;
    while(flag){
        flag=0;
        for(j=N-1;j>=1;j--){
            if(A[j-1]>A[j]){
                k=A[j];
                A[j]=A[j-1];
                A[j-1]=k;
                count++;
                flag=1;
            }
        }
    }
    for(i=0;i<N-1;i++){
        printf("%d",A[i]);
        if(i!=N-1) printf(" ");
    }
    printf("%d\n",A[N-1]);
    printf("%d\n",count);
    
    return 0;
}


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

using namespace std;
#define F first
#define S second
typedef long long lli;
const int MX = 100005 , infi =1000000 , mod = 1000000007;
typedef pair<int,int> pii;

lli n,m , vals[MX] , dp[MX];

lli super(int i)
{
    if(i==n-1)return 0;
    else if(i>=n)return 1e10;
    lli &ret = dp[i];
    if(ret==-1)ret = 0;
    else return ret;
    return ret = min( super(i+1)+abs(vals[i]-vals[i+1]) ,
                      super(i+2)+abs(vals[i]-vals[i+2]) );
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    cin>>n;
    memset(dp,-1,sizeof dp);
    for(int i=0;i<n;i++)
        cin>>vals[i];
    cout<<super(0);
    return 0;
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pb push_back
#define f(i,x,n) for(int i=x;i<n;i++)
#define all(c) c.begin(),c.end()
#define int ll
using ll = long long;
using pii = pair<int,int>;
const int MOD = 1e9+7, N = 1e5 + 10; 

int32_t main(){
   ios::sync_with_stdio(false);
   cin.tie(NULL);
   string s;
   cin >> s;
   for(auto &e : s){
      cout << 'x';
   }
   return 0;
} 

Measured memory_bytes: 256
#define HAVE_STRUCT_TIMESPEC
#include<bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int h,n;
    cin>>h>>n;
    int sum=0;
    int x;
    for(int i=1;i<=n;++i){
        cin>>x;
        sum+=x;
    }
    if(sum>=h)
        cout<<"Yes";
    else
        cout<<"No";
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(){
    int n, k, r, s, p;
    string t;
    cin >> n >> k;
    cin >> r >> s >> p;
    cin >> t;
    int ans = 0;
    for(int i = 0; i < n; i++){
        if(i >= k){
            if(t[i] == t[i-k]){
                t[i] = 'n';
                continue;
            }
        }
        if(t[i] == 'r') ans += p;
        else if(t[i] == 's') ans += r;
        else if(t[i] == 'p') ans += s;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 512
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int mod=1000_000_007;
    int n=sc.nextInt();
    int[] a=new int[n+1];
    int m=sc.nextInt();
    Deque<Integer> dq=new ArrayDeque<>();
    for(int i=0;i<m;i++){
      dq.addLast(sc.nextInt());
    }
    dq.addLast(n*2);
//    System.err.println(dq);
    a[0]=1;
    if(dq.peekFirst()==1){
      a[1]=0;
      dq.pollFirst();
    }else{
      a[1]=1;
    }
    for(int i=2;i<=n;i++){
      if(i==dq.peekFirst()){
        a[i]=0;
        dq.pollFirst();
      }else{
        a[i]=(a[i-1]+a[i-2])%mod;
      }
    }
//    System.err.println(Arrays.toString(a));
    System.out.println(a[n]);
  }
}

Measured memory_bytes: 63016
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

//<editor-fold defaultstate="collapsed" desc="Headers & Macros">
#include <bits/stdc++.h>

#pragma GCC optimize("O3")

using namespace std;
//</editor-fold>

class BCraneAndTurtle {
public:
    int testNumber = 0;
    void solve(std::istream& in, std::ostream& out) {
        unsigned int x, y;

        in >> x >> y;

        if (y & 1u) {
            out << "No" << '\n';
            return;
        }

        int c = (4 * x - y) / 2;

        if (c >= 0 && c <= x) {
            out << "Yes" << '\n';
        } else {
            out << "No" << '\n';
        }
    }
};


int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    BCraneAndTurtle solver;
    std::istream& in(std::cin);
    std::ostream& out(std::cout);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 3636
#include <stdio.h>
#define INF 1000000000
#define N 101

int matrixChainOrder(int*);
int min(int,int);

int n;

int main() {

  
  int i,R[N],C[N],p[N];
  
  scanf("%d",&n);
  for(i = 0; i < n; i++)
    scanf("%d %d",&R[i],&C[i]);
  p[0] = R[0];
  for(i = 0; i < n; i++)
    p[i+1] = C[i];

  printf("%d\n",matrixChainOrder(p));
      
  return 0;
}

int matrixChainOrder(int *p)
{
  int i,j,l,k,q,m[N][N];
  for(i = 1; i < n+1; i++)
    m[i][i] = 0;

  for(l = 2; l < n+1; l++) {
    for(i = 1; i < n-l+2; i++) {
      j = i+l-1;
      m[i][j] = INF;
      for(k = i; k < j; k++) {
	q = m[i][k] + m[k+1][j] + p[i-1]*p[k]*p[j];
	m[i][j] = min(m[i][j],q);
      }
    }
  }
  return m[1][n];
}

int min(int m,int q)
{
  if(m < q) return m;
  else return q;
}



Measured memory_bytes: 2052
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.InputMismatchException;
import java.util.List;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskX solver = new TaskX();
		solver.solve(1, in, out);
		out.close();
	}

	static int INF = 1 << 30;
	static int MOD = 1000000007;
	static int[] mh4 = { 0, -1, 1, 0 };
	static int[] mw4 = { -1, 0, 0, 1 };
	static int[] mh8 = { -1, -1, -1, 0, 0, 1, 1, 1 };
	static int[] mw8 = { -1, 0, 1, -1, 1, -1, 0, 1 };

	static class TaskX {

		public void solve(int testNumber, InputReader in, PrintWriter out) {

			int d = in.nextInt();
			int n = in.nextInt();

			List<Integer> list = new ArrayList<>();
			int ans = 0;
			if (d == 0) {
				for (int i = 1; i <= 110; i++) {
					if (i % 100 != 0) {
						list.add(i);
					}
				}
				ans = list.get(n-1);
			} else if (d == 1) {
				for (int i = 1; i <= 20000; i++) {
					if (i % 100 == 0 && i % 10000 != 0) {
						list.add(i);
					}
				}
				ans = list.get(n-1);
			} else if (d == 2) {
				for (int i = 1; i <= 2000000; i++) {
					if (i % 10000 == 0 && i % 1000000 != 0) {
						list.add(i);
					}
				}
				ans = list.get(n-1);
			}

			out.println(ans);

		}
	}

	static class InputReader {
		BufferedReader in;
		StringTokenizer tok;

		public String nextString() {
			while (!tok.hasMoreTokens()) {
				try {
					tok = new StringTokenizer(in.readLine(), " ");
				} catch (IOException e) {
					throw new InputMismatchException();
				}
			}
			return tok.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(nextString());
		}

		public long nextLong() {
			return Long.parseLong(nextString());
		}

		public double nextDouble() {
			return Double.parseDouble(nextString());
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt();
			}
			return res;
		}

		public long[] nextLongArray(int n) {
			long[] res = new long[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextLong();
			}
			return res;
		}

		public InputReader(InputStream inputStream) {
			in = new BufferedReader(new InputStreamReader(inputStream));
			tok = new StringTokenizer("");
		}
	}

}


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

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

int main()
{
    int n, k, q;
    int a;
    cin >> n >> k >> q;
    vector<int> point(n, k);

    if ((k - q) > 0)
    {
        rep(i, n) cout << "Yes" << endl;
        return 0;
    }
    else
    {
        rep(i, q)
        {
            a = 0;
            cin >> a;
            point[(a - 1)] += 1;
        }
        rep(i, n)
        {
            if (point[i] - q > 0)
            {
                cout << "Yes" << endl;
            }
            else
            {
                cout << "No" << endl;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 1024
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse4")

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

// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
// using namespace __gnu_pbds;
// template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define all(x) begin(x), end(x)
#define sz(x) (int) x.size()

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

const int MOD = 1e9+7; // 998244353;
const int MX = 2e5+5;
const ll INF = 1e18;
const ld PI = acos((ld)-1);
const ld EPS = 1e-6;
const int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};
const char nl = '\n';

template <typename T> inline T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template <typename T> inline T lcm(T a, T b) { return a / gcd(a, b) * b; }
template <class T> void ckmin(T& a, T b) { a = min(a, b); }
template <class T> void ckmax(T& a, T b) { a = max(a, b); }

// (Integer/Long).bitCount(x)
int pct(int x) { return __builtin_popcount(x); }
int pct(ll x) { return __builtin_popcountll(x); }

void DBG() { cerr << "]" << endl; }
template<class H, class... T> void DBG(H h, T... t) { cerr << h; if (sizeof...(t)) cerr << ", "; DBG(t...); }

void setIn(string s) { freopen(s.c_str(),"r",stdin); }
void setOut(string s) { freopen(s.c_str(),"w",stdout); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
void setIO(string s = "") {
	unsyncIO();
	if (sz(s)) { setIn(s+".in"), setOut(s+".out"); }
}

// Binary Exponentiation
ll pow(ll b, ll e, ll m = 0LL, ll ans = 1LL) { while (e) { if (e & 1LL) { ans *= b; if (m) ans %= m; } b *= b, e >>= 1LL; if (m) b %= m; } return ans; }



void solve(int tcn) {
	int n; cin >> n;
	vector<ll> cnt(n+1, 0);
	for (int i = 1; i <= n; ++i)
		for (int j = i; j <= n; j += i)
			cnt[j]++;
	ll ans = 0LL;
	for (int i = 1; i <= n; ++i)
		ans += cnt[i] * i;
	cout << ans << nl;
}

int main() {
    setIO();

    int t = 1; //cin >> t;
	for (int i = 1; i <= t; ++i) {
		solve(i);
	}
	return 0;
}

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

int main(){
	double w;
	while( scanf(" %lf", &w) != EOF ){
		
		if(w<=48) printf("light fly\n");
		else if(w<=51) printf("fly\n");
		else if(w<=54) printf("bantam\n");
		else if(w<=57) printf("feather\n");
		else if(w<=60) printf("light\n");
		else if(w<=64) printf("light welter\n");
		else if(w<=69) printf("welter\n");	
		else if(w<=75) printf("light middle\n");
		else if(w<=81) printf("middle\n");
		else if(w<=91) printf("light heavy\n");
		else printf("heavy\n");
	}

	return 0;
}

Measured memory_bytes: 1192
x,y = map(int,input().split())
ans = 0

if x == 1 and y == 1:
    ans += 400000
    
li = [0,300000, 200000, 100000]

if x <= 3:
    ans += li[x]
if y <= 3:
    ans += li[y]

print(ans)

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


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, A, B;
    cin >> N >> A >> B;
    vector<int> ans;
    if (A + B > N + 1) {
        cout << -1 << endl;
        return 0;
    }
    REP(i, N - A + 1, N) ans.push_back(i);
    int remain = N - A;
    B--;
    while(B > 0) {
        //dump(remain);
        int len = remain / B;
        if (len > A) {
            cout << -1 << endl;
            return 0;
        }
        REP(i, remain - len + 1, remain) ans.push_back(i);
        B--;
        remain -= len;
    }
    if (ans.size() != N) {
        cout << -1 << endl;
        return 0;
    }
    rep(i, N) {
        if (i != 0) cout << " ";
        cout << ans[i];
    }


    return 0;
}


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

int main(){
    int D;
    cin >> D;
    vector<int> c(27, 0);
    rep(j, 26) cin >> c[j+1];
    int s[D+1][27];
    rep(i, D){
        rep(j, 26){
            cin >> s[i+1][j+1];
        }
    }
    vector<int> t(D+1, 0);
    rep(i, D) cin >> t[i+1];

    int ans = 0;
    vector<int> lastday(27, 0);

    for(int day = 1; day <= D; day++){
        ans += s[day][t[day]];
        lastday[t[day]] = day;
        for(int j = 1; j <= 26; j++){
            ans -= c[j] * (day - lastday[j]); 
        }
        cout << ans << endl;
    }

    // rep(i, 365){
    //     cout << (i % 26) + 1 << endl;
    // }

    return 0;
}


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

int main(){
    int x, y;
    cin >> x >> y;
    double a = 2 * x - y * 0.5;
    double b = y * 0.5 - x;

    if (a >= 0 && b >= 0 && int(a*b) == a*b ){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 3636
#include<stdio.h>

int main(){
  int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  
  if(a<c && c<b || b<c && c<a){
    printf("Yes");
  }else{
   	printf("No"); 
  }
  
  return 0;
}

Measured memory_bytes: 128
x, y = map(int,input().split())
ans = [float("inf") for i in range(4)]
if y - x >= 0:
  ans[0] = y - x

if -y - x + 1>= 0:
  ans[1] = -y - x + 1
  
if y + x +1 >= 0:
  ans[2] = y + x +1
  
if -y + x + 2 >= 0:
  ans[3] = -y +x +2
  
print(min(ans))

Measured memory_bytes: 3064
#include <iostream>
#include <set>
#include <vector>
#include <algorithm>
using namespace std;

typedef unsigned long long int ulint;
typedef long long int lint;

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

  vector<ulint> A;
  
  for (int i = 0; i < N; ++i) {
    ulint a;
    cin >> a;
    A.push_back(a);
  }

  vector<ulint> C(N, (ulint) -1);
  
  for (int i = N - 1; i >= 0; --i) {
    // TODO: binary search here.
    auto it = upper_bound(C.begin(), C.end(), A[i]);
    // int j = 0;
    // while (A[i] >= C[j]) {
    //   ++j;
    // }
    *it = A[i];
    // C[j] = A[i];    
  }

  // cout << "C= " << endl;
  // for (int i = 0; i < N; ++i) {
  //   cout << C[i] << " ";
  // }
  // cout << endl;
  
  auto it = find(C.begin(), C.end(), (ulint) -1);

  ulint val =  it - C.begin();

  cout << val << endl;

}


Measured memory_bytes: 2036
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>
#include<math.h>
#include<limits.h>
#define MAX 200002
int main(){
    int N,K;
    scanf("%d %d",&N,&K);
    int A[MAX];
    for(int i=1;i<=N;i++)
        scanf("%d",A+i);
    for(int i=K+1;i<=N;i++){
        if(A[i-K]<A[i])
            printf("Yes\n");
        else
            printf("No\n");
    }
}


Measured memory_bytes: 2444
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
using namespace std;

int main()
{
	string S;
	cin >> S;
	
	int l = S.length();
	int n = 13;
	int mod = (int)pow(10, 9) + 7;
	
	vector<vector<int>> dp(l + 1, vector<int>(n, 0));
	dp[0][0] = 1;
	
	int mul = 1;
	for(int i = l - 1; i >= 0; i--)
	{
		if(S[i] != '?')
		{
			int j = S[i] - '0';
			for(int k = 0; k < 13; k++)
			{
				dp[l - i][(j * mul + k) % 13] += dp[l - i - 1][k];
			}
		}
		
		else
		{
			for(int j = 0; j < 10; j++)
			{
				for(int k = 0; k < 13; k++)
				{
					dp[l - i][(j * mul + k) % 13] += dp[l - i - 1][k];
					dp[l - i][(j * mul + k) % 13] %= mod;
				}
			}
		}

		mul = mul * 10 % 13;
	}
	
	cout << dp[l][5] << endl;
	return 0;
}

Measured memory_bytes: 9088
/*    AUTHOR: julianferres, sáb 29 ago 2020 00:47:22 -03 */
#include <bits/stdc++.h>
using namespace std;

// DEBUGGER
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
//END DEBUGGER

typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;
typedef vector<ii> vii; typedef vector<bool> vb;
#define FIN ios::sync_with_stdio(0);cout.tie(0)
#define forr(i, a, b) for(int i = (a); i < (int) (b); i++)
#define forn(i, n) forr(i, 0, n)
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define esta(x,c) ((c).find(x) != (c).end())
const int INF = 1<<30; // const ll INF = 1LL<<60;
const int MOD = 1e9+7; // 998244353
const int MAXN  = 2e5+5;


int main(){  
    FIN;

    string s; cin >> s;
    ll ans = 0;
    forn(i, s.size()){ ans+= (s[i]-'0'); ans %= 9; }
    ans %= 9;
    cout << (ans%9 ? "No" : "Yes") << "\n";

    return 0;
}


Measured memory_bytes: 3788
#include<iostream> 
#include<bits/stdc++.h> 
using namespace std;
int main(){ 
	ios::sync_with_stdio(false); 
	cin.tie(0); 
	int N,K;
	cin>>N>>K;
	vector<int> a(N);
	for(int i=0;i<N;i++){ 
		cin>>a[i];
	} 
	vector<bool> dp(K+1); 
	dp[0]=false;
	for(int i=1;i<=K;i++){ 
		dp[i]=false;
		for(int j=0;j<N;j++){ 
			if((i-a[j])>=0){ 
				dp[i]=dp[i] or (not dp[i-a[j]]);
			} 
		} 
	} 


	if(dp[K]){
		cout<<"First"<<endl;
	}else{
		cout<<"Second";
	}


	
	return 0;
} 



Measured memory_bytes: 256
#include<iostream>
using namespace std;
#define MAX 1000000
int main()
{
  int b[MAX+1]={0},i,j;
  b[0]=b[1]=1;
  for(i=4;i<=MAX;i+=2)b[i]=1;
  for(i=3;i*i<=MAX;i+=2)
    if(!b[i])for(j=i+i;j<=MAX;j+=i)b[j]=1;
  int c[MAX+1]={0};
  for(i=1;i<=MAX;i++)c[i]=c[i-1]+!b[i];

  int n,p,m,X,f,l;
  while(cin>>n,n){
    X=0;
    for(i=0;i<n;i++){
      cin>>p>>m;
      f=p-m-1;if(f<0)f=0;
      l=p+m;if(l>MAX)l=MAX;
      X+=c[l]-c[f]-1;
    }
    cout<<X<<endl;
  }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll INF = 1e18;
const ll mod = 1000000007;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
int ctoi(char c) {
  if (c >= '0' && c <= '9') {
    return c - '0';
  }
  return 0;
}
ll factorial(ll n) {
  if (n == 1) {
    return 1;
  }
  ll ans = factorial(n-1);
  return ans*n;
}
ll gcd(ll a, ll b) {
  if (a < b) {
    ll tmp = a;
    a = b;
    b = tmp;
  }
  ll r = a%b;
  while(r != 0) {
    a = b;
    b = r;
    r = a%b;
  }
  return b;
}
ll lcm(ll a, ll b) {
  return (a/gcd(a, b))*b;
}

int main() {
  ll n;
  cin >> n;
  ll t = 0, h = 0;
  string st, sh;
  rep(i, n) {
    cin >> st >> sh;
    if (st < sh) {
      h += 3;
    } else if (st == sh) {
      t++;
      h++;
    } else {
      t += 3;
    }
  }
  cout << t << ' ' << h << endl;
}


Measured memory_bytes: 3164
function Main(input) {
	input = input.trim().split(" ");
  var list1 = input[0].split("");
  var list2 = input[1].split("");
  var list3 = input[2].split("");
  if(list1[list1.length - 1] == list2[0] && list2[list2.length - 1] == list3[0]){
     console.log("YES");
     }else{
     console.log("NO");
     }
  
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7372
object Main extends App {

  import java.io.{BufferedOutputStream, BufferedReader, InputStreamReader, PrintWriter}

  val in = new BufferedReader(new InputStreamReader(System.in))
  val out = new PrintWriter(new BufferedOutputStream(System.out))
  var ans = BigInt(1)
  var flag = false
  var flag2 = false
  val n = in.readLine().toInt
  in.readLine().split(" ").map(x => if (BigInt(x) == 0) flag = true else if (ans * BigInt(x) > 1000000000000000000L) flag2 = true else ans *= BigInt(x))
  out.println(if (flag) 0 else if (flag2) -1 else ans)
  out.flush()
}

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

//#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define LL long long

int main() {
	int n;
	int inp[200005];
	cin >> n;
	int tot = 0 ;
	for(int i=0;i<n;i++) {
		cin >> inp[i];
		tot = tot ^ inp[i];
	}
	for(int i=0;i<n;i++) {
		cout << (tot ^ inp[i]) << " ";
	}
	cout << endl;

	return 0;
}


Measured memory_bytes: 4416
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<math.h>
#include<stdio.h>
#include<string>

using namespace std;

int main(void)
{
	int flag = 9;
	int n;
	cin >> n;
	long long int count=0;
	vector<int> a(n);
	int i;
	for (i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	while (1)
	{
		for (i = 0; i < n; i++)
		{
			if (a[i] != 0)
				break;
		}
		if (i == n)
		{
			break;
		}
		count++;
		for (i; i < n; i++)
		{
			if (a[i] == 0)
			{
				flag = 1;
				break;
			}
			a[i] = a[i] - 1;
		}
		
	}
	cout << count << endl;
	return 0;
}


Measured memory_bytes: 256