akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
using namespace std;

#define int long long
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
ll mod = (1000000007LL);
inline ll Mod(ll a, ll b){return (a%b);}
inline ll poww(ll a, ll b){ll res = 1;while (b > 0){if(b & 1) res = (res * a)%mod;a = (a * a)%mod;b >>= 1;}return res;}
ll gcd (ll a, ll b) { while (b) { a %= b,swap(a, b);}return a;}
void read(vector<int> &w, int n){w.resize(n);for(int i = 0; i < n; i++) cin>>w[i];}
void print(vector<int> &w){for(int i =0; i < sz(w); i++){if(i == sz(w) - 1) cout<<w[i]<<"\n";else cout<<w[i]<<" ";}}
int prodmod(vector<int> w);
int summod(vector<int> w);
///CUIDADO COM MAXN
#define N 300050

int n, m, q, k, v[N], ans;
pii w[N];
string s;

int32_t main(){
	ios::sync_with_stdio(false); cin.tie(0);
	ll n;
	cin>>n;
	int sum=0;
	int pot=1;
	vector<int> pow26(200);
	pow26[0]=1;
	for(int i=1;i<200;i++){
		pow26[i]=(26LL*pow26[i-1]);
	}
	for(int len=1;1;len++){
		pot *= 26;
		sum += pot;
		// couyt<<"LEN "<
		if(sum >= n){
			sum -=pot;
			n -= sum;
			// cout<<"LEN  "<<len<<"\n";
			//uso len caras;
			int acum = 0;
			string ans;
			for(int i=1;i<=len;i++){
				// int acum = 0;//pow26[len-i];
				int can=0;
				for(char c='a';c<='z';c++){
					int falta = len-i;
					acum += pow26[falta];
					// cout<<"CHAR "<<c<<" = "<<acum<<
					if(acum >= n){
						ans.pb(c);
						n = n - acum + pow26[len-i];
						acum = 0;
						// n-=acum;
						// acum=0;
						// cout<<"PIUT "<<c<<"\n";
						break;
					}
				}
				// if(!can)
			}
			cout<<ans<<"\n";
			// cout<<"\n";/
			return 0;
		}
	}
}
/*
    CUIDADO COM MAXN, MOD, OVERFLOW 
    >Colocar (>DEFINE INT LONG LONG<) no inicio do template
    >mod = (1e9 + 7), por padrao (NAO ESQUECER DE ALTERAR)
    >NAO ESQUECER DEFINE INT LONG LONG
    > N = 1 ? 
*/
int summod(vector<int> w){int curr=0;for(int i=0;i<sz(w); i++){curr = (curr+w[i])%mod;if(curr<0)curr+=mod;}return curr;}
int prodmod(vector<int> w){int curr = 1;
for(int i = 0; i < sz(w); i++){if(w[i] >= mod) w[i] %= mod;curr = (curr * w[i]) % mod;if(curr < 0) curr += mod;}return curr;}

Measured memory_bytes: 3656
import java.io.*;
import java.lang.reflect.Array;
import java.math.*;
import java.text.DecimalFormat;
import java.util.*;




public class Main {


    private static boolean valid(int st,char [] s,char [] t) {
        int len = s.length - st;
        if (len > t.length) return false;
        for (int i = 0;st < s.length;st++,i++)
            if (s[st] != t[i])
                return false;
        return true;
    }
    public static void main(String[] args) throws Exception {
        IO io = new IO(null, null);
        int n = io.getNextInt();
        char [] s = io.getNext().toCharArray();
        char [] t = io.getNext().toCharArray();

        int ans = 2*n;
        for (int i = 0;i <= n;i++){
            int len = n + i;
            if (valid(i,s,t)) {
                ans = len;
                break;
            }
        }
        io.println(ans);
        io.close();
    }
}





class IO{
    private BufferedReader br;
    private StringTokenizer st;
    private PrintWriter writer;
    private String inputFile,outputFile;

    public boolean hasMore() throws IOException{
        if(st != null && st.hasMoreTokens()) return true;
        if(br != null && br.ready()) return true;
        return false;
    }
    public String getNext() throws FileNotFoundException, IOException{
        while(st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine());
        return st.nextToken();
    }

    public String getNextLine() throws FileNotFoundException, IOException{
        return br.readLine().trim();
    }

    public int getNextInt() throws FileNotFoundException, IOException{
        return Integer.parseInt(getNext());
    }
    public long getNextLong() throws FileNotFoundException, IOException{
        return Long.parseLong(getNext());
    }

    public void print(double x,int num_digits) throws  IOException{
        writer.printf("%." + num_digits + "f" ,x);
    }
    public void println(double x,int num_digits) throws  IOException{
        writer.printf("%." + num_digits + "f\n" ,x);
    }
    public void print(Object o) throws  IOException{
        writer.print(o.toString());
    }

    public void println(Object o) throws  IOException{
        writer.println(o.toString());
    }
    public IO(String x,String y) throws FileNotFoundException, IOException{
        inputFile = x;
        outputFile = y;
        if(x != null) br = new BufferedReader(new FileReader(inputFile));
        else br = new BufferedReader(new InputStreamReader(System.in));
        if(y != null) writer = new PrintWriter(new BufferedWriter(new FileWriter(outputFile)));
        else writer = new PrintWriter(new OutputStreamWriter(System.out));
    }

    protected void close() throws IOException{
        br.close();
        writer.close();
    }
    public void outputArr(Object [] A) throws IOException{
        int L = A.length;
        for (int i = 0;i < L;i++) {
            if(i > 0) writer.print(" ");
            writer.print(A[i]);
        }
        writer.print("\n");
    }
}


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

int main () {
  int N;
  cin >> N;
  for(int i = 0; 4 * i <= N; i++){
  	for(int j = 0; 4 * i + 7 * j <= N;j++){
    	if(4 * i + 7 * j == N){
          cout << "Yes" << endl;
          return 0;
        }
    }
  }
 cout << "No" << endl; 
 return 0;
}

Measured memory_bytes: 256
N = int(input())
a = list(map(int, input().split()))

cnt = 0

while True:
    for i in range(len(a)):
        if a[i] % 2 != 0:
            break
        elif i == len(a)-1:
            for j in range(len(a)):
                a[j] = a[j]/2
            cnt += 1
    else:
        continue
    break
    
print(cnt)


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

using namespace std;

#define int long long

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, a, b;
    cin >> n >> a >> b;
    int ans = (n / (a + b)) * a;
    int r = n % (a + b);
    ans += min(a, r);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main{

	Scanner sc=new Scanner(System.in);

	int INF=1<<28;
	double EPS=1e-9;

	int n;
	String[] ss;

	void run(){
		for(;;){
			n=sc.nextInt();
			if(n==0){
				break;
			}
			ss=new String[n];
			for(int i=0; i<n; i++){
				ss[i]=sc.next();
			}
			solve();
		}
	}

	int size;
	int[] cs;
	int[] map;
	boolean[] used;
	int ans;

	void solve(){
		int[] a=new int[256];
		fill(a, -1);
		size=0;
		for(String s : ss){
			for(int i=0; i<s.length(); i++){
				if(a[s.charAt(i)]==-1){
					size++;
					a[s.charAt(i)]=INF;
				}
				a[s.charAt(i)]=min(a[s.charAt(i)], s.length()-1-i);
			}
		}
		cs=new int[size];
		for(int k=0, i=0; i<256; i++){
			if(a[i]>=0){
				cs[k++]=i+1000*a[i];
			}
		}
		sort(cs);

		for(int i=0; i<size; i++){
			//debug(i, (char)(cs[i]%1000), cs[i]/1000);
		}

		used=new boolean[10];
		map=new int[256];
		fill(map, -1);
		ans=0;
		dfs(0);
		// debug(ans);
		println(""+ans);
	}

	void dfs(int k){
		if(k==size){
			if(ok(8)){
				ans++;
			}
			return;
		}
		for(int i=0; i<10; i++){
			if(!used[i]){
				used[i]=true;
				map[cs[k]%1000]=i;
				if(ok(cs[k]/1000)){
					dfs(k+1);
				}
				map[cs[k]%1000]=-1;
				used[i]=false;
			}
		}
	}

	boolean ok(int d){
		int sum=0;
		for(int j=0; j<n; j++){
			if(map[ss[j].charAt(0)]==0&&ss[j].length()>1){
				return false;
			}
			int num=0;
			for(int i=max(0, d-ss[j].length()); i<d; i++){
				num=num*10+map[ss[j].charAt(ss[j].length()-d+i)];
			}
			// debug(j, num);
			if(j==n-1){
				sum-=num;
			}else{
				sum+=num;
			}
		}
		int mod=1;
		for(int i=0; i<d; i++){
			mod*=10;
		}
		return sum%mod==0;
	}

	boolean ok(){
		int sum=0;
		for(int j=0; j<n; j++){
			if(map[ss[j].charAt(0)]==0&&ss[j].length()>1){
				return false;
			}
			int num=0;
			for(int i=0; i<ss[j].length(); i++){
				num=num*10+map[ss[j].charAt(i)];
			}
			if(j==n-1){
				sum-=num;
			}else{
				sum+=num;
			}
		}
		return sum==0;
	}

	void swap(int[] is, int i, int j){
		int t=is[i];
		is[i]=is[j];
		is[j]=t;
	}

	void rev(int[] is, int i, int j){
		for(j--; i<j; i++, j--){
			int t=is[i];
			is[i]=is[j];
			is[j]=t;
		}
	}

	void debug(Object... os){
		System.err.println(Arrays.deepToString(os));
	}

	void print(String s){
		System.out.print(s);
	}

	void println(String s){
		System.out.println(s);
	}

	public static void main(String[] args){
		// System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		new Main().run();
	}
}

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

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }

int main() {
    int N; 
  	cin >> N;
    vector<int> a(N);
    for (int i = 0; i < N; ++i) cin >> a[i];

   
    vector<int> left(N+1, 0), right(N+1, 0);
    for (int i = 0; i < N; ++i) left[i+1] = GCD(left[i], a[i]);
    for (int i = N-1; i >= 0; --i) right[i] = GCD(right[i+1], a[i]);

    int res = 0;
    for (int i = 0; i < N; ++i) {

        int l = left[i];
        int r = right[i+1];

        chmax(res, GCD(l, r));
    }
    cout << res << endl;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define MAX 100005
#define ll long long
#define upperlimit 1000100
#define INF 1e18
#define eps 1e-8
#define endl '\n'
#define pcc pair<char,char>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define MOD 1000000007
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define pd(t) printf("%d\n",t)
#define plld(t) printf("%lld\n",t)
#define mp(a,b) make_pair(a,b)
#define FF first
#define SS second
#define pb(x) push_back(x)
#define vi vector<int>
#define clr(a) memset(a,0,sizeof(a))
#define debug(a) printf("check%d\n",a)
#define csl ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
 
ll gcd(ll n1,ll n2){
	if(n1%n2==0)return n2;
	return gcd(n2,n1%n2);
}
ll powmod(ll base,ll exponent)
{
	ll ans=1;
	while(exponent){
		if(exponent&1)ans=(ans*base)%MOD;
		base=(base*base)%MOD;
		exponent/=2;
	}
	return ans;
}
int main()
{
	csl;
	int h,w;
	cin>>h>>w;
	for(int i=1;i<=h;i++)
	{
		for(int j=1;j<=w;j++)
		{
			string temp;
			cin>>temp;
			if(temp=="snuke")
			{
				cout<<char('A'+j-1)<<i<<endl;
				return 0;
			}
		}
	}
}

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

using namespace std;

using ll = long long;

const int N = 100'001;

ll dp[N];

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

    fill(dp + 1, dp + N, -1);

    int n, cap;
    cin >> n >> cap;

    ll ans = 0;

    for (int i = 0; i < n; ++i) {
        int w;
        ll v;
        cin >> w >> v;
        for (int j = cap; j >= w; --j) {
            if (dp[j - w] == -1) continue;
            dp[j] = max(dp[j], dp[j - w] + v);
            ans = max(ans, dp[j]);
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1024
#include <stdio.h>
int main(void){
    
   int H,W,i,j;
   
   while(1){
       scanf("%d %d",&H,&W);
       if(H==0 && W==0) break;
       else{
           for(i=0;i<H;i++){
               if(i%2==0){
                   for(j=0;j<W;j++){
                       if(j%2==0) printf("#");
                       else printf(".");
                   }
               }
               else{
                   for(j=0;j<W;j++){
                       if(j%2==0) printf(".");
                       else printf("#");
                   }
               }
               printf("\n");
           }
       }
       printf("\n");
   }
   
    return 0;
    
}


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

using namespace std;
#define _rep(n, a, b) for (int n = (a); n <= (b); ++n)
#define _rev(n, a, b) for (int n = (a); n >= (b); --n)
#define _for(n, a, b) for (int n = (a); n < (b); ++n)
#define _rof(n, a, b) for (int n = (a); n > (b); --n)
#define oo 0x3f3f3f3f3f3f
#define ll long long
#define db double
#define eps 1e-3
#define bin(x) cout << bitset<10>(x) << endl;
#define what_is(x) cerr << #x << " is " << x << endl
#define met(a, b) memset(a, b, sizeof(a))
#define all(x) x.begin(), x.end()
#define pii pair<int, int>
#define pdd pair<db, db>
#define endl "\n"
const int mod = 1e9 + 7;
const int maxn = 2e6 + 10;
vector<ll> f(maxn), invf(maxn);
ll qpow(ll a, ll b) {
    ll ret = 1;
    for (; b; a = a * a % mod, b >>= 1) {
        if (b & 1) {
            ret = ret * a % mod;
        }
    }
    return ret;
}


void prework(){
    f[0] = 1;
    _rep(i, 1, maxn-1){
        f[i] = f[i-1] * i%mod;
    }
    invf[maxn - 1] = qpow(f[maxn - 1], mod - 2);
    for(int i = maxn-2;i>=0;i--){
        invf[i] = invf[i + 1] * (i + 1) % mod;
    }

}

ll C(ll n, ll m){
    if(n>m||m<0)return 0;
    if(n==0||m==n) return 1;
    ll res = (f[m] * invf[m-n]%mod *invf[n])%mod;
    return res;
}
signed main() {
    int k;
    string s;
    cin >> k >> s;
    prework();
    ll len = s.size();
    ll res = 0;
    _rep(i, 0, k) {
        res = (res + qpow(26, i) * qpow(25, k - i)%mod  * C(len-1, k + len - 1 - i)%mod)%mod;
    }
    cout << res << endl;


}

Measured memory_bytes: 36488
(function main() {
  const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n');
  const n1 = Number(lines.shift());
  const arr1 = lines.shift().split(' ').map(Number);
  const n2 = Number(lines.shift());
  const arr2 = lines.shift().split(' ').map(Number);

  const solve = memoization(function(i, m) {
    if (m == 0) return true;
    if (i >= n1) return false;
    return solve(i + 1, m) || solve(i + 1, m - arr1[i]);
  });

  arr2.map(m => solve(0, m) ? 'yes' : 'no').forEach(res => console.log(res));
})();

function memoization(f) {
  var cache = {};
  function innerFunc(...param) {
    // let c = cache[param];
    // console.log(cache);
    if (typeof cache[param] !== 'undefined') {return cache[param];}
    return cache[param] = f(...param);
  }
  return innerFunc;
}



Measured memory_bytes: 24412
import sys
for e in sys.stdin:
 e=list(map(int,e.split(',')))
 c=[e.count(i+1)for i in range(13)];d=c+c
 if 4 in c:s='four card'
 elif 3 in c:
  if 2 in c:s='full house'
  else:s='three card'
 elif 2 in c:
  if c.count(2)-1:s='two pair'
  else:s='one pair'
 elif sum([1]*5==d[i:i+5]for i in range(10)):s='straight'
 else:s='null'
 print(s)


Measured memory_bytes: 5604
#include <stdio.h>
#include <string.h>
#include <ctype.h>

struct RING
{
	char str[22];
};
typedef struct RING Ring;

int main()
{
	char look[11];
	char work[22];
	int kazu;
	Ring ring[100];
	int i,k,m;
	int len,length,count=0;
	scanf("%s", look);
	scanf("%d", &kazu);
	length = strlen(look);
	for(i=0; i<kazu; i++){
		scanf("%s", ring[i].str);
		strcpy(work, ring[i].str);
		strcat(ring[i].str, work);
	}
	for(i=0; i<kazu; i++){
		len=strlen(ring[i].str);
		for(k=0; k<len; k++){
			if(look[0]==ring[i].str[k]){
				for(m=1; m<length; m++){
					if(look[m]!=ring[i].str[k+m]){
						break;
					}
				}
				if(m==length){
					count++;
					break;
				}
			}
		}
	}
	printf("%d\n", count);
	return 0;
}

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

const int MOD = 1000000007;

const int INF_32 = 1LL << 30;
const int64_t INF_64 = 1LL << 60;

int main()
{
    int A1, A2, A3;
    cin >> A1 >> A2 >> A3;
    if (A1 + A2 + A3 >= 22) {
        cout << "bust" << endl;
    } else {
        cout << "win" << endl;
    }
}


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

# a = 1 の枚数
# b = 0 の枚数
# c = -1 の枚数
# k 引ける枚数

if a < 0:
    a = 0

if b < 0:
    b = 0

if c < 0:
    c = 0

max_val = 0

x = k - a
# 残り枚数が0以上の場合aはすべて引ける
if x >= 0:
    max_val = max_val + a * 1
    k = x
elif x < 0:
    max_val = max_val + k * 1
    k = 0


if k > 0:
    x = k - b
    if x >= 0:
        max_val = max_val + b * 0
        k = x
    elif x < 0:
        k = 0
        max_val = max_val + k * 0


if k > 0:
    x = k - c
    if x >= 0:
        max_val = max_val + c * -1
    elif x < 0:
        max_val = max_val + k * -1

print(max_val)


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

#define fi first
#define se second
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb(s) push_back(s)
#define mp(a,b) make_pair(a,b)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define maxch(x,y) x=max(x,y)
#define minch(x,y) x=min(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt(x) bitset<32>(x).count()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<P, int> PPI;
typedef pair<ll, ll> PL;
typedef pair<P, ll> PPL;

#define INF INT_MAX/3

#define MAX_N 1000

int n;

int dfs(int s,int l,int d){
	if(d==4){
		if(s==0)return 1;
		else return 0;
	}
	if(s==0)return 1;
	if(s<0)return 0;
	int res=0;
	for(int i=l;i*i<=s;i++){
		res+=dfs(s-i*i,i,d+1);
	}
	return res;
}

int main(){
	cin.sync_with_stdio(false);
	while(1){
		cin>>n;
		if(n==0)break;
		cout<<dfs(n,1,0)<<endl;
	}
	return 0;
}

Measured memory_bytes: 3124
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
#define all(v) v.begin(), v.end()
#define repi(i, n, init) for (ll i = init; i < (n); i++)
#define repd(i, n, init) for (ll i = (n); i >= init; i--)
#define repm(i, m) for (auto i = m.begin(); i != m.end(); i++)
#define repb(bit, n, init) for (ll bit = init; bit < (1 << n); ++bit)

vector<ll> fact, invfact;
ll modpower(ll x, ll n, ll mod)
{
    ll res = 1;
    while (n)
    {
        if (n & 1)
            res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}
ll inv(ll n)
{
    return modpower(n, MOD - 2, MOD);
}
void COMinit(ll k)
{ //空っぽの配列を二つ
    k++;
    fact.resize(k, 0);
    invfact.resize(k, 0);
    fact[0] = 1;
    repi(i, k, 1)
    {
        fact[i] = fact[i - 1] * i % MOD;
    }
    invfact[k - 1] = inv(fact[k - 1]);
    repd(i, k - 2, 0)
    {
        invfact[i] = invfact[i + 1] * (i + 1) % MOD;
    }
    return;
}
ll nCk(vector<ll> &fact, vector<ll> &invfact, ll n, ll k)
{ //この関数を使う前にCOMinit
    if (k < 0 || n < k)
        return 0LL;
    return fact[n] * invfact[k] % MOD * invfact[n - k] % MOD;
}
ll com(ll n, ll k)
{
    ll iv = 1;
    ll fa = 1;
    repi(i, k, 0)
    {
        fa *= (n - i);
        fa %= MOD;
    }
    repi(i, k + 1, 1)
    {
        iv *= inv(i);
        iv %= MOD;
    }
    return fa * iv % MOD;
}

//---------main function----------

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

Measured memory_bytes: 3596
#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;

typedef long long int ll;
typedef long double ld;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define vsort(a) sort(a.begin(), a.end())
#define rev(a) reverse(a.begin(), a.end());

const int MOD = 1000000007;
const int INF = INT_MAX;



int main()
{

    ll n;
    cin >> n;
    ll x, a[n];
    cin >> x;
    rep(i, n) cin >> a[i];

    sort(a, a+n);

    int res;
    rep(i, n){
        if (a[i] < x){
            x -= a[i];
            if (i == n-1){
                res = i;
            }
        }
        else if (a[i] == x){
            res = i+1;
            break;
        }
        else {
            res = i;
            break;
        }
    }


    cout << res << endl;


    



    return 0;
}




//              g++ -std=c++1z  

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll=long long;
#define print(n) cout<<n<<endl
#define rep(i,a,n) for(int i=a;i<n;i++)
#define ALL(s) s.begin(),s.end()
#define P pair<ll,ll>
#define vl vector<ll>
#define vi vector<int>
#define vvl vector<vector<ll>>
#define vvi vector<vector<int>>
const int M=200111;
const int inf=1000000007;
const long long INF=1e18;
int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};
int ddx[8]={1,-1,0,0,1,-1,-1,1},ddy[8]={0,0,1,-1,1,-1,1,-1};

int n,a,b,cnt=0;
int flag[M];
int dist1[M]={},distn[M]={};
vi g[M];

void __dist(int node,int y[]){
	flag[node]=true;
	for(auto x:g[node])
		if(!flag[x]){
			y[x]=(y[node]+1);
			__dist(x,y);
		}
}

int main(){
	cin>>n;
	rep(i,0,n-1){
		cin>>a>>b;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	rep(i,0,n+1)flag[i]=false;
	__dist(1,dist1);
	rep(i,0,n+1)flag[i]=false;
	__dist(n,distn);
	int X=0,Y=0;
	rep(i,1,n+1){
		if(dist1[i]<=distn[i])X++;
		else Y++;
	}
	if(X>Y)print("Fennec");
	else print("Snuke");
}

Measured memory_bytes: 14592
#include<bits/stdc++.h>
using namespace std;
class UnionFind{
private: 
    vector<int> rank;
    vector<int> par;
public:
    UnionFind(int n){
        rank.resize(n);
        par.resize(n);
        for(int i = 0; i < n; i++){
            par[i] = i;
            rank[i] = 0;
        }
    }

    bool same(int a, int b){return root(a)==root(b);}
    int root(int a){return (par[a]==a?a:root(par[a]));}

    void unite(int a, int b){
        int root_a = root(a), root_b = root(b);
        if(root_a==root_b) return;
        if(rank[root_a]>rank[root_b]){
            par[root_b]=root_a;
        }
        else if(rank[root_a]==rank[root_b]){
            par[root_b]=root_a;
            rank[root_a]++;
        }
        else{
            par[root_a] = root_b;
        }
    }
};


int main(){
    int n, k, p; 
    cin>>n>>k>>p;
    UnionFind u1(n+1);
    for(int i =0; i<k; i++){
        int a, b;
        cin>>a>>b;
        u1.unite(a, b);
    }
    UnionFind both(n+1);
    for(int i =0; i<p; i++){
        int a, b; 
        cin>>a>>b;
        both.unite(a, b);
    }
    map<pair<int,int>, int> answer;
    for(int i = 1; i <= n; i++){
        answer[make_pair(u1.root(i), both.root(i))]++;
    }

    for(int i = 1; i <= n; i++){
        cout<<answer[{u1.root(i), both.root(i)}]<<" ";
    }

    return 0;
}

Measured memory_bytes: 15104
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<queue>
using namespace std;
int main()
{
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    int sum1=a+b;
    int sum2=a+c;
    int sum3=b+c;
    int minn=sum1;
    if(sum2<minn)
    {
        minn=sum2;
    }
    if(sum3<minn)
    {
        minn=sum3;
    }
    printf("%d\n",minn);
}


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


int main() {
   int n,k;
   cin>>n>>k;
   int d;
   int vis[n+1]={0};
   for(int i=0;i<k;i++){
   	cin>>d;
   	int x;
   	for(int j=0;j<d;j++){
   		cin>>x;
   		vis[x]=1;
	}
   }
   int c=0;
   for(int i=1;i<n+1;i++){
   	if(vis[i]==0) c++;
   }
   cout<<c;
}

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

int main(void){
	int n;
	cin >> n;
	for(int i=0;i<n;++i){
		double xa,ya,ra,xb,yb,rb,ab;
		cin >> xa >> ya >> ra >> xb >> yb >> rb;
		double d_2 = (xa-xb)*(xa-xb)+(ya-yb)*(ya-yb);
		if(d_2>(ra+rb)*(ra+rb)){
			cout << "0\n";
		}else if(d_2==(ra+rb)*(ra+rb)){
			cout << "1\n";
		}else{
			if(d_2<(ra-rb)*(ra-rb)&&(ra>rb)){
				cout << "2\n";
			}else if(d_2<(rb-ra)*(rb-ra)&&(ra<rb)){
				cout << "-2\n";
			}else{
				cout << "1\n";
			}
		}
	}
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007

int main() {

  int N;
  cin >> N;

  int odd = 0;
  for(int i = 0;i < N;i++) {
    int A;
    cin >> A;
    if(A % 2 != 0) odd++;
  }

  if(odd % 2 == 0) cout << "YES" << endl;
  else cout << "NO" << endl;


}

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

typedef long long ll;
const int nax = 1e5 + 5;
ll t[nax];

int main() {
	int n, x;
	scanf("%d%d", &n, &x);
	for(int i = 1; i <= n; ++i) scanf("%lld", &t[i]);
	ll ans = 0;
	for(int i = 1; i <= n; ++i) {
		if(t[i] > x) {
			ans += t[i] - x;
			t[i] = x;
		}
		if(t[i-1] + t[i] > x) {
			ans += t[i-1] + t[i] - x;
			t[i] = x - t[i-1];
		}
	}
	printf("%lld\n", ans);
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
void solve() {
	int a;
	cin >> a;
	cout << a + a*a + a*a*a;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	solve();
}



Measured memory_bytes: 3552
A, B, M = list(map(int, input().split()))
a_list = list(map(int, input().split()))
b_list = list(map(int, input().split()))

ans = min(a_list) + min(b_list)

for i in range(M):
    x, y, c = list(map(int, input().split()))
    cost = a_list[x - 1] + b_list[y - 1] - c
    if cost < ans:
        ans = cost
        
print(ans)

Measured memory_bytes: 18736
n = int(input())
a = [int(input()) for i in range(n)]

even_num = set([a[i] for i in range(0,n) if i % 2 == 0])

a.sort()

odd_num = set([a[i] for i in range(0, n) if i % 2 == 1])

count = len(even_num & odd_num)
print(count)


Measured memory_bytes: 13804
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

#define REP(i,n)   for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); i++)
#define DUMP2D(a, n, m) REP(i, n) REP(j, m) printf("%d%c", a[i][j], j + 1 == m ? '\n' : ' '); puts("")

const int S_MAX = 3000;

struct st {
  int len;
  int pi;
  int pj;
};

string s, t;

int m, n;
st dp[S_MAX + 1][S_MAX + 1];

void solve() {
  m = s.length();
  n = t.length();

  REP(i, m + 1)  dp[i][0] = { 0, -1, -1 };
  REP(j, n + 1)  dp[0][j] = { 0, -1, -1 };
  REP(i, m) REP(j, n) {
    if (s[i] == t[j]) {
      dp[i + 1][j + 1] = { dp[i][j].len + 1, i, j };
    } else if (dp[i][j + 1].len >= dp[i + 1][j].len) {
      dp[i + 1][j + 1] = dp[i][j + 1];
    } else {
      dp[i + 1][j + 1] = dp[i + 1][j];
    }
  }

  // REP(i, m + 1) REP(j, n + 1)
  //   printf("(%d,%d,%d)%c", dp[i][j].len, dp[i][j].pi, dp[i][j].pj, j == n ? '\n' : ' '); puts("");

  string ans;
  int i = m, j = n;
  while (true) {
    int i2 = dp[i][j].pi;
    int j2 = dp[i][j].pj;
    if (i2 < 0) break;
    ans += s[i2];
    i = i2, j = j2;
  }
  reverse(ans.begin(), ans.end());
  cout << ans << endl;
}

void input() {
  cin >> s;
  cin >> t;
}

int main() {
  input();
  solve();
  return 0;
}


Measured memory_bytes: 105856
#include <bits/stdc++.h>
#define modd 1000000007
using namespace std;
typedef long long int ll;
ll pow2[400001];
int main()
{
    pow2[0]=1;
    for(int i=1;i<=400000;i++)
    {
        pow2[i] = pow2[i-1]*2;
        pow2[i] = pow2[i]%modd;
        //cout<<pow2[i]<<endl;
    }
    ll ans=0;
    ll n;
    cin>>n;
    ll c[n];
    for(int i=0;i<n;i++)
    {
        cin>>c[i];
    }
    sort(c,c+n);
    for(ll i=0;i<n;i++)
    {
        ans = (ans + (n+1-i)*c[i])%modd;
    }
    ans = (ans*pow2[2*(n-1)])%modd;
    cout<<ans<<"\n";
}


Measured memory_bytes: 4992
#include<bits/stdc++.h>
/* 
*    coder :: ATUL_PANDEY_2608
*        >>> INDIA <<<
*/
using namespace std;

// #define  part ..
#define listi vector<int > 
#define listll vector<long long >
#define pii pair<int ,int > 
#define pll pair<long long ,long long >
#define heap priority_queue<long long >

#define pb(a) push_back(a)
#define mod 998244353
#define maxx 200006
#define ll long long 
#define quick   ios_base::sync_with_stdio(NULL),cin.tie(0);
#define rep(i,a,b) for(int i=a;i<b;i++)
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// #define test int t;cin>>t;while(t--)
// end of #define 

// define globals ...




 int Main()
{ 

  
  string s,t;

  cin>>s>>t;
  int l = int(s.length());

  int cnt=0;
  for(int i=0;i<l;i++){
  	if(s[i]!=t[i]){
  		cnt++;
  	}
  }

  cout<<cnt;


  
  return 0;
}























// main function..
int main(){

    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif

    Main();
    
    
}


Measured memory_bytes: 3856
#include <iostream>
using namespace std;
 
int main() {
    int a, b, c;
    cin >> a >> b >> c;

    if (a - b >= 0){
	  //a > b
      if (c - a >= 0){
        cout << a + b << endl;//c > a > b
      } else {
        cout << b + c << endl;//a > b , a > c
      } //b < a 
    } else if (c - b >= 0) {
      cout << b + a << endl;//c > b > a
    } else {
      cout << a + c << endl;//b>a,b>c
    }
}

Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
using namespace std;
#define REP(i,n) for(int i = 0; i < (int)n; i++)
#define FOR(i,a,b) for(int i = a; i < (int)b; i++)
#define pb push_back
#define mp make_pair
typedef vector<int> vi;
typedef pair<int, int> pi;
typedef long long ll;
typedef unsigned long long ull;
const int IINF = 1<<28;
const ll MOD = 1000000007;
const int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};

const int MAX_V = 367;
struct edge {
	int to, cap, cost, rev;
};
int V = MAX_V;
vector<edge> G[MAX_V];
int dist[MAX_V];

void add_edge(int from, int to, int cap, int cost) {
	G[from].pb((edge){to, cap, cost, G[to].size()});
	G[to].pb((edge){from, 0, -cost, G[from].size() - 1});
}

int min_cost_flow(int s, int t, int f) {
	int res = 0;
	int prevv[MAX_V] = {}, preve[MAX_V] = {};
	while(f > 0) {
		fill(dist, dist + V, IINF);
		dist[s] = 0;
		bool update = true;
		while(update) {
			update = false;
			REP(v, V) {
				if(dist[v] == IINF) continue;
				REP(i, G[v].size()) {
					edge &e = G[v][i];
					if(e.cap > 0 && dist[e.to] > dist[v] + e.cost) {
						dist[e.to] = dist[v] + e.cost;
						prevv[e.to] = v;
						preve[e.to] = i;
						update = true;
					}
				}
			}
		}
		if(dist[t] == IINF)
			return -1;
		int d = f;
		for(int v= t; v != s; v = prevv[v])
			d = min(d, G[prevv[v]][preve[v]].cap);
		f -= d;
		res += d * dist[t];
		for(int v= t; v != s; v = prevv[v]) {
			edge &e = G[prevv[v]][preve[v]];
			e.cap -= d;
			G[v][e.rev].cap += d;
		}
	}
	return res;
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n;
	while(cin >> n, n) {
		REP(i, MAX_V) {
			G[i].clear();
			dist[i] = 0;
		}
		REP(i, n) {
			int a, b, c;
			cin >> a >> b >> c;
			add_edge(a-1, b, 1, -c);
		}
		REP(i, 365)
			add_edge(i, i+1, 2, 0);
		cout << -min_cost_flow(0, 365, 2) << endl;
	}
	return 0;
}

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

int N; string s[1001001];

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

	cin >> N;
	int ab = 0;
	vector<pair<int, int> > P, Q;
	for (int i = 0; i < N; i++){
		cin >> s[i];

		int b = 0, mn = 0;
		for (char c : s[i]){
			if (c == '(') b++;
			else b--;
			mn = min(mn, b);
		}

		ab += b;
		if (b >= 0) P.push_back({ -mn, -b });
		else Q.push_back({ b - mn, b });
	}

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

	sort(P.begin(), P.end());
	sort(Q.begin(), Q.end());

	for (auto &t : { P, Q }){
		int b = 0;
		for (auto &p : t){
			if (b - p.first < 0){
				cout << "No" << endl;
				return 0;
			}
			b -= p.second;
		}
	}

	cout << "Yes" << endl;
	return 0;
}


Measured memory_bytes: 50180
/**
 * North North West
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

import static java.lang.Integer.parseInt;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;

		while ((line = br.readLine()) != null && !line.isEmpty()) {
			if (line.equals("#")) break;

			// h = north
			// t = west
			List<Character> dirs = new ArrayList<Character>();
			for (int i = line.length() - 1; i >= 0; ) {
				if (line.charAt(i) == 'h') {
					dirs.add('h');
					i -= 5;
				} else {
					dirs.add('t');
					i -= 4;
				}
			}

			int numerator = 0;
			int denominator = (int) Math.pow(2, dirs.size() - 1);

			if (dirs.get(0) == 'h') {
				numerator = 0;
			} else {
				numerator = 90 * denominator;
			}
			for (int i = 1; i < dirs.size(); i++) {
				if (dirs.get(i) == 'h') {
					numerator -= 90 * denominator / (int) Math.pow(2, i);
				} else {
					numerator += 90 * denominator / (int) Math.pow(2, i);
				}
			}
			while (denominator != 1 && numerator % 2 == 0) {
				numerator /= 2;
				denominator /= 2;
			}
			System.out.println(numerator + (denominator > 1 ? "/" + denominator : ""));
		}
	} //end while
} //end main

Measured memory_bytes: 17020
input=input()
num = input.split()
a=int(num[0])
b=int(num[1])
 
remainder=4-a%4
rva=a
rvb=0
dst=a+remainder-1
end=0;
if (dst >= b):
    dst=b
    end=1
 
for t in range(a, dst):
    rva = rva^(t+1)
 
if (end==0):
    remainder=b%4
    rvb=b-remainder
 
    for t in range(b-remainder, b):
        rvb = rvb^(t+1)
 
print(rva^rvb)


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


int main()
{
	std::ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    long test=1;
	
	while(test--)
	{
	    long B,a,b,c=0,k,d=0,i,n,j,temp,p,m,tx,ty,x,y,dx,dy;
	    cin>>n;
	    long arr[n+1];
	    for(i=1;i<=n;i++)
	    {
	        cin>>arr[i];
	        c+=arr[i];
	    }
	    cin>>m;
	    while(m--)
	    {
	        cin>>a>>b;
	        if(arr[a]>b)
	        cout<<c-(arr[a]-b)<<endl;
	        else 
	        cout<<c+b-arr[a]<<endl;
	    }
    }
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

using namespace std;
using ll = long long;

constexpr ll infl = 10000000000000007LL;
constexpr int inf = 1000000007;

int main() {
    ll a, b;
    cin >> a >> b;
    if (a * b <= 0)
        cout << "Zero" << endl;
    else if (a > 0 || (b - a + 1) % 2 == 0)
        cout << "Positive" << endl;
    else
        cout << "Negative" << endl;
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <cmath>
#include <string>
#include <set>
#include <vector>
#include <map>
#include <list>
using namespace std;
typedef pair<int, int> point;

int pjd(int x) {
    int i=2;
    while(i*i<=x) {
        if(x%i==0)
            return 0;
        i++;
    }
    return 1;
}

int main(void) {
    int q, i, l, r, c[100001]={0};
    cin >> q;
    
    for(i=3; i<=100000; i++) {
        if(pjd(i)&&pjd((i+1)/2))
            c[i] = c[i-1]+1;
        else
            c[i] = c[i-1];
    }
    
    for(i=0; i<q; i++) {
        cin >> l >> r;
        cout << c[r]-c[l-1] << endl;
    }
}


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

using namespace std;

#define FAST_IO ios_base::sync_with_stdio(0); cin.tie(0)
#define FOR(i, a, b) for(int i = (a); i <= (b); i++)
#define REP(n) FOR(O, 1, (n))
#define pb push_back
#define f first
#define s second
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<ll> vl;
typedef vector<piii> viii;

const int MAXN = 500100, MAXK = 30;
const ll MOD = 1e9+7;
const ll INF = 1e18;
const ld PI = asin(1) * 2;

int n, m;
int p[MAXN];
string s[MAXN];
bool ac[MAXN];
int pen[MAXN];

int main()
{
    FAST_IO;

    cin >> n >> m;
    FOR(i, 1, m) {
        cin >> p[i] >> s[i];

        if (ac[p[i]]) continue;
        if (s[i] == "AC") ac[p[i]] = true;
        if (!ac[p[i]]) pen[p[i]]++;
    }

    int penCnt = 0, ans = 0;
    FOR(i, 1, n) {
        if (!ac[i]) continue;
        ans++;
        penCnt += pen[i];
    }

    cout << ans <<" " << penCnt << endl;

    return 0;
}


Measured memory_bytes: 11520
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <ctime>
#include <bitset>
#include <complex>
#include <chrono>
#include <random>
#include <functional>

using namespace std;

#define int long long

const int INF = 1e12 + 239;

int solve(vector<pair<int, char>> a, char F, char S) {
	int mx = -2 * INF;
	int ans = INF;
	for (auto [coord, c] : a) {
		if (c == S) {
			ans = min(ans, coord - mx);
		}
		if (c == F) {
			mx = coord;
		}
	}
	return ans;
}

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

	int n;
	cin >> n;
	map<int, vector<pair<int, char>>> xs;
	map<int, vector<pair<int, char>>> ys;
	map<int, vector<pair<int, char>>> dl;
	map<int, vector<pair<int, char>>> sm;
	for (int i = 0; i < n; i++) {
		int x, y;
		char c;
		cin >> x >> y >> c;
		x *= 2;
		y *= 2;
		xs[x].push_back({y, c});
		ys[y].push_back({x, c});
		dl[x - y].push_back({x, c});
		sm[x + y].push_back({x, c});
	}
	int ans = INF;
	for (auto [x, v] : xs) {
		sort(v.begin(), v.end());
		int C = solve(v, 'U', 'D');
		if (C == INF) continue;
		ans = min(ans, C / 2);
	}
	for (auto [y, v] : ys) {
		sort(v.begin(), v.end());
		int C = solve(v, 'R', 'L');
		if (C == INF) continue;
		ans = min(ans, C / 2);
	}
	for (auto [D, v] : dl) {
		sort(v.begin(), v.end());
		int C = solve(v, 'R', 'D');
		if (C != INF) ans = min(ans, C);
		C = solve(v, 'U', 'L');
		if (C != INF) ans = min(ans, C);
	}
	for (auto [S, v] : sm) {
		sort(v.begin(), v.end());
		int C = solve(v, 'D', 'L');
		if (C != INF) ans = min(ans, C);
		C = solve(v, 'R', 'U');
		if (C != INF) ans  = min(ans, C);
	}
	if (ans == INF) {
		cout << "SAFE\n";
	} else {
		cout << ans * 5 << endl;
	}
}

Measured memory_bytes: 76992
using System;

class Program
{
    static void Main()
    {
        var inp = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        for (int i = 0; i < 2; i++) if (inp[i] == 1) inp[i] = 14;
        if (inp[0] > inp[1]) Console.WriteLine("Alice");
        else if (inp[0] < inp[1]) Console.WriteLine("Bob");
        else Console.WriteLine("Draw");
    }
}


Measured memory_bytes: 13140
using System;
class Thin {
    static void Main() {
        string input = Console.ReadLine();
        int height = int.Parse(input.Split(' ')[0]);

        for(int i = 0; i < height; i++) {
            input = Console.ReadLine();
            Console.WriteLine(input);
            Console.WriteLine(input);
        }
    }
}

Measured memory_bytes: 2776
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>

using namespace std;

#define ll long long

int main(void){
    int k, x;
    cin >> k >> x;

    for(int i = x-(k-1);i <= x+(k-1);++i){
        cout << i << " ";
    }
    cout << endl;

    return 0;
}

Measured memory_bytes: 256
parseInt(x) = parse(Int, x)
parseBigInt(x) = parse(BigInt, x)
parseFloat(x) = parse(Float64, x)
parseBigFloat(x) = parse(BigFloat, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
    s=chomp(readline())
    if s=="ABC"
        println("ARC")
    else
        println("ABC")
    end
end
main()

Measured memory_bytes: 151928
a,b,k=map(int,input().split())
A=[]
if k>=b-a:
  for i in range(b-a+1):
    print(a+i)
else:
  for i in range(k):
    A.append(a+i)
    if a+i!=b-i:
      A.append(b-i)
  for i in range(len(A)):
    print(sorted(A)[i])

Measured memory_bytes: 3060
using System;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
    class Program2
    {

        static void Main(string[] args)
        {
            int N = Int32.Parse(Console.ReadLine());
            List<string> items = new List<string>(N);

            for (int i = 0; i < N; i++)
            {
                    items.Add(Console.ReadLine());
            }
            Console.WriteLine(items.Distinct().Count().ToString());
        }
    }
}

Measured memory_bytes: 48148
def main():
    S = input()

    n1, n2 = int(S[:2]), int(S[-2:])

    mmyy = 1 <= n1 <= 12
    yymm = 1 <= n2 <= 12

    if mmyy and yymm:
        print("AMBIGUOUS")
    elif mmyy:
        print("MMYY")
    elif yymm:
        print("YYMM")
    else:
        print("NA")



if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
#include <string>
#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;
int main()
{

	int length;
	string s;
	cin >> length >> s;

	int x = 0;
	int max = 0;
	for (int i = 0; i < length; i++) {
		if (s[i] == 'I') {
			x++;
		}
		else { x--; }
		if (max < x) {
			max += 1;
		}
    }
	cout << max << endl;
	int wait;
	cin >> wait;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc=new Scanner(System.in);
        double a=sc.nextDouble();
        double b=sc.nextDouble();
        double c=sc.nextDouble();
        System.out.println(a*b*Math.sin(Math.toRadians(c))/2);
        System.out.println(a+b+Math.sqrt(a*a+b*b-2*a*b*Math.cos(Math.toRadians(c))));
        System.out.println(b*Math.sin(Math.toRadians(c)));
    }
}



Measured memory_bytes: 27884
// Confessions of a Dangerous Mind

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

const int N = 2e5 + 3;
const int M = 1e6 + 7;
const long long MOD = 1e9 + 7;
const long long INF = 1e18 + 9;
const int SM = 2e3 + 5;
const long long T = 5e3;
const int logN = 22, BL = 400;
const double EPS = 3e-16;

/*
	Keep moving forward. Take the Leap of Faith
*/

int main(){
//  freopen(".in", "r", stdin);
//  freopen(".out", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
	
	long long n; cin >> n;
	
	map<long long, long long> m;
	vector<long long> a(n + 1);
	long long ans = 0;
	for(long long i = 1; i <= n; i++){
		cin >> a[i];
		m[i - a[i]]++;
	}
	
	for(long long i = 1; i <= n; i++){
		ans += m[a[i] + i];
	}
	
	cout << ans;
	
    return 0;
}

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

int main() {
  string N;
  cin >> N;
  
  long long result=0;
  int length = (int)N.size();
  for(int i=0; i<length; i++) {
    char& num_c = N.at(i);
    int num = num_c - '0';
    result += num;
  }
  
  if (result%9 == 0) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 3720
function Main(input) {
  input = input.split("\n");
  var N = parseInt(input[0].split(" ")[0]);
  var M = parseInt(input[0].split(" ")[1]);
  var S = input[1].split(" ").map(i => parseInt(i));
  var T = input[2].split(" ").map(i => parseInt(i));
  var mod = Math.pow(10,9)+7;
  var dp=new Array(N+1).fill(0);
  var sum=new Array(N+1).fill(0);
  for(var i=0;i<N+1;i++){
    var tmp=new Array(M+1).fill(0);
    dp[i]=tmp;
  }
  for(var i=0;i<N;i++){
    for(var j=0;j<M;j++){
      if(S[i]==T[j]){
        dp[i+1][j+1]=(dp[i][j+1]+dp[i+1][j]+1)%mod;
      }else{
        dp[i+1][j+1]=(dp[i][j+1]+dp[i+1][j]+(mod-dp[i][j]))%mod;
      }
    }
  }
  var ans=dp[N][M]+1;

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 71216
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i < (n);++i)
using namespace std;
using ll = long long; 
using P = pair<int,int>;
using vv = vector<vector<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;}

const int INF = 2147483647;
const long long inf = 1ll << 60;
const long long mod = 1000000007;

int dx[4] = {1,0,-1,0};
int dy[4] = {0,-1,0,1};
int main(){
    int n;cin >> n;
    ll ans = 1;
    bool ok = false;
    rep(i,n){
	ll a;cin >> a;
	if(a==0){
	    cout << 0 << endl;
	    return 0;
	}
	if(a  <= 1000000000000000000/(__int128)ans){
	   ans *= a; 
	}else{
	    ok = true;
	}
    }
    if(ok) cout << -1 << endl;
    else cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3604
n,k = gets.chomp.split(" ").map{|e|e.to_i}

data = Array.new(n, 0)
k.times do
	d = gets.chomp.to_i
	for i in gets.chomp.split(" ").map{|e|e.to_i} do
		data[i-1] += 1
	end
end
sum = 0
for i in data do
	if i==0 then sum+=1 end
end

print(sum)

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repr(i, n) for(int i = (int)(n); i >= 0; i--)
#define repm(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define repmr(i, m, n) for(int i = (int)(n); i >= (int)(m); i--)
#define all(x) (x).begin(),(x).end()
#define inf 2e9
#define MOD 1000000007

using namespace std;
typedef long long ll;

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

    int ans = 0;
    repm(i,1,n+1){
        int cnt = 0;
        if(i%2 == 1){
            repm(j,1,i+1){
                if(i%j == 0) cnt++;
            }
        }
        if(cnt == 8) ans++;
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
unittest
{
	assert( [ "6 1", "3" ].parse.expand.solve == 4 );
	assert( [ "10 2", "4", "5" ].parse.expand.solve == 0 );
	assert( [ "100 5", "1", "23", "45", "67", "89" ].parse.expand.solve == 608200469 );
}



import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nm = input.front.split.to!( long[] );
	auto as = new long[]( nm[ 1 ] );
	foreach( ref a; as )
	{
		input.popFront;
		a = input.front.to!( long );
	}
	return tuple( nm[ 0 ], as );
}

auto solve( long n, long[] as )
{
	const MOD = 10L ^^ 9 + 7;
	
	auto dp = new long[]( 1 + n );
	dp[ 0 ] = 1;
	for( auto i = 1L; i < dp.length; i++ )
	{
		if( !as.empty && i == as.front )
		{
			as.popFront;
			continue;
		}
		if(      0 <= i - 2 && 0 < dp[ i - 2 ] ) dp[ i ] = ( dp[ i - 1 ] + dp[ i - 2 ] ) % MOD;
		else if( 0 <= i - 1 && 0 < dp[ i - 1 ] ) dp[ i ] = dp[ i - 1 ];
	}
	return dp[ $ - 1 ];
}


Measured memory_bytes: 4732
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vstr=vector<string>;
using vvstr=vector<vector<string>>;
using vch=vector<char>;
using vvch=vector<vector<char>>;
using vbo=vector<bool>;
using vvbo=vector<vector<bool>>;
using vpii=vector<pair<int,int>>;
using pqsin=priority_queue<int,vector<int>,greater<int>>;
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define decp(n) cout<<fixed<<setprecision((int)n)
const int inf=1e9+7;
const ll INF=1e18;

int main(){
    int n;cin>>n;
    vin b(n);
    set<int> s;
    map<int,int> m;
    int j=0;
    rep(i,n){
        int a;cin>>a;
        if(!(s.count(a))){
            s.insert(a);
            m[a]=j;
            b[j]++;
            j++;
        }
        else b[m[a]]++;
    }
    int ans=0;
    rep(i,j)if(b[i]%2)ans++;
    cout<<ans<<endl;
}

Measured memory_bytes: 9984