akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>

int main(void) {

	//??????????????¨?±?????????????????????\???
	int in, i;
	scanf("%d\n", &in);

	//??¬????????°????????°?????¨?±???????
	int residence[4][3][10] = {0};
	int people;
	//???????????°?????????
	for (i = 0; i < in; i++) {
		//??¬???????????¨???????????????????????°???????????°????????¨?±????????????°?????\???
		int building;
		int storey;
		int room;
		scanf("%d %d %d %d\n",&building,&storey,&room,&people );

		//????????¨?±??????´?????????????????????
		residence[building-1][storey-1][room-1]+=people;

	}
	//???????????°???????????????	


	int j, k;
	//4??¬????????????
	for (i = 0; i < 4; i++) {
		
		//3????????????
		for (j = 0; j < 3; j++) {
		
			//10??¨?±??????????
			for (k = 0; k < 10; k++) {
				printf(" %d",residence[i][j][k]);
			}
			//10??¨?±????????????????
            printf("\n");
		}
		//?????°???????????????

		//?????????#???????????????
		if (i == 3) {
			break;
		}

	//????????????#????????\
	printf("####################\n");


	}
	//??¬??????????????????

	return 0;
}

Measured memory_bytes: 616
//#pragma warning(disable:4996)
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#include <complex>
#include <cstdio>
#include <list>
#include <bitset>
//#include <stdio.h>

//< in.txt > out.txt
using namespace std;
//std::ios::sync_with_stdio(false);
//std::cin.tie(0);
const long long MOD = 1e9 + 7;
const long long INF = 1e15;
typedef long long LL;
typedef long double LD;
//typedef boost::multiprecision::cpp_int bigint;
typedef pair<LL, LL> PLL;
typedef pair<int, int> PI;
typedef pair<LD, LL> pdl;
typedef pair<LD, LD> pdd;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef unsigned long long ULL;

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int a, b, h;
	cin >> a >> b >> h;
	cout << (a + b) * h / 2 << "\n";
	return 0;
}

Measured memory_bytes: 3164
#include <vector>
#include <cstdio>
#include <cstring>
using namespace std;
#define t_max 10000001
char M[1001][1001];
short S[1001][1001];
int P[1001][1001];
char table[t_max];
pair<short,short>m[t_max];
int m_rev[t_max];
pair<short,int> dfs(int x,int y){
	if(y==1001)return make_pair(0,0);
	if(S[x][y]>=0)return make_pair(S[x][y],P[x][y]);
	int m=0,m_place=0,i=-1;
	for(;i<2;i++){
		if(x+i<0||1000<x+i)continue;
		pair<short,int> p=dfs(x+i,y+1);
		if(m<p.first||(m==p.first&&m_place<p.second))m=p.first,m_place=p.second;
	}
	if(m==0){
		if(M[x][y])return make_pair(S[x][y]=1,P[x][y]=m_rev[x*1001+y]);
		return make_pair(S[x][y]=0,P[x][y]=0);
	}else{
		return make_pair(S[x][y]=m+M[x][y],P[x][y]=m_place);
	}
}
main(){
	int k=1,z,x,y,i,n,s;
	m[k]=make_pair(x=500,y=500),m_rev[x*1001+y]=k,k++;
	for(z=2;z<=1000;z+=2){
		x++,y++;
		for(i=0;i<z;i++)m[k]=make_pair(x,--y),m_rev[x*1001+y]=k,k++;
		for(i=0;i<z;i++)m[k]=make_pair(--x,y),m_rev[x*1001+y]=k,k++;
		for(i=0;i<z;i++)m[k]=make_pair(x,++y),m_rev[x*1001+y]=k,k++;
		for(i=0;i<z;i++)m[k]=make_pair(++x,y),m_rev[x*1001+y]=k,k++;
	}
	table[0]=table[1]=1;
	for(x=2;x<t_max;x++)if(!table[x])for(y=x*2;y<t_max;y+=x)table[y]=1;
	for(;scanf("%d%d",&n,&s),n;){
		memset(M,0,sizeof(M));
		memset(S,0xff,sizeof(S));
		memset(P,0,sizeof(P));
		for(i=1;i<=n;i++)if(!table[i])M[m[i].first][m[i].second]=1;
		pair<short,int> p=dfs(m[s].first,m[s].second);
		printf("%d %d\n",p.first,p.second);
	}
}

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

using namespace std;

#define fcout(d) cout << fixed << setprecision(d)
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define rep1(i,n) for(int (i) = 1; (i) <= (n); ++(i))
#define repU(i,bottom,ceiling) for(int (i) = (bottom); (i) <= (ceiling); ++(i))
#define repD(i,ceiling,bottom) for(int (i) = (ceiling); (i) >= (bottom); --(i))
#define pub push_back
#define pob pop_back
#define prf printf
#define scf scanf
#define mkp make_pair
#define fir first
#define sec second
#define clr(a) memset((a),0,sizeof(a))
#define all(a)  begin((a)),end((a))

typedef long long ll;
typedef unsigned long long ull;
typedef double db;

const vector<pair<int,int>> DIR = { {1,0},{0,1},{-1,0},{0,-1},{1,1},{-1,1},{-1,-1},{1,-1} };
const int INF = -1 + (1<<30);
const int MOD = (int)1e9 + 7;

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

template<typename T> inline T lcm(T a,T b){ return a / gcd(a,b) * b; }

inline long long Pow(const long long n,long long m,const int mod = MOD){
	long long res = 1,pow = n;
	while(m) {
		if(m & 1) res = (res * pow) % mod;
		pow = (pow * pow) % mod;
		m >>= 1;
	}
	return res;
}

inline vector<long long> Frac(const int range,const int mod = MOD){
	vector<long long> frac;
	frac.push_back(1);
	for(int i = 1; i <= range; ++i) frac.push_back((long long)frac.back() * i % mod);
	return frac;
}

inline long long Comb(const int n,const int m,const int mod = MOD){
	if(n < m || m < 0) return 0;
	vector<long long> frac(Frac(n,mod));
	long long rev = Pow((long long)frac[m] * frac[n-m] % mod,mod-2,mod);
	return rev * frac[n] % mod;
}

template<typename T> inline bool v_find(const vector<T> v,const T obj){
	auto itr = find(v.begin(), v.end(), obj);
	size_t index = distance(v.begin(),itr);
	if (index != v.size()) { return true; }
	return false; 
}

template<typename T> inline bool v_erase(vector<T> &v,const T obj){
	auto itr = find(v.begin(), v.end(), obj);
	size_t index = distance(v.begin(),itr);
	if (index != v.size()) {
		v.erase(itr);
		return true;
	}
	return false;	
}

