akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define pf push_front
#define all(t) t.begin(), t.end()
#define inrange(i, a, b) (((i)>= min((a), (b))) && ((i) <= max((a), (b))))
typedef vector<ll> vi;
#define fi first
#define se second
#define show(x) cout << #x << " is " << x << "\n";
const ll inf = 9e18;
const ll mod = 1e9 + 7;
const ld pi = 3.141592653589793238462643383279502884;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

void print(ll a[], ll n){for(ll i=0;i<n;i++){cout<<a[i]<<" ";}cout<<"\n";}
ll power(ll x, ll y, ll M = inf){
	if(y<=0) return 1;
    ll ans = 1;
    x %= M;
    while(y){
        if(y&1)
            ans = (x * ans) % M;

        x = (x * x) % M;
        y >>= 1;
    }
    return ans;
}
ll modInverse(ll n) {return power(n, mod-2, mod);}
inline ll mul(ll a, ll b){ return (a * b) % mod; }
inline ll sub(ll a, ll b){ ll c = a - b; if(c < 0) c += mod; return c; }
inline ll add(ll a, ll b){ ll c = a + b; if(c > mod) c -= mod; return c; }
inline ll divi(ll a, ll b){ return mul(a, modInverse(b)); }

//------------------------------------------------------------------------------------------

//const ll N = 1e5 + 1;
//vector<ll> adj[N];
//bool visited[N];
ll mp[1000001];
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    cout<<fixed<<setprecision(10);


	ll n;
	cin>>n;
	ll a[n];
	map<ll, ll> mp1;
	for(int i=0;i<n;i++){
		cin>>a[i];
		mp[a[i]]++;
		mp1[a[i]]++;
	}
	//sort(a, a+n);
	//map<ll, ll> mp;
	ll ans=0;
	for(int i=1;i<=1000000;i++){
		if(mp[i]>=1){
			for(int j=2*i;j<=1000000;j+=i){
				mp[j]++;
			}
		}
		if(mp[i]==1 && mp1[i]==1) ans++;
	}
	cout<<ans;
    return 0;
}


Measured memory_bytes: 31344
N = int(input())                                  
S  = list(map(int, input().split()))                 

ans = 0
p = 0
                                                   
while True:
    for i in range(N):
        if S[i] % 2 == 0:
            S[i] = S[i] / 2
        else:
            p += 1
            break
    if p != 0:
        break

    ans += 1                                     
                                                                                                                                                             
print(ans)


Measured memory_bytes: 2940
#include <iostream>
#include <cstdio>
#include <string>
#include <queue>
#include <stack>
#include <list>
#include <algorithm>
#include <vector>
#define REP(i,n) for(long long int i=0;i<n;i++)
#define P 1000000007
using namespace std;

long long int powmp(long long x,long long n){
	const long long p = 1000000007;
	if(n==0) return 1;
	long long y = x%p;
	if(n==1) return y;
	long long tmp = (powmp(y,n/2))%p;
	if(n%2==0) return (tmp*tmp)%p;
	else return (powmp(y,n-1)*y)%p;
}

int main(long long int argc, char const *argv[])
{
	long long int w,h;
	priority_queue<long long int, vector<long long int>, greater<long long int> > pqw;
	priority_queue<long long int, vector<long long int>, greater<long long int> > pqh;
	long long int cw=0;
	long long int ch=0;
	long long int ans = 0;
	cin >> w >> h;
	REP(i,w){
		long long int t;
		cin >> t;
		pqw.push(t);
	}
	REP(i,h){
		long long int t;
		cin >> t;
		pqh.push(t);
	}
	REP(i,w+h){
		if(pqh.empty()){
			long long int t = pqw.top();
			pqw.pop();
			ans += t*(h+1-ch);
			cw++;
		}
		else if(pqw.empty()){
			long long int t = pqh.top();
			pqh.pop();
			ans += t*(w+1-cw);
			ch++;
		}
		else if(pqw.top()<pqh.top()){
			long long int t = pqw.top();
			pqw.pop();
			ans += t*(h+1-ch);
			cw++;
		}
		else if(pqw.top()>pqh.top()){
			long long int t = pqh.top();
			pqh.pop();
			ans += t*(w+1-cw);
			ch++;
		}
		else{
			long long int t = pqw.top();
			pqw.pop();
			ans += t*(h+1-ch);
			cw++;
		}
	}
	cout << ans << "\n";
	return 0;
}	

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

int main(){
    int n, m;
    scanf("%d %d", &n, &m);
    vector<int> adjlist[n+1];
    vector<int> fnodes;
    for(int i = 0; i < m; i++){
        int a, b;
        scanf("%d %d", &a, &b);
        adjlist[a].push_back(b);
        if(adjlist[a].size() == 4){
            fnodes.push_back(a);
        }
        adjlist[b].push_back(a);
        if(adjlist[b].size() == 4){
            fnodes.push_back(b);
        }
    }
    int fours = 0;
    for(int i = 0; i < n; i++){
        if(adjlist[i].size() % 2 == 1){
            printf("No");
            return 0;
        }
        if(adjlist[i].size() == 4){
            fours++;
        }
        if(adjlist[i].size() > 4){
            fours = 3;
        }
    }
    if(fours < 2){
        printf("No");
        return 0;
    }
    if(fours > 2){
        printf("Yes");
        return 0;
    }
    for(int i = 0; i < 3; i++){
        int from = fnodes[0];
        int ath = adjlist[fnodes[0]][i];
        while(true){
            if(ath == fnodes[1]){
                break;
            }
            if(ath == fnodes[0]){
                printf("Yes");
                return 0;
            }
            if(adjlist[ath][0] == from){
                from = ath;
                ath = adjlist[ath][1];
            }else{
                from = ath;
                ath = adjlist[ath][0];
            }
        }
    }
    printf("No");
}


Measured memory_bytes: 5760
//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

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

	string s, t;
	cin >> s >> t;
	sort(all(s));
	sort(all(t), greater<char>());
	if (s < t)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
 
typedef long long int lli;
 
