akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
using namespace std;
#define INF 2147483647
#define LINF 9223372036854775807
#define MOD 1000000007
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define repb(i,n) for(int i=n-1;i>=0;i--)
#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define ARDEB(i,X) cout<< #X <<"["<<i<<"]: "<<X[i]<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define ARDEB(i,X) {}
#define END {}
#endif
typedef pair<int,int> P;
//typedef long long int ll;

int ans;

signed main(){

    string s;
    cin>>s;
    int f=0,f2=0;
    if((s[0]-'0')*10+(s[1]-'0')>=0 && (s[2]-'0')*10+(s[3]-'0')>0 && (s[2]-'0')*10+(s[3]-'0')<=12){
        f=1;
    }
    if((s[2]-'0')*10+(s[3]-'0')>=0 && (s[0]-'0')*10+(s[1]-'0')>0 && (s[0]-'0')*10+(s[1]-'0')<=12){
        f2=1;
    }
    if(f && f2)cout<<"AMBIGUOUS"<<endl;
    else if(f) cout<<"YYMM"<<endl;
    else if(f2)cout<<"MMYY"<<endl;
    else cout<<"NA"<<endl;

}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

using namespace std;
typedef long long int ll;
#define MAX_N 1000

int main()
{
	int n;
	cin>>n;
	bool ans = false;
	for(int i = 1; i <= 9; i++){
		for(int j = 1; j <= 9; j++){
			if( n == (i*j)){
				ans = true;
				break;
			}
		}
	}
	if(ans == true){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
	return 0;
}


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

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; }
#define ll long long 
#define INF 999999999
#define rep(i,n) for(int i=0;i<n;i++)
using Graph = vector<vector<int>>;
queue<int> quex,quey;

int main(){
    int a,b=0;    cin >> a ;
    vector<char>v(a);
    rep(i,a) cin>>v.at(i);

    rep(i,a-2){
        if(v.at(i)=='A' && v.at(i+1)=='B' && v.at(i+2)=='C') b++;
    }

    cout << b << endl;
}

Measured memory_bytes: 256
h, w = map(int, input().split())
s = [0] * h
for i in range(h):
    s[i] = list(input())

for i in range(h):
    for j in range(w):
        tmp = 0
        if i >=1 and j >=1:
            if s[i-1][j-1]=='#' : tmp += 1
        if i >= 1:
            if s[i-1][j] =='#': tmp += 1
        if i >= 1 and j <= w-2:
            if s[i-1][j+1] =='#': tmp += 1
        if j >= 1:
            if s[i][j-1] =='#': tmp += 1
        if j <= w-2:
            if s[i][j+1] =='#': tmp +=1
        if i <= h-2 and j>= 1:
            if s[i+1][j-1] =='#': tmp+=1
        if i <= h-2 :
            if s[i+1][j] =='#': tmp+=1
        if i <= h-2 and j<= w-2:
            if s[i+1][j+1] =='#': tmp+=1
    
        if s[i][j] =='.':
            s[i][j] = str(tmp)

for i in range(h):
    print(''.join(s[i]))

Measured memory_bytes: 3188
#include <map>
#include <iostream>
# define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int main() {
    int n, m, k, v; cin >> n >> m;
    map<int, int> counter;

    rep (i, n) {
        cin >> k;
        rep (j, k) {
            cin >> v;
            if (counter.find(v) == counter.end()) {
                counter[v] = 1;
            }
            else { 
                counter[v]++;
            }
        }
    }

    int ans = 0;
    for (auto counter_pair : counter) {
        if (counter_pair.second == n) ans++;
    }
    cout << ans << endl;
    return 0;
}



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

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

    ll ans = 0;
    if(a == b && b == c){
        if(a % 2 == 0){
            cout << -1 << endl;
        }else{
            cout << 0 << endl;
        }
    }else{
        while(1){
            if(a % 2 == 1 || b % 2 == 1 || c % 2 == 1){
                break;
            }

            ll k = 0;
            ll t = 0;
            ll s = 0;
            k = a / 2;
            t = b / 2;
            s = c / 2;
            a = t + s;
            b = k + s;
            c = t + k;
            ans++;
        }

        cout << ans << endl;
    }
}

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

int main() {
	int n,k;
	cin>>n>>k;
	vector<int>v(n);
	for(int i=0;i<n;i++)
	{
	    cin>>v[i];
	}
	vector<int>arr(n,INT_MAX);
	arr[0]=0;
	for(int i=0;i<n;i++)
	{
	    for(int j=i+1;j<=min(n-1,i+k);j++)
	    {
	        arr[j]=min(arr[j],arr[i]+abs(v[i]-v[j]));
	    }
	}
	cout<<arr[n-1]<<endl;
	return 0;
}

Measured memory_bytes: 4028
#include<bits/stdc++.h>
using namespace std;
using ull=unsigned long long;
#define mod 1000000007
#define mod2 998244353 
#define PI 3.14159265
#define ll long long
#define ld long double
#define pi pair<ll,ll>
#define pb push_back
#define vi vector<ll>
#define sz size()
#define setbits(x)  __builtin_popcount(x)
#define fi first
#define se second
#define lz length()
#define all(x) (x).begin(),(x).end()
#define scf(x) scanf("%lld",&x)
#define rep(i,n) for(ll i=0;i<n;i++)
const int INF = (int)1e9;
const ll IINF=1LL<<62;
const int maxn=10000005;

//int divr[maxn];
/**/
/*void divisor()
{for(int i=2;i<sqrt(maxn);i++)
     {
          if(!divr[i])
          {
               for(int j=i*i;j<maxn;j+=i)if(!divr[j])divr[j]=i;     
          }
     }
     for(int i=1;i<maxn;i++)if(!divr[i])divr[i]=i;
}*/
 