template<class T,class U> inline auto LB(const T v,const U in){ return lower_bound(v.begin(),v.end(),in); }

template<class T,class U> inline auto UB(const T v,const U in){ return upper_bound(v.begin(),v.end(),in); }

inline unsigned long long next_subset(unsigned long long subset){
	unsigned long long tem = subset + (subset & -subset);
	unsigned long long btm = (~tem & subset) / (subset & -subset) >> 1;
	return btm | tem;
}
ll n;
inline void solve(){
	cin>>n;
	if(n&1) cout<<n*2;
	else cout<<n;

	return;
}

inline void input(){
	

	return;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	input();
	solve();
	return 0;
}





Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repp(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define rrep(i, n, m) for (int i = n; i >= m; i--)
#define p(a,b) printf(a,b);
#define c(s) cout<< (s) << endl;
#define yes cout<<"Yes"<<endl;
#define no cout<<"No"<<endl;
#define YES cout<<"YES"<<endl;
#define NO cout<<"NO"<<endl;
#define cyn(c) cout<<(c?"Yes":"No")<<endl;
#define cYN(c) cout<<(c?"YES":"NO")<<endl;
#define pyn(c) printf("%s\n",c?"Yes":"No");
#define pYN(c) printf("%s\n",c?"YES":"NO");
typedef long long LL;
template <class T>
bool contain(const std::string &s, const T &v)
{
    return s.find(v) != std::string::npos;
}

int main()
{
    int H,W,h,w; cin>>H>>W>>h>>w;
    c((H-h)*(W-w));
}


Measured memory_bytes: 256
from collections import defaultdict
from heapq import heappop, heappush
N, M = map(int, input().split())

d = defaultdict(list)
for _ in range(N):
    a, b = map(int, input().split())
    d[a].append(b)

ans = 0
q = []

for i in range(1, M+1):
    for j in d[i]:
        heappush(q, -j)
    if q:
        ans += (-heappop(q))

print(ans)

Measured memory_bytes: 27908
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <map>
#define mp make_pair
#define pb push_back
#define p push
#define FOR(a,c) for(int a = 0;a<c;a++)
#define ll long long int
#define abs(x) (x<0 ? (-x) : x)
#define getI(a) scanf("%d",&a)
#define getII(a,b) scanf("%d%d",&a,&b)
#define getIII(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define getLL(a,b) scanf("%lld%lld",&a,&b)
#define BEND(c) (c).begin(),(c).end()
#define fi first
#define se second
#define pi 3.1415926535897932384626
#define getS(a) scanf("%s",a)
#define pfi(a) printf("%d",a);
#define pfii(a,b) printf("%d%d",a,b);
#define pfl(a) printf("%lld",a);
#define pfll(a,b) printf("%lld%lld",a,b);


#define sag (sol|1)
#define sol (root<<1)
#define ort (bas+son)/2
using namespace std;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vl;
typedef vector<pair<int,int>> vpi;
typedef vector<pair<long long,long long>> vpl;
typedef pair<int,int> pii;
typedef pair <ll,ll> pll;


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

    vpl ar(n);
    for (int i = 0; i <n ; ++i) {
        cin>>ar[i].first>>ar[i].second;
    }
    double k =0;
    for (int j = 0; j <n ; ++j) {
        for (int i = j+1; i <n ; ++i) {
             k += sqrt((ar[j].first-ar[i].first)*(ar[j].first-ar[i].first) + (ar[j].second-ar[i].second)*(ar[j].second-ar[i].second));
            //cout << k<<"\n";

        }
    }
    double fac =1;
    for (int l = 1; l <=n-1 ; ++l) {
        fac*=l;
    }

    printf("%.12lf",2*(k * fac )/(double)(fac*n));

    return 0;
}




    /*

    int gcd(int a, int b) {
        while (a > 0 && b > 0)
            if (a > b) a %= b;
            else b %= a;
        return a + b;
    }

    int lcm(int a, int b) {
        return a*b / gcd(a,b);
    }
    long long fast_exp(long long n,long long k){
        if(k == 0)
            return 1;
        if(k==1)
            return n;

        long long temp = fast_exp(n,k>>1);
        if((k&1)==1)
            return (n*temp*temp);
        return (temp*temp);

    }

     */

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

int f(int x) {
	int res = 0;
	while (x != 0) {
		res += x % 10;
		x /= 10;
	}
	return res;
}
int main() {
	int n;
	cin >> n;
	if (n%f(n) == 0) {
		cout << "Yes" << endl;
	}
	else cout << "No" << endl;
	return 0;
}

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    long long N, K; 
    cin >> N >> K;
    vector<pair<int, int>> a;

    a.resize(N);
    for (int n = 0; n < N; ++n) {
        cin >> a[n].first;
        cin >> a[n].second;
    }
    sort(a.begin(), a.end());
  
    for (int n = 0; n < N; ++n) {
     	K = K - a[n].second;
        if (K <= 0) {
          	cout << a[n].first;
            break;
        }
    }

    return 0;
}


Measured memory_bytes: 1024
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
using namespace std;
typedef long long LL;

#define _CRT_SECURE_NO_WARNINGS
int N;
int ToHash(const char* _s) {
	if (strcmp(_s,"Male")==0) {
		return 1;
	}if (strcmp(_s, "Female") == 0) {
		return 2;
	}
	else {
		return 0;
	}
}
string s;
int g[100010] = {};
bool Q(int _n) {
	printf("%d\n",_n);
	fflush(stdout);
	scanf("%s", s.c_str());
	g[_n] = ToHash(s.c_str());
	if (g[_n] == 0) {
		return false;
	}
	return true;
}

int main() {
	scanf("%d",&N);
	int s,l;

	if (!Q(0)){return 0; }
	if (!Q(N/2)){return 0;}

	if( (g[0] == g[N/2] && (N/2)%2==0 )||(g[0] != g[N / 2] && (N / 2) % 2 == 1) ){
		if (!Q(N-1)) { return 0; }
		s = N / 2;
		l = N - 1;
	}
	else {
		s = 0;
		l = N/2;
	}
	int c = 0;
	while (true) {
		c++;
		if (c>17) {
			break;
		}
		int now = (s + l) / 2;
		if (!Q(now)) { return 0; }
		if ((g[s] == g[now] && (now-s) % 2 == 0) || (g[s] != g[now] && (now-s) % 2 == 1)) {
			s = now;
		}
		else {
			l = now;
		}
	}

	return 0;
}