int main(void) {
    lli n,m;
    scanf("%lld%lld",&n,&m);
 
    lli b=-1,e=100000000000000ULL;
 
    while(e-b>1) {
        lli mi = (b+e)/2;
        lli t = mi-n;
        if(m-2*mi>=0 && (mi-n) <= (m-2*mi)/2 )
            b = mi;
        else
            e = mi;
    }
    printf("%lld\n", b);
 
    return 0;
}

Measured memory_bytes: 384
#include <stdio.h>
int main(void)
{
    int n, i, x, j;
    char S, H, C, D;
    //持っている枚数を聞く
    scanf("%d", &n);
    //表を作って0を入れる
    int a[4][13] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    //カードの種類が何かn回聞く
    for (i = 1; i <= n; i++)
    {
        scanf(" %c %d", &S, &x);
        //表を使って持っているカード1とおく
        if (S == 'S')
        {
            a[0][x - 1] = 1;
        }
        if (S == 'H')
        {
            a[1][x - 1] = 1; /* code */
        }
        if (S == 'C')
        {
            a[2][x - 1] = 1;
        }
        if (S == 'D')
        {
            a[3][x - 1] = 1; /* code */
        }
    }

    //持っていないカードをS,H,C,D、の順、ランクの小さい順に書き出す
    for (j = 0; j < 4; j++)
    {
        for (i = 0; i <= 12; i++)

        {
            if (a[j][i] == 0)
            {
                if (j == 0)
                {
                    printf("S %d\n", i + 1);
                }
                if (j == 1)
                {
                    printf("H %d\n", i + 1);
                }
                if (j == 2)
                {
                    printf("C %d\n", i + 1); /* code */
                }
                if (j == 3)
                {
                    printf("D %d\n", i + 1);
                } /* code */
            }
        }
    }
    return 0;
}



Measured memory_bytes: 2760
#include <bits/stdc++.h>
// Hey! 僕の提出を見てくれてありがとう.
// ロボ子さん可愛いぞ！！！！！君もV沼にはまろう↓
// https://www.youtube.com/channel/UCDqI2jOz0weumE8s7paEk6g
using namespace std;
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define pri_queue priority_queue //優先度付きキュー
#define syo(x) fixed << setprecision(x) //iostreamで小数をx桁表示
//sortを降順にする時は greater<型>()
const long long MOD = 1000000007;
ll souwa(ll s, ll e){
  ll a = (s*(s+1));
  ll b = (e*(e+1));
  return (b/2 - a/2);
}
void solve(long long N, long long K){
  ll ans = 0;
  for (int i = K; i <= N+1; i++) {
    ans = ans%MOD + (souwa(N-i,N) - souwa(0,i-1) + 1)%MOD;
  }
  cout << ans << endl;
}

int main(){
    long long N;
	scanf("%lld",&N);
	long long K;
	scanf("%lld",&K);
    solve(N, K);
}


Measured memory_bytes: 3712
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;

typedef long long LL;

const int N = 105;
const int MOD = 1000000007;

int n,f[N][N],h[N],w[N],m;

int ksm(int x,int y) {
    if(y < 0)return 1;
    int ans = 1;
    while(y) {
        if(y & 1)ans = (LL)ans * x % MOD;
        x = (LL)x * x % MOD;
        y /= 2;
    }
    return ans;
}