/*const int N=1000005;
ll n;
struct line {
    long long m, c;
    long long eval(long long x) { return m * x + c; }
    long double intersectX(line l) { return (long double) (c - l.c) / (l.m - m); }
};
vector<pair<pi,ll>> rect;
deque<line> dq;
*/
/*ll modexpo(ll a,ll b)
{
     ll ans=1LL;
     while(b>0)
     {
          if(b&1)ans=(ans*a)%mod;
          a=(a*a)%mod;
          b>>=1;
     }
     return ans;
}
*/
int main(){
     
     int n;
     cin>>n;
     int a[n];
     for(int i=0;i<n;i++)cin>>a[i];
     unordered_map<int,int> mp;
     int res=0;
     for(int i=0;i<n;i++){
          if(mp.count(a[i]-1)){
               mp[a[i]]=1+mp[a[i]-1];
          }
          else mp[a[i]]=1;
          res=max(res,mp[a[i]]);
     }
     cout<<n-res;
}
 
 
 
 
 

























Measured memory_bytes: 12236
#include <stdio.h>

int N, M;
char A[103][103];

int main() {
    scanf("%d %d", &N, &M); N--, M--;
    for(int i=1; i<=100; i++) for(int j=1; j<=100; j++) A[i][j] = i > 50 ? '#' : '.';
    for(int i=1; i<=50; i+=2) for(int j=1; j<=50; j++) if(M) A[i][i&1?j*2-1:j*2] = '#', M--;
    for(int i=100; i>50; i-=2) for(int j=1; j<=50; j++) if(N) A[i][i&1?j*2-1:j*2] = '.', N--;
    puts("100 100");
    for(int i=1; i<=100; i++) puts(A[i] + 1);
}


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

using ll = long long;
ll modinv(ll a, ll m) {
	assert(m > 0);
	if (m == 1) return 0;
	a %= m;
	if (a < 0) a += m;
	assert(a != 0);
	if (a == 1) return 1;
	return m - modinv(m, a) * m / a;
}

template <int MOD_> struct modnum {
private:
	int v;
public:
	static const int MOD = MOD_;

	modnum() : v(0) {}
	modnum(ll v_) : v(int(v_ % MOD)) { if (v < 0) v += MOD; }
	explicit operator int () const { return v; }
	friend bool operator == (const modnum& a, const modnum& b) { return a.v == b.v; }
	friend bool operator != (const modnum& a, const modnum& b) { return a.v != b.v; }

	modnum operator ~ () const {
		modnum res;
		res.v = modinv(v, MOD);
		return res;
	}

	modnum& operator += (const modnum& o) {
		v += o.v;
		if (v >= MOD) v -= MOD;
		return *this;
	}
	modnum& operator -= (const modnum& o) {
		v -= o.v;
		if (v < 0) v += MOD;
		return *this;
	}
	modnum& operator *= (const modnum& o) {
		v = int(ll(v) * ll(o.v) % MOD);
		return *this;
	}
	modnum& operator /= (const modnum& o) {
		return *this *= (~o);
	}

	friend modnum operator + (const modnum& a, const modnum& b) { return modnum(a) += b; }
	friend modnum operator - (const modnum& a, const modnum& b) { return modnum(a) -= b; }
	friend modnum operator * (const modnum& a, const modnum& b) { return modnum(a) *= b; }
	friend modnum operator / (const modnum& a, const modnum& b) { return modnum(a) /= b; }
};

using num = modnum<998244353>;

vector<num> fact;
vector<num> ifact;

void init(){
	fact = {1};
	for(int i = 1; i < 100000; i++) fact.push_back(i * fact[i-1]);
	for(num x : fact) ifact.push_back(1 / x);	
}

num ncr(int n, int k){
	if(k < 0 || k > n) return 0;
	return fact[n] * ifact[k] * ifact[n-k];
}

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

	int n;
	cin >> n;
	vector<int> P(n);
	vector<int> B(n);
	for(int i = 0; i < n; i++) cin >> P[i] >> B[i];

	int tp = 0;
	for(int p : P) tp += p;

	const int M = 410;

	vector<vector<num> > pows(M, vector<num>(M, 0));
	for(int i = 0; i < M; i++){
		num x = 1;
		for(int a = 0; a < M; a++){
			pows[i][a] = x;
			x *= i;
			x /= tp;
		}
	}

	vector<vector<num> > dp(M, vector<num>(M, 0));
	dp[0][0] = -1;
	for(int i = 0; i < n; i++){
		vector<vector<num> > newdp = dp; // do nothing
		for(int a = 0; a < B[i]; a++){
			for(int x = 0; x <= 400; x++){
				for(int y = 0; y <= 400; y++){
					if(dp[x][y] == 0) continue;
					newdp[x + a][y + P[i]] -= dp[x][y] * pows[P[i]][a] * ifact[a];
				}
			}
		}
		dp = newdp;
	}
	num ans = 0;
	for(int x = 0; x <= 400; x++){
		for(int y = 0; y <= 400; y++){
			if(x == 0 && y == 0) continue;
			if(dp[x][y] == 0) continue;
			ans += dp[x][y] * fact[x] / pows[y][x+1];
		}
	}
	cout << (int) ans << '\n';
}

Measured memory_bytes: 3120
from collections import deque
n,q=map(int,input().split())
T=[[]for i in range(n+1)]
for i in range(n-1):
    a,b=map(int,input().split())
    T[a].append(b)
    T[b].append(a)
tasu=[0]*(n+1)
for i in range(q):
    p,x=map(int,input().split())
    tasu[p]+=x
    
def bfs(a):
    ans=[-1]*(n+1)
    q=deque([a])
    ans[a]=tasu[a]
    while q:
        x=q.popleft()
        moto=ans[x]
        for w in T[x]:
            if ans[w]<0:
                ans[w]=moto+tasu[w]
                q.append(w)
    return ans
kotae = bfs(1)[1:]
print(*kotae, sep=' ')

Measured memory_bytes: 61372
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
using namespace std;
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define print(x) cout<<(x)<<'\n'
#define print_vec(v) rep(i,v.size()){if(i!=0)cout<<" ";cout<<v[i];}cout<<'\n'
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";rep(i,v.size())cout<<" "<<v[i];cout<<'\n'
#define pb push_back
#define mp make_pair
#define MOD 1000000007 //10^9+7
#define fi first
#define sc second
using ll=long long;
using pi=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;
using vstr=vector<string>;
int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
void yes(bool c) { if (c)print("Yes"); else print("No"); };
void YES(bool c) { if (c)print("YES"); else print("NO"); };