Measured memory_bytes: 852
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using str = string;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vs> vvs;
typedef vector<vc> vvc;
typedef vector<vb> vvb;
using P = pair<ll,ll>;
#define REP(i, n) for (ll i = 0; i < (int)(n); i++)
#define RREP(i, n) for (ll i = (int)(n)-1; i > -1 ; i--)
#define IN(T, x) T x;cin >> x;
#define AIN(T, a, n) vector<T> a(n);REP(i, n){cin >> a[i];}
#define A2IN(T1, a, T2, b, n) vector<T1> a(n);vector<T2> b(n);REP(i, n){cin >> a[i] >> b[i];}
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort(ALL(a))
#define RSORT(a) SORT(a);reverse(ALL(a))
#define pb push_back
#define mp make_pair
#define PF first
#define PS second
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
template<typename A, size_t N, typename T>void Fill(A (&array)[N], const T &val){fill( (T*)array, (T*)(array+N), val );}
#define OUT(x) cout << x << endl
#define BOUT(b) if(b){OUT("Yes");}else{OUT("No");}
const ll MOD = 100000007;
const ll INF = 10e9;
#define PI 3.14159265369;
ll dx[4] = {1,-1,0,0};
ll dy[4] = {0,0,1,-1};
ll ddx[8] = {1,1,1,-1,-1,-1,0,0};
ll ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main() {
  IN(str,S);
  bool ans = true;
  REP(i,S.size()){
    if((i%2 == 0 && S.at(i) == 'L') || (i%2 == 1 && S.at(i) == 'R'))
      ans = false;
  }
  BOUT(ans);
}



Measured memory_bytes: 256
using System.Text;
using System.Collections.Generic;
using System;

public class hello
{
    public static Dictionary<string, int> d;
    public static Dictionary<int, string> dr;
    public static string[] z, z0, z1;

    public static void Main()
    {
        z = new string[]
        {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z","ld", "mb", "mp", "nc", "nd", "ng", "nt", "nw", "ps", "qu", "cw", "ts" };
        z0 = new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z" };
        z1 = new string[] { "ld", "mb", "mp", "nc", "nd", "ng", "nt", "nw", "ps", "qu", "cw", "ts" };
        d = new Dictionary<string, int>();
        dr = new Dictionary<int, string>();
        var map = new int[38, 38];
        for (int i = 0; i < 38; i++)
        {
            d[z[i]] = i;
            dr[i] = z[i];
        }
        Array.Reverse(z0);
        Array.Reverse(z1);
        var maxv = new int[38];
        var maxcs = new int[38];
        var n = int.Parse(Console.ReadLine().Trim());
        var p = 0;
        while (p++ < n)
        {
            string[] line = Console.ReadLine().Trim().Split(' ');
            foreach (var x in line)
                getAns(x, maxv, maxcs, map);
        }
        print(maxv, maxcs);
    }
    static void print(int[] maxv, int[] maxcs)
    {
        var sb = new StringBuilder();
        for (int i = 0; i < 38; i++)
        {
            var cw = dr[maxcs[i]];
            sb.Append(string.Format("{0} {1} {2}\n", dr[i], cw, maxv[i]));
        }
        Console.Write(sb);
    }
    static void getAns(string s, int[] maxv, int[] maxcs, int[,] map)
    {
        if (s.Length == 1) return;
        var p = 0;
        var pre = 0;
        var pret = s.Substring(0, 2);
        var find = false;
        foreach (var y in z1)
            if (pret == y) { find = true; pre = d[y]; p += 2; break; }
        if (p == s.Length) return;
        if (!find) { pre = s[0] - 'a'; p++; }
        while (true)
        {
            find = false;
            if (p == s.Length - 1) { goto next; }
            var t = s.Substring(p, 2);
            foreach (var y in z1)
                if (t == y)
                {
                    find = true;
                    var ti = d[y];
                    map[pre, ti]++;
                    if (map[pre, ti] > maxv[pre]) { maxv[pre] = map[pre, ti]; maxcs[pre] = ti; }
                    if (map[pre, ti] == maxv[pre] && ti < maxcs[pre]) maxcs[pre] = ti;
                    p += 2;
                    pre = ti;
                    break;
                }
            next:;
            if (!find)
            {
                var ti = s[p] - 'a';
                map[pre, ti]++;
                if (map[pre, ti] > maxv[pre]) { maxv[pre] = map[pre, ti]; maxcs[pre] = ti; }
                if (map[pre, ti] == maxv[pre] && ti < maxcs[pre]) maxcs[pre] = ti;
                pre = ti;
                p++;
            }
            if (p >= s.Length) break;
        }
    }
}



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

int main() {
    int N;
    cin >> N;
    int ans;
    ans=0;
    for( int i=1; i<10; ++i ){
        for( int j=1; j<10; ++j){
            if( i*j == N ){
                ans +=0;
            }
            else{
                ans +=1;
            }
        }
    }
    if( ans==81){
        cout << "No" << endl;
    }
    else{
        cout << "Yes" << endl;
    }
}

Measured memory_bytes: 256
a=int(input())
b=int(input())
if a == 1:
  if b == 2:
    print(3)
  else:
    print(2)
elif a == 2:
  if b == 1:
    print(3)
  else:
    print(1)
else:
  if b == 1:
    print(2)
  else:
    print(1)

Measured memory_bytes: 3060
#!/usr/bin/env python
"""M-SOLUTIONS プロコンオープン 2020: A - Kyu in AtCoder
https://atcoder.jp/contests/m-solutions2020/tasks/m_solutions2020_a
"""


def main():
    X = int(input())