int main() {
    scanf("%d",&n);
    for(int i = 1;i <= n;i ++) {
        scanf("%d",&h[i]);
        w[++ m] = h[i];
    }
    sort(w + 1,w + m + 1);
    m = unique(w + 1,w + m + 1) - w - 1;
    for(int i = 1;i <= n;i ++) {
        h[i] = lower_bound(w + 1,w + m + 1,h[i]) - w;
    }
    f[0][0]=1;
    for(int i = 1;i <= n;i ++) {
        for(int j = h[i] + 1;j <= h[i-1];j ++)
            (f[i][0] += f[i - 1][j] * 2 % MOD) %= MOD;
        (f[i][0] += f[i - 1][0] * 2 % MOD) %= MOD;
        for(int j = 1;j <= h[i];j ++) {
            f[i][j]=(LL)f[i - 1][j] * ksm(2,w[h[i]] - w[h[i-1]]) % MOD;
            if(h[i - 1] >= j)continue;
            if(j > 1)(f[i][j] += (LL)f[i - 1][0] * (ksm(2,w[j] - w[j - 1]) - 1) % MOD * 2 % MOD * ksm(2,w[h[i]] - w[j]) % MOD) %= MOD;
            else (f[i][j] += (LL)f[i - 1][0] * (ksm(2,w[j]) - 2) % MOD * ksm(2,w[h[i]] - w[j]) % MOD) %= MOD;
        }
    }
    int ans = 0;
    for(int i = 0;i <= m;i++)
        (ans += f[n][i]) %= MOD;
    printf("%d",ans);
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>//pair
#include<cmath>//abs,sqrt
#include<cstring>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) cout<<arg<<"\n"
#define prin2(arg1,arg2) cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
const int INF=1e+9;
const ll INFLL=1e+17;
int main(){
  int n;cin>>n;
  ll a[200010];
  rep(i,n) cin>>a[i];
  rep(i,n) a[i]=a[i]-i-1;
  sort(a,a+n);
  ll b=a[(n-1)/2];
  ll res=0;
  rep(i,n){
    res+=abs(a[i]-b);
  }
  prin(res);

  
  

  

  return 0;
}


Measured memory_bytes: 1792
MOD=10**9+7
cnt=0; sum=0; prev=nil; can=true; h=Hash.new(0)
def gs() gets.chomp end
def gi() gets.chomp.to_i end
def gsmi() gets.chomp.split.map(&:to_i) end

def desc(ar) ar.sort!{|x,y| y<=>x} end
def min(a,b) a<=b ? a : b end
def max(a,b) a>=b ? a : b end
def sum(ar) ar.inject(:+) end

def C(a,b) b==0||a==b ? 1 : (b=a-b if a/2<b;(a-b+1..a).inject(:*)/(1..b).inject(:*)) end
def rui(ar) s=[0]; ar.size.times{|i| s<<s[-1]+ar[i]}; s end
def rev_rui(ar) s=[0]; ar.size.times.reverse_each{|i| s<<s[-1]+ar[i]}; s end

def puts_yesno(b) puts(b ? 'Yes' : 'No') end
def putsend(s) puts s; exit end
def debug(k,v) puts "#{k}:#{v}" end
########### ( ˘ω˘ )ｽﾔｧ… ###########
n=gi
names=[]
times=[]
st=n.times {
  inp=gets.chomp.split
  names<<inp[0]
  times<<inp[1].to_i
}
x=gs

idx=names.index(x)
puts sum(times[idx+1..-1]).to_i

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

typedef struct {
	long x;
	long y;
} S_COORDINATE;

int cmpAscVal(const void * n1, const void * n2)
{
	if (((S_COORDINATE *)n1)->x > ((S_COORDINATE *)n2)->x)
	{
		return 1;
	}
	else if (((S_COORDINATE *)n1)->x < ((S_COORDINATE *)n2)->x)
	{
		return -1;
	}
	else
	{
    if (((S_COORDINATE *)n1)->y > ((S_COORDINATE *)n2)->y)
  	{
  		return 1;
  	}
  	else if (((S_COORDINATE *)n1)->y < ((S_COORDINATE *)n2)->y)
  	{
  		return -1;
  	} else {
      return 0;
    }
	}
}

int main(void) {

  int n;
  scanf("%d", &n);
  S_COORDINATE balls[n];
  for (int i = 0; i < n; i++) {
    scanf("%ld %ld", &balls[i].x, &balls[i].y);
  }
  if (n == 1) {
    printf("1\n");
    return 0;
  }
  qsort(balls, n, sizeof(S_COORDINATE), cmpAscVal);
  long criterion_x,criterion_y;
  int criterion_count;
  int max = 0;
  for (int criterion_s = 0; criterion_s < n-1; criterion_s++) {
    for (int criterion_l = criterion_s+1; criterion_l < n; criterion_l++) {
      criterion_x = balls[criterion_l].x-balls[criterion_s].x;
      criterion_y = balls[criterion_l].y-balls[criterion_s].y;
      criterion_count = 0;
      for (int s = 0; s < n-1; s++) {
        for (int l = s+1; l < n; l++) {
          if (balls[l].x == balls[s].x+criterion_x && balls[l].y == balls[s].y+criterion_y) {
            criterion_count++;
          }
        }
      }
      if (criterion_count > max) {
        max = criterion_count;
      }
    }
  }
  printf("%d\n", n-max);

  return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>

using namespace std;

int main()
{
	int a,b,c,d;
	int ans;
	cin >> a >> b >> c >> d;
	ans=(a-c)*(b-d);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,a) for(int i=0;i<(a);i++)
const ll MOD=1000000007;
//const ll MOD=998244353;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll H; cin>>H;
  int N; cin>>N;
  ll sum=0;
  rep(i,N){
    ll A; cin>>A;
    sum+=A;
  }
  if(sum>=H) cout<<"Yes\n";
  else cout<<"No\n";
  return 0;
}

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

public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner();
        int sum = sc.nextInt();
        double r = sum;
        r /=3;
        double v = r*r*r;
        System.out.println(v);
    }
}


class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}


Measured memory_bytes: 21332
from sys import stdin

n, *a = (int(x) for x in stdin.read().split())

count = {i: 0 for i in set(a)}
for i in a: count[i] += 1 

suite_count = count.copy()
for i in count:
    if i - 1 in count: suite_count[i] += count[i-1]
    if i + 1 in count: suite_count[i] += count[i+1]

print(max(suite_count.values()))

Measured memory_bytes: 16100
#include <stdio.h>
#include <string.h>
int main(){
  char string[1002];
  int length;
  scanf("%s", string);
  length = strlen(string);
  if(string[length-1] == 's'){
    string[length]='e';
    string[length+1]='s';
    string[length+2]='\0';
  } else {
    string[length]='s';
    string[length+1]='\0';
  }
  printf("%s\n",string);
}

Measured memory_bytes: 1660
#ifndef _WIN32
#include<iostream>
#endif // !_WIN32

#include<queue>
#include<algorithm>
#include<vector>
#include<tuple>

using namespace std;

typedef long long LL;
const LL INF = 1e17;


#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)



typedef vector<LL> V;
typedef vector<V> VV;
typedef tuple<LL, int, int> T;

typedef priority_queue<T> QUE;
int N, M, H, K,P,s,t;
int a[1123];
int b[1123];
LL c[1123];
int h[1123];
int r[1123];
LL dijkstra(VV &g, int p) {
	QUE que;
	VV d(N, V(H + 1,INF));
	d[s][0] = 0;
	que.push(T(0, s, 0));
	while (que.size()) {
		int v, tt; LL cost;
		tie(cost, v, tt) = que.top(); que.pop();
		cost = -cost;
		if (d[v][tt] < cost)continue;
		for (auto &e : g[v]) {
			int u = a[e] ^ b[e] ^ v;
			int nt = tt + h[e];
			if (nt > H)continue;
			LL nc = cost+c[e];
			if ((p >> r[e]) & 1)nc -= c[e];
			if (d[u][nt] <= nc)continue;
			d[u][nt] = nc;
			que.push(T(-nc, u, nt));
		}
	}
	LL res = INF;
	for (auto &it : d[t])res = min(res, it);
	return res;
}

int main() {
	while (cin >> N >> M >> H >> K, N + M + H + K) {
		VV g(N);
		REP(i, M) {
			cin >> a[i] >> b[i] >> c[i] >> h[i] >> r[i];
			a[i]--;
			b[i]--;
			r[i]--;
			g[a[i]].push_back(i);
			g[b[i]].push_back(i);

		}
		cin >> s >> t; s--; t--;
		cin >> P;
		vector<LL> p(1 << K, INF);
		p[0] = 0;
		REP(i, P) {
			LL val, num;
			int bit = 0;
			cin >> num >> val;
			REP(_, num) {
				int k;
				cin >> k; k--;
				bit |= (1 << k);
			}
			p[bit] = min(p[bit], val);
		}
		P = 1 << K;
		REP(i, P) {
			REP(j, P) {
				p[i | j] = min(p[i | j], p[i] + p[j]);
			}
		}
		LL res = INF;
		REP(i, P) {
			res = min(res, p[i]+dijkstra(g, i));
		}
		if (res == INF)cout << -1 << endl;
		else cout << res << endl;
	}
}

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