void solve() {
    ll N,M; cin >> N >> M;
    
    print(N*M);
}
 
int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
	cout<<fixed<<setprecision(20);
    //int q; cin >> q;
	//while (q--)
		solve();
    return 0;
}

Measured memory_bytes: 3620
import math
def dist(x,y):
    return math.sqrt(sum([(s-t)**2 for s,t in zip(x,y) ]) )

N,D = map(int, input().split() )
x=[]
for i in range(N):
    x.append(list(map(int, input().split() )))
count = 0
for i in range(N):
    xs = x[i+1:N]
    dists = [dist(x[i], y) for y in xs]
    count += sum([s - int(s) == 0 for s in dists ])
print(count)

Measured memory_bytes: 3064
import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		
		while (true) {
			int a = scanner.nextInt();
			char op = scanner.next().charAt(0);
			int b = scanner.nextInt();
			
			if (op == '?') break;
			
			int ans;
			
			switch (op) {
			case '+':
				ans = a + b;
				break;
				
			case '-':
				ans = a - b;
				break;
			case '*':
				ans = a * b;
				break;
			case '/':
				ans = a / b;
				break;
			default:
				ans = 0;
				break;
			}
			
			System.out.println(ans);
		}

	}

}



Measured memory_bytes: 26264
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let n = read::<u32>();
    println!("{}", n.pow(3));
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


Measured memory_bytes: 4352
def main():
    from collections import Counter
    N = int(input())
    *a, = map(int, input().split())

    ctr = Counter(a)
    frm_n = sum(x * (x - 1) // 2 for x in ctr.values())

    ans = []
    for x in a:
        ans.append(frm_n - ctr[x] + 1)

    print(*ans, sep='\n')


if __name__ == '__main__':
    main()

# import sys
# input = sys.stdin.readline
# 
# sys.setrecursionlimit(10 ** 7)
# 
# (int(x)-1 for x in input().split())
# rstrip()
#
# def binary_search(*, ok, ng, func):
#     while abs(ok - ng) > 1:
#         mid = (ok + ng) // 2
#         if func(mid):
#             ok = mid
#         else:
#             ng = mid
#     return ok


Measured memory_bytes: 30004
def comb(n,y):
    for i in range(n+1):
        for j in range(n+1-i):
            if 10000*i+5000*j+1000*(n-i-j)==y:
                return [i,j,n-i-j]
    return [-1,-1,-1]

n,y=map(int,input().split())
print("{} {} {}".format(*comb(n,y)))

Measured memory_bytes: 3064
ps = [[0.0, 0.0], [100.0, 0.0]]

deg = 0
PLUS_DEG = 60
MINUS_DEG = -120

def get_rad(deg)
  deg * (Math::PI / 180)
end

dirs = [0]
points = [1, -1, 1]

gets.to_i.times do
  len = (ps[1][0] - ps[0][0]) / 3
  _ps = [[0, 0]]
  dirs = dirs.inject([]) {|m, dir| m + [dir] + points }
  current_p = [0, 0]
  dirs.each do |dir|
    deg += begin
      case dir
      when 0; 0
      when 1; PLUS_DEG
      when -1; MINUS_DEG
      end
    end
    current_p[0] += len * Math.cos(get_rad(deg))
    current_p[1] += len * Math.sin(get_rad(deg))
    current_p[1] = 0.0 if current_p[1] < 0.00001
    _ps << current_p.clone
  end
  ps = _ps.clone
end

ps.each do |line|
  puts "#{line[0]} #{line[1]}"
end

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

/*
   3???????????°?????????true
   */
    bool has3(int x){
    while(x){
      if ( x % 10 == 3 ) return true;
      x /= 10;
    }
    return false;
    }

void call(int n){
    for ( int x = 1; x <= n; x++ ){
        if ( x % 3 == 0 || has3(x) ){
         cout << " " << x;
        }
    }
    cout << endl;
}

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



        

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define In_The_Name_Of_Allah_The_Merciful ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define Alhamdulillah return 0;
#define all(v) v.begin(),v.end()
#define debug(n) cerr << "[" << #n << " = " << n << "]" << endl 

const int N = 2e5;
vector <int> adj[N];
int n , q;
ll lazy[N];

void dfs (int u = 0 , int p = -1){
    for (int v : adj[u]){
        if (v ^ p){
            lazy[v] += lazy[u];
            dfs(v,u);
        }
    }
}

void Suhaib_Sawalha (){

    cin >> n >> q;
    for (int i = 1 , u , v ; i < n ; ++i){
        cin >> u >> v;
        --u , --v;
        adj[u].push_back(v);
        adj[v].push_back(u);
    }

    for (int i = 0 , u , c; i < q ; ++i){
        cin >> u >> c;
        lazy[u-1] += c;
    }

    dfs();
    for (int i = 0 ; i < n ; ++i)
        cout << lazy[i] << ' ';

}

int main(){
                                In_The_Name_Of_Allah_The_Merciful   /* بسم الله الرحمن الرحيم  */
#ifndef ONLINE_JUDGE
    freopen("SuhaibSawalha1.txt","r",stdin);
#endif
//int _;for(cin>>_;_;--_,cout<<'\n')
        Suhaib_Sawalha();
                                         Alhamdulillah                    /* الحمد لله */
}

Measured memory_bytes: 28532
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  char c;
  cin >> c;
  if ( c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o') {
     cout << "vowel" << endl;
  }

  else {
     cout << "consonant" << endl;
  }
}

Measured memory_bytes: 256
import java.util.*;
import static java.lang.Math.*;
import java.math.BigInteger;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		int k = sc.nextInt();
		double[] sum = new double[n+1];
		for(int i = 0; i < n; i++){
		    int a = sc.nextInt();
		    sum[i+1] = sum[i] + ((double)a + 1)/2;
		}
		
		// 計算
		double result = 0;
		for(int i = 0; i < n-k+1; i++){
		    result = max(result, sum[i+k]-sum[i]);
		}
		
		// 出力
		System.out.println(result);
	}
}



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

