akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define PI 3.14159265358979
#define MOD 1000000007 // = 10^9 + 7

using namespace std;
using ll = long long;

void solve()
{
	int n, a;
	cin >> n;

	int now_num = 1;
	int cnt = 0;

	for(int i = 0; i < n; ++i)
	{
		cin >> a;
		if (a == now_num)
		{
			cnt++;
			now_num++;
		}
	}

	if (now_num == 1)
	{
		cout << -1;
	}
	else
	{
		cout << n - cnt;
	}
}

int main()
{
	fastio;
	solve();

	return 0;
}

Measured memory_bytes: 256
#include <functional>
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <string>
#include <cstring>
#include <math.h>
using namespace std;


int main() {
    string n;
 
   cin >> n;
  
  if(n=="Sunny"){
    cout << "Cloudy" << endl;
  }else if(n=="Cloudy"){
    cout << "Rainy" << endl;
  }else if(n=="Rainy"){
    cout << "Sunny" << endl;
  }
  
   
   
  return 0;
}

Measured memory_bytes: 256
from copy import copy
import random
import math
import sys
input = sys.stdin.readline
D = int(input())
c = list(map(int,input().split()))
s = [list(map(int,input().split())) for _ in range(D)]
last = [0]*26
ans = [0]*D
score = 0
for i in range(D):
    ps = [0]*26
    for j in range(26):
        pl = copy(last)
        pl[j] = i+1
        ps[j] += s[i][j]
        for k in range(26):
            ps[j] -= c[k]*(i+1-pl[k])
    idx = ps.index(max(ps))
    last[idx] = i+1
    ans[i] = idx+1
    score += max(ps)
for k in range(1,40001):
    na = copy(ans)
    x = random.randint(1,365)
    y = random.randint(1,365)
    if x == y:
        continue
    na[x-1],na[y-1] = na[y-1],na[x-1]
    last = [0]*26
    ns = 0
    for i in range(D):
        last[na[i]-1] = i+1
        ns += s[i][na[i]-1]
        for j in range(26):
            ns -= c[j]*(i+1-last[j])
    T = 300-(298*k/40000)
    p = pow(math.e,-abs(ns-score)/T)
    if ns > score or random.random() < p:
        ans = na
        score = ns
for a in ans:
    print(a)

Measured memory_bytes: 87864
#include "bits/stdc++.h"
#define ff first
#define ss second
#define szof(_x) ((int) (_x).size())
#define TASK_NAME ""

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9 + 7;
const ll INFL = 1e18 + 123;
const double PI = atan2(0, -1);
mt19937 tw(960172);
ll rnd(ll x, ll y) { static uniform_int_distribution<ll> d; return d(tw) % (y - x + 1) + x; }


void solve() {
	int n, s;
	cin >> n >> s;
	set<pair<int, ll>> all;
	for (int i = 0; i < n; ++i) {
		int x, p;
		cin >> x >> p;
		all.insert({x, p});
	}

	ll ans = 0;
	int fl = -1;
	while (true) {
		if (all.begin()->ff > s) {
			ans += (--all.end())->ff - s;
			break;
		}
		if ((--all.end())->ff < s) {
			ans += s - all.begin()->ff;
			break;
		}

		if ((all.begin())->ss < (--all.end())->ss) {
			auto tmp = *all.begin();
			all.erase(all.begin());
			auto tmp2 = *--all.end();
			all.erase(--all.end());
			if (fl != 1) {
				ans += tmp2.ff - tmp.ff;
				fl = 1;
			}
			tmp2.ss += tmp.ss;
			all.insert(tmp2);
		} else {
			auto tmp = *all.begin();
			all.erase(all.begin());
			auto tmp2 = *--all.end();
			all.erase(--all.end());
			if (fl != 2) {
				ans += tmp2.ff - tmp.ff;
				fl = 2;
			}
			tmp.ss += tmp2.ss;
			all.insert(tmp);
		}
		//cerr << ans << endl;
	}

	cout << ans << "\n";
}


int main() {
	//freopen(TASK_NAME ".in", "r", stdin);
	//freopen(TASK_NAME ".out", "w", stdout);
	cerr << fixed << setprecision(15);
	cout << fixed << setprecision(15);
	ios::sync_with_stdio(false);

	int tests = 1;
	// cin >> tests;
	for (int it = 1; it <= tests; ++it) {
		solve();
	}
	
	#ifdef LOCAL
		cerr << "time: " << clock() << " ms\n";
	#endif
	return 0;
}

Measured memory_bytes: 6528
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
using namespace std;
int main(){
    int n,a;
    cin >> n;
    int ans = 0;
    rep(i,n) {
        cin >> a;
        a--;
        ans += a;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
A, B, K = map(int, input().split())

for i in range(int(K/2)):
    if A % 2 == 1:
        A = A - 1
    A = A// 2
    B = B + A 
    
    if B % 2 == 1:
        B = B -1
    B = B//2
    A = A + B
    
if K % 2 ==0:
    print(A,B)
else:
    if A % 2 == 1:
        A = A - 1
    A = A// 2
    B = B + A
    print(A,B)

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

#define rep(l, r) for (int i = (l); i < (r); i++)

typedef long long ll;
 
using namespace std;

int main() {
    char b;
    cin >> b;

    switch (b) {
        case 'A':
            cout << 'T';
            break;
        case 'C':
            cout << 'G';
            break;
        case 'G':
            cout << 'C';
            break;
        case 'T':
            cout << 'A';
            break;
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);i++)
//#define int long long  
int main(){
    int N,K,X,Y;
    cin >> N >> K >> X >> Y;
    cout << min(K,N)*X + Y*max(0,N-K) << endl;
	return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<int> a(n, 0);
  vector<int> ans(n, 0);
  for (int i = 1; i < n; i++) {
    cin >> a.at(i);
  }

  for (int i = 1; i < n; i++) ans.at(a.at(i) - 1)++;

  for (int i = 0; i < n; i++) {
    cout << ans.at(i) << endl;
  }
  return 0;
}

Measured memory_bytes: 4784
#include <bits/stdc++.h>
using namespace std;
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define lli long long int
#define tc int t;cin>>t;while(t--)
#define all(x) x.begin(),x.end()
#define f first
#define s second
#define pb push_back
#define vi vector<int>
#define vll vector<lli>
#define vpi vector<pair<int,int> > 
#define vpll vector<pair<lli,lli> > 
#define vvi vector<vector<int> >
#define vvll vector<vector<lli> > 
#define maxn 6005



int main(){
    fastio;
    string s;
    cin>>s;
    lli tot=0;
    for(int i=0;i<s.length();i++)
    {
        tot+=s[i]-'0';tot%=9;
    }
    if(tot) cout<<"No\n";
    else cout<<"Yes\n";
    return 0;
}


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

int a[200010];
int main(){
	int n, m, x, y;
	scanf("%d%d", &n, &m);
	for(int i = 0;i < m;i++){
		scanf("%d%d", &x, &y);
		if(x == 1 || x == n)a[y]++;
		if(y == 1 || y == n)a[x]++;
	}
	int ans = 0;
	for(int i = 0;i <= n;i++)if(a[i] >= 2)ans++;
	if(ans)printf("POSSIBLE\n");
	else printf("IMPOSSIBLE\n");
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#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++)
typedef long long ll;
using namespace std;

int main()
{
  int a;
  string s;
  cin >> a;
  cin >> s;
  
  if(a >= 3200) cout << s << endl;
  else cout << "red" << endl;
  

}

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

int main(){
  int A,B;
  cin >>A>>B;
  
  int ans = 0;
  int i = 1;
  while(true){
    if(B==1){
      ans = 0;
      cout <<ans<< endl;
      return 0;
    }
    if(i*A-i+1>=B){
      ans=i;
      cout <<ans<< endl;
      return 0;
    }
    i++;
  }
}

Measured memory_bytes: 256
//#pragma GCC optimze("Ofast")
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define mod 1000000007
#define md 998244353
#define trace(...)
#define ll long long int
#define ld long double
#define fi first
#define se second
#define fr(i,a,b) for(ll i=a;i<=b;i++)
#define frr(i,b,a) for(ll i=b;i>=a;i--)
#define mem(a) memset(a, 0, sizeof(a))
#define vpi std::vector<pair<int,int>>
#define pii pair<int,int>
#define pb push_back
#define sall(v) sort(v.begin(),v.end())
#define all(v) (v.begin(),v.end())
#define minf -10000000
const ll infl=0x3f3f3f3f3f3f3f3fLL;
const int infi=0x3f3f3f3f;
typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> oset;
auto clk=clock();
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
    uniform_int_distribution<int> uid(0,lim-1);
    return uid(rang);
}
ll power(ll x, ll y,ll p) { 
    ll res = 1;      // Initialize result 
    x = x % p;  // Update x if it is more than or equal to p 
    while (y > 0) {  
        if (y & 1) // If y is odd, multiply x with result
            res = (res*x) % p;  
        y = y>>1; // y = y/2 // y must be even now
        x = (x*x) % p;   
    } 
    return res; 
}
ll power(ll x, ll y) { 
    ll res = 1;      // Initialize result 
    while (y > 0) {    
        if (y & 1)// If y is odd, multiply x with result 
            res = (res*x) ;  
        y = y>>1; // y = y/2 // y must be even now 
        x = (x*x);   
    } 
    return res; 
}
 
ll max3(ll a,ll b,ll c){
    return max(a,max(b,c));
}
ll min3(ll a,ll b,ll c){
    return min(a,min(b,c));
}
bool isPrime(ll n) { // Corner cases 
    if (n <= 1) 
        return false; 
    if (n <= 3) 
        return true; 
    if (n % 2 == 0 || n % 3 == 0) 
        return false; 
    for (ll i = 5; i * i <= n; i = i + 6) 
        if (n % i == 0 || n % (i + 2) == 0) 
            return false; 
    return true; 
}

void solve() {
    int r;cin>>r;
    cout<<2*M_PI*r<<endl;
    return ;
}

int main(){
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
    
    int t;
    // cin>>t;
    t=1;
    while(t--){
        solve();
    }
    
    return 0;
}

Measured memory_bytes: 3804
H,W = map(int,input().split())
A = [input() for i in range(H)]
sy = sx = ty = tx = -1
for i,row in enumerate(A):
    for j,c in enumerate(row):
        if c=='S':
            sy,sx = i,j
        if c=='T':
            ty,tx = i,j
if sy==ty or sx==tx:
    print(-1)
    exit()

S = H+W
G = S+1
P = G+1
es = [[] for i in range(P)] # [[to1,cap1,rev1], ...]

def add_edge(fr,to,cap):
    es[fr].append([to,cap,len(es[to])])
    es[to].append([fr,0,len(es[fr])-1])
INF = float('inf')
add_edge(S, sy, INF)
add_edge(S, H+sx, INF)
add_edge(ty, G, INF)
add_edge(H+tx, G, INF)
for i,row in enumerate(A):
    for j,c in enumerate(row):
        if c!='o': continue
        add_edge(i, H+j, 1)
        add_edge(H+j, i, 1)

level = [0] * P
iters = [0] * P
from collections import deque
def dinic_max_flow(s,t):
    global iters

    def _bfs(s):
        global level
        level = [-1] * P
        level[s] = 0
        q = deque([s])
        while q:
            v = q.popleft()
            for to,cap,rev in es[v]:
                if cap > 0 and level[to] < 0:
                    level[to] = level[v] + 1
                    q.append(to)

    def _dfs(v,t,f):
        if v == t: return f
        for i in range(iters[v],len(es[v])):
            iters[v] += 1
            to,cap,rev = es[v][i]
            if es[v][i][1] > 0 and level[v] < level[to]:
                d = _dfs(to,t,min(f,es[v][i][1]))
                if d > 0:
                    es[v][i][1] -= d #cap
                    es[to][rev][1] += d
                    return d
        return 0

    flow = 0
    while True:
        _bfs(s)
        if level[t] < 0: return flow
        iters = [0] * P
        f = 0
        while True:
            f = _dfs(s,t,INF)
            if f <= 0: break
            flow += f

print(dinic_max_flow(S,G))

Measured memory_bytes: 7412
function Main(input){
	input = input.split("\n");
	var n = input[2];
	var arr = input[1].split("");
	var s = arr[n-1];
	for(var i=0;i<arr.length;i++){
		if(arr[i]!=s) arr[i] = "*";
	}
	console.log(arr.join(""))
}Main(require("fs").readFileSync("/dev/stdin", "utf8").trim());

Measured memory_bytes: 7372
#include<stdio.h>

int main()
{
 int N;
 int first;
 int last;

 scanf("%d",&N);

 first = N/100;
 last = N - 100*first;
 last = N - 10*(last/10) - 100*first;

 if(last == first)
 {
  printf("Yes\n");
 }else{
  printf("No\n");
 }

 return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>

using namespace std;

int n, a = 0, b = 0, c = 0, d = 0;
string s;

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    while (n--) {
        cin >> s;
        if (s == "AC")
            a++;
        else if (s == "WA")
            b++;
        else if (s == "TLE")
            c++;
        else
            d++;
    }
    cout << "AC x " << a << endl;
    cout << "WA x " << b << endl;
    cout << "TLE x " << c << endl;
    cout << "RE x " << d << endl;

    return 0;
}

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

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

    int n, m;
    cin >> n >> m;
    char A[n][n];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            cin >> A[i][j];
        }
    }
    char B[m][m];
    for(int i = 0; i < m; i++){
        for(int j = 0; j < m; j++){
            cin >> B[i][j];
        }
    }

    for(int i = 0; i < n - m + 1; i++){
        for(int j = 0; j < n - m + 1; j++){
            int cnt = 0;
            for(int k = i; k < i + m; k++){
                for(int l = j; l < j + m; l++){
                    if(A[k][l] == B[k - i][l - j]) cnt++;
                }
            }
            if(cnt == m * m){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int D,N;
  cin >> D >> N;
  if (N == 100) N++;
  if (D == 0) cout << N;
  if (D == 1) cout << N * 100;
  if (D == 2) cout << N * 10000;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <vector>
#include <utility>
#include <numeric>
#include <string>
#include <set>
#include <map>
#include <tuple>
#include <queue>
#include <stack>
#define rep(i, a, n) for(int (i) = (int)(a);(i) < (int)(n);++(i))
#define repe(i, a, n) for(int (i) = (int)(a);(i) <= (int)(n);++(i))
#define repif(i, a, x) for(int (i) = (int)(a);(x);++(i))
#define repr(i, a, n) for(int (i) = (int)(a);(i) > (int)(n);--(i))
#define reper(i, a, n) for(int (i) = (int)(a);(i) >= (int)(n);--(i))
#define SIZE(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()
#define RNG(x, n) &((x)[0]), &((x)[n])
#define BRK(x) { (x); break; }
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define yes cout << "yes" << endl;
#define no cout << "no" << endl;
#define fcout cout << fixed << setprecision(10)
#define pb push_back
#define EPS (1e-20)
#define INF 2147483647
#define MOD 1000000007
using llint = long long;
using VI = std::vector<int>;
using PII = std::pair<int, int>;
using SI = std::set<int>;
using MII = std::map<int, int>;
using TIII = std::tuple<int, int, int>;
using namespace std;


int A, B, C, D, E, F;


void solve(){
	A *= 100, B *= 100;
	int w = 0, s = 0;
	int ansW = 0, ansS = 0;
	repif(i, 0, A*i<=F){
		repif(j, 0, B*j<=F-A*i){
			w = A*i+B*j;
			repif(k, 0, C*k<=F-w){
				repif(l, 0, D*l<=F-w-C*k){
					s = C*k+D*l;
					if(w == 0) break;
					if(w+s > F) break;
					if(ansW == 0 && ansS == 0) BRK((ansW=w, ansS=s));
					if(100*s > E*w) break;
					if(s*(ansW+ansS) > ansS*(w+s)) ansW = w, ansS = s;
				}
			}
		}
	}
	cout << ansW+ansS << ' ' << ansS << endl;
}


signed main(){
	cin >> A >> B >> C >> D >> E >> F;

	solve();

	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<vector>
#define ms(i, j) memset(i, j, sizeof i)
#define LL long long
#define db double
using namespace std;
int n;
int tw, fr;
void clean() {
	tw = fr = 0;
}
void solve() {
	clean();
	for (int i = 1; i <= n; i++) {
		int x;
		scanf("%d", &x);
		if (x % 4 == 0) fr++; else if (x % 2 == 0) tw++;
	}
	if (tw) {
		if (fr >= n - tw - fr) {
			printf("Yes\n");
		} else printf("No\n");
	} else if (fr + 1 >= n - tw - fr) {
		printf("Yes\n");
	} else printf("No\n");
}
int main() {
	while (scanf("%d", &n) == 1) solve();
	return 0;
}


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

namespace cShaprTest
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split().ToArray()[0];

            var acgt = " ACGT";
            var total = 0;

            for (var i = 0; i < input.Length; i++)
            {
                if (acgt.Contains(input[i]))
                {
                    var sum = 1;
                    for (var j = i + 1; j < input.Length; j++)
                    {
                        if (acgt.Contains(input[j]))
                        {
                            sum++;
                        } else
                        {
                            break;
                        }
                    }

                    total = Math.Max(total, sum);
                }
            }

            Console.WriteLine(total);
        }
    }
}

Measured memory_bytes: 13268
def get_quad(n, p):
    for ni in range(n,0,-1):
        if p[ni] and p[ni - 2] and p[ni - 6] and p[ni - 8]:
            return ni
        
def sieve():
    n = 10000001
    p = [1] * n
    p[0] = p[1] = 0
    
    for i in range(int(n ** 0.5)):
        if p[i]:
            for j in range(2 * i, len(p), i):
                p[j] = 0
    return p
import sys
f = sys.stdin

prime = sieve()
while True:
    n = f.readline().strip()
    if not n.isdigit():
        continue
    n = int(n)
    if n == 0:
        break
    print(get_quad(n, prime))

Measured memory_bytes: 84652
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;

	void run(){
		for(;;){
			int m=sc.nextInt();
			if(m==0){
				break;
			}
			int sum=0;
			double area1=0;
			for(int i=0; i<m-1; i++){
				int deg=sc.nextInt();
				area1+=Math.sin(Math.toRadians(deg))/2;
				sum+=deg;
			}
			area1+=Math.sin(Math.toRadians(360-sum))/2;

			int n=sc.nextInt();
			sum=0;
			double area2=0;
			for(int i=0; i<n-1; i++){
				int deg=sc.nextInt();
				area2+=Math.sin(Math.toRadians(deg))/2;
				sum+=deg;
			}
			area2+=Math.sin(Math.toRadians(360-sum))/2;
			// debug(area1,area2);
			
			if(area1>area2+EPS){
				println("1");
			}else if(area1+EPS<area2){
				println("2");
			}else{
				println("0");
			}
		}
	}

	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 <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

int main()
{
  char a;
  cin >> a;
  if (a == 'a' || a == 'i' || a == 'u' || a == 'e' || a == 'o')
    cout << "vowel" << endl;
  else
    cout << "consonant" << endl;
}


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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { cout << #a << " = " << a << endl; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T> void operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) cin >> e; }

typedef long long ll;
int const inf = 1<<29;

#define END { cout << "No\n"; exit(0); }

int main() {
  int N; cin >> N;
  int t = 0, x = 0, y = 0;
  rep(i, N) {
    int nt, nx, ny;
    cin >> nt >> nx >> ny;
    int cost = abs(nx - x) + abs(ny - y);
    int dftime = nt - t;
    if (cost > dftime) END;
    if (cost < dftime && (dftime - cost) % 2) END;
    x = nx, y = ny, t = nt;
  }

  cout << "Yes\n";
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#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++)
using namespace std;
int main(){
  int n,m;
  cin>>n>>m;
  vector<int>p(m),y(m);
  vector<int>a[n];
  rep(i,m){
    cin>>p.at(i)>>y.at(i);
    p.at(i)--;
    a[p.at(i)].push_back(y.at(i));
  }
  rep(i,n){
    sort(a[i].begin(),a[i].end());
  }
  map<int,int>memo;
  rep(i,n){
    rep(j,a[i].size()){
      memo[a[i].at(j)]=j+1;
    }
  }
  rep(i,m){
    string s=to_string(memo.at(y.at(i)));
    while(s.size()<6){
      s='0'+s;
    }
    s=to_string(p.at(i)+1)+s;
    while(s.size()<12){
      s='0'+s;
    }
    cout<<s<<endl;     
  }
}

Measured memory_bytes: 12416
def dfs(v, edges, visited, matched):
    for u in edges[v]:
        if u in visited:
            continue
        visited.add(u)
        if matched[u] == -1 or dfs(matched[u], edges, visited, matched):
            matched[u] = v
            return True
    return False


xn, yn, e = map(int, input().split())
edges = [set() for _ in range(xn)]
matched = [-1] * yn

for _ in range(e):
    x, y = map(int, input().split())
    edges[x].add(y)

print(sum(dfs(s, edges, set(), matched) for s in range(xn)))

Measured memory_bytes: 8556
#include<bits/stdc++.h>
#define MAX 100005
using namespace std;
 
int main(){
  int n, x, a[MAX], ans = 0, i, j;
  scanf("%d%d", &n, &x);
  for(int i = 0; i < n; i++){
    scanf("%d", &a[i]);
    a[i] = abs(a[i]-x);
  }
  while(n-1){
    sort(a, a+n);
    if(a[n-1] != 0 && a[n-2] == 0) break;
    for(i = 0; i < n && a[i] == 0; i++);
    for(j = i+1; j < n; j++) a[j] %= a[i];
  }
  printf("%d\n", a[n-1]);
}

Measured memory_bytes: 640
#include <stdio.h>

int main()
{
  char S[3];
  int i,N=0;
  int c0=0,c1=0,c2=0,c3=0;

  scanf("%d",&N);
  for(i=0; i<N; i++){
    scanf("%s",S);
      if(S[0] == 'A'){
        c0++;
      }else if(S[0] == 'W'){
        c1++;
      }else if(S[0] == 'T'){
        c2++;
      }else{
        c3++;
      }
  }

    printf("AC x %d\n", c0);
    printf("WA x %d\n", c1);
    printf("TLE x %d\n", c2);
    printf("RE x %d\n", c3);

    return 0;
}


Measured memory_bytes: 2136
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
using namespace std;
#define pb push_back
#define pf push_fron
#define INF 1e9
#define PI acos(-1)
typedef long long ll;



int main() {
	
	string str;
	cin >> str;
	bool c[3] = { false };
	bool flag = true;

	for (int i = 0; i < 3; i++) {
		c[str[i] - 'a'] = true;
	}

	for (int i = 0; i < 3; i++) {
		if (!c[i])flag = false;
	}

	cout << ((flag) ? "Yes" : "No") << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;


int main()
{
    set<int> setOfNumbers;
    REP(i, 3) {
        int a;
        cin >> a;
        setOfNumbers.insert(a);
    }
    cout << setOfNumbers.size() << endl;
    return 0;
}

Measured memory_bytes: 256
#![allow(non_snake_case)]
#![allow(unused_variables)]
#![allow(dead_code)]

fn main() {
    let s: Vec<char> = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().chars().collect()
    };
    let t: Vec<char> = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        line.trim().chars().collect()
    };

    // 各アルファベットについて、sの出現位置をメモしておく
    // メモした出現位置用いた二分探索により、次のインデックスを計算する　
    let N = s.len();
    let mut x: std::collections::HashMap<_, _> = (0..26).map(|i| {
        let ascii_code = ('a' as u8) + i;
        (ascii_code as char, vec![])
    }).collect();
    for (i, &c) in s.iter().enumerate() { x.get_mut(&c).unwrap().push(i as i64); }
    for (i, &c) in s.iter().enumerate() { x.get_mut(&c).unwrap().push((i + N) as i64); }
    fn bis<P>(ok: i64, ng: i64, p: P) -> i64
        where P: Fn(i64) -> bool {
        let mid = (ok + ng) / 2;
        if (ok - ng).abs() == 1 {
            ok
        } else if p(mid) {
            bis(mid, ng, p)
        } else {
            bis(ok, mid, p)
        }
    }
    let k: i64 = t.iter().fold(-1, |res, &c| {
        if res == -2 || x[&c].is_empty() { -2 }
        else {
            let i = res % (N as i64);
            let j = bis(x[&c].len() as i64, -1, |j| x[&c][j as usize] > i);
            res + (x[&c][j as usize] - i)
        }
    });
    let ans = if k >= 0 { k + 1 } else { -1 };

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


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

using namespace std;

map<pair<int, int>, int> mp;
long long an[10];
int h, w, n;

bool ok(int a, int b){
	return a > 0 && b > 0 && a + 2 <= h && b + 2 <= w;
}

int main(){
//	freopen("input.inp", "r", stdin);
	scanf("%d%d%d",&h,&w,&n);
	for(int i = 1; i <= n; ++i){
		int x, y;
		scanf("%d%d",&x,&y);
		for(int j = x - 2; j <= x; ++j){
			for(int k = y - 2; k <= y; ++k){
				if (ok(j, k)) ++mp[make_pair(j, k)];
			}
		}
	}
	for(map<pair<int, int>, int>::iterator it = mp.begin(); it != mp.end(); ++it){
		++an[it->second];
	}
	for(int i = 1; i < 10; ++i) an[0] += an[i];
	an[0] = 1ll * (h - 2) * (w - 2) - an[0];
	for(int i = 0; i < 10; ++i) printf("%lld\n",an[i]);
	return 0;
}

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

typedef long long int ll;
typedef vector<int> vi;			typedef vector<ll> vl;
typedef vector<vi> vvi; 		typedef vector<vl> vvl;
typedef pair<int, int> 	pii;	typedef pair<ll, ll> pll;
typedef vector<pii> vii; 		typedef vector<pll> vll;
typedef map<int,int> mii;
typedef vector<char> vc;
typedef vector<bool> vb;
#define endl '\n'
#define forn(i,n) for(int i=0;i<n;i++)
#define rforn(i,n) for(int i=n-1;i>=0;i--)
#define forne(i,n) for(int i=1;i<=n;i++)
#define rforne(i,n) for(int i=n;i>=1;i--)
#define forse(i,s,e) for(int i=s;i<e;i++)
#define rforse(i,s,e) for(int i=e-1;i>=s;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll)x.size()
#define MOD 1000000007
#define F first
#define S second
#define pb push_back
#define pf push_front
#define rb pop_back
#define rf pop_front
#define in insert
#define mp make_pair
#define fill(a,x) memset(a,x,sizeof a);
#define trav(a,x) for(auto &a:x)
#define min3(a, b, c) min(min(a, b), c)
#define min4(a, b, c, d) min(min(a, b), min(c, d))
#define max3(a, b, c) max(max(a, b), c)
#define max4(a, b, c, d) max(max(a, b), max(c, d))
const ll INFL = 1e18;
const int INFI = 1e9;
#ifdef KARAN
	#include "../../trace.h"
#else
    #define trace(args...)
#endif

ll div_floor(const ll &a,const ll &b) { return a / b - (((a ^ b) < 0) and a % b);}
ll div_ceil(const ll &a,const ll &b) { return a / b + (((a ^ b) >= 0) and a % b);}
ll modpow(ll a, ll b, ll m = MOD){a %= m; ll res = 1; 
	while (b) {if (b & 1)res = (res * a) % m; a = (a * a) % m; b >>= 1;} return res;}
ll bpow(ll a, ll b){ll res = 1; while (b) {if (b & 1)res = res * a; a = a * a; b >>= 1;} return res;}
ll modinv(ll a, ll m = MOD) {return modpow(a, m - 2, m);}
void graph(vvi &adj, int m) {int x, y; forn(i, m){cin>>x>>y; adj[--x].pb(--y); adj[y].pb(x);}}

void solve(){
	int n; cin>>n;
	map<string, int> mp;
	mp["AC"] = mp["TLE"] = mp["WA"] = mp["RE"] = 0;
	forn(i, n){
		string s; cin>>s;
		mp[s]++;
	}
	cout<<"AC x "<<mp["AC"]<<endl;
	cout<<"WA x "<<mp["WA"]<<endl;
	cout<<"TLE x "<<mp["TLE"]<<endl;
	cout<<"RE x "<<mp["RE"]<<endl;
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	#ifdef KARAN
		freopen("inp.txt", "r", stdin);
    	freopen("out.txt", "w", stdout);
    	freopen("err.txt", "w", stderr);
	#endif
	int t=1;
	// cin>>t;
	while(t--)
		solve();
}

Measured memory_bytes: 3672
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
constexpr ll mod=1e9+7;

int main()
{
  ll n,k,s;
  cin>>n>>k>>s;
  for (int i = 0; i < k; ++i)
  {
    cout<<s<<" ";
  }
  for (int i = k; i < n; ++i)
  {
    if(s==1e9) cout<<1<<" ";
    else cout<<s+1<<" ";
  }

}

Measured memory_bytes: 3648
N, T =(int(x) for x in input().split())
a = 1001
b = 1001
for i in range(N):
    c, t =(int(z) for z in input().split())
    if c <= b:
        if t <= T:
            a = t
            b = c
    else:
        pass
if T >= a:
    print(b)
else:
    print('TLE')

Measured memory_bytes: 3060
#include <stdio.h>
#include <stdio.h>
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <queue>

using namespace std;

int main(void){
    int r,c;
    cin >> r >> c;
    
    int tables[1000][1000];
    
    for(int i = 0;i < r;++i){
        for(int j = 0;j < c;++j){
            cin >> tables[i][j];
        }
    }

    // 横表示
    for(int i = 0;i < r;++i){
        int sum1 = 0;
        for(int j = 0;j < c;++j){
            cout << tables[i][j] << " ";
            sum1 += tables[i][j];
        }
        cout << sum1 << endl;
        tables[i][c] = sum1;
    }
    
    // 縦表示
    for(int i = 0;i < c + 1;++i){
        int sum1 = 0;
        for(int j = 0;j < r;++j){
            sum1 += tables[j][i];
        }
        cout << sum1 ;
        if(i + 1 < c + 1){
            cout << " ";
        }
    }
    cout << endl;
    
    return 0;
}



Measured memory_bytes: 3404
#include <bits/stdc++.h>
using namespace std;
using ll=unsigned long long;

int main(){
  ll N,K; cin>>N>>K;
  vector<ll> A(N+1,0),check(N+1,0);
  set<ll> S;
  deque<ll> D;
  for(ll i=1; i<=N; i++) cin>>A[i];
  ll next=1;
  for(ll i=1; i<=N+1; i++){//loop探す
    if(S.count(next)>0){
      while(D.front()!=next && K>0){
        D.pop_front();
        K--;
      }
      break;
    }
    S.insert(next);
    D.push_back(next);
    next=A[next];
  }
  ll loop=D.size(),aft;
  if(loop==0)
    cout<<D[0]<<endl;
  else{
    aft=K%loop;
    cout<<D[aft]<<endl;
  }
}


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

typedef vector<int> vi;
typedef pair<int, int> ii;
typedef long long int ll;
typedef vector<ii> vii;

int a, b, c;
int main() {
	cin >> a >> b >> c;
	if( a == b) cout << c << endl;
	else if( a == c ) cout << b << endl;
	else if( b == c ) cout << a << endl;
	return 0;
}

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

int main()
{
  long long A[3];scanf("%lld %lld %lld",&A[0],&A[1],&A[2]);
  if(A[0]%2==0||A[1]%2==0||A[2]%2==0){printf("0\n");return 0;}
  sort(A,A+3);
  printf("%lld\n",A[0]*A[1]);
}

Measured memory_bytes: 3712
h,n = [int(i) for i in input().split()]
l = [[int(i) for i in input().split()] for _ in range(n)]
 
inf = float('inf')
memo = [inf for _ in range(h+1)]
memo[0] = 0
for i in range(h+1):
    for x,y in l:
        j = min(i+x, h)
        memo[j] = min(memo[j],memo[i] + y)
print(memo[-1])

Measured memory_bytes: 44124
#include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <limits>
#include <random>
#include <complex>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstdint>
using namespace std;

#define REP(i,n) for (int i = 0; i < n; i++)
typedef long long ll;

int main () {

	int n; cin >> n;
	vector < int > v(n);
	REP(i,n) cin >> v[i];

	map < int,int > cnt1, cnt2;
	REP(i,v.size()) {
		if (i % 2) cnt1[v[i]]++;
		else cnt2[v[i]]++;
	}

	cnt1[100010] = 0;
	cnt2[100011] = 0;

	vector < pair < int,int > > ans1;
	vector < pair < int,int > > ans2;
	for (auto x : cnt1) {
		ans1.push_back(make_pair(x.second, x.first));
	}

	for (auto x : cnt2) {
		ans2.push_back(make_pair(x.second, x.first));
	}

	sort(ans1.begin(), ans1.end());
	sort(ans2.begin(), ans2.end());
	reverse(ans1.begin(), ans1.end());
	reverse(ans2.begin(), ans2.end());

	int ans = 1e9;
	REP(i,2) REP(j,2) {
		if (ans1[i].second == ans2[j].second) continue;
		int anst = ans1[i].first + ans2[j].first;
		ans = min(ans, n - anst);
	}

	cout << ans << endl;

    return 0;
}

Measured memory_bytes: 6520
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 入力
		int A = sc.nextInt();
		int B = sc.nextInt();
		int T = sc.nextInt();
      		
		// 答えを出力
		System.out.println(T/A*B);
	}
}


Measured memory_bytes: 23892
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb emplace_back
#define x first
#define y second
#define sz(a) ((int)(a).size())
#define rep(i,a,b) for(auto i=(a); i<(b); i++)
#define dec(i,n,a) for(auto i=(n); i>=(a); i--)
#define clr(a,v) memset(a, v, sizeof(a))
#define all(a) (a).begin(),(a).end()
#define EPS 2e-9
#define fcin ios_base::sync_with_stdio(false)
#define db(x) cerr << #x << " == " << x << endl
#define _ << " " <<
#define MAXN 202020
#define LOGN 20
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;

int cmp(ll x, ll y = 0, ll tol = 0) {
	return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1; }
struct point{
	ll x, y;
	point():x(0),y(0){}
	point(ll X, ll Y):x(X),y(Y){}
	int cmp(point a){
        if(::cmp(x,a.x))
            return ::cmp(x,a.x);
        return ::cmp(y,a.y);
    }
    point operator+(point a){ return point(x+a.x, y+a.y); }
    point operator-(point a){ return point(x-a.x, y-a.y); }
    ll operator*(point a){ return x*a.x + y*a.y; }
    ll operator%(point a){ return x*a.y - y*a.x; }
    bool operator<(point a){ return cmp(a)==-1; }
    bool operator==(point a){ return cmp(a)==0; }
    bool operator!=(point a){ return cmp(a)!=0; }
    bool operator<=(point a){ return cmp(a)<=0; }
};
int ccw(point a, point b, point c){ return cmp((b-a)%(c-a)); }
bool between(point a, point b, point c){ return ccw(a,b,c)==0 && cmp((a-b)*(c-b)) <= 0; }
ld angle(point u, point v){ return atan2(u%v,u*v); }

typedef vector<point> polygon;

point pivot;
bool radialcomp(point p, point q){
	point P = p-pivot, Q = q-pivot;
	ll R = P%Q;
	if(cmp(R)) return R > 0;
	return cmp(P*P,Q*Q) < 0;
}
polygon convex_hull(polygon &T){
	int j=0, n = T.size(); polygon U(n);
	pivot = *min_element(all(T));
	sort(all(T), radialcomp);
	for(int i = 0; i < n; i++){
		while(j > 1 && ccw(U[j-1],U[j-2],T[i]) >= 0) j--;
		U[j++] = T[i];
	}
	U.erase(j+all(U));
	return U;
}

int n;
ld ans[MAXN], pi = acosl((ld)-1);
polygon vet;
map<pii, int> trad;

int get(point p){
	assert(trad.count(mp((int)p.x,(int)p.y)));
	return trad[mp((int)p.x,(int)p.y)];
}

int main(){
	scanf("%d", &n);
	rep(i,0,n){
		int x, y;
		scanf("%d%d", &x, &y);
		vet.pb(point(x,y));
		trad[mp(x,y)] = i;
	}
	vet = convex_hull(vet);
	assert(sz(vet) >= 2);
	if(sz(vet) == 2){
		rep(i,0,sz(vet)) ans[get(vet[i])] = 0.5;
		rep(i,0,n) printf("%.20lf\n", (double)ans[i]);
		return 0;
	}
	rep(i,0,sz(vet)){
		int l = (i+sz(vet)-1)%sz(vet);
		int r = (i+1)%sz(vet);
		int id = get(vet[i]);
		point p1 = vet[l] - vet[i];
		p1 = point(-p1.y,p1.x);
		point p2 = vet[i] - vet[r];
		p2 = point(-p2.y,p2.x);
		ld an = angle(p1,p2);
		assert(an > 0);
		ans[id] = an/(2*pi);
	}
	rep(i,0,n) printf("%.20lf\n", (double)ans[i]);
	ld sum = 0;
	rep(i,0,n) sum += ans[i];
	assert(fabs(sum-1) < 1e-6);
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define FOR(v, a, b) for(int v = (a); v < (b); ++v)
#define REP(v, n) FOR(v, 0, n);
using namespace std;

int main(){
	int n, m, a, b;
	map< int, int > mp;
	vector< int > w;
	
	while(cin >> n, n){
		mp.clear();
		w.clear();
		
		FOR(i, 0, n){
			cin >> m >> a >> b;
			
			if(mp.find(a) != mp.end()) mp[a] += m;
			else mp[a] = m;
			
			if(mp.find(b) != mp.end()) mp[b] -= m;
			else mp[b] = -m;
		}
		
		for(map< int, int >::iterator it = mp.begin(); it != mp.end(); ++it){
			w.push_back(it->second);
		}
		
		for(vector< int >::iterator it = w.begin(); it != w.end(); ++it){
			if(it != w.begin()) (*it) += (*(it - 1));
		}
		
		if(*max_element(w.begin(), w.end()) > 150) cout << "NG" << endl;
		else cout << "OK" << endl;
	}
	
	return 0;
}

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

#define lint long long
#define P pair<int, int>
#define LLP pair<long long, long long>
#define REP(i, x, n) for(int i = (x), i##_len = (int)(n) ; i < i##_len ; ++i)
#define rep(i, n) for(int i = 0, i##_len = (int)(n) ; i < i##_len ; ++i)
#define repr(i, n) for(int i = (int)(n) - 1 ; i >= 0 ; --i)
#define SORT(x) sort((x).begin(), (x).end())
#define SORT_INV(x) sort((x).rbegin(), (x).rend())

const int IINF = 1e9 + 100;
const long long LLINF = 2e18 + 129;
const long long MOD = 1e9 + 7;
const int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
const int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};
const double EPS = 1e-8;

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

    string s;
    cin >> s;

    if(s[5] == '1' || s[6] >= '5'){
        cout << "TBD" << endl;
    }else{
        cout << "Heisei" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
N, M, X, Y = map(int, input().split())
x_list = list(map(int, input().split())) + [X]
x_list.sort()
y_list = list(map(int, input().split())) + [Y]
y_list.sort()
if max(x_list) < min(y_list):
    print('No War')
else:
    print('War')

Measured memory_bytes: 3060
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int n1 = n / 1000;
		int n2 = n % 1000 / 100;
		int n3 = n % 1000 % 100 / 10;
		int n4 = n % 1000 % 100 % 10;
		boolean ans = false;
		if (n2 == n3 && n1 == n2 || n2 == n3 && n3 == n4) {
			ans = true;
		}
		System.out.println(ans ? "Yes" : "No");
	}
}


Measured memory_bytes: 35712
#include <stdio.h>

int main(int argc, const char * argv[]) {
    // insert code here...
    int a,b;
    scanf("%d %d",&a,&b);
    
    if(a<b){
        printf("a < b\n");
    }
    else if(a==b){
        printf("a == b\n");
    }
    else{
        printf("a > b\n");
    }
    
    return 0;
}

Measured memory_bytes: 580
n = int(input())
xyp = [list(map(int,input().split())) for i in range(n)]

def caldp(a):
    n = len(a)
    a.sort()
    dp = [[float("INF")]*(n+1) for i in range(n+1)]
    dp[0][0] = 0
    for l in range(n):
        for r in range(l+1,n+1):
            now = float("INF")
            for k in range(l,r):
                count = 0
                for i in range(l,r):
                    count += abs(a[i][0]-a[k][0])*a[i][1]

                now = min(now,count)
            for j in range(n):
                dp[r][j+1] = min(dp[r][j+1],dp[l][j]+now)

            now = 0
            for i in range(l,r):
                now += abs(a[i][0])*a[i][1]
            for j in range(n+1):
                dp[r][j] = min(dp[r][j],dp[l][j]+now)

    res = [float("INF")]*(n+1)
    for i in range(n+1):
        res[i] = dp[-1][i]
    return res

ans = [float("INF")]*(n+1)

for s in range(1<<n):
    lx = []
    ly = []
    for i in range(n):
        if s >> i & 1:
            lx.append((xyp[i][0],xyp[i][2]))
        else:
            ly.append((xyp[i][1],xyp[i][2]))
    lx = caldp(lx)
    ly = caldp(ly)
    for i in range(len(lx)):
        for j in range(len(ly)):
            ans[i+j] = min(ans[i+j],lx[i]+ly[j])

for i in ans:
    print(i)

Measured memory_bytes: 77700
//#include <bits/stdc++.h>
//#include <stdio.h>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <tuple>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>

using namespace std;
using ll=long long;
using intpair=pair<int,int>;
using intpv=vector<intpair>;
using llpair=pair<ll,ll>;
using llpv=vector<llpair>;
using intvec=vector<int>;
using llvec=vector<ll>;
using intq=queue<int>;
using llq=queue<ll>;
using intmat=vector<intvec>;
using llmat=vector<llvec>;
using pairmat=vector<llpv>;

template<typename T, typename U>
using pv=vector<pair<T,U>>;
template<typename T>
using matrix=vector<vector<T>>;
template<typename T>
using pque=priority_queue<T>;
template<typename T>
using lpque=priority_queue<T,vector<T>,greater<T>>;

#define PI 3.141592653589793
#define INTINF 1<<30
#define LLINF 1LL<<60
#define MPRIME 1000000007
#define MPRIME9 998244353

#define len length()
#define pushb push_back
#define fi first
#define se second

#define setpr fixed<<setprecision(15)
#define all(name) name.begin(),name.end()
#define rall(name) name.rbegin(),name.rend()
#define gsort(vbeg,vend) sort(vbeg,vend,greater<>())
#define matin(mat,H,W) for(int i__=0; i__<H; i__++)for(int j__=0; j__<W; j__++) cin>>mat[i__][j__]
#define out(n) cout<<n<<endl

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

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

template<class T>
inline void outmat(T& a, int y, int x) {
	for(int i=0; i<y; i++) {
		for(int j=0; j<x; j++) cout<<a[i][j]<<" ";
		cout<<endl;
	}
}

template<class T>
inline void init(T& v) {
	for(auto &a__: v) cin>>a__;
}
template<class T, class U>
inline void init(vector<pair<T,U>>& v) {
	for(auto &a__: v) cin>>a__.first>>a__.second;
}
template<class T, class N>
inline void init(T& v, N n) {
	v.resize(n);
	for(auto &a__: v) cin>>a__;
}
template<class T, class U, class N>
inline void init(vector<pair<T,U>>& v, N n) {
	v.resize(n);
	for(auto &a__: v) cin>>a__.first>>a__.second;
}

template<class N>
void resiz(N n) {
	//empty
}
template<class N, class T, class... U>
void resiz(N n, T&& hd, U&&... tl) {
	hd.resize(n);
	resiz(n,forward<U>(tl)...);
}

ll GCD(ll a, ll b) { //最大公約数
	if(a==0||b==0) return 0;
	if(a<b) swap(a,b);
	ll tmp = a%b;
	while(tmp!=0) {
		a = b;
		b = tmp;
		tmp = a%b;
	}
	return b;
}

ll binpow(ll a, ll ex, ll p) { //繰り返し二乗法
	ll result=1;
	while(ex>0) {
		if(ex&1) result=result*a%p;
		ex>>=1;
		a=a*a%p;
	}
	return result;
}

ll Fact(ll x, ll p) { //階乗
	ll f=1;
	for(ll i=2; i<=x; i++) {
		f*=i;
		f%=p;
	}
	return f;
}

int DigitNum(ll n) { //桁数
	int digit=0;
	ll div=1LL;
	while(n/div) {
		digit++;
		div*=10;
	}
	return digit;
}

int N;
intvec A;
int xors=0;

void input() {
	cin>>N;
	A.resize(N);
	for(int i=0; i<N; i++) {
		cin>>A[i];
		xors=xors^A[i];
	}
}

void solve() {
	for(int i=0; i<N; i++) {
		cout<<(xors^A[i])<<" ";
	}
	cout<<endl;
}

int main() {
	while(1) {
		input();
		solve();
		break;
	}
}


Measured memory_bytes: 3984
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("unroll-loops") 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define int long long
#define fr(i,a,b) for(int i = a ; i <= b ; ++i)
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
#define fst first
#define snd second
using namespace __gnu_pbds;
using ordered_set =
 tree<int, null_type,less<int>,
 rb_tree_tag,tree_order_statistics_node_update>;
//find_by_order(k):returns iterator to kth element starting from 0
//order_of_key(k):returns count of elements strictly smaller than k
typedef long long ll;typedef pair<int, int> pii;
typedef vector<int> vi;typedef long double ld;
template<class T>
using min_heap = priority_queue<T,vector<T>,greater<T>>; 
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
template<class T> void re(T& x) { cin >> x; }
template<typename T> 
void remdup(vector<T>& v) {												
	sort(all(v)); v.erase(unique(all(v)), v.end());
}
template<typename T> void re(vector<T> &v) {trav(i,v) cin >> i;}
template<class H, class... T> void re(H& h, T&... t) { re(h); re(t...); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
#ifdef np
#include "/home/o_o/MyCodes/pr.h"
#else
#define trace(...)
#endif

#define MOD 1000000007  


void solve(){
	int  x ;re(x) ;
	if(!x ) cout << 1 << endl; 
	else cout << 0 << endl; 
}
signed main() {
	unsyncIO();
	int tt =1 ;
	// cin >> tt;
	rep(i,0,tt) solve();













#ifdef np
	cout <<endl<<endl<< "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}


Measured memory_bytes: 3600
import math

a, b, x = map(int, input().strip().split())

if x < a * a * b / 2:

	c1 = 2 * x / (b * a)
	
	r1 = math.atan2(b, c1) * 180.0 / math.pi

	print(r1)
else:

	c2 = (a * b - x / a) * 2 / a
	
	r2 = math.atan2(c2, a) * 180.0 / math.pi
	
	print(r2)


Measured memory_bytes: 3060
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;

int main() {
	int a, b;
	cin >> a >> b;
	int cnt = 1;
	int value = 0;
	while (b > 0 && a > 0) {
		//cnt++;
		value += (b % 10) * cnt;
		b /= 10;
		cnt = cnt * 10;
		if (b == 0) {
			while (a > 0) {
				//cnt++;c
			//	cout << value << endl;
				value += (a % 10) * cnt;
				a /= 10;
				cnt = cnt * 10;
			}
		}
		//cout << value << endl;
	}
	int k = sqrt(value + 0.0001);
	if (k * k == value) {
		cout << "Yes";
	}else {
		cout << "No";
	}
}


Measured memory_bytes: 256
io = STDIN
k=io.gets.to_i
a,b=io.gets.split.map(&:to_i)
n=a/k
ans=nil
while !ans
  if (a..b).include?(n*k)
    ans='OK'
  elsif b<n*k
    ans='NG'
  end
  n+=1
end
puts ans


Measured memory_bytes: 14340
def roll(die, d):
    if d == "E":
        return [die[3], die[1], die[0], die[5], die[4], die[2]]
    if d == "N":
        return [die[1], die[5], die[2], die[3], die[0], die[4]]
    if d == "S":
        return [die[4], die[0], die[2], die[3], die[5], die[1]]
    if d == "W":
        return [die[2], die[1], die[5], die[0], die[4], die[3]]
    if d == "L":
        return [die[0], die[3], die[1], die[4], die[2], die[5]]
    if d == "R":
        return [die[0], die[2], die[4], die[1], die[3], die[5]]
 
def checkdice(die1, die2):
    ans = False
    for d in "RRRNRRRNRRRSRRRSRRRNRRRR":
        if die1 == die2:
            ans = True
            break
        die2 = roll(die2, d)
    return ans
 
dice = []
msg = "Yes"
n = int(input())
for _ in range(n):
    dice.append(list(map(int, input().split())))
for i in range(n):
    for j in range(i + 1, n):
        if checkdice(dice[i], dice[j]):
            msg = "No"
            break
    if msg == "No":
        break
print(msg)


Measured memory_bytes: 5612
#include<stdio.h>
#include<math.h>
int main(){
	int n;
	scanf("%d",&n);
	while(n!=0){
		float a[n];
		int i;
		for(i=0;i<n;i++){
			scanf("%f",&a[i]);
		}
		float sum=0,ave;
		for(i=0;i<n;i++){
			sum+=a[i];
		}
		ave=sum/n;
		float nbunsan=0,bunsan;
		for(i=0;i<n;i++){
			nbunsan+=(a[i]-ave)*(a[i]-ave);
		}
		bunsan=nbunsan/n;
		float hensa;
		hensa=sqrt(bunsan);
		printf("%f\n",hensa);
		scanf("%d",&n);
	}
	return 0;
}

Measured memory_bytes: 656