    ans = 0
    if 400 <= X and X <= 599:
        ans = 8
    elif 600 <= X and X <= 799:
        ans = 7
    elif 800 <= X and X <= 999:
        ans = 6
    elif 1000 <= X and X <= 1199:
        ans = 5
    elif 1200 <= X and X <= 1399:
        ans = 4
    elif 1400 <= X and X <= 1599:
        ans = 3
    elif 1600 <= X and X <= 1799:
        ans = 2
    elif 1800 <= X and X <= 1999:
        ans = 1
    print('{}'.format(ans))


if __name__ == '__main__':
    main()


Measured memory_bytes: 9136
#include<bits/stdc++.h>
using namespace std;
#define fine cout<<"fine"<<endl;
#define ll long long int
#define pb push_back
#define FASTIO ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
const ll inf=(ll)2e18;
const int mod=1e9+7;
bool overflow(ll a,ll b){
    if (a <= (inf+b-1)/b) return false;
    return true;
}
int main(){
FASTIO;
int n;
cin>>n;
int x=n/2+(n%2);
cout<<x<<endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#define ll long long
using namespace std;

const ll mod=1000000000+7;
int n,k,a[2005],ok[2005],num[2005];
ll ans=0;

int main(void){
	scanf("%d %d",&n,&k);
	for(int i=1;i<=n;i++){
		scanf("%d",&a[i]);
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++)
		if(a[i]>a[j])ok[i]++;
	}
	for(int i=1;i<=n;i++){
		for(int j=i+1;j<=n;j++)
		if(a[i]>a[j])num[i]++;
		ans=(ans+num[i]*(k+0ll))%mod;
	}
	for(int i=1;i<=n;i++){
		ll now;
		now=(k)*(k-1ll)/2ll;
		now%=mod;
		ans=(ans+ok[i]*now)%mod;
	}
	printf("%lld\n",ans);
}

Measured memory_bytes: 128
#include<stdio.h>
int main(){
  int A,B,C;
  scanf("%d %d %d", &A, &B, &C);
  
  int flag = 0;
  if(A == B && A != C) flag = 1;
  if(B == C && (A != B || A != C)) flag = 1;
  if(A == C && (B != A || B != C)) flag = 1;
  
  if(flag == 1){
    printf("Yes");
  }else{
    printf("No");
  }
}

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

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

#define FOR(i, n, m) for (ll(i) = (m); (i) < (n); ++(i))
#define REP(i, n) FOR(i, n, 0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll)1e15;

int main()
{
    string S;
    cin >> S;
    int n = 0;
    REP(i, S.length())
    {
        if (S[i] == '2')
            n++;
    }
    cout << n << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

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

        int n = sc.nextInt();

        for (int i = 0; i < 50000; i++) {
            if (i * 108 / 100 == n) {
                System.out.println(i);
                System.exit(0);
            }
        }

        System.out.println(":(");
    }
}


Measured memory_bytes: 23124
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		String[] s = new String[n];
		for(int i = 0; i < n; i++) {
			s[i] = sc.next();
		}
		int[] cnt = new int[4];
		for(int i = 0; i < 4; i++) {
			cnt[i] = 0;
		}
		
		for(int i = 0; i < n; i++) {
			if(s[i].charAt(0) == 'A') {
				cnt[0]++;
			}
			if(s[i].charAt(0) == 'W'){
				cnt[1]++;
			}
			if(s[i].charAt(0) == 'T') {
				cnt[2]++;
			}
			if(s[i].charAt(0) == 'R') {
				cnt[3]++;
			}
		}
		System.out.println("AC x "+cnt[0]+"\n"+"WA x "+cnt[1]+"\nTLE x "+cnt[2]+"\nRE x "+cnt[3]);
	}
}


Measured memory_bytes: 55136
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define cvector vector<char>
#define svector vector<string>
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define rep(i,n) for(ll i=0; i<n; ++i)
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,ans=0,m;cin>>n;
  for(ll i=1;i<=n;++i) {
    m=n/i;
    ans+=i*m*(m+1)/2;
  }
  print(ans);
  return 0;
}

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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

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

	string s; cin >> s;
	string key = "keyence";

	bool ans = false;

	for (int i = 0;i < s.size();i++){
		for (int j = i;j < s.size();j++){
			if(s.size()-(j-i) != 7) continue;
			int ki = 0;
			int si = 0;
			bool flag = true;
			while(si < i){
				//cout << s[si] << " ";
				if(s[si] == key[ki]){
					ki++; si++;
				}
				else{
					flag = false;
					break;
				}
			}
			si = j;
			while(si < s.size()){
				//cout << s[si] << " ";
				if(s[si] == key[ki]){
					ki++; si++;
				}else{
					flag = false;
					break;
				}
			}
			if(flag) ans = true;;
			//cout << endl;
		}
	}

	if(ans) cout << "YES" << endl;
	else cout << "NO" << endl;

	return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define pii pair<int, int>
  
using namespace std;
const int inf = 1e9 + 7;




signed main() {
/*#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif*/

    int n, k;
    cin >> n >> k;
    int res = min(n % k, k - n % k);

    cout << res;
}

Measured memory_bytes: 256
<?php
  fscanf(STDIN,"%d%d",$N,$X);
  $cnt=1;
  $now=0;
  $L=explode(" ",fgets(STDIN));
  for($i=0;$i<$N;$i++)
  {
    $now+=$L[$i];
    $cnt+=$now<=$X;
  }
  echo $cnt;

Measured memory_bytes: 3576
#include<vector>
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include <iostream>
#include <algorithm>
#include <map>
#include <cmath>
#include<queue>
#include <sstream>
#include <set>

const long long MOD = 1000000007;
using namespace std;
typedef long long llong;

//int isalpha(char ch): ch がアルファベットなら true を返す
//int isdigit(char ch): ch が数字なら true を返す
//int islower(char ch): ch が小文字なら true を返す
//int isupper(char ch): ch が大文字なら true を返す
//int tolower(char ch): ch の小文字を返す
//int toupper(char ch): ch の大文字を返す

//string型
//size()	文字数を返す
//Insert()	（指定した場所に）文字・文字列を挿入する
//erase()	（指定した場所の）文字・文字列を削除する
//clear()	すべての文字を削除する
//substr()	文字列の（指定した）部分文字列を返す
//replace()	（指定した）部分文字列を新しい文字列に置換する
//c_str()変換
//文字列の比較は、<=や==などを使え
//replace関数を使い、簡単に文字列を置換
//リバース関数：reverse(str.begin(), str.end());
//map<type, type> dict;で宣言
//グラフ理論用変数
//vector<vector<llong> > graph(N);

//ソート
//降順sort(v.begin(), v.end(), std::greater<Type>());

//大文字から小文字へんかん
//w[i] = w[i]-'A'+'a';

//vector
//assignメソッド　引数：サイズ、値
//与えられたサイズと値でvectorを初期化する

//queueクラス
//find()次に取り出す値の表示をする。
//pop()値を取り出す。戻り値はなし
//push()キューに値をプッシュする

//priority_queueクラス

//切り上げ
//ceil
//floor

int main(){
    llong N, M;
    cin >> N >> M;
    priority_queue<llong> PQ;
    vector<vector<llong> > Table(M+1);
    pair<llong, llong> x;
    llong min_day = MOD;
    for(int i=0; i<N; i++){
        cin >> x.first >> x.second;
        if(x.first>M){
            continue;
        }
        Table[x.first].push_back(x.second);
        min_day = min(x.first, min_day);
    }
    llong total = 0;
    llong now_day = min_day;

    while(now_day<=M){
        for(int j=0; j<Table[now_day].size(); j++){
            PQ.push(Table[now_day][j]);
        }
        if(PQ.empty()){
            now_day++;
            continue;
        }
        total = total + PQ.top();
        PQ.pop();
        now_day++;
    }
    cout << total << endl;
    return 0;
}


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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define endl "\n"
#define eb emplace_back
#define pb push_back
#define mk make_pair
#define mt make_tuple