#ifndef __TOPCYBERFLOWER
#define debug(...) 0
#else
#define debug(...) cout << " [-] ", _dbg(#__VA_ARGS__, __VA_ARGS__)
template<class TH> void _dbg(const char *sdbg, TH h){ cout << sdbg << '=' << h << endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
    while(*sdbg != ',') cout << *sdbg++;
    cout << '=' << (h) << ','; 
    _dbg(sdbg+1, a...);
}
#endif

#define TYPEMAX(type)   numeric_limits<type>::max()
#define TYPEMIN(type)   numeric_limits<type>::min()
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;

int main(void){
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    ll n,a,b; cin>>n>>a>>b;
    cout<<n/(a+b)*a+min(n%(a+b),a);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {

  int A,B,C,D;
  cin >>A>>B>>C>>D;
  if ((A+B)>(C+D)){
  cout<<"Left"<<endl;
  }
  else if ((A+B)==(C+D)){
  cout<<"Balanced"<<endl;
  }
  else{
  cout<<"Right"<<endl;
  }
    
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scn = new Scanner(System.in);
		int count = Integer.parseInt(scn.next());
		int total = Integer.parseInt(scn.next());
		int nowMoney = 0;
		boolean isSuccess = false;
		int lastNum = 0;
		for (int i = 0; i <= count; i++) {
			for (int j = 0; j <= count; j++) {
				lastNum = count - (i + j);
				nowMoney = i * 10000 + j * 5000 + lastNum * 1000;
				if (isSuccess) {
					break;
				}
				if (nowMoney == total && lastNum >= 0) {
					System.out.println(i + " " + j + " " + lastNum);
					isSuccess = true;
					break;
				}
			}
		}
		if (!isSuccess) {
			System.out.println("-1 -1 -1");
		}

	}

}


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

int main()
{
    string s,t;
    cin>>s>>t;
    t.pop_back();
    //cout<<s<<" "<<t<<endl;
    if(s==t) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;

    return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
const int N = 305;
int n;
double mem[N][N][N];
bool vis[N][N][N];

double dp(int one, int two, int three) {
	if (one == 0 && two == 0 && three == 0) {
		return 0;
	}
	if (mem[one][two][three]) {
		return mem[one][two][three];
	}
	vis[one][two][three] = true;

	int t = one + two + three;

	double ans = (double) n / t;

	if (one) {
		ans += (double) one / t * dp(one - 1, two, three);
	}
	if (two) {
		ans += (double) two / t * dp(one + 1, two - 1, three);
	}
	if (three) {
		ans += (double) three / t * dp(one, two + 1, three - 1);
	}
	
	return mem[one][two][three] = ans;
}

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

	cin >> n;

	int x, cnt[4] = {0, 0, 0, 0};
	for (int i = 0; i < n; i++) {
		cin >> x;
		cnt[x]++;
	}

	cout << setprecision(15) << dp(cnt[1], cnt[2], cnt[3]) << '\n';

	return 0;
}


Measured memory_bytes: 246016
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

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

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

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

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

// x ** n % mods を求める
pub fn mod_pow(x: i64, n: i64, mods: i64) -> i64 {
    if n == 0 {
        return 1;
    }
    let mut res = mod_pow(x * x % mods, n / 2, mods);
    if n % 2 == 1 {
        res = res * x % mods;
    }
    return res;
}

// (1/n) % mods を求める
pub fn mod_inv(n: i64, mods: i64) -> i64 {
    return mod_pow(n, mods-2, mods);
}

// nCk % mods を求める
pub fn mod_comb(n: i64, k: i64, mods: i64) -> i64 {
    let sum1 = (n-k+1..n+1).fold(1, |ac, x| ac * x % mods);
    let sum2 = (1..k+1).fold(1, |ac, x| ac * x % mods);
    return sum1 * mod_inv(sum2, mods) % mods;
}


fn main() {
    input!{
        a: [[i32; 3]; 3],
        n: usize,
        b: [i32; n],
    }
    let mut c: [[i32; 3]; 3] = [[0; 3]; 3];
    for item in b.iter() {
        for i in 0..3 {
            for j in 0..3 {
                if item == &a[i][j] {
                    c[i][j] = 1;
                }
            }
        }
    }
    let mut flag = 0;
    for i in 0..3 {
        if c[i][0] == 1 && c[i][1] == 1 && c[i][2] == 1 {
            flag = 1;
        }
        else if c[0][i] == 1 && c[1][i] == 1 && c[2][i] == 1 {
            flag = 1;
        }
    }
    if c[0][0] == 1 && c[1][1] == 1 && c[2][2] == 1 {
        flag = 1;
    }
    else if c[0][2] == 1 && c[1][1] == 1 && c[2][0] == 1 {
        flag = 1;
    }
    
    if flag == 1 {
        println!("Yes");
    }
    else {
        println!("No");
    }
}


Measured memory_bytes: 4352
#include <stdio.h>
#include <string.h>
#include <vector>
#include <numeric>
#include <algorithm>
#include <functional>
#include <string>
#include <math.h>

using namespace std;


int main() {
  char tab[100];
  scanf("%s", &tab);

  string s(tab);

  scanf("%s", &tab);
  string t(tab);

  printf("%s", (s == t.substr(0, t.size() - 1)) ? "Yes" : "No");

  return 0;
}


Measured memory_bytes: 3324
import sys
import queue

q = queue.Queue()
sys.setrecursionlimit(10**7)
INF = 10**10
MOD = 10**9 + 7
S = []
history = []
N, A, B ,C = map(int,input().split())
d = {}
d['A'] = A
d['B'] = B
d['C'] = C

for n in range(N):
    s = input()
    S.append(s)

def select(L,R,x):
    diff = 1
    if L!=x:
        diff *= -1
    d[L] += diff
    d[R] -= diff
    history.append(x)

for n in range(N):
    L, R = S[n]
    if d[L] >= 2:
        select(L,R,R)
    elif d[L] == 0:
        if d[R] == 0:
            print ('No')
            exit()
        else:
            select(L,R,L)
    elif d[L] == 1:
        if d[R] >= 2:
            select(L,R,L)
        elif d[R] == 0:
            select(L,R,R)
        elif d[R] == 1:
            if n!=N-1:
                if L in S[n+1]:
                    select(L,R,L)
                else:
                    select(L,R,R)
            else:
                select(L,R,L) # どちらでもOK