int main (){
    int a, b;
    cin>>a>>b;
    vector<int> Vec(12);
    Vec={0, 2, 0, 1, 0, 1, 0, 0, 1, 0, 1, 0};
    if(Vec.at(a-1)==Vec.at(b-1)){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
    
}

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

using namespace std;

const int N = 234567;

int a[N];
int b[N];
int c[N];
int tree[N];

void add(int k,int n)
{
    for(;k<=n;k+=(k&-k)){
        tree[k]++;
    }
}

int read(int k)
{
    int sum = 0;
    for(;k;k-=(k&-k)){
        sum += tree[k];
    }
    return sum;
}

signed main()
{
    int n,k;
    scanf("%lld %lld",&n,&k);
    for(int i=1;i<=n;i++){
        scanf("%lld",&a[i]);
        a[i] -= k;
    }
    b[0] = 0;
    int h = 0;
    for(int i=1;i<=n;i++){
        b[i] = b[i-1] + a[i];
        c[h++] = b[i];
    }
    sort(c,c+n);
    int len = unique(c,c+n)-c;
    for(int i=0;i<=n;i++){
        b[i] = lower_bound(c,c+len,b[i])-c+1;
    }
    int q = 0;
    for(int i=0;i<=n;i++){
        q += read(b[i]);
        add(b[i],len);
    }
    printf("%lld\n",q);
    return 0;
}


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

int main(){
  int N,L,sum=0,d=0;
  cin >> N >> L;
  int tas[N];
  for(int i=1;i<=N;i++){
    tas[i-1]=L+i-1;
    sum += tas[i-1];
  }
  int c = abs(tas[0]);
  for(int i=0;i<N;i++){
    if(abs(tas[i])<=c){
    	c = abs(tas[i]);
        d = sum - tas[i];
    }
  }
  cout << d << endl;
}


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

int main() {
    int N, M; cin >> N >> M;
    vector<string> A(N), B(M);
    REP(i, 0, N) cin >> A[i];
    REP(i, 0, M) cin >> B[i];

    REP(i, 0, N - M + 1) {
        REP(j, 0, N - M + 1) {
            bool ok = true;
            REP(k, 0, M) {
                REP(l, 0, M) {
                    if (A[i + k][j + l] != B[k][l]) ok = false;
                }
            }

            if (ok) {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include "iostream"
#include "cstring"
#include "queue"
using namespace std;
int main(void)
{
	int dx[6]={0,1,1,0,-1,-1},dy[6]={-1,0,1,1,0,-1};
	int used[200][200];
	int t,n;
	int X,Y;
	queue<int> xs,ys;
	while (cin>>t>>n,t) {
		memset(used,0,sizeof(used));
		for (int i = 0; i < n; i++) {
			cin>>X>>Y;
			used[Y+100][X+100]=1;	
		}
		cin>>X>>Y;
		xs.push(X+100); ys.push(Y+100);
		used[Y+100][X+100]=1;
		int ans=1;
		while (!xs.empty()) {
			int x=xs.front(),y=ys.front();
			xs.pop(); ys.pop();
			if(used[y][x]<=t)
			{
				for (int i = 0; i < 6; i++) {
					int nx=x+dx[i],ny=y+dy[i];
					if(!used[ny][nx])
					{
						xs.push(nx); ys.push(ny);
						used[ny][nx]=used[y][x]+1;
						ans++;
					}
				}
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 1376
#include <bits/stdc++.h>
using namespace std;
const int MAX_P=110;
const int dx[2]={1,0},dy[2]={0,1};

int gx,gy,p;
int X1[MAX_P],X2[MAX_P],Y1[MAX_P],Y2[MAX_P];

void solve(){
    vector<vector<int>> ok(gx+1,vector<int>(gy+1,3));
    for (int i=0;i<p;++i){
        if (X1[i]>X2[i]) swap(X1[i],X2[i]);
        if (Y1[i]>Y2[i]) swap(Y1[i],Y2[i]);
        ok[X1[i]][Y1[i]]^=(X1[i]==X2[i]?2:1);
    }
    vector<vector<int>> dp(gx+1,vector<int>(gy+1,0));
    dp[0][0]=1;
    for (int i=0;i<=gx;++i){
        for (int j=0;j<=gy;++j){
            for (int k=0;k<2;++k){
                int nx=i+dx[k],ny=j+dy[k];
                if (gx<nx||gy<ny) continue;
                if (!(ok[i][j]&1<<k)) continue;
                dp[nx][ny]+=dp[i][j];
            }
        }
    }
    int ans=dp[gx][gy];
    if (!ans) cout << "Miserable Hokusai!" << '\n';
    else cout << ans << '\n';
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int t; cin >> t;
    for (;t--;){
        cin >> gx >> gy >> p;
        for (int i=0;i<p;++i)
            cin >> X1[i] >> Y1[i] >> X2[i] >> Y2[i];
        solve();
    }
}


Measured memory_bytes: 3148
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
const double PI=acos(-1);

template<typename T>
istream& operator>> (istream& is, vector<T> &vec){
    for(T& x: vec) is >> x;
    return is;
}

int main(){
    ll n; cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    ll money = 1000;
    rep(i, n-1){
        if(a[i] < a[i+1]) money = money/a[i]*a[i+1] + money%a[i];
        //cout << money << endl;
    }

    cout << money << endl;
    return 0;
}

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

#define MOD 1000000007
template<typename ty1,typename ty2>
inline int add(ty1 x, ty2 y) {
	if(y>=MOD)y%=MOD;
	if(x>=MOD)x%=MOD;
    x += y; return x < MOD ? x : x - MOD;
}
template<typename ty1,typename ty2>
inline void addto(ty1 &x, ty2 y) {
		  if(y>=MOD)y%=MOD;
		  if(x>=MOD)x%=MOD;
	      x += y; if (x >= MOD) x -= MOD;
}
template<typename ty1,typename ty2>
inline int sub(ty1 x, ty2 y) {
		if(y>=MOD)y%=MOD;
		 if(x>=MOD)x%=MOD;
        x -= y; return x < 0 ? x + MOD : x;
}
template<typename ty1,typename ty2>
inline void subto(ty1 &x, ty2 y) {
	if(y>=MOD)y%=MOD;
	if(x>=MOD)x%=MOD;
    x -= y; if (x < 0) x += MOD;
}
template<typename ty1,typename ty2>
inline int mul(ty1 x, ty2 y) {
        if(y>=MOD)y%=MOD;
		if(x>=MOD)x%=MOD;
        return 1ll * x * y % MOD;
}
template<typename ty1,typename ty2>
void multo(ty1 &x, ty2 y) {
        if(y>=MOD)y%=MOD;
		if(x>=MOD)x%=MOD;
        x=1ll * x * y % MOD;
}


long long int ppow(long long int i, long long int j){
		long long int res = 1LL;
		while (j){
			if ((j & 1LL)){
				res *= i;
				if (res >= MOD){
					res %= MOD;
				}
			}
			j >>= 1;
			i *= i;
			if (i >= MOD){
				i %= MOD;
			}
		}
		return res;
	}
class Combination{
	
public:
	vector<long long int> k;
	vector<long long int> r;
	void resize(int N){
		k.resize(N + 2);
		r.resize(N + 2);
		k[0] = 1;
		for (int i = 1; i < N+2; i++){
			k[i] = k[i - 1];
			k[i] *= i;
			if (k[i] >= MOD)k[i] %= MOD;
		}
		long long int al = k[k.size() - 1];
		long long int iv = ppow(k[k.size() - 1],MOD-2);
		r[k.size() - 1] = iv;
		for (int i = (int)(r.size()) - 2; i >= 0; i--){
			r[i] = r[i + 1] * (i + 1);
			if (r[i] >= MOD){
				r[i] %= MOD;
			}
		}
	}
	long long int C(int a, int b){
		if (a < b)return 0;
		long long int up = k[a];
		long long int dw = r[b] * r[a - b];
		dw %= MOD;
		up *= dw;
		up %= MOD;
		return up;
	}
	long long int H(int a, int b){
		return C(a + b - 1, b);
	}
	long long int catalan_number(int n){
		return (C(2 * n, n) + MOD - C(2 * n, n - 1)) % MOD;
	}
};
Combination C;

string s;
#define MAX 200002
char buf[MAX];
int main(){
	scanf("%s",buf);
	s=buf;
	vector<pair<int,int> > v;
	for(int i=0;i<s.size();i++){
		if(s[i]=='?'){
			int lef=i;
			int rig=i;
			while(i<s.size()&&s[i]=='?'){
				i++;
			}
			v.push_back(make_pair(lef,i-1));
			i--;
		}
	}
	for(int i=0;i<v.size();i++){
		int lef=v[i].first;
		int rig=v[i].second;
		int len=rig-lef;
		if(len>1){
			for(int j=0;j<=len;j++){
				if(j==0){
					s[j+lef]='D';
				}
				else{
					s[j+lef]='D';
				}
			}
		}
		else{
			if(true||v[i].second+1<s.size()&&s[v[i].second+1]=='D'){
				for(int j=0;j<=len;j++){
					if(j%2==0){
						s[rig-j]='D';
					}
					else{
						s[rig-j]='D';
					}
				}
			}
		}
	}
	printf("%s\n",s.c_str());
	return 0;
}


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

namespace ConsoleApp11
{
    class Class37
    {
        static void Main()
        {
            long N = long.Parse(Console.ReadLine());
            long count = 0;
            if(N%2==0)
            {
                for(long i = 10; i <= N; i *= 5)
                {
                    count += N / i;
                }
            }
            Console.WriteLine(count);
        }
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define invrepr(i,a,b) for(int i=b-1;i>=a;i--)
#define invrep(i,n) invrepr(i,0,n)
#define repitr(itr,a) for(auto itr=a.begin();itr!=a.end();++itr)
const int MOD=1e9+7;


int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n) {
        cin >> a[i];
        a[i]-=i+1;
    }
    sort(a.begin(),a.end());
    int mid=a[n/2];
    ll ans=0;
    rep(i,n) ans+=abs(a[i]-mid);
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
string S;
cin>>S;
int res = 0;
string t = "CODEFESTIVAL2016";
for(int i = 0; i < 16; ++i){
    if(S[i] != t[i])res++;
}
cout<<res<<endl;
return 0;
}


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

const int maxn = 1e5+5;
int a[maxn],n;

struct node{
	int x;
	int num;
	friend bool operator < (node n1,node n2){
		return n1.num < n2.num;
	}
};

node b[maxn];

void solve(){
	sort(a+1,a+n+1);
	int tot = 0;
	priority_queue<node> q;
	for(int i = 1;i <= n;){
		int j = i;
		int cnt = 0;
		while(j <= n && a[j] == a[i]) j++;
		cnt = j-i;
		++tot;
		b[tot].x = a[i];
		b[tot].num = cnt;
		//printf("tot = %d b[].x = %d b[].num = %d\n",tot,b[tot].x,b[tot].num);
		q.push(b[tot]);
		i = j;
	}
	int ans = 0;
	for(;;){
		node u = q.top();q.pop();
		//printf("u.x = %d u.num = %d\n",u.x,u.num);
		if(u.num == 1) {
			q.push(u);
			break;
		}
		if(u.num < 3){
			if(q.empty()){

			}
			else{
				node v = q.top();q.pop();
			//	printf("---- v.x = %d v.num = %d\n",v.x,v.num);
				int mn = min(u.x,v.x);
				int mx = max(u.x,v.x);
				if(v.x == mn || v.x == mx){
					v.num = v.num - 1;
					if(v.num) q.push(v);
					node tmp;
					tmp.x = u.x;tmp.num = 1;
					q.push(tmp);
				}
				else{
					q.push(v);
				}
			}
		}
		else{
			u.num -= 2;
			q.push(u);
		}
	}
	
	printf("%d\n",q.size());
	/*while(!q.empty()){
		printf("--- %d %d\n",q.top().x,q.top().num);
		q.pop();
	}*/
}

int main(){
	while(scanf("%d",&n) != EOF){
		for(int i = 1;i <= n;i++) scanf("%d",&a[i]);
		solve();
	}
	return 0;
}

Measured memory_bytes: 2296
a, b, c = map(int, input().split())
k = int(input())

ans = 'No'

for i in range(k):
  if a >= b:
    b  = b * 2
  elif b >= c:
    c = c * 2
  elif a >= c:
    c = c * 2
  else:
    c = c * 2

if a < b < c:
  ans = 'Yes'

print(ans)

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

using namespace std;

int main(){
    vector<int> a(3);
    for (auto&e:a) {
        scanf("%d",&e);
    }
    sort(a.begin(),a.end());
    printf("%s\n",a[2]==a[1]+a[0]?"Yes":"No");
    return 0;
}


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

// See debug.cc for usage etc
#define DEBUG 1

template <class... Args>
string dbgFormat(const char* fmt, Args... args) {
  size_t len = snprintf(nullptr, 0, fmt, args...);
  char buf[len + 1];
  snprintf(buf, len + 1, fmt, args...);
  return string(buf);
}

#if DEBUG
  #define DLOG(...)        cerr << dbgFormat(__VA_ARGS__) << endl
  #define DCALL(func, ...) func(__VA_ARGS__)
#else
  #define DLOG(...)
  #define DCALL(func, ...)
#endif

int gcd(int x, int y) {
  if (x < y) return gcd(y, x);
  if (y == 0) return x;
  int z = x % y;
  return gcd(y, z);
}

int main() {
#if !DEBUG
  ios_base::sync_with_stdio(false);
#endif

  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
  }
  vector<int> left(N), right(N);
  left.at(0) = a.at(0);
  right.at(0) = a.at(N-1);
  for (int i = 1; i < N; i++) {
    left.at(i) = gcd(left.at(i-1), a.at(i));
    right.at(i) = gcd(right.at(i-1), a.at(N-1-i));
  }
  int val = max(left.at(N-2), right.at(N-2));
  for (int i = 0; i <= N-3; i++) {
    val = max(val, gcd(left.at(i), right.at(N-3-i)));
  }
  cout << val << endl;
  return 0;
}



Measured memory_bytes: 1408
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define vi vector<int>
#define vvi vector<vi>
#define substr(s,f,t) (s.substr(f-1,t-f+1))
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
using namespace std;
struct Grid{ll x,y,t;};
struct Edge{ll to,cost;};
struct Graph{vector<vector<Edge>>E;int V;
  const ll Inf = llINF;const int MAX_V=201010;vector<ll>d;
  Graph(int n):E(n){d.resize(MAX_V);E.resize(n);V=n;}
  void init(){for(int i=0;i<MAX_V;i++)d[i]=Inf;}
  void add_edge(ll from,ll to,ll cost){E[from].pb({to,cost});}
};
int n;
int dep;
int ans=0;
set<int>se;
vi hog;
void dfs(int bit,int d){
  if(dep==d){
    int cnt=0;
    for(int num:se){
      if(bit&(1<<cnt)){
	hog.pb((24-num)%24);
      }else{
	hog.pb(num);
      }
      cnt++;
    }
    int mi=INF;
  
    for(int i=0;i<hog.size();i++)
      for(int j=i+1;j<hog.size();j++){
	if(hog[i]==0){
	  mi=min(mi,min(24-hog[j],hog[j]));
	}else if(hog[j]==0){
	  mi=min(mi,min(24-hog[i],hog[i]));
	}else{
	  mi=min(mi,abs(hog[i]-hog[j]));
	}
      }
    for(int i=0;i<dep;i++)hog.pop_back();
    ans=max(ans,mi);
    return;
  }
  dfs(bit+(1<<d),d+1);
  dfs(bit,d+1);
}
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>n;
  vi hh(30);
  hh[0]++;
  bool fl=false;
  int a;
  for(int i=1;i<=n;i++){cin>>a;hh[a]++;if(hh[a]>=3)fl=true;}
  if(n==1){
    cout<<a<<endl;
    return 0;
  }
  if(fl)cout<<0<<endl;
  else{
    for(int i=0;i<30;i++){
      if(hh[i]==1){
	se.insert(i);
      }else if(hh[i]==2){
	hog.pb(i);
	hog.pb((24-i)%24);
      }
    }
    dep=se.size();
    dfs(0,0);
    cout<<ans<<endl;
  }
  return 0;
}


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

int main(void){
    string s;
    cin >> s;
    int count = 0;
    while(count != s.length()){
        count = 0;
    for(int i = 0; i < s.length(); i++){
         if(s[i] == 'B'){
            if(i == 0)
                s.erase(s.begin());
            else
                s.erase(i-1,2);
            i -= 2;
         }
    }
    for(int i = 0; i < s.length(); i++){
        if(s[i] != 'B')
            count++;
    }
    }
    cout << s << endl;
    return 0;
}


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

typedef long long ll;
const int MAX_N = 100000;

int main() {
	int N;
	ll A[MAX_N];

	std::cin >> N;
	for (int i = 0; i < N; i++) {
		std::cin >> A[i];
	}
	std::sort(A, A + N, std::greater<ll>());

	ll S = 1, ans = 0;
	int cnt = 0;
	for (int i = 0; i < N - 1; i++) {
		if(A[i] == A[i + 1]) {
			S *= A[i];
			++cnt;
			if(cnt == 2) {
				ans = S;
				break;
			}
			++i;
		}
	}

	std::cout << ans << std::endl;
}

Measured memory_bytes: 1024
import sys
import random
import math

def rd():
        return sys.stdin.readline().rstrip()

def rdi():
        return [ int(x) for x in rd().split() ]

K, = rdi()

#K = 100000

def sm(x):
        r = 0
        while x > 0:
                r += x % 10
                x /= 10
        return r

assert sm(9) == 9
assert sm(123) == 6

def jth(x, j):
        r = x % (10 ** (j+1))
        r /= (10 ** j)
        return r

ans = []
if False:
        a = []
        for i in range(1, 100000):
                a.append( (i/float(sm(i)), i) )
        a.sort()
        mx = 0
        for x in a:
                x, y = x
                if y > mx:
                        print y, x
                        ans.append(y)
                mx = max(mx, y)

out = 0
k = 1
while k <= 9 and out < K:
        print k
        k += 1
        out += 1


k = 10

while out < K:
        while True:
                s = sm(k)
                j = math.log10(k/s)
                #print k, s, j
                if j < 0:
                        break
                p = int(math.floor(j))
                j = 0
                while j <= p:
                        a = jth(k, j)
                        if a < 9:
                                k += 10 ** j
                                s += 1
                                break
                        j += 1
                else:
                        break
        print k
        assert not ans or k in ans
        #for i in range(1000000):
        #       assert k/float(sm(k)) <= (k+i)/float(sm(k+i))
        k += 1
        out += 1


Measured memory_bytes: 3316
h, w = map(int, input().split())
n = int(input())
a = list(map(int, input().split()))
boje = []
for i, x in enumerate(a):
    for j in range(x):
        boje.append(i + 1)
m = [[0 for j in range(w)] for i in range(h)]
cnt = 0
for i in range(h):
    if i % 2 == 0:
        for j in range(w):
            m[i][j] = boje[cnt]
            cnt += 1
    else:
        for j in range(w - 1, -1, -1):
            m[i][j] = boje[cnt]
            cnt += 1
    print(' '.join(map(str, m[i])))


Measured memory_bytes: 3572
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <utility>
#define ll long long int
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()

using namespace std;

int main(){
	int n,d;
	cin >> n >> d;
	cout << ceil((double)n/(d*2+1)) << endl;
}


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

void solveA(){
  int a,b,c;
  cin >> a >> b >> c;

  cout << min(b/a,c) << endl;
}
void solveB(){
  int a,b,k;
  cin >> a >> b >> k;
  vector<int> vec;
  int cnt=0;
  int i;

  for(i=1;i<=100;i++){
    if(a%i==0 && b%i==0){
      vec.push_back(i);
    }
  }

  sort(vec.begin(),vec.end(),greater<int>());

  cout << vec[k-1] << endl;
}
void solveC(){
  string s;
  cin >> s;
  int cntone=0;
  int cntzero=0;

  for(int i=0;i<s.length();i++){
    if(s[i]=='0'){
      cntzero++;
    }
    else {
      cntone++;
    }
  }
  cout << min(cntzero,cntone) * 2 << endl;
}

void solveD(){
}

int main(){
  solveC();
}


Measured memory_bytes: 512
import numpy as np

N,K = map(int,input().split())
A = np.sort(list(map(int,input().split())))
F = np.sort(list(map(int,input().split())))[::-1]

Amax = A[-1]
Fmax = F[0]

x=0
if sum(A) < K:
    x = 0
else:
    xl = 0
    xh = Amax*Fmax
    while xh-xl > 0:
        xm = int((xl+xh)//2)
        AF = A-xm//F 
        if np.sum(AF[AF>0]) > K: 
            xl = xm + 1
        else: 
            xh = xm
    else:
        x = xl
print(x)            


Measured memory_bytes: 38856
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scan(&n)

	a := make([]int,n)
	b := make([]int,n)
	c := make([]int,n-1)

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

	for i := 0; i < n; i++ {
		var val int
		fmt.Scan(&val)
		b[i] = val
	}

	for i := 0; i < n - 1; i++ {
		var val int
		fmt.Scan(&val)
		c[i] = val
	}

	tmp := a[0]
	var ans int
	for i := 0; i < n; i++ {
		ans += b[a[i] - 1]
		if a[i] == tmp + 1 {
			ans += c[a[i] - 2]
		}
		tmp = a[i]
	}
	fmt.Println(ans)
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define loop(i,a,b) for(ll i=a;i<=b;i++)
#define inputv(arr,n) for(ll i=0;i<n;i++){ll value;cin>>value;arr.pb(value);}
#define sz(a) ((ll)(a).size())
#define len(a) ((ll)(a).length())
#define F first
#define S second
#define vi vector <int> 
#define pll pair<ll,ll>
#define vpll vector<pll>
#define vs vector <string>
#define vc vector <char>
#define vl vector <ll>
#define all(c) (c).begin(),(c).end()
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)
#define IOS { ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0); }
inline ll max(ll a,ll b)
{return ((a>b)?a:b);}
inline ll min(ll a,ll b)
{return ((a>b)?b:a);}
inline ll gcd(ll a ,ll b)
{if(b==0) return a;a%=b;return gcd(b,a);}
#define nl cout<<"\n"
using namespace std;
ll power(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll modInverse(ll a){return power(a,mod-2);}
const int N=500023;
// hashing for pairs
struct HASH{
  size_t operator()(const pair<int,int>&x)const{
    return hash<long long>()(((long long)x.first)^(((long long)x.second)<<32));
  }
};
//sort in reverse order
bool compare(ll x, ll y){
    return x>y;
}
void solve()
{
  ll n;
  cin>>n;
  vl ans;
  double p = log(n)/log(26);
  ll len = floor(p);
  ll num=1;
  while (n)
  {
    ll val =(n-1)%26;
    ans.pb(val);
    n--;
    (n)/=26;
  }
  reverse(all(ans));
  for (ll i = 0; i < ans.size(); i++)
  {
    char ch = 97+ans[i];
    cout<<ch;
  }
  nl;
  return;
}
int main()
{
    IOS;
    int T=1;
  //  cin>>T;
    int t=0;
    while(t++<T)
    {
        //cout<<"Case #"<<t<<":"<<' ';
        solve();
        //cout<<'\n';
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define debug(x) cerr << #x << ": " << x << '\n'

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

const long long INF = 3e18 + 12;
const int inf = 1e9;

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

  int a;
  cin >> a;

  if (a < 1200) {
    cout << "ABC" << endl;
  } else {
    cout << "ARC" << endl;
  }

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ok() puts(ok?"Yes":"No");
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
using namespace std;
using ll = long long;
using vi = vector<int>;
using ii = pair<int, int>;
using vvi = vector<vi>;
using vii = vector<ii>;
using gt = greater<int>;
using minq = priority_queue<int, vector<int>, gt>;
using P = pair<ll,ll>;
const ll LINF = 1e18L + 1;
const int INF = 1e9 + 1;
//clang++ -std=c++11 -stdlib=libc++ 

int main() {
  char c; cin >> c;
  int dif = c-'A';
  if (dif >= 26) {
    cout << "a" << endl;
  } else {
    cout << "A" << endl;
  }
  return 0;
}

Measured memory_bytes: 3644
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        int y = Integer.parseInt(sc.next());
        if (n <= k) {
            System.out.println(n * x);
        } else {
            System.out.println(k * x + (n - k) * y);
        }
    }
}

Measured memory_bytes: 21844
import java.util.Scanner;
public class Main {
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();

		if (!S.contains("x")){
			System.out.println(1000);
		}else if (S.equals("oox")){
			System.out.println(900);
		}else if (S.equals("oxo")){
			System.out.println(900);
		}else if (S.equals("xoo")){
			System.out.println(900);
		}else if (S.equals("xxx")){
			System.out.println(700);
		}else {
			System.out.println(800);
		}
	}
}

Measured memory_bytes: 35724
import java.util.Scanner;
public class Main {
	public static void main(String []args) {
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
		int b=sc.nextInt();
		int c=sc.nextInt();
		int k=0;
		if(a>b) {
			k=b;
			b=a;
			a=k;
		}
		if(b>c) {
			k=c;
			c=b;
			b=k;
		}
		if(a>b) {
			k=b;
			b=a;
			a=k;
		}
		System.out.println(a+" "+b+" "+c);
	}
}



Measured memory_bytes: 26432
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<math.h>
#include<string>
#include <iomanip>
#include<deque>
#include<queue>
#include<stack>
#include<set>


using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e9;

//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(int i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用
#define ret return 0

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 ketasitei setprecision(15) //15桁表示

long long gcd(long long a, long long b)
{
	long long tmp, r;
	if (a < b)
	{
		tmp = a;
		a = b;
		b = tmp;
	}
	r = a % b;
	while (r != 0)
	{
		a = b;
		b = r;
		r = a % b;
	}

	return b;
}
long long lcm(long long a, long long b)
{
	long long tmp, x;
	x = a * b;
	return x / gcd(a, b);
}
int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);

	ll n;
	cin >> n;
	ll m;
	cin >> m;
	m *= 2;
	vector<ll> a(n), tmp(n);
	rep(i, n)
	{
		cin >> a[i];
		tmp[i] = a[i];
	}

	bool isEven = false;
	bool isOdd = false;
	ll minEven = INF, evnum = 0;

	for (int i = 0; i < n; i++)
	{
		ll tmpn = tmp[i];
		while (tmpn % 2 != 1)
		{
			tmpn /= 2;
			evnum++;
		}
		if (minEven == evnum || i==0)
		{
			minEven = evnum;
			evnum = 0;
			continue;
		}
		else
		{
			cout << 0 << endl;
			ret;
		}
		evnum = 0;
	}
	//for (int i = 0; i < n; i++)
	//{
	//	for (int j = 0; j < minEven; j++)
	//	{
	//		tmp[i] /= 2;
	//	}
	//	if (tmp[i] % 2 == 0)
	//	{
	//		isEven = true;
	//	}
	//	if (tmp[i] % 2 == 1)
	//	{
	//		isOdd = true;
	//	}
	//	if (isEven && isOdd)
	//	{
	//		cout << 0 << endl;
	//		ret;
	//	}
	//}

	ll gcnum = a[0];
	for (int i = 1; i < n; i++)
	{
		gcnum = lcm(a[i], gcnum);
      if(gcnum>1000000000)
        {cout<<0<<endl;ret;}
	}

	ll ans = 0;
	for (int i = 1; gcnum * i <= m; i++)
	{
		if (i % 2 == 1)
		{
			ans++;
		}
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1792
h,w=map(int,input().split())
WF=[list(map(int,input().split())) for i in range(10)]
a=[list(map(int,input().split())) for i in range(h)]

for k in range(10):
    for i in range(10):
        for j in range(10):
            WF[i][j]=min(WF[i][j],WF[i][k]+WF[k][j])

ans=0
for i in range(h):
    for j in range(w):
        if a[i][j]!=-1:
            ans+=WF[a[i][j]][1]
print(ans)


Measured memory_bytes: 3316
#include<stdio.h>
int main(void){
    int n,sum=0,a;
    scanf("%d",&n);
    a=n;
    while(n>=1){
        sum=sum+n%10;
        n=n/10;
    }
    if(a%sum==0){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 128
use std::io::Read;

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

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let s = iterator.next().unwrap();

    let mut ans = 0;
    let mut prev = String::new();
    let mut curr = String::new();

    for ch in s.chars() {
        curr.push(ch);
        if prev != curr {
            ans += 1;
            prev = curr;
            curr = String::new();
        }
    }

    return ans.to_string();
}


Measured memory_bytes: 4352
#define _USE_MATH_DEFINES
#include  <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include<math.h>
#include<iomanip>
#include<stdio.h>
#include <stdlib.h>
#include<stdio.h>
#include <queue>
#include<map>
#include <sstream>
#include<set>
#include<stack>

//#include<bits/stdc++.h>


using namespace std;


int main()
{
    
    char a;
    cin >> a;
    if (a >= 'A' && a <= 'Z')cout << "A" << endl;
    else cout << "a" << endl;

    return 0;

}

Measured memory_bytes: 3632