#define Umap unordered_map
#define graph vector<vector<int>>

#define NO cout<<"NO"<<endl
#define YES cout<<"YES"<<endl

#define INF 1e9+5
#define N 40001
#define MAXN   100001


bool sortbysec(const tuple<int, int, int>& a,  
               const tuple<int, int, int>& b) 
{ 
    return (get<1>(a) < get<1>(b)); 
}
void dfs(int s, graph &g, bool vis[]){
	vis[s] = true;
	for(int i=0;i<g[s].size();i++){
		if(!vis[g[s][i]]) dfs(g[s][i],g,vis);
	}
}

string common_prefix(vector<string>& strings){
	string prefix;
	for(string s : strings){
		for(int i=0;i<s.size() && s[i]!='*';++i){
			if(i<prefix.size()){
				if(s[i]!=prefix[i]) return "*";
			}
			else prefix+=s[i];
		}
	}
	return prefix;
}

void reverse(vector<string>& strings){
	for(string& s : strings){
		reverse(s.begin(),s.end());
	}
}

int spf[0];
void sieve(){
	spf[1] = 1;
	for(int i=2;i<MAXN;i++) spf[i] = i;

	for(int i=4;i<MAXN;i+=2) spf[i] = 2;

	for(int i=3; i*i<MAXN;i++){
		if(spf[i]==i){
			for(int j=i*i;j<MAXN;j+=i){
				if(spf[j]==j) spf[j] = i;
			}
		}
	}
}
vector<int> getFactorization(int x){

	vector<int> primeFactors;
	while(x>1){
		primeFactors.pb(spf[x]);
		x /= spf[x];
	}
	return primeFactors;
}


#define ll long long
void max_self(ll& a, ll b) {
    a = max(a, b);
}
void solve(){
	// sieve(); 

	int n,W; cin>>n>>W;
	vector<ll>dp(W+1);

	for(int i=0;i<n;i++){
		int weight,value; cin>>weight>>value;

		for(int weight_already = W-weight; weight_already>=0; weight_already--){
			max_self(dp[weight_already+weight],dp[weight_already]+value);
		}
	}
	ll ans = 0;
	for(int i=0;i<=W;i++) max_self(ans,dp[i]);
	cout<<ans<<endl;
	

}

int main() {
IOS;
	int t=1; 
	// cin>>t;
	for(int i=1;i<=t;i++){
		// cout<<"Case #"<<i<<": ";
		solve();
	}
	return 0;
}

Measured memory_bytes: 1024
r,g,b,n=map(int,input().split())
count=0
n0=n
for i in range(n0//r+1):
    n=n0
    n-=r*i
    for j in range(n//g+1):
        n=n0-r*i-g*j
        if n%b==0:
            count+=1
print(count)

Measured memory_bytes: 2940
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
typedef struct node *link;

struct node{
  int item;
  link next, prev;
};

int main(void){
  int n, i, j, getitem, size = 0;
  char s[16];
  link head, end;
  head = malloc(sizeof(*head));
  head->item = -1;
  head->next = NULL;
  head->prev = NULL;
  end = head;
 
  scanf("%d", &n); //input number
 
  for(i = 0; i < n; i++){
    scanf("%s", s);
    if(!strcmp(s, "insert")){ //insert
      scanf("%d", &getitem);
      link x;
      x = malloc(sizeof(*x));
      x->item = getitem;
      x->next = head;
      x->prev = NULL;
      head->prev = x;
      head = x;
      size++;
    }else if(!strcmp(s, "delete")){ //delete
      scanf("%d", &getitem);
      link x;
      x = malloc(sizeof(*x));
      x = head;
      if(head->item == getitem){ //head is delete point
    head = head->next;
    head->prev = NULL;
    size--;
    continue;
      }
      while(x->next->item != -1){ //look for delete point
    if(x->next->item == getitem){
      x->next = x->next->next;
      x->next->prev = x;
      size--;
      break;
    }else{
      x = x->next;
    }
      }
    }else if(!strcmp(s, "deleteFirst")){ //deleteFirst
      if(size == 0){
    continue;
      }
      head = head->next;
      head->prev = NULL;
      size--;
    }else if(!strcmp(s, "deleteLast")){ //deleteLast
      if(size == 0){ //no element
    continue;
      }else if(size == 1){ //only one element(same as deleteFirst)
    head = head->next;
    head->prev = NULL;
    size--;
    continue;
      }
      end->prev->prev->next = end;
      size--;
    }
  }


  //output
  link x;
  x = malloc(sizeof(*x));
  x = head;
  for(i = 0; i < size-1; i++){
    printf("%d ", x->item);
    x = x->next;
  }
  printf("%d\n", x->item);
  return 0;
}

Measured memory_bytes: 36088
def main():
    n = int(input())
    to_i = {c: i for i, c in enumerate('MARCH')}
    counts = [0] * 5
    for _ in range(n):
        c = input()[0]
        if c in to_i:
            counts[to_i[c]] += 1
    res = 0
    for i in range(0, 5):
        for j in range(i + 1, 5):
            for k in range(j + 1, 5):
                res += counts[i] * counts[j] * counts[k]
    print(res)


if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include<iostream>
using namespace std;
int main()
{
  int h1,h2,m1,m2,k,res;
  cin >> h1 >> m1 >> h2 >> m2 >> k;
  res=(h2-h1)*60+m2-m1-k;
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 3176
#include <iostream>
#include <string>
#include <cstring>

using namespace std;

typedef long long ll;

ll dp[105][4][4][4];
int n;
string oni[4] = {"A", "C", "G", "T"};
const ll mod = (ll)1e9 + 7;

string nadi(string s, int poc){
	string ret = "";
	for(int i = poc ; i < poc + 3 ; ++i){
		ret += s[i];
	}
	return ret;
}

bool dobar(string s){
	if(nadi(s, 0) == "AGC" || nadi(s, 1) == "AGC")
		return 0;
	return 1;
}

bool provjeri(string s){
	for(int i = 0 ; i < 3 ; ++i){
		swap(s[i], s[i + 1]);
		if(!dobar(s))
			return 0;
		swap(s[i], s[i + 1]);
	}
	return dobar(s);
}

int main(){
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
cin >> n;
for(int i = 0 ; i < 4 ; ++i){
	for(int j = 0 ; j < 4 ; ++j){
		for(int v = 0 ; v < 4 ; ++v){
			dp[2][i][j][v] = 1;
		}
	}
}
dp[2][0][2][1]--;
dp[2][0][1][2]--;
dp[2][2][0][1]--;
for(int i = 3 ; i < n ; ++i){
	for(int j = 0 ; j < 4 ; ++j){
		for(int v = 0 ; v < 4 ; ++v){
			for(int l = 0 ; l < 4 ; ++l){
				for(int w = 0 ; w < 4 ; ++w){
					string s = oni[j] + oni[v] + oni[l] + oni[w];
					if(provjeri(s)){
						dp[i][v][l][w] = (dp[i][v][l][w] + dp[i - 1][j][v][l]) % mod;
					}
				}
			}
		}
	}
}
ll sol = 0;
for(int i = 0 ; i < 4 ; ++i){
	for(int j = 0 ; j < 4 ; ++j){
		for(int v = 0 ; v < 4 ; ++v){
			sol = (sol + dp[n - 1][i][j][v]) % mod;
		}
	}
}
cout << sol << endl;

return 0;
}



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

int main()
{
    int n,a,b;
    scanf("%d %d %d",&n,&a,&b);
    if(n == 2) {
        printf("Borys\n");
    }
    else {
        int x = b-a-1;
        if(x % 2) {
            printf("Alice\n");
        }
        else
            printf("Borys\n");
    }
    return 0;

}


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

#define test(t) while(t--)
#define fo(i,k,n) for(int i=k;i<n;i++)
#define refl(a,x) for(auto& a:x)
#define MIN(a,b)  (a>b?b:a)
#define ll  long long int
#define MOD 1e9 + 7
#define in  cin>>
#define out cout<<
#define en "\n"
#define sp " "
#define fi first
#define se second
#define fast()  ios_base::sync_with_stdio(false);cin.tie(0);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
//typedef pair<int,int> pai;
//typedef pair<char,int> pac;



/*bool f(int x,int y){

return x>y;
}*/


using namespace std;


void solve()
{ float r;
   in r;
  //float pi= 3.14;
  float ans  = 2*(3.14)*r;
  out setprecision(3)<<fixed<<ans<<en;
}

int main(){ fast()
             //freopen("input.txt","r",stdin);
	         //freopen("output.txt","w",stdout);
             ll t=1;
             //cin>>t;
            test(t){
            solve();
            }
return 0;}


Measured memory_bytes: 3768
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#include <bits/stdc++.h>
#include <fstream>
#include<string.h>
#include <algorithm>
#include<math.h>
#include<vector>
#include <queue>
#include <deque> 
#define ll long long
#define M 1000000007 
#define MM 998244353
#define INF 4e18
using namespace std;

int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    /*ll t,tcitr;
    cin>>t;
    tcitr=0;
    while(tcitr<t)
    {*/
        //cout<<"Case #"<<tcitr+1<<": ";
        ll a,b,c,d;
        cin>>a>>b>>c>>d;
        cout<<max({a*c,a*d,b*c,b*d})<<"\n";
        /*tcitr++;
    }*/
    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define endl codeforces
#define ALL(v) std::begin(v), std::end(v)
#define ALLR(v) std::rbegin(v), std::rend(v)
using ll = std::int64_t;
using ull = std::uint64_t;
using pii = std::pair<int, int>;
using tii = std::tuple<int, int, int>;
using pll = std::pair<ll, ll>;
using tll = std::tuple<ll, ll, ll>;
template <typename T> using vec = std::vector<T>;
template <typename T> using vvec = vec<vec<T>>;
template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return std::min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return std::max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return std::max(low, std::min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { return t = clamp(t, low, high); }
template <typename T> T make_v(T init) { return init; }
template <typename T, typename... Tail> auto make_v(T init, std::size_t s, Tail... tail) { auto v = std::move(make_v(init, tail...)); return vec<decltype(v)>(s, v); }
template <typename T, std::size_t Head, std::size_t ...Tail> struct multi_dem_array { using type = std::array<typename multi_dem_array<T, Tail...>::type, Head>; };
template <typename T, std::size_t Head> struct multi_dem_array<T, Head> { using type = std::array<T, Head>; };
template <typename T, std::size_t ...Args> using mdarray = typename multi_dem_array<T, Args...>::type;
namespace init__ { struct InitIO { InitIO() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(30); } } init_io; }

vec<ll> nlis;

void dfs(ll d, ll n, ll cur) {
    cur = cur * 10 + n;
    if (d == 0) {
        nlis.push_back(cur);
        return;
    }

    for (ll k = -1; k <= 1; k++) {
        ll nn = n + k;
        if (!(0 <= nn && nn < 10)) continue;
        dfs(d - 1, nn, cur);
    }
}

int main() {
    bool f = false;
    for (ll d = 0; d < 10 && !f; d++) for (ll n = 1; n < 10 && !f; n++) {
        dfs(d, n, 0);
        if (d == 9 && n == 3) f = true;
    }
    std::sort(ALL(nlis));
    ll k;
    std::cin >> k;
    std::cout << nlis[k - 1] << '\n';
    return 0;
}


Measured memory_bytes: 1908
#include <iostream>
#include <vector>
#include <unordered_map>
#include <deque>
#include <list>
#include <set>
#include <random>
#include <deque>

using namespace std;
using ll = long long;
const int BIG = 100000007;

int main() {
    ll n;
    cin >> n;
    vector<ll> divisorCount(n + 1,2);
    --divisorCount[1];

    ll la = n / 2;
    for(unsigned int i = 2;i <= la;++i){
        unsigned int j = i * 2;
        while(j <= n){
            ++divisorCount[j];
            j += i;
        }
    }

    ll total = 0;
    for(int i = 1;i <= n;++i){
        total += i * divisorCount[i];
       // cout << i << ":" << divisorCount[i] << endl;
    }

    cout << total << endl;
}




Measured memory_bytes: 80968
N,k=gets.chomp.split(" ")
N_i = N.to_i
K = k.to_i
d_array=gets.chomp.split(" ").map(&:to_i)
E_array= (0..9).to_a - d_array

ret = N_i
loop do
    if ret.to_s.split("").all? { |s| E_array.include?(s.to_i) }
        break
    end
    ret+=1
end
puts ret

Measured memory_bytes: 14216
H, W = map(int, input().split())
S = [list(input()) for _ in range(H)]

for i in range(H):
    for j in range(W):
        if S[i][j] == '.':
            S[i][j] = str(
                sum(S[x][y] == '#'
                    for x in range(max(0, i - 1), min(H, i + 2))
                    for y in range(max(0, j - 1), min(W, j + 2))
                )
            )
for s in S:
    print(''.join(s))

Measured memory_bytes: 3188
#include<bits//stdc++.h>
using namespace std;
typedef unsigned long long int ll; // unsighed ll じゃないとオーバーフロー
#define rep(i,n) for(int i = 0; i < n;i++)
ll n, a[10],d,t;map<ll, ll> mp;
ll dfs(ll now) {
    if (now == 0)return 0;// なんかこれなかったら無理らしい
    if (now == 1)return d;
    if (mp.count(now)>0) return mp[now]; // すでにあったらリターン
    ll ret = d * now;
    for (int i : {2, 3, 5}) {
        ll next = now / i;// nより小さいiの倍数の時  floor
        ret = min(ret, a[i] + (now - next * i) * d + dfs(next));
        next = (now + i - 1) / i;// ｎより大きいiの倍数の時 ceiling
        ret = min(ret, a[i] + (next * i - now) * d + dfs(next));
    }
    return mp[now] = ret;
}
int main() {
    cin >> t;
    rep(q, t) {
        cin >> n >> a[2] >> a[3] >> a[5] >> d;
        mp.clear();
        cout << dfs(n) << endl;
    }
}

Measured memory_bytes: 4392
// C++ 14
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)
void solve(); int main() { solve(); return 0; }

void solve() {
  ll n;
  cin >> n;
  vector<int> A(n);
  loop(i,0,n) cin >> A[i];
  int s = 0;
  loop(i,0,n) s ^= A[i];
  loop(i,0,n) cout << (s^A[i]) << " ";
  cout << endl;
}


Measured memory_bytes: 4064
#include <algorithm>
#include <iostream>
#include <string>
#include <random>
#include <cassert>
#include <cstring>
#include <chrono>
#include <set>
#include <map>
 
using namespace std;
 
typedef long long ll;
 
const ll mod = 1000 * 1000 * 1000 + 7;
 
ll GCD(ll a, ll b) {
  if (a < 0) a *= -1;
  if (b < 0) b *= -1;
  if (a == 0) return b;
  return GCD(b % a, a);
}
 
void Normalize(ll& x, ll& y) {
  ll g = GCD(x, y);
  x /= g;
  y /= g;
  if (make_pair(x, y) < make_pair(-x, -y)) {
    x = -x;
    y = -y;
  }
}
 
ll Get(const vector<pair<int, int>>& v) {
  int min1 = mod;
  int min2 = mod;
  ll pow1 = 1;
  ll pow2 = 1;
  for (auto p : v) {
    if (p.first == 0) {
      min1 = min(min1, p.second);
      pow1 = pow1 * 2 % mod;
    } else {
      min2 = min(min2, p.second);
      pow2 = pow2 * 2 % mod;
    }
  }
  ll result = (pow1 + pow2 - 1 + mod) % mod;
  if (min1 > min2) result = 1;
  return result;
}
 
int main()
{
  int n;
  cin >> n;
  vector<ll> x, y;
  ll add = 0;
  for (int i = 0; i < n; ++i) {
    ll a, b;
    cin >> a >> b;
    if (a == 0 && b == 0) {
      add++;
      continue;
    }
    x.push_back(a);
    y.push_back(b);
  }
 
  n = x.size();
 
  map<pair<ll, ll>, vector<pair<int, int>>> m;
 
  for (int i = 0; i < n; ++i) {
    ll cx = x[i];
    ll cy = y[i];
 
    Normalize(cx, cy);
    m[{cx, cy}].push_back({0, i});
 
    cx = y[i];
    cy = -x[i];
    
    Normalize(cx, cy);
    m[{cx, cy}].push_back({1, i});
  }
 
  ll result = 1;
  for (auto it : m) {
    auto v = it.second;
    result = result * Get(v) % mod;
  }
 
  cout << (result + add - 1 + mod) % mod << endl;
 
  return 0;
}


Measured memory_bytes: 50032
#include<bits/stdc++.h>
using namespace std;
int a[4][4],n;
/*
a1+b1 = c11 
a1+b2 = c12
a1+b3 = c13
a2+b1 = c21
a2+b2 = c22
a2+b3 = c23
*/
int main()
{
	for(int i=1;i<=3;++i)
	for(int j=1;j<=3;++j)cin>>a[i][j];
	for(int i=2;i<=3;++i)
	if(a[i][2]-a[i][1]!=a[1][2]-a[1][1] || a[i][3]-a[i][2] != a[1][3]-a[1][2])
	{
		cout<<"No"<<endl;
		return 0;
	}
	for(int i=2;i<=3;++i)
	if(a[2][i]-a[1][i]!=a[2][1]-a[1][1] || a[3][i]-a[2][i] != a[3][1]-a[2][1])
	{
		cout<<"No"<<endl;
		return 0;
	}
	cout<<"Yes"<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String T = sc.next();
		int A = sc.nextInt();
		int B = sc.nextInt();
		String U = sc.next();

		if(S.equals(U)) {
			System.out.println(A-1 + " " + B);
		} else {
			System.out.println(A + " " + (B-1));
		}
	}
}

Measured memory_bytes: 23252
#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define PII pair<int,int>
#define VI vector<int>
#define VPII vector<pair<int,int> >
#define PLL pair<long long,long long>
#define VPLL vector<pair<long long,long long> >
#define F first
#define S second
typedef long long LL;
using namespace std;
const int MOD = 1e9+7;
const int SIZE = 1e6+10;
const int MAXLEN = (int)2e5 + 5;

char s[MAXLEN];
int SA[MAXLEN], cnt[MAXLEN], ary1[MAXLEN], ary2[MAXLEN];
int *Rank, *Height;


inline bool cmp(int *r, int a, int b, int l) {
    return r[a] == r[b] && r[a + l] == r[b + l];
}

void make_suffix_array(int MSIZE, int len) {
    int p, *x, *y, *tmp, i, j, k;
    x = ary1; y = ary2;
    memset(cnt, 0, sizeof(int) * MSIZE);
    for (i = 0; i < len; i++) cnt[x[i] = s[i]]++;
    for (i = 1; i < MSIZE; i++) cnt[i] += cnt[i - 1];
    for (i = len - 1; i >= 0; i--) SA[--cnt[x[i]]] = i;
    for (j = p = 1; p < len; j <<= 1, MSIZE = p) {
        for (p = 0, i = len - j; i < len; i++) y[p++] = i;
        for (i = 0; i < len; i++) {
            if (SA[i] >= j) y[p++] = SA[i] - j;
        }
        memset(cnt, 0, sizeof(int) * MSIZE);
        for (i = 0; i < len; i++) cnt[x[y[i]]]++;
        for (i = 1; i < MSIZE; i++) cnt[i] += cnt[i - 1];
        for (i = len - 1; i >= 0; i--) SA[--cnt[x[y[i]]]] = y[i];
        tmp = x; x = y; y = tmp;
        x[SA[0]] = 0;
        for (i = p = 1; i < len; i++) {
            x[SA[i]] = cmp(y, SA[i - 1], SA[i], j) ? p - 1 : p++;
        }
    }
    Rank = x;
    Height = y;
    for (i = k = 0; i < len - 1; i++) {
        if (k > 0) k--;
        j = SA[Rank[i] - 1];
        while (s[i + k] == s[j + k]) k++;
        Height[Rank[i]] = k;
    }
}
int dp[SIZE];
int main(){
    RS(s);
    int n=LEN(s);
    make_suffix_array(128,n+1);
    REP(i,n){
        if(Height[Rank[i]]+1<=n-i){
            dp[Height[Rank[i]]+1]++;
            dp[n-i+1]--;
        }
    }
    int an=0;
    REPP(i,1,n+1){
        dp[i]+=dp[i-1];
        an=max(an,dp[i]);
    }
    printf("%d\n",an);
    return 0;
}


Measured memory_bytes: 2304
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <tuple>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl;

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<long long, long long> pll;

const int INF = 1 << 30;
const long long INFL = 1LL << 62;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 110;

int main() {
	ll n;
	cin >> n;
	ll x[N];
	rep(i, n) cin >> x[i];
	ll ans = INFL;
	for(int p = 1; p <= 100; p++) {
		ll tmp = 0;
		rep(i, n) {
			tmp += (x[i] - p) * (x[i] - p);
		}
		ans = min(tmp, ans);
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
/*▄███████▀▀▀▀▀▀███████▄
░▐████▀▒ЗАПУСКАЕМ▒▀██████▄
░███▀▒▒▒▒▒ДЯДЮ▒▒▒▒▒▒▀█████
░▐██▒▒▒▒▒БОГДАНА▒▒▒▒▒████▌
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀
░░░░▄█████████████  █▒▒▐▌
░░░▀███▀▀████▀█████▀▒▌
░░░░░▌▒▒▒▄▒▒▒▄▒▒▒▒▒▒▐
░░░░░▌▒▒▒▒▀▀▀▒▒▒▒▒▒▒▐*/
#include <iostream>
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <tuple>
#include <math.h>
#include <set>
#include <stack>
#include <bitset>
#include <map>
#include <queue>
#include <random>
#include <unordered_set>
#include <unordered_map>
#define DEBUG
#define fi first
#define se second
#define pqueue priority_queue
#define pb(x) push_back(x)
//#define endl '\n'
#define all(x) x.begin(), x.end()
#define int long long
#define mk(a, b) make_pair(a, b)
     
using namespace std;
      
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vector<ll> > vvi;
typedef vector<ull> vull;
typedef vector<ll> vll;
// typedef tuple<ll, ll, ll> tiii;
typedef pair<int, int> pii;
typedef vector<pair<int, int> > vpii;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
typedef vector<string> vs;
typedef vector< vector<ll> > vvi;
typedef vector<char> vc;
      
const ll INF = 1e9 + 228;
const ll INFLL = 1e18;
const ll MOD = 1e9 + 7;
static const int maxn = 2e5 + 228;;
const ld eps = 1e-7;
const ld eps2 = 1e-9;
const ll MOD2 = 998244353;
const ll dosz = 5e5;
const ll SZ = (1<<18);
const ld PI = atan2l(0, -1);
     
void fast_io(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    #ifdef DEBUG
//      freopen("haybales.in", "r", stdin);
//      freopen("haybales.out", "w", stdout);
    #endif
}

void solve(){
	int n;
	cin >> n;
	vi nums(n);
	vi cnt(n+1, 0);
	for(int &i:nums)
		cin >> i, cnt[i]++;
	int ans = 0;
	for(int i=0; i<=n; i++)
		ans += cnt[i]*(cnt[i]-1)/2;
	for(int i=0; i<n; i++){
		ans -= cnt[nums[i]] * (cnt[nums[i]]-1)/2;
		cnt[nums[i]]--;
		ans += cnt[nums[i]] * (cnt[nums[i]]-1)/2;
		cout << ans << endl;
		ans -= cnt[nums[i]] * (cnt[nums[i]]-1)/2;
		cnt[nums[i]]++;
		ans += cnt[nums[i]] * (cnt[nums[i]]-1)/2;

	}	
}

signed main(){
        fast_io();
	srand(time(NULL));
//	cout << fixed << setprecision(12);
	int q = 1;
//	cin >> q;
	while(q--)
		solve();
     
}





Measured memory_bytes: 5760
k = int(input())
#a, b = map(int, input().split())
#x, y, z = map(int, input().split())
#a, b, c, d = map(int, input().split())
#arr = list(map(int, input().split()))
s = input()

if len(s) <= k:
	print(s)
else:
	print(s[:k] + '...')

Measured memory_bytes: 9164
<?php
  
$n = trim(fgets(STDIN));
$l = explode(' ', trim(fgets(STDIN)));
$li = $l;
sort($l);

$ans = 'NO';
for($i=0; $i<$n; $i++){
  $o = $li[$i];
  for($j=0; $j<$n; $j++){
    $s = $li[$j];
    $li[$i] = $s;
    $li[$j] = $o;
    if ($li == $l){
      $ans = 'YES';
      break;
    }
    $li[$j] = $s;
  }
  $li[$i] = $o;
}

echo $ans;
  
?>

Measured memory_bytes: 4732
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
    	Scanner input = new Scanner(System.in);
    	int n = input.nextInt();
    	input.nextLine();
    	for(int i = 0 ; i < n ; i++){
    		System.out.println(afin(input.nextLine()));
    	}
    }
    
    public static String afin(String st){
    	for(int i = 1 ; i <= 25 ; i+=2){
    		if(i % 13 == 0)continue;
    		for(int j = 0 ; j <= 25 ;j++){
        		StringBuilder sb = new StringBuilder();
    			for(int k = 0 ; k < st.length() ; k++){
    				char c = st.charAt(k);
    				if(c == ' '){
    					sb.append(" ");
    				}else{
    					char nc = (char)(((c-97)*i+j) % 26 + 97);
    					sb.append(nc);
    				}
    			}
    			//System.out.println(sb);
    			if(sb.indexOf("that") != -1 || sb.indexOf("this") != -1)return sb.toString();
    		}
    	}
    	return null;
    }
}

Measured memory_bytes: 22036
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  string s;
  vector<int> c={0,0,0,0};
  vector<string> t={"AC","WA","TLE","RE"};
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>s;
    for(int j=0;j<4;j++){
      if(t[j]==s){
        c[j]++;
      }
    }
  }
  for(int i=0;i<4;i++){
    cout<<t[i]<<" x "<<c[i]<<endl;
  }
}

Measured memory_bytes: 3636