print ('Yes')
for h in history:
    print (h)

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

int main(void){
    int n;
    int max;
    string str;
    scanf("%d", &n);
    //vector<string> vec(n);
    map<string, int> pp;
    
    for(int i = 0; i < n; i++){
        cin >> str;
        if(pp.count(str)){
            pp.at(str)++;
        }else{
            pp[str] = 1;
        }
    }
    
    max = 0;
    for (auto p : pp) {
        auto key = p.first;
        auto value = p.second;
        if(value >= max){
            max = value;
        }
    }
    
    for (auto p : pp) {
        auto key = p.first;
        auto value = p.second;
        if(value == max){
            cout << key << endl;
        }
    }
    
    return 0;
}

Measured memory_bytes: 25216
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<ctype.h>
 
int main(){
	char a[1000];
	char b[100];
	char c[100];

scanf("%s%s%s",a,b,c);



printf("%c%c%c\n",toupper(a[0]),toupper(b[0]),toupper(c[0]));
	



return 0;
}

Measured memory_bytes: 128
s = input()

def dfs(i, f, sum):
    if i == 3:
        if sum == 7:
            # 答えは1つ出力すれば良いので =7 になれば終了
            print(f + "=7")
            exit()

    else:
        # 式 f の末尾に符号と次の数字を追加し、その分 sum に加減する
        dfs(i + 1, f + "-" + s[i + 1], sum - int(s[i + 1]))
        dfs(i + 1, f + "+" + s[i + 1], sum + int(s[i + 1]))

dfs(0, s[0], int(s[0]))

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        char[] c = s.toCharArray();

        int countA = 0;
        int countB = 0;

        for (char ch : c) {
            if (ch == 'A') {
                countA++;
            } else {
                countB++;
            }
        }

        if(countA!=0 && countB!=0){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 23380
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define pll pair<ll,ll>
#define pii pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define For(i,a,b) for(int i=a;i<b;i++)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define mp make_pair
#define bit(n) (1LL<<(n))
#define F first
#define S second
#define debug(x) cerr << x << endl
#define Complex complex<double>
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const ll INF = 1LL<<60;
const ll mod = (int)1e9 + 7;

/*
テストケース全てに目を通す
テストケースが2個以下だったらなんかある
N最小のコーナーケースがないか調べる
制約をしっかりと確認する（1からNまでの順列、全て異なる値などの制約も含め）
制約のn*mとn,mを読み違えない
操作の逆順を考える
オーバーフローしないか確かめる
Codeforcesではscanfを使う
modの引き算には+modをする
エラー出力は消す
エラー出力を消せ！！！！！
数値の区切り位置を誤読しない
木はn-1ノード
関数単位で調べる
cout << fixed;
cout << setprecision(n) << ans;
 */

int main() {
    int h,w;
    cin >> h >> w;
    int s[h][w];
    rep(i,h){
        rep(j,w){
            char c;
            cin >> c;
            if(c=='#')s[i][j]=1;
            else s[i][j]=0;
        }
    }
    int mi[h][w]={};
    mi[0][0]=s[0][0];
    rep(i,h+w-1){
        if(!i)continue;
        rep(j,i+1){
            int nowh=j;
            int noww=i-j;
            if(nowh<0 || h<=nowh || noww<0 || w<=noww)continue;
            else{
                if(nowh==0)mi[nowh][noww]=mi[nowh][noww-1]+(bool)(s[nowh][noww-1]==0 && s[nowh][noww]==1);
                else if(noww==0)mi[nowh][noww]=mi[nowh-1][noww]+(bool)(s[nowh-1][noww]==0 && s[nowh][noww]==1);
                else mi[nowh][noww]=min(mi[nowh][noww-1]+(bool)(s[nowh][noww-1]==0 && s[nowh][noww]==1),mi[nowh-1][noww]+(bool)(s[nowh-1][noww]==0 && s[nowh][noww]==1));
            }
        }
    }
    cout << mi[h-1][w-1];
}

/*
推すしかない
*/



Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=0;(i)<(n);i++)
#define INF 1001001001
#define LLINF 1001001001001001001
#define MOD 1000000007
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; }
#define ALL(v) v.begin(), v.end()
typedef long long ll;



int main(){

string s,t,u;
cin >> s >> t;
ll a,b;
cin >> a >> b;
cin >> u;


if(u==s)cout << a-1 << ' ' << b << endl;
else cout << a << " " <<b-1 <<  endl;

return 0;
}





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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int vector_finder(std::vector<ll> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

int main() {
  ll A; string B; cin >> A >> B;
  ll D = (B[0] - '0') * 100 + (B[2] - '0') * 10 + (B[3] - '0');
  ll tmp = A * D;
  cout << tmp / 100 << endl;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define override_rep(i, l, r, mes, ...) mes
#define rep1(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = l; i < r; i++)
#define rep(...) override_rep(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)
using P = pair<int, int>;
template<typename T, typename U>
istream& operator>>(istream& in, pair<T, U>& p) {
    in >> p.first >> p.second;
    return in;
}

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

signed main(signed argc, char* argv[]) {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    const int MOD = 1e9+7;
    int n,k;
    cin>>n>>k;
    int g;
    cin>>g;
    bool b=k<=g;
    rep(i,n-1){
        int in;
        cin>>in;
        g=gcd(g,in);
        if(k<=in)b=true;
    }
    if(k%g==0&&b)cout<<"POSSIBLE"<<endl;
    else cout<<"IMPOSSIBLE"<<endl;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
 
int main()
{
    // get a integer
    int N;
    cin >> N;
    int arr[2][N];
    for (int i = 0; i < 2; i++) {
       for (int j = 0; j < N; j++) {
            cin >> arr[i][j];
       }
    }
    
    int max = -1;
    int sum = 0;
    for (int j = 0; j < N; j++) {
        sum = 0;
        for (int p = 0; p <= j; p++) {
            sum += arr[0][p]; 
        }
        for (int q = j; q < N; q++) {
            sum += arr[1][q];
        }
        if (sum > max) max = sum;
    }
    cout << max;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>


int main(){

  int x, y, s, max;
  int i, j;

  while(scanf("%d %d %d", &x, &y, &s),x){
    max=0;
    for(i=1;i<s;i++){
      for(j=1;j<s;j++){
	if(i*(100+x)/100+j*(100+x)/100==s){
	  if(i*(100+y)/100+j*(100+y)/100>max) max=i*(100+y)/100+j*(100+y)/100;
	}
      }
    }
    printf("%d\n", max);
  }


  return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

int main() {
    int n, t;
    cin >> n >> t;
    vector<int> a(n);
    rep(i, n) cin >> a[i];

    vector<int> mn(n), mx(n);
    mn[0] = a[0];
    mx[n - 1] = a[n - 1];
    for(int i = 1; i < n; i++){
        mn[i] = min(mn[i - 1], a[i]);
        mx[n - 1 - i] = max(mx[n - i], a[n - 1 - i]);
    }

    int bene = 0;
    rep(i, n - 1)if(bene < mx[i + 1] - mn[i])bene = mx[i + 1] - mn[i];

    set<P> s;
    rep(i, n - 1){
        if(bene == mx[i + 1] - mn[i]){
            s.insert(make_pair(mx[i + 1], mn[i]));
        }
    }

    cout << s.size() << endl;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

int cnth[300010], cntw[300010];
int a[300010], b[300010];
pii p[300010];

bool cmp(int &x, int &y) {
    return cnth[x]>cnth[y];
}

bool cmp2(int &x, int &y) {
    return cntw[x]>cntw[y];
}

int main() {
    ios_base::sync_with_stdio(0);
    int n, m, t; cin >> n >> m >> t;
    for (int i=0;i<t;i++) {
        cin >> p[i].fi >> p[i].se;
        cnth[p[i].fi]++; cntw[p[i].se]++;
    }
    sort(p, p+t);

    for (int i=1;i<=n;i++) a[i] = i;
    for (int i=1;i<=m;i++) b[i] = i;
    sort(a+1, a+n+1, cmp);
    sort(b+1, b+m+1, cmp2);

    int s = 1, w = 1;
    while (s<=n&&cnth[a[s]]==cnth[a[1]]) s++;
    while (w<=m&&cntw[b[w]]==cntw[b[1]]) w++;

    int ans = 0;
    for (int i=1;i<s;i++) for (int j=1;j<w;j++) {
        int g = binary_search(p, p+t, make_pair(a[i], b[j]));
        ans = max(ans, cnth[a[i]]+cntw[b[j]]-g);
        if (!g) break;
    }
    cout << ans << endl;
}


Measured memory_bytes: 10636
#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int n;
	long long k;
	cin >> n >> k;
	vector<long long> a(n + 1), p(n + 1);
	a[0] = 1;
	p[0] = 1;
	for (int i = 1; i <= n; i++) {
		a[i] = a[i - 1] * 2 + 3;
		p[i] = p[i - 1] * 2 + 1;
	}
	
	long long ans = 0;
	for (int i = n; i >= 0; i--) {
		if (i == 0) {
			ans += 1;
			break;
		}

		if (k == 1) {
			break;
		}
		else if (k <= a[i - 1] + 1) {
			k--;
		}
		else if (k == a[i - 1] + 2) {
			ans += p[i - 1] + 1;
			break;
		}
		else if (k <= 2 * a[i - 1] + 2) {
			ans += p[i - 1] + 1;
			k -= a[i - 1] + 2;
		}
		else {
			ans += p[i];
			break;
		}
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define rg register
#define ll long long
#define db double
#define N 100005
using namespace std;
int a,b,c,sum;
int main()
{
	scanf("%d%d%d",&a,&b,&c);
	for(rg int i=100;i>=1;i--)
	{
		if(a%i==0&&b%i==0) sum++;
		if(sum==c&&a%i==0&&b%i==0){
			printf("%d",i);
			return 0;
		}
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
using namespace std;
int n;
int in[26],out[26];
bool d[26][26];
bool used[26];
void f(int u)
{
	used[u]=1;
	for(int i=0;i<26;i++)
	{
		if(!d[u][i])continue;
		if(used[i])continue;
		f(i);
	}
}
main()
{
	while(cin>>n,n)
	{
	    for(int i=0;i<26;i++)
	    {
	        in[i]=out[i]=0;
	        used[i]=1;
	        for(int j=0;j<26;j++)d[i][j]=0;
	    }
	    int st;
	    for(int i=0;i<n;i++)
		{
		    string s;cin>>s;
		    int a=s[0]-'a',b=s[s.size()-1]-'a';
		    if(i==0)st=a;
		    in[a]++;
		    out[b]++;
		    d[a][b]=d[b][a]=1;
		    used[a]=used[b]=0;
		}
		f(st);
		bool ok=1;
		for(int i=0;i<26;i++)ok&=in[i]==out[i]&&used[i];
		cout<<(ok?"OK":"NG")<<endl;
	}
}



Measured memory_bytes: 3136
n = list(map(int, input().split(' ')))

c = [0 for _ in range(10)]

for num in n:
  c[num] += 1

flg = [1,7,9,4]
result = True

for i, count in enumerate(c):
  if i in flg:
    if count != 1:
      result = False

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

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define ll long long
using namespace std;
void put(int x){
	if(x<0) {
		putchar('-');
		x*=-1;
	}
	if(x==0) {
		putchar('0');
	}
	int num=0;
	char c[15];
	while(x) {
		c[++num]=(x%10)+48;
		x/=10;
	}
	while(num) {
		putchar(c[num--]);
	}
	putchar('\n');
}
inline void in(int &x){
	char ch=getchar();
	int flag=1;
	while(!(ch>='0'&&ch<='9')) {
		if(ch=='-')
			flag*=-1;
		ch=getchar();
	}
	x=ch-'0';
	ch=getchar();
	while(ch>='0'&&ch<='9') {
		x=((x<<3)+(x<<1))+ch-'0';
		ch=getchar();
	}
	x*=flag;
}
int a,b,c; 
int main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	in(a);in(b);in(c);
	printf("%d\n",(a-c)/(b+c));
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[1000];
main()
{
    int n,m;
    cin>>n;
    for(int i=0;i<2*n;i++)
    {
        cin>>a[i];
    }

    sort(a,a+2*n);
    int ans=0;
    for(int i=0;i<2*n;i+=2)
    {
        ans+=a[i];
    }

    cout<<ans;
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
int main()
{
	long long n, m;
	scanf("%lld%lld", &n, &m);
	if(m % 2)
	{
		long long lim = n / m;
		printf("%lld\n", lim * lim * lim);
	}
	else
	{
		long long lim = n / (m / 2);
		long long odd = lim / 2, even = lim - odd;
		printf("%lld\n", even * even * even + odd * odd * odd);
	}

}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		ArrayList<Integer> num = new ArrayList<Integer>();
		ArrayList<String> param = new ArrayList<String>();
		int system = 2; // 文字の空白区切り 0:ON 1:OFF 2:(※数字の場合)

		while (sc.hasNext()) {

			if (system == 0)
				param.add(sc.next());
			if (system == 1)
				param.add(sc.nextLine());
			if (system == 2)
				num.add(sc.nextInt());
		}
		//param.remove(0); //不要な文字削除用
		//num.remove(0);
		Method(num, param);
	}

	static void Method(ArrayList<Integer> num, ArrayList<String> param) {
		System.out.println(num.get(0) + (num.get(1) / 2));
	}
}

Measured memory_bytes: 21460
#include<bits/stdc++.h>
//#pragma GCC optimize("O3")
//#pragma GCC target ("sse4")
using namespace std;
#define PB push_back
#define all(x) (x).begin(),(x).end()
#define MEM(x,a) memset((x),a,sizeof((x)))
#define F first
#define S second
#define imx INT_MAX
#define inI(x) scanf("%d",&x)
#define inI2(x,y) scanf("%d %d",&x,&y)
#define inI3(x,y,z) scanf("%d %d %d",&x,&y,&z)
const long long MOD = (long long)(1e9+7);
const long long MMX = (long long)(1e18);
typedef long long LL;
long long n,w,val[105],ww[105],k=MMX,dp[105][1000],ans=0;
int main()
{
    for(int i=0;i<105;i++)for(int j=0;j<1000;j++)dp[i][j]=-1;
    dp[0][0]=0;
    scanf("%lld %lld",&n,&w);
    for(int i=1;i<=n;i++)
    {
        scanf("%lld %lld",&ww[i],&val[i]);
        k=min(k,ww[i]);
    }
    for(int i=1;i<=n;i++)ww[i]-=k;
    for(int t=1;t<=n;t++)
    {
        for(int i=100;i>=0;i--)
        {
            for(int j=1000;j>=0;j--)
            {
                if(dp[i][j]!=-1)
                {
                    dp[i+1][j+ww[t]]=max(dp[i+1][j+ww[t]],dp[i][j]+val[t]);
                }
            }
        }
    }
    for(int i=0;i<105;i++)for(int j=0;j<1000;j++)if(((i*k)+j)<=w)ans=max(ans,dp[i][j]);
    printf("%lld",ans);
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <vector>
#include <utility>
#include <unordered_map>
typedef long long ll;
using namespace std;
const int mod=1e9+7;


string solve(){
    string s;
    cin>>s;
    return (s=="ARC")?"ABC":"ARC";
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
#endif
    int t=1;
    //cin>>t;
    while(t--) cout<<solve()<<'\n';
    //while(t--) solve(),cout<<'\n';
    return 0;
}


Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;  
#define rep(i, a, b) for(ll i = a; i < b; i++)
#define Rep(i, a, b) for(ll i = a; i <= b; i++)
#define repr(i, a, b) for(ll i = b-1; i >= a; i--)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
using ll = long long;
#define ALL(v) (v).begin(),(v).end()
#define endl "\n"
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define co(x) cout << x << endl
#define coel cout << endl
#define pb push_back
#define sz(v) ((ll)(v).size())
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
// const ll INF = 1LL << 60;
const ll INF = 100000000000;
#define pp pair<ll, pair<ll, ll>> 
// #define fi first
// #define se second
 
/*--------------------------------------------------------------------------------

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

bool IsPrime(int n){
    if (n<2) return false;
    else if (n==2) return true;
    else if (n%2==0) return false;
    double q=sqrt(n);
    for(int i=3;i<q+1;i+=2){
        if(n%i==0){
            return false;
        }
    }
    return true;
}

int main(){
    // 1~55555 で 5の倍数+1 の素数を列挙
    Vl sosu;
    for(ll i = 1; i <= 55555; i += 5){
        if(IsPrime(i)) sosu.push_back(i);
    }
    ll n; cin >> n;
    rep(i, 0, n) cout << sosu[i] << " \n"[i==n-1];

    return 0;
}


Measured memory_bytes: 3640
#include <stdio.h>
#include <math.h>
#define INFINITY 1000000001
int count=0;

void merge(int* A,int left,int mid,int right);
void mergeSort(int* A,int left,int right);


int main(){
int n,i,A[500000];
    
    scanf("%d",&n);
  
  for(i = 0; i < n; i++){
    scanf("%d",&A[i]);
  }

  mergeSort(A,0,n);
  
  for(i = 0; i < n-1; i++){
    printf("%d",A[i]);
    printf(" ");
  }
  printf("%d",A[i]);
  printf("\n");
  printf("%d\n",count);
  return 0;
}

void merge(int* A,int left,int mid,int right){
  int n1,n2,L[300000],R[300000],i,j,k;
  n1 = mid - left;
  n2 = right - mid;
  
  for(i = 0; i <= n1-1;i++){
    L[i] = A[left + i];
  }
  
  for(i = 0; i <= n2-1;i++){
    R[i] = A[mid + i];
  }
  L[n1] = INFINITY;
  R[n2] = INFINITY;

  i = 0;
  j = 0;

  for(k = left; k <= right-1; k++){
    if(L[i] <= R[j]){
      A[k] = L[i];
      i = i + 1;
    }
    else{
      A[k] = R[j];
      j = j + 1;
	}
count++;
}

}

void mergeSort(int* A,int left, int right){
int mid;
if(left + 1 < right){
mid = (left + right) / 2;

mergeSort(A,left,mid);

mergeSort(A,mid,right);

merge(A,left,mid,right);

}
}

Measured memory_bytes: 4524
#include <cstdio>
#include <cstdlib>
#include <string>
#include <iostream>
using namespace std;

struct Node{
	int key;
	Node*left,*right,*parent;
};

Node *root, *NIL;

void insert(int k){
	Node *y=NIL;
	Node *x=root;
	Node *z;
	
	z=(Node*)malloc(sizeof(Node));
	z->key=k;
	z->left=NIL;
	z->right=NIL;

	while(x!=NIL){
		y=x;
		if(z->key<x->key)
			x=x->left;
		else 
			x=x->right;
	}
	z->parent=y;
	if(y==NIL)
		root=z;
	else{
		if(z->key<y->key)
			y->left=z;
		else
			y->right=z;
	}
}


void inorder(Node *u){
	if(u==NIL) return;
	inorder(u->left);
	printf(" %d", u->key);
	inorder(u->right);
}

void preorder(Node*u){
	if(u==NIL) return;
	printf(" %d",u->key);
	preorder(u->left);
	preorder(u->right);
}


int main(){
	//freopen("data.in","r",stdin);
	int n;
	string com;
	int x;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		cin>>com;
		if(com=="insert"){
			scanf("%d",&x);
			insert(x);
		}else if(com=="print"){
			inorder(root);
			printf("\n");
			preorder(root);
			printf("\n");
		}
	}
	return 0;
}

Measured memory_bytes: 26740
#include <cstdio>
#include <cctype>
#include <utility>
using namespace std;

#define gcu getchar_unlocked
#define pcu putchar_unlocked
#define _T template <typename T>
#define _HT template <typename H, typename... T>
#define _il inline
#define _in _il int in
#define _sc _il bool scan
_T T in(int c){T n=0;bool m=false;while(isspace(c)){c=gcu();}if(c=='-')m=true,c=gcu();
	do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m?-n:n;}
_in() {return in<int>(gcu());}
_T T scan(T &n){int c=gcu();return c==EOF?false:(n=in<T>(c),true);}
_sc(char &c){c=gcu();gcu();return c!=EOF;}
#ifdef _GLIBCXX_STRING
_sc(string &s){int c;s="";
	for(;;){c=gcu();if(c=='\n'||c==' ')return true;else if(c==EOF)return false;s+=c;}}
#endif
_HT _sc(H &h, T&&... t){return scan(h)&&scan(t...);}
#define _vo _il void out
#define _vl _il void outl
_vo(bool b) {pcu('0'+b);}
_vo(const char *s){while(*s)pcu(*s++);}
_vo(char c){pcu(c);}
#ifdef _GLIBCXX_STRING
_vo(string s){for(char c:s)pcu(c);}
#endif
_T _vo(T n){static char buf[20];char *p=buf;
	if(n<0)pcu('-'),n*=-1;if(!n)*p++='0';else while(n)*p++=n%10+'0',n/=10;
	while (p!=buf)pcu(*--p);}
_vl(){out('\n');}
#ifdef _GLIBCXX_VECTOR
_T _vo(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);outl();}
#endif
_HT _vo(H&& h, T&&... t){out(h);out(move(t)...);}
template <typename... T> _vl(T&&... t){out(move(t)...);outl();}

int main() {
	for (int n = in(); n; n--) {
		int k = in(), p = in();
		outl(k % p ? k % p : p);
	}
}


Measured memory_bytes: 2624
#include <bits/stdc++.h>
#include <iomanip>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef int64_t Int;
const double pi = M_PI;

int main()
{
    int n, b, f, r, v;
    cin >> n;
    int rooms[4][3][10] = {};

    for (Int i = 0; i < n; i++)
    {
        cin >> b >> f >> r >> v;
        rooms[b - 1][f - 1][r - 1] += v;
    }

    for (int i = 0; i < 4; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            for (int k = 0; k < 10; k++)
            {
                cout << ' ' << rooms[i][j][k];
            }
            cout << endl;

            if (j == 2 && i != 3)
            {
                cout << "####################" << endl;
            }
        }
    }
}



Measured memory_bytes: 3092
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};

mod util {
    use std::io::stdin;
    use std::str::FromStr;
    use std::fmt::Debug;

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

    #[allow(dead_code)]
    pub fn get<T: FromStr>() -> T
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().parse().unwrap()
    }

    #[allow(dead_code)]
    pub fn gets<T: FromStr>() -> Vec<T>
    where
        <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }

    #[allow(dead_code)]
    pub fn get2<T: FromStr, U: FromStr>() -> (T, U)
    where
        <T as FromStr>::Err: Debug,
        <U as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    }

    #[allow(dead_code)]
    pub fn get3<S: FromStr, T: FromStr, U: FromStr>() -> (S, T, U)
    where
        <S as FromStr>::Err: Debug,
        <T as FromStr>::Err: Debug,
        <U as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        )
    }
}

#[allow(unused_macros)]
macro_rules! debug {
        ($x: expr) => {
            println!("{}: {:?}", stringify!($x), $x)
        }
    }

fn main() {
    let n: usize = util::get();
    let mut a: Vec<i64> = util::gets();

    let total = a.iter().sum::<i64>();
    let add = (1..n + 1).sum::<usize>() as i64;

    if total % add != 0 {
        println!("NO");
        return;
    }

    let m = total / add;

    let a0 = a[0];
    a.push(a0);
    if a.windows(2).all(|v| {
        let sub = v[1] - v[0];
        m >= sub && (m - sub) % n as i64 == 0
    })
    {
        println!("YES");
    } else {
        println!("NO");
    }
}


Measured memory_bytes: 6396
#include<stdio.h>
#include<math.h>
   
int main() {
  int a, b, ans;
     
  while (scanf("%d %d", &a, &b) != EOF) {
    ans = (int)log10(a + b) + 1;
    printf("%d\n", ans);
  };
  return 0;
}

Measured memory_bytes: 644