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

int main(void)
{
	int n=0, m=0, i=0, j=0, count=0;
	scanf("%d", &n);
	int a[n];
	for(i=0; i<n; i++){ scanf("%d", &a[i]); }
	
	scanf("%d", &m);
	int b[m];
	for(i=0; i<m; i++){ 
		scanf("%d", &b[i]);
		for(j=0; j<n; j++)
		{
			if(a[j]==b[i]){
				count++;
				break;
			}
		}
	}
	printf("%d\n", count);

	return 0;
}



Measured memory_bytes: 2100
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;

int main() {
        int a;
        vector<int> n;
        for (int i = 0; i < 3; i++) {
                cin >> a;
                n.push_back(a);
        }
        sort(n.begin(), n.end());
        if (n[0] + n[1] == n[2])
                cout << "Yes" << endl;
        else
                cout << "No" << endl;
        return 0;
}

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

int main() {
  int N, K;
  cin >> N >> K;
  int position_1;
  for (int i = 0; i < N; i++) {
    int tmp;
    cin >> tmp;
    if (tmp == 1) {
      position_1 = i+1;
      break;
    }
  }
  int ans = (position_1-1+K-2)/(K-1);
  if (position_1 != N) {
    position_1 += (K-1)*ans - (position_1-1);
    ans += (N-position_1+K-2)/(K-1);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#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>
#include <ctime>

using namespace std;

//int→string
//string→int
//------------------------------------------
inline int toInt(string s) {
    int v;
    istringstream sin(s);
    sin >> v;
    return v;
}

template<class T>
inline string toString(T x) {
    ostringstream sout;
    sout << x;
    return sout.str();
}

//sqrt
//-------------------------------------------
template<class T>
inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())

//repetition
//------------------------------------------
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define REP(i, n)  FOR(i,0,n)
#define REPR(i, n) for(int i = n;i >= 0;i--)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;


int main() {

    int N; scanf("%d", &N);
    int A; scanf("%d", &A);
    int B; scanf("%d", &B);

    if(abs(A-B)%2 ==0){
        printf("Alice");
    }else{
        printf("Borys");
    }

    return 0;
}











































Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#include <iostream>
#include <iomanip>
#include <istream>
#include <ostream>
#include <sstream>
#include <iterator>
#include <vector>
#include <algorithm>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <utility>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <string>
#include <ctime>
#include <cctype>
#include <cstdlib>
#define IINF 10e8
#define INF 1<<30
#define MOD 1000000007
#define mod 1000000007
#define rep(i, a, n) for (ll i = a; i < (ll)(n); i++)
#define Endl endl
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define mmax(x,y)(x>y?x:y)
#define mmin(x,y)(x<y?x:y)
#define chmax(x,y) x=mmax(x,y)
#define chmin(x,y) x=mmin(x,y)
#define all(x) (x).begin(),(x).end()
#define siz(x) (ll)(x).size()
#define PI acos(-1.0)
using namespace std;
//using Int=int_fast64_t;
typedef long long int ll;
typedef long long int LL;
typedef pair<ll,ll>Pll;
typedef pair<int,int>Pin;
template<class T> using V=vector<T>;
long long GCD(long long a, long long b) { return b ? GCD(b, a%b) : a; }
long long LCM(long long a, long long b)  {return a/GCD(a,b)*b;}
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};
int ddx[8]={-1,0,1,0,1,1,-1,-1};
int ddy[8]={0,-1,0,1,1,-1,1,-1};
char dir[4]={'u','l','d','r'};
ll cmp(pair<ll,ll>a,pair<ll,ll> b){
        if(a.fi!=b.fi)
        return a.fi<b.fi;
        else
        return a.se<b.se;
}
//---------------------------------------------------------------------------
int N,Q;
string S;
vector<set<int>>pls;

void solve(){
	pls.assign(26,set<int>({INF}));
	//pls.resize(26);
	for(int i=0;i<N;i++){
		pls[S[i]-'a'].insert(i);
	}
	while(Q--){
		int type;cin>>type;
		if(type==1){
			int ind;char nc;cin>>ind>>nc;ind--;
			auto pc=S[ind];
			S[ind]=nc;
			pls[pc-'a'].erase(ind);
			pls[nc-'a'].insert(ind);
		}
		else{
			int l,r;cin>>l>>r;l--;
			int res=0;
			for(int c=0;c<26;c++){
				//if(pls[c].empty())continue;
				int lid=*pls[c].lower_bound(l);
				int rid=*pls[c].lower_bound(r);
				if(rid>lid)res++;
			}
			cout<<res<<endl;
		}
	}
}
//---------------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------
    cin >> N >> S >> Q;
    solve();
    //-------------------------------
    return 0;
}
//---------------------------------------------------------------------------



Measured memory_bytes: 26268
#include <bits/stdc++.h>
using namespace std;
#define int unsigned long long

int FindLCM(int a, int b)
{
	return (a * b) / __gcd(a, b);
}

int rangeDivisor(int m, int n, int a, int b)
{
	int lcm = FindLCM(a, b);

	int a_divisor = n / a - (m - 1) / a;
	int b_divisor = n / b - (m - 1) / b;

	int common_divisor = n / lcm - (m - 1) / lcm;

	int ans = a_divisor + b_divisor - common_divisor;
	return ans;
}

int32_t main()
{
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	cout<<b-a+1-(rangeDivisor(a,b,c,d));
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
using namespace std;
constexpr int kMod = 1000000007;
typedef long long LL;

constexpr LL kInf = 1e18;
typedef pair<LL, int> P;  // cost, vertex_idx

vector<vector<LL>> dijkstra(int s, const vector<vector<int>>& G) {
  priority_queue<P, vector<P>, greater<P>> que;

  vector<vector<LL>> d(G.size(), vector<LL>(3, kInf));
  d[s][0] = 0;
  que.push(P(0, s));

  while (!que.empty()) {
    auto [dist, v] = que.top(); que.pop();
    int x = dist % 3;
    int y = (x + 1) % 3;

    if (d[v][x] < dist) continue;
    for (const auto& u : G[v]) {
      if (d[u][y] > d[v][x] + 1LL) {
        d[u][y] = d[v][x] + 1LL;
        que.push(P(d[u][y], u));
      }
    }
  }

  return d;
}

int main() {
  int N, M; cin >> N >> M;
  vector<vector<int>> G(N);
  for (int i = 0; i < M; ++i) {
    int u, v; cin >> u >> v; --u, --v;
    G[u].push_back(v);
  }
  int S, T; cin >> S >> T; --S, --T;
  auto d = dijkstra(S, G);
  if (d[T][0] == kInf) cout << -1 << endl;
  else                 cout << d[T][0]/3LL << endl;
}


Measured memory_bytes: 13928
#include<bits/stdc++.h>
using namespace         std;
#define                 int long long
#define                 pb push_back
#define                 mp make_pair
#define st(arr,a)       memset(arr,a,sizeof arr)
#define                 nl cout<<endl
#define                 real signed
#define                 endl '\n'              
#define bitcount(x)     __builtin_popcountll(x)
const int MOD = 1000000007ll;
#define forn(i,a,b)     for(int i=a;i<=b;i++)
#define rfor(i,a,b)     for(int i=a;i>=b;i--)
#define all(x)          x.begin() , x.end()
#define pi pair<int,int>
#define X first
#define Y second
#define N 1014159
#define  vi vector<int>
#define  v  vector

int n;
int A[4][N];
int dp[N][5];

void solve()
{
    cin>>n;
    forn(i,1,n)
    {
        cin>>A[1][i]>>A[2][i]>>A[3][i];;
    }
    
    forn(i,1,n)
    {
        forn(j,1,3)
        {
           forn(k,1,3)
            {
                if(k == j)continue;
                dp[i][j] = max(dp[i][j],dp[i-1][k]+A[j][i]);
            }
        }    
    }

    int x = 0;
    forn(i,1,3)x = max(x,dp[n][i]);
    cout<<x;
    
}


signed main() 
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); 
    int t = 1;
    //cin>>t;
    while(t--)
    {
        solve();
    }



    return 0;

}

//       g++ -g c.cpp ; ./a.exe

Measured memory_bytes: 12544
#include<bits/stdc++.h>
#define ll long long 
const int N = 2000 + 10;
const int mod = 1e9 + 7;
using namespace std;
ll f[N][N], fac[N*N], rfac[N*N];
int n,m;
namespace solver
{
  ll fpm(ll x,ll y)
  {
    ll s=1;
    while(y)
	{
	  if(y&1) s=s*x%mod;
	  y>>=1; x=x*x%mod;
	}
	return s;
  }
  void upd(ll &x,ll y)
  {
	x+=y; x%=mod;
  }
  ll c(int x,int y)
  {
    if(x<0) return 0;
	if(x<y) return 0;
	return fac[x]*rfac[y]%mod*rfac[x-y]%mod;
  }
  void init()
  {
    scanf("%d%d",&n,&m);
	if(m == 1) { puts("1"); return;}
	fac[0]=1ll; 
	for(int i=1;i<=n*m;++i) fac[i]=fac[i-1]*i%mod;
	rfac[n*m]=fpm(fac[n*m],mod-2);	 
	for(int i=n*m-1;i>=0;--i) rfac[i]=rfac[i+1]*(i+1)%mod;
	
	f[0][0]=1ll;
	for(int i=0;i<=n;++i)
	  for(int j=i;j>=0;--j)
	  {
	    upd(f[i+1][j+1],f[i][j]*c(i*m-j+m-2,m-2));
	    if(j) upd(f[i][j-1],f[i][j]);
	  }
	f[n][0]=f[n][0]*fac[n]%mod;
	printf("%lld\n",f[n][0]);
  } 
}
int main()
{
  solver::init();  

}

Measured memory_bytes: 94848
import java.util.Scanner;
//import java.util.Random;

class Main{
	public static void main(String[] args){
		Scanner stdIn=new Scanner(System.in);
		
		int n=stdIn.nextInt();
		int m=stdIn.nextInt();
		
		int[] a=new int[m];
		int[] b=new int[m];
		for(int i=0;i<m;++i){
			a[i]=stdIn.nextInt();
			b[i]=stdIn.nextInt();
			a[i]--;
			b[i]--;
		}
		
		int ans=0;
		for(int i=0;i<m;++i){
			UnionFind uf=new UnionFind(n);
			for(int j=0;j<m;++j){
				if(i==j){}
				else uf.unite(a[j],b[j]);
			}
			if(uf.num>1) ans++;
		}
		
		System.out.println(ans);
	}
}

class UnionFind{
	int[] par;
	int num;
	
	UnionFind(int n){//constructor.
		par=new int[n];
		for(int i=0;i<n;++i) par[i]=-1;
		num=n;
	}
	
	void init(int n){
		par=new int[n];
		for(int i=0;i<n;++i) par[i]=-1;
		num=n;
	}
	
	int root(int x){
		if(par[x]<0) return x;
		par[x]=root(par[x]);
		return par[x];
	}
	
	int size(int x){
		return -par[root(x)];
	}
	
	boolean same(int x,int y){
		return root(x)==root(y);
	}
	
	boolean unite(int x,int y){
		x=root(x);
		y=root(y);
		if(x==y) return false;
		par[x]+=par[y];
		par[y]=x;
		num--;
		return true;
	}
}

Measured memory_bytes: 21844
#include<iostream>
using namespace std;
#define f(i,n) for(int i=0;i<n;i++)
int main(){
  while(1){
    int n,m,sn[100]={},sm[100]={},nsum=0,msum=0;
    cin>>n>>m;
    if(n+m==0)break;
    f(i,n)cin>>sn[i],nsum+=sn[i];
    f(i,m)cin>>sm[i],msum+=sm[i];
    int min=1000000,sa=nsum-msum;
    f(i,n)f(j,m)if(2*(sn[i]-sm[j])==sa&&sn[i]+sm[j]<min)nsum=sn[i],msum=sm[j],min=sn[i]+sm[j];
    if(min==1000000)cout<<-1<<endl;
    else cout<<nsum<<" "<<msum<<endl;
  }
  return 0;
}

Measured memory_bytes: 3124
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Globalization;
using System.Diagnostics;
using static System.Console;
//using System.Numerics;
//using static System.Math;


class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;


    void solve()
    {
        var A = cin.scanint;
        if (A[0] + A[1] > A[2] + A[3])
        {
            WriteLine("Left");
        }
        else if (A[0] + A[1] < A[2] + A[3])
        {
            WriteLine("Right");
        }
        else
        {
            WriteLine("Balanced");
        }
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
}

Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,a,b) for(int i=a;i<=b;i++)
inline ll r() {
	ll x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c))x=x*10+c-'0',c=getchar();
	return x*f;
}
#define d r()
ll a,b,c;
int main(){
	a=d,b=d,c=d;
	printf("%lld",c*((a%b?a/b+1:a/b)));
	return 0;
}


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

vector<int> primes;
bool is_prime[1000100];

void search_prime(int n){
	for(int i = 0; i <= n; ++i)
		is_prime[i] = true;
	is_prime[0] = is_prime[1] = false;
	for(int i = 2; i <= n; ++i){
		if(is_prime[i]){
			primes.push_back(i);
			for(int j = i * 2; j <= n; j += i)
				is_prime[j] = false;
		}
	}
}

int main() {
	search_prime(1000050);
	int n;
	while(cin >> n){
		if(n == 0 && n == 1){
			cout << "0" << endl;
		}
		else{
			int idx = lower_bound(primes.begin(), primes.end(), n) - primes.begin();
			if(primes[idx] == n)
				idx++;
			cout << idx << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 2564
//{{{
#include<algorithm>
#include<cmath>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<random>
#include<set>
#include<sstream>
#include<sys/time.h>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(prints) FUNC(printw) FUNC(printwe) FUNC(printb) FUNC(printbe) FUNC(printd) FUNC(printde) FUNC(printdu);
#endif
template <class S, class T>
istream& operator >> (istream& in, pair<S, T>& p){ return in >> p.first >> p.second; }
template <class T>
istream& operator >> (istream& in, vector<T>& v){ for(auto& e : v){ in >> e; } return in; }
//}}}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<int> as(n); cin >> as;
    sort(as.begin(), as.end());
    map<int, int> bs;
    vector<pair<int, int>> cbs(m);
    for(int i = 0; i < m; i++){
        cin >> cbs[i].second >> cbs[i].first;
    }
    sort(cbs.begin(), cbs.end());
    ll acc = 0;
    for(int i = 0; i < n; i++){
        if(cbs.empty() || as.back() > cbs.back().first){
            acc += as.back();
            as.pop_back();
        }else{
            acc += cbs.back().first;
            cbs.back().second--;
            if(cbs.back().second == 0){
                cbs.pop_back();
            }
        }
        printde(acc);
    }
    cout << acc << '\n';
}


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

int a[100009];
int b[100009];

int main()
{
    int n;
    int dis=0;
    cin>>n;
    for (int i=0;i<n;i++)
    {
        cin>>a[i];
        if(i!=0)
        {
            b[i]=abs(a[i]-a[i-1]);
            dis=dis+b[i];
        }
    }
    b[0]=abs(a[0]);
    b[n]=abs(a[n-1]);
    dis=dis+b[0]+b[n];

    for (int i=0;i<n;i++)
    {    
        int ans=dis;
        if(i==0)
        {
            if((0<a[0]&&a[0]<a[1])||(0>a[0]&&a[0]>a[1]))
            {
                
            }else
            {
                ans=ans-b[0]-b[1]+abs(0-a[1]);
            }
        }else if (i==n-1)
        {
            if((0<a[n-1]&&a[n-1]<a[n-2])||(0>a[n-1]&&a[n-1]>a[n-2]))
            {
                
            }else
            {
                ans=ans-b[n]-b[n-1]+abs(0-a[n-2]);
            }
        }else
        {
            if((a[i-1]<a[i]&&a[i]<a[i+1])||(a[i-1]>a[i]&&a[i]>a[i+1]))
            {
                
            }else
            {
                ans=ans-b[i]-b[i+1]+abs(a[i-1]-a[i+1]);
            }
        }
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 2048
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9 + 7);

int main(void) {
	int w, h, n;
	cin >> w >> h >> n;
	
	vector< vector<int> > white(w, vector<int>(h, 1));
	
	for(int i = 0; i < n; ++i) {
		int x, y, a;
		cin >> x >> y >> a;
	
		if( a == 1 ) {
			for(int j = 0; j < x; ++j) {
				for(int k = 0; k < h; ++k) {
					white[j][k] = 0;
				}
			}
		}
		
		if( a == 2 ) {
			for(int j = x; j < w; ++j) {
				for(int k = 0; k < h; ++k) {
					white[j][k] = 0;
				}
			}
		}
		
		if( a == 3 ) {
			for(int j = 0; j < w; ++j) {
				for(int k = 0; k < y; ++k) {
					white[j][k] = 0;
				}
			}
		}
		
		if( a == 4 ) {
			for(int j = 0; j < w; ++j) {
				for(int k = y; k < h; ++k) {
					white[j][k] = 0;
				}
			}
		}
	}
	
	int ans = 0;
	for(int i = 0; i < w; ++i) {
		for(int j = 0; j < h; ++j) {
			if( white[i][j] == 1 ) ans++;
		}
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 3616
/*/ Author: KaySeeKay /*/

#include<bits/stdc++.h>
using namespace std;  

/*/---------------------------Defines-----------------------------------------/*/

#pragma GCC optimize("Ofast") 
#define int long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back 
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)  
#define fn1 for( int i =1;i<=n; i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define endl '\n'
#define PI  3.14159265358979323846
#define MOD 1000000007
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
const int N = 2e6+5;  
const int INF = 1e18L;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}
int ar[N];
/*/-----------------------------Code begins----------------------------------/*/
int spf[N+10];
bool pf[N+10];
void pre(){
  for(int i =1;i<N;i++)spf[i] =i;
  for(int i=2;i*i<N;i++){
    if(!pf[i]){
      for(int j=2*i;j<N;j+=i){
        spf[j] =i;
        pf[j]=1;
      }
    }
  }
}
signed main(){
  #ifndef ONLINE_JUDGE
  freopen("input.txt","r",stdin);
  freopen("output.txt","w",stdout);
  #endif
  IOS;
  int T=1;
  // cin >> T;
  while(T--){
    int n;
    cin >> n;
    int g =0;
    map<int,int>mp;
    pre();
    bool ok =1;
    fn1{
      cin >> ar[i];
      int x =ar[i];
      map<int,int>cur;
      while(x>1){
        cur[spf[x]]++;
        x/=spf[x];
      }
      for(auto i : cur)mp[i.fi]++;
      g=__gcd(g,ar[i]);
    }
    for(auto i : mp)if(i.se>1)ok=0;
    if(ok){
      cout<<"pairwise coprime";
    }else if(ok==0 && g==1){
      cout<<"setwise coprime";
    }else {
      cout<<"not coprime";
    }
  }
  return 0;
}

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

#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)

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

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

double get_snuke(ll n){
	ll tn=n,s=0;
	while(tn>0){s+=tn%10;tn/=10;}
	return (double)n/s;
}

int main() {
	int k;cin>>k;
	ll ans=0,d=1;
	while(k>0){
		if(get_snuke(ans+d)>get_snuke(ans+10*d)) d*=10;
		ans+=d;
		cout<<ans<<endl;
		k--;
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,x,y,yen;
	cin>>a>>b>>c>>x>>y;
	if(a+b>2*c)
	{
		if(x>y)
		{
			if((2*y*c+(x-y)*a)>2*x*c) yen=2*x*c;
			else yen=2*y*c+(x-y)*a;
		}
		else
		{
			if((2*x*c+(y-x)*b)>2*y*c) yen=2*y*c;
			else yen=2*x*c+(y-x)*b;
		}
		
	}
	else yen=a*x+b*y;
	cout<<yen<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000000;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

///////////////////////////




int main() {

	double T, X;
	cin >> T >> X;
	cout << T / X;

	

	system("PAUSE");
}

Measured memory_bytes: 504
N = int(input())
A = map(int, input().split())
Q = int(input())



A = list(A)

hashmap = {}
s = 0
for i in range(len(A)):
	s += A[i]
	hashmap[A[i]] = hashmap.get(A[i], [0, A[i]]) 
	hashmap[A[i]][0] += 1

for _ in range(Q):
	# replace every element whose value is B with C
	B, C = map(int, input().split())

	if B in hashmap:
		num = hashmap[B][0]
		del hashmap[B]
		s -= num * B
		s += num * C

		hashmap[C] = hashmap.get(C, [0, C])
		hashmap[C][0] += num
	print(s)

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

vector<ll> pos, neg;
vector<pair<ll, ll> > ans;

int main() {
	int n;
	ll x, y;

	cin >> n;
	
	if(n == 1) {
		cin >> x;
		cout << x << endl;
	}

	for(int i = 0; i < n; ++i) {
		cin >> x;
		if(x <= 0) 	neg.push_back(x);
		else		pos.push_back(x);
	}

	sort(pos.begin(), pos.end(), greater<ll>());
	sort(neg.begin(), neg.end());

	int sz0 = pos.size(), sz1 = neg.size();

	if(sz0 == 0)
		++sz0, --sz1, pos.push_back(neg.back());
	if(sz1 == 0)
		++sz1, --sz0, neg.push_back(pos.back());

	for(int i = 1; i < sz0; ++i) {
		ans.push_back({neg[0], pos[i]});
		neg[0] -= pos[i];
	}

	for(int i = 0; i < sz1; ++i) {
		ans.push_back({pos[0], neg[i]});
		pos[0] -= neg[i];
	}

	cout << pos[0] << endl;
	for(auto it : ans)
		cout << it.first << " " << it.second << endl;

	return 0;
}

Measured memory_bytes: 5104
from collections import deque
from heapq import heapify,heappop,heappush,heappushpop
from copy import copy,deepcopy
from itertools import product,permutations,combinations,combinations_with_replacement
from collections import defaultdict,Counter
from bisect import bisect_left,bisect_right
# from math import gcd,ceil,floor,factorial
# from fractions import gcd
from functools import reduce
from pprint import pprint

INF = float("inf")

def mycol(data,col):
    return [ row[col] for row in data ]

def mysort(data,col,reverse_flag):
    data.sort(key=lambda x:x[col],reverse=reverse_flag)
    return data

def mymax(data):
    M = -1*float("inf")
    for i in range(len(data)):
        m = max(data[i])
        M = max(M,m)
    return M

def mymin(data):
    m = float("inf")
    for i in range(len(data)):
        M = min(data[i])
        m = min(m,M)
    return m

def mycount(ls,x):
    # lsはソート済みであること
    l = bisect_left(ls,x)
    r = bisect_right(ls,x)
    return (r-l)

def myoutput(ls,space=True):
    if space:
        if len(ls)==0:
            print(" ")
        elif type(ls[0])==str:
            print(" ".join(ls))
        elif type(ls[0])==int:
            print(" ".join(map(str,ls)))
        else:
            print("Output Error")
    else:
        if len(ls)==0:
            print("")
        elif type(ls[0])==str:
            print("".join(ls))
        elif type(ls[0])==int:
            print("".join(map(str,ls)))
        else:
            print("Output Error")

def I():
    return int(input())

def MI():
    return map(int,input().split())

def RI():
    return list(map(int,input().split()))

def CI(n):
    return [ int(input()) for _ in range(n) ]

def LI(n):
    return [ list(map(int,input().split())) for _ in range(n) ]

def S():
    return input()

def MS():
    return input().split()

def RS():
    return list(input().split())

def CS(n):
    return [ input() for _ in range(n) ]

def LS(n):
    return [ list(input().split()) for _ in range(n) ]

import math

a,b,h,m = MI()

t = 60*h + m
# print(t)

l = (t*6)%360
# print(l)

s = (t*0.5)%360
# print(s)

theta = min( abs(l-s), 360-abs(l-s) )
# print(theta)

rad = math.radians( theta )
# print(rad)

y = a**2 + b**2 - 2*a*b*math.cos(rad)

ans = math.sqrt(y)

print(ans)

Measured memory_bytes: 68812
k=int(input())
if k%2==0:
  print(-1)
  exit()
  
ans=1
pin=7
mod=k

for i in range(1000000):
  if pin%k==0:
    print(ans)
    exit()
    
  ans+=1
  pin*=10
  pin+=7
  pin%=mod
  

print('-1')
  

Measured memory_bytes: 63480
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
typedef long long ll;

int N;
int a[100000],b[100000],c[100000];
int main(){
	cin>>N;
	rep(i,N) cin>>a[i];
	rep(i,N) cin>>b[i];
	rep(i,N) cin>>c[i];
	sort(a,a+N);
	sort(b,b+N);
	sort(c,c+N);
	ll ans = 0;
	rep(i,N){
		ll x = lower_bound(a,a+N,b[i]) - a;
		ll y = N - (upper_bound(c,c+N,b[i]) - c);
		ans += x*y;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 1408
# coding: utf-8

import sys
import math
import collections
import itertools
def input(): return sys.stdin.readline().strip()
def gcd(x, y): return y if x % y == 0 else gcd(y, x % y)
def lcm(x, y): return (x * y) // gcd(x, y)
MOD = 10 **9 + 7

# N = int(input())
# S = input()
N, D = map(int, input().split())
# 横
# L = [int(x) for x in input().split()]
# 縦
# A = [int(input()) for _ in range(N)]
# 多次元
X = [[int(x) for x in input().split()] for _ in range(N)]

comb = list(itertools.combinations(X, 2))

ans = 0
for c in comb :
    tmp = 0
    for a, b in zip(c[0], c[1]) :
        tmp += (a - b) ** 2

    if math.sqrt(tmp) % 1 == 0 :
        ans += 1

print(ans)


Measured memory_bytes: 38256
// Author : Mohamed Sameh
#include <bits/stdc++.h>
typedef long long ll ;
#define pb push_back
#define f first
#define s second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SZ(a) (int)a.size()
#define Flush fflush(stdout);
using namespace std ;
const int M = 2e5 ;
int n ;
int a[M];
int main()
{
    scanf ("%d" , &n );
    for (int i =0 ; i < n ;i++)scanf ("%d" ,a +i );
    ll ans =0 ;
    ll sum =0 , xo =0 ;
    for (int i =0 , j =0 ; j < n ;j++)
    {
        sum += a[j];
        xo  ^= a[j];
        while (sum != xo )
        {
            sum -= a[i];
            xo ^= a[i];
            i++;
        }
        ans += (j - i + 1 );
    }
    printf ("%lld\n" ,ans );
}


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

main(){
    int x, y;
    while( cin >> x >> y && x && y ){
	int m = x+y;
	char ch = 'A';
	for ( int i = 1; i < 5; i++ ){
	    cin >> x >> y;
	    if ( x+y > m ){
		m = x+y;
		ch = (char)('A' + i);
	    }
	}
	cout << ch << " " << m << endl;
    }
}

Measured memory_bytes: 0
#include <iostream>
using namespace std;
int main(){
    int s,t,z,x;
    t=0;
    cin >> s;
    if(s/100==1){
        t++;
        }
    else{
        t=0;
        }
    x=s%10;
    z=(s/10)%10;
    if(x==1){
        t++;
        }
    if(z==1){
        t++;
        }
    cout << t;
    return 0;
}

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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int n; cin>>n;
	int cnt=1;
	for(int i=2,j=2;i<=n;i+=j,++j){
		++cnt;
	}
	while(n>0){
		cout<<min(cnt,n)<<"\n"s;
		n-=cnt;
		--cnt;
	}
}


Measured memory_bytes: 3628
n = int(input())
s = input()
e = s.count('E')
w = 0
ans = 3 * (10 ** 5)
for i in s:
    if i == 'E':
        e -= 1
    ans = min(ans,e + w)
    if i == 'W':
        w += 1
print(ans)

Measured memory_bytes: 9704
import math

tmp = input().split()
A = int(tmp[0])
B = int(tmp[1])
H = int(tmp[2])
M = int(tmp[3])

ang = (H*30+M*0.5-M*6)/180*math.pi

l = math.sqrt(A**2+B**2-2*A*B*math.cos(ang))

print(l)

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

int main()
{
	int a, b, c;

	scanf("%d %d %d" , &a, &b, &c);

	if(a > 20 || a < 1 || b > a || b < 1) exit(0);
	if(c > 20 || c < 1) exit(0);

	if(c-(a-b) < 0) {
		printf("%d\n", 0);
	} else {
		printf("%d\n", c-(a-b));		
	}

	return 0;
}

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

using namespace std;

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

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int v[5];
int k;

int main(){
    char A,C,G,T,B;

    cin >> B;
    if(B == 'A')
        cout << 'T';
    else if(B == 'T')
        cout << 'A';
    else if(B == 'C')
        cout << 'G';
    else if(B == 'G')
        cout << 'C';
    else
        cout << "error";


//    REP(i,5)cin>>v[i];
//    cin>>k;
//    bool ok = true;
//    REP(i,5){
//        REP(j,i){
//            int d = v[i]-v[j];
//            if(d>k)ok=false;
//        }
//    }
//    puts(ok ? "Yay!" : ":(");
//    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
/*
g++ -std=c++11 -Wall -g -fsanitize=undefined -D_GLIBCXX_DEBUG abc/abc117/d.cpp
*/
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define SZ(x) ((int)(x).size())
#define INF (1e16)
typedef long long ll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);//おまじないでcin, cout早くする
    int n;
    cin >> n;
    vector<int> l(n);
    rep(i, n){
        cin >> l[i];
    }
    sort(l.begin(), l.end());

    int s = 0;
    rep(i, n - 1){
        s += l[i];
    }

    if(s > l[n - 1]) cout << "Yes" << "\n";
    else cout << "No" << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
string a;
int c, ans;
int main() {
	cin>>a;
	for(int i=0; a[i]; i++) {
		if(a[i]=='S') c++;
		else if(c>0) c--;
		else ans++;
	}
	cout<<ans*2;
	return 0;
}

Measured memory_bytes: 640
#include <iostream>

using namespace std;

int main(){
    int a, b;
    
    while(true) {
      cin >> a >> b;
      if (a == 0 && b == 0) break;
    
      if (a < b){
        cout << a << " " << b << endl;
      } else {
        cout << b << " " << a << endl;
      }
    }
    
    return 0;
}


Measured memory_bytes: 3016
using System;
using System.Linq;

namespace AOJ
{
	class Program
	{
		public static void Main(string[] args)
		{
			var a = Console.ReadLine().Split(' ').Select(x=>int.Parse(x)).ToList();
			Console.WriteLine(0<=a[2]-a[4]&&a[2]+a[4]<=a[0]&&0<=a[3]-a[4]&&a[3]+a[4]<=a[1]?"Yes":"No");
		}
	}
}

Measured memory_bytes: 19968
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <utility>
#include <set>
#include <map>
#include <tuple> 
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <list>
using namespace  std;
using ll = long long;
using P = pair<ll, ll>;
#define REP(i, n) for(long long (i)=0, i_bound = (long long)(n); (i)<i_bound; ++i)
#define FOR(i, a, b) for(long long (i)=(a); (i)<(b); ++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
const long long MOD = static_cast<long long>(1e9) + 7LL;
const long long INF = 1234567891234567890LL;
int main(){
    cin.tie(0);
    cout.sync_with_stdio(false);
    bool ok = false;
    int N; cin>>N;
    REP(i, 10){
        REP(j, 10){
            if(i*j==N){
                ok = true;
            }
        }
    }
    if(ok) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

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

int main()
{
    int n, l;
    cin >> n >> l;
    int g = 0;
    for (int i = 0; i < n; i++) {
        g += l + i;
    }
    int ans;
    int diff = numeric_limits<int>::max();
    for (int i = 0; i < n; i++) {
        int sum = 0;
        for (int j = 0; j < n; j++) {
            if (j != i) {
                sum += l + j;
            }
        }
        if (abs(g - sum) < diff) {
            diff = abs(g - sum);
            ans = sum;
        }
    }
    cout << ans << endl;
    return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repc(i, a, b) for (int i = a; i <= (int)(b); i++)
#define ll long long
#define vec vector
#define ft first
#define sd second
#define all(vec) vec.begin(), vec.end()
typedef pair<int, int> P;
const int MOD = 1e9 + 7;
const int INF = 1001001001;
const int dx[4] = {1, 0,-1, 0};
const int dy[4] = {0, 1, 0,-1};


int main() {
  int n;
  cin >> n;
  vec<ll> a(n);
  rep(i, n){
    cin >> a[i];
    if(a[i] == 0){
      cout << 0 << endl;
      return 0;
    }
  }
  ll ans = 1;
  rep(i, n){
    if(a[i] <= 1000000000000000000 / ans){
      ans *= a[i];
    }
    else{
      cout << -1 << endl;
      return 0;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 4008
#include <iostream>
#include <vector>
#include <sstream>

using namespace std;
int main()
{
    std::vector<int> v;
    std::string s;
    cin>>s;
    std::stringstream ss{s};
    std::string buf;
    while (std::getline(ss, buf, '/')) {
        v.push_back(stoi(buf));
    }
    if(v[0]<2019){
        cout<<"Heisei"<<endl;
        return 0;
    }
    if(v[1]<5){
        cout<<"Heisei"<<endl;
        return 0;
    }

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

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#include <set>
#include <map>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <queue>

using namespace std;

using ll = long long;
using ldb = long double;

#define forn(i, x, n) for (int i = x; i < (int)(n); ++i)
#define forcin(a, n) for (int i = 0; i < n; cin >> a[i], ++i)
#define forb(i, x, n) for (int i = (int)(x); i >= n; --i)
#define mmax(a, b, c) max(a, max(b, c))
#define mmin(a, b, c) min(a, min(b, c))
#define pb push_back
#define mp make_pair

const int N = 100500 * 3;
const long double eps = 1e-11;

int a[N];

int main() {
    string a, b;
    cin >> a >> b;
    string s;
    s += a;
    s += b;
    int num = atoi(s.c_str());
    for (int i = 1; i * i <= num; ++i) {
        if (i * i == num) {
            cout << "Yes";
            return 0;
        }
    }
    cout << "No";
}


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

#define int ll
#define endl "\n"
#define ends ' '
#define die(x) return cout << x << endl, 0
#define all(v) v.begin(), v.end()
#define sz(x) (int)(x.size())
#define debug(x) cerr << #x << ": " << x << endl
#define debugP(p) cerr << #p << ": {" << p.first << ", " << p.second << '}' << endl
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const ll INF = 1e9;
const int MOD = 1e9 + 7;

////////////////////////////////////////////////////////////////////

const int N = 2e5 + 5;

int A[N], FEN[N];
ll PS[N];

void Add(int p, int x = 1) { for (p++; p < N; p += p & -p) FEN[p] += x; }
int Get(int p) {
	int sum = 0;
	for (; p > 0; p -= p & -p) sum += FEN[p];
	return sum;
}

int32_t main() {

	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	
	int n, k, ans = 0; cin >> n >> k;
	vector<int> comp; comp.push_back(0);
	for (int i = 1; i <= n; i++) cin >> A[i], PS[i] = PS[i - 1] + A[i];
	for (int i = 1; i <= n; i++) PS[i] -= 1LL * i * k, comp.push_back(PS[i]);
	sort(all(comp));
	comp.resize(unique(all(comp)) - comp.begin());
	for (int i = 0; i <= n; i++) PS[i] = lower_bound(all(comp), PS[i]) - comp.begin();
	Add(PS[0]);
	for (int i = 1; i <= n; i++) {
		ans += Get(PS[i] + 1);
		Add(PS[i]);
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 6644
#pragma GCC optimize(3)
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/priority_queue.hpp>
#define MAXN 100005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef pair<int,int> P;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef __gnu_pbds::priority_queue<int,greater<int>,pairing_heap_tag> pq;
int n,a,b,dummy;
vector<int> ans;
void solve(int n,int to,int cur)
{
    if(n==1)
    {
        ans.push_back(cur);
        ans.push_back(to^cur);
        return;
    }
    if(to&(1<<(n-1)))
    {
        solve(n-1,1,cur);
        solve(n-1,(to^(1<<(n-1)))^1,cur^(1<<(n-1))^1);
        return;
    }
    int swapped=-1;
    for(int i=0;i<n;i++)
    {
        if(to&(1<<i))
        {
            swapped=i;
            to^=(1<<(n-1));
            to^=(1<<i);
            solve(n-1,1,cur);
            solve(n-1,(to^(1<<(n-1)))+1,cur^(1<<(n-1))^1);
            break;
        }
    }
    assert(swapped!=-1);
    int sz=(int)ans.size();
    vector<int> dif;
    dif.clear();
    for(int i=sz-1;i>sz-(1<<n);i--) 
    {
        int d=ans[i]^(ans[i-1]);
        dif.push_back(d);
    }
    reverse(dif.begin(),dif.end());
    for(int i=sz-(1<<n)+1;i<sz;i++)
    {
        int id=i-(sz-(1<<n)+1);
        if(dif[id]==(1<<swapped)) ans[i]=ans[i-1]^(1<<(n-1));
        else if(dif[id]==(1<<(n-1))) ans[i]=ans[i-1]^(1<<(swapped));
        else ans[i]=ans[i-1]^dif[id];
    }
}
int main()
{
    scanf("%d",&n);
    scanf("%d%d",&a,&b);
    dummy=a;b^=a;a=0;
    if(__builtin_popcount(b)%2==0)
    {
        puts("NO");
        return 0;
    }
    puts("YES");
    solve(n,b,dummy);
    for(auto v:ans) printf("%d ",v);
    return 0;
}



Measured memory_bytes: 1844
while True:
    [a,op,b] = raw_input().split()
    a = int(a)
    b = int(b)
    if op == '?':
        break
    if op == '+':
        print a + b
    if op == '-':
        print a - b
    if op == '*':
        print a * b
    if op == '/':
        print a / b

Measured memory_bytes: 4208
#include <iostream>
#include<algorithm>
#include<stdio.h>
#include<string.h>
using namespace std;

int main()
{
    int n;
    int a[100005];
    scanf("%d",&n);
    for(int i=0; i<n; i++)
        scanf("%d",&a[i]);
    sort(a,a+n);
    int sum=0;
    for(int i=0; i<n; i++)
    {
        if(a[i]==a[i+1])
        a[i]=a[i+1]=0;


    }
    for(int j=0;j<n;j++)
    {
        if(a[j]!=0)
            sum++;
    }


printf("%d\n",sum);
return 0;
}


Measured memory_bytes: 640
#include <cstdio>
#include <cmath>

using namespace std;

bool testcase_ends() {
    double v;
    if (scanf("%lf", &v) == EOF) return 1;

    int N;
    for (N=1; v>9.8*sqrt(5*(N-1)/4.9); ++N);

    printf("%d\n", N);
    return 0;
}

int main() {
    int solved=0;
    while (!testcase_ends())
        ++solved;

    return !solved;
}

Measured memory_bytes: 2672
import java.util.ArrayList;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
    public static void main(String[] args)  {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        ArrayList<Integer> poses = new ArrayList<>();
        poses.add(x);
        for (int i = 0;i < n;++i){
            poses.add(sc.nextInt());
        }
        poses.sort(Comparator.comparingInt(a -> a));
        int m = poses.get(1) - poses.get(0);
        for (int i = 1;i < n;++i){
            int p = poses.get(i + 1) - poses.get(i);
            while (m != p){
                if(m > p)m = m - p;
                else p = p - m;
            }
            if(m == 1){
                System.out.println(1);
                return;
            }
        }
        System.out.println(m);
    }

}




Measured memory_bytes: 62488
import numpy as np

n = int(input())
xs = list(map(int, input().strip().split()))
mn = min(xs)
mx = max(xs)
xs = np.array(xs)
diffs = np.empty((100, n), dtype=np.int)
for p in range(100):
    diffs[p] = xs - (p + 1)

ans = np.min(np.sum(diffs**2, axis=1))

print(ans)


Measured memory_bytes: 14424
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(200000)
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def fi(): return float(input())
def mfi(): return map(float, input().rstrip().split())
def lmfi(): return list(map(float, input().rstrip().split()))
def li(): return list(input().rstrip())
def debug(*args, sep=" ", end="\n"): print("debug:", *args, file=sys.stderr, sep=sep, end=end) if not __debug__ else None
def exit(*arg): print(*arg); sys.exit()
# template


def main():
    S = input().rstrip()
    cnt = 0
    for i in range(len(S)):
        if S[i] != S[-i - 1]:
            cnt += 1
    print(cnt // 2)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 38384
import java.util.*;

public class Main
{
 
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        int n;
        n = sc.nextInt();

        ArrayList<Integer> p = new ArrayList<Integer>();

        for(int i = 0; i<n; i++)
        {
            p.add(sc.nextInt());
        }

        int count = 0;
        int index = 0;
        for(int i=0; i<n-2; i++)
        {
            if(p.get(i)<p.get(i+1)){
                if(p.get(i+1) < p.get(i+2)){
                    count++;
                }
            }
            else if(p.get(i)>p.get(i+1)){
                if(p.get(i+1) > p.get(i+2)){
                    count++;
                }
            }
        }
        System.out.println(count);
    }
}

Measured memory_bytes: 21332
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long int ll;
typedef vector<pair<ll,ll> > Q;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
const ll inf=1e9+7;
ll gcd(ll a, ll b) { return (b ? gcd(b, a % b) : a); }
ll lcm(ll a, ll b) { return a / (gcd(a, b)) * b; }


int main(){
  int h,w,n;
  cin>>w>>h>>n;
  int minw=0,minh=0,maxw=w,maxh=h;
  rep(i,n){
    int x,y,a;
    cin>>x>>y>>a;
    if(a==1) minw=max(minw,x);
    else if(a==2) maxw=min(maxw,x);
    else if(a==3) minh=max(minh,y);
    else if(a==4) maxh=min(maxh,y);
  }
  if((maxw-minw)<=0 || (maxh-minh)<=0) cout<<0<<endl;
  else cout<<(maxw-minw)*(maxh-minh)<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
    int n, a, b, c, i;
    scanf("%d\n", &n);
    for(i = 0; i < n; i++){
        scanf("%d %d %d\n", &a, &b, &c);
        if((a*a + b*b) == c*c){
            printf("YES\n");
        }
        else if((b*b + c*c) == a*a){
            printf("YES\n");
        }
        else if((c*c + a*a) == b*b){
            printf("YES\n");
        }
        else{
            printf("NO\n");
        }
    }
    return 0;
}

Measured memory_bytes: 2688
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>

using namespace std;

int main(void) {
	int a,b;
	cin >> a >> b;
	cout << a/b << " ";
	cout << a%b << " ";
	cout << setprecision(10) << fixed << (double)a/b << endl;
	return 0;
}



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

int main() {
    int n, k; cin >> n >> k;
    vector<int> a(n);
    int l = 1;
    int r = 1000000000;
    for(int i=0; i<n; i++) cin >> a[i];

    while(l < r){
        int m = l + (r-l)/2;
        int cnt = 0;
        for(int i=0; i<n; i++){
            cnt += (a[i]-1)/m;
        }
        if(cnt > k) l = m + 1;
        else r = m;
        //cout << l << " " << r << endl;
    }
    cout << r << endl;
}

Measured memory_bytes: 3864
#include <bits/stdc++.h>
using namespace std;
using ll         = long long;
constexpr ll MOD = 1000000007;
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define REP2(i, x, n) for (ll i = x; i < (n); i++)
const long long INF = numeric_limits<long long>::max();
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;
}
vector<ll> getNums(ll N) {
    vector<ll> num(N);
    REP(i, N) {
        cin >> num[i];
    }
    return num;
}
int main() {
    ll N;
    cin >> N;
    auto heights = getNums(N);

    ll sum = 0;
    for (ll i = 1; i < N; ++i) {
        if (heights[i - 1] > heights[i]) {
            sum += heights[i - 1] - heights[i];
            heights[i] = heights[i - 1];
        }
    }

    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 4840
#include <stdio.h>

int main(){
  int a, b, i, j, n, sum,c[10][10];
  sum = 0;
  scanf("%d",&n);
  for(i=1;i<=9;i++){
    for(j=1;j<=9;j++) c[i][j]=0;
  }
  for(i=1;i<=n;i++){
    for(a=i;a>=10;a/=10);
    b = i%10;
    c[a][b]++;
  }
  for(i=1;i<=9;i++){
    for(j=1;j<=9;j++) sum += c[i][j]*c[j][i];
  }
  printf("%d",sum);
}

Measured memory_bytes: 128