akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = int(1e5);

int odd[MAX_N];
int even[MAX_N];

int main(){
	int n;
	cin >> n;
	
	for(int i=0; i<n; i++){
		int a;
		cin >> a;
		if(i%2 == 0) even[a]++;
		else odd[a]++;
	}
	
	int ov1 = 0, ov2 = 0, oi1 = 0, oi2 = 0;
	int ev1 = 0, ev2 = 0, ei1 = 0, ei2 = 0;
	for(int i=0; i<=MAX_N; i++){
		if(ov1 <= odd[i]){
			ov2 = ov1; oi2 = oi1;
			ov1 = odd[i]; oi1 = i;
		}
		else if(ov2 < odd[i]){
			ov2 = odd[i]; oi2 = i;
		}
		if(ev1 <= even[i]){
			ev2 = ev1; ei2 = ei1;
			ev1 = even[i]; ei1 = i;
		}
		else if(ev2 < even[i]){
			ev2 = even[i]; ei2 = i;
		}
	}
    
	if(ei1 == oi1) cout << min(n - ev1 - ov2, n - ev2 - ov1) << endl;
	else cout << n - ev1 - ov1 << endl;
	
	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
using namespace std;
int main(){
long n,m,i,j,h[500000],j2,j3,j5,x2,x3,x5,f;
while(cin>>m){
if(m==0)break;
cin>>n;
j2=j3=j5=0;
x2=x3=x5=1;
f=0;
for(i=0;;i++){
h[i]=min(min(x2,x3),x5);
if(f==0&&h[i]>=m){j=i;f=1;}
if(h[i]>n)break;
while(x2<=h[i])x2=2*h[j2++];
while(x3<=h[i])x3=3*h[j3++];
while(x5<=h[i])x5=5*h[j5++];
}
cout<<i-j<<endl;
}
return 0;
}

Measured memory_bytes: 1168
#include<bits/stdc++.h>
#define pb push_back
#define all(x) x.begin(), x.end()
using namespace std;
const int maxn = 303, M = 100;
int a, b, d[14][14], C[M+3][M+3], sz = 1;
signed main() {
	cin.tie(0)->sync_with_stdio(0);
	cin >> a >> b;
	for(int i = 1; i <= a; i++)
		for(int j = 1; j <= b; j++)
			cin >> d[i][j];
	for(int as = 0; as <= M; as++) {
		for(int bs = 0; bs <= M; bs++) {
			int mn = 0;
			for(int i =1; i <= a; i++)
				for(int j = 1; j <= b; j++)
					mn = max(mn, d[i][j] - as*i - bs*j);
			C[as][bs] = mn;
		}
	}
	for(int i = 1; i <= a; i++)
		for(int j = 1; j <= b; j++) {
			int cst = 1<<30;
			for(int as = 0; as <= M; as++)
				for(int bs = 0; bs <= M; bs++)
					cst = min(cst, as*i + bs*j + C[as][bs]);
			if(cst != d[i][j]) return cout << "Impossible\n", 0;
		}
	
	cout << "Possible\n";
	cout << 2*M+2 << " " << (M+1)*(M+1) + 2*M << '\n';
	for(int i = 1; i <= M; i++)
		cout << sz << " " << sz+1 << " X\n", sz++;
	sz++;
	for(int i = 1; i <= M; i++)
		cout << sz << " " << sz+1 << " Y\n", sz++;
	for(int i = 0; i <= M; i++)
		for(int j = 0; j <= M; j++)
			cout << 1+i << " " << M+2+j << " " << C[i][M-j] << '\n';
	cout << 1 << " " << 2*M+2 << '\n';
}


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

using namespace std;

int main(){
    int n;
    cin >> n;
    vector <int> a(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    sort(a.begin(),a.end());
    int req1=a.back()/2,req2=(a.back()+1)/2;
    int cur = INT_MAX, curi;
    for(int i=0;i<n;i++){
        int val = min(abs(req1-a[i]),abs(req2-a[i]));
        if(val<cur){
            cur=val;
            curi=i;
        }
    }
    cout << a.back() << " " << a[curi] << endl;
    return 0;
}

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

typedef long long ll;
const long long LINF = 1LL << 60;
const long long LMINF = 1LL << 63;
const int INF = 1 << 30;

#define REP(i,n) for(int i = 0;i < n;++i)
#define REPS(i,x) for(int i = 1;i <= (int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i >= 0;i--)
#define RREPS(i,x) for(int i=((int)(x));i > 0;i--)
#define PB push_back
#define F first
#define S second
#define MP make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#define debug(x) cerr << #x << ": " << x << "\n"

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



int main(){
    ios::sync_with_stdio(false);cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    REP(i,n)cin >> a[i];
    sort(ALL(a), greater<int>());  
    
    int ali = 0;
    int bob = 0;
    REP(i,n){
        if(i%2 == 0){
            ali += a[i];
        }else{
            bob += a[i];
        }
    }
    cout << ali - bob << endl;

    return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define rep(i,n) for(long long i=0; i<n; i++)
#define Rep(i,n) for(long long i=1; i<n; i++)
#define ll long long
#include <math.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <vector>


using namespace std;
#define PI acos(-1)


ll ans=0;

int main(){
    ll n,m,k;
    cin>>n>>m>>k;
  vector<ll> a(n);
  rep(i,n)cin>>a[i];
  vector<ll> b(m);
  rep(i,m)cin>>b[i];
  
  vector<ll> A={0};
  rep(i,n)A.push_back(A[i]+a[i]);
  vector<ll> B={0};
  rep(i,m)B.push_back(B[i]+b[i]);
  ll j=B.size()-1;
  rep(i,A.size()){
      if(k<A[i])break;
      else{
          while(k<A[i]+B[j]){
              j--;
          }
          ans=max(ans,i+j);
      }
  }
  cout<<ans<<endl;
}



Measured memory_bytes: 11088
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <map>
#include <vector>
#include <cmath>

using namespace std;

void a_one_card_poker(void) {
	int a, b;
	cin >> a >> b;

	if (a == b) cout << "Draw" << endl;
	else if (a == 1) cout << "Alice" << endl;
	else if (b == 1) cout << "Bob" << endl;
	else cout << (a > b ? "Alice" : "Bob") << endl;
}

int main()
{
    a_one_card_poker();
    return 0;
}

Measured memory_bytes: 3604
#include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queue>
#include <stack>
#include <tuple>
#include <ctime>
#include <list>
#include <map>
#include <set>

#define REP(i,n) for(int i=0;i<(n);i++)
#define TR(i,x) for(__typeof(x.begin()) i=x.begin();i!=x.end();i++)
#define ALL(x) x.begin(),x.end()
#define SORT(x) sort(ALL(x))
#define CLEAR(x) memset(x,0,sizeof(x))
#define FILL(x,c) memset(x,c,sizeof(x))
#define SIZE(x) (int)(x).size()

#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;

const int MAXN = 310;

int n, m;
char C[MAXN][MAXN];
int g[MAXN][MAXN];
int dp[MAXN][MAXN];

int Solve(int col) {
    char a[MAXN], b[MAXN];
    REP(i, n) {
        a[i + 1] = C[i][col];
        b[i + 1] = C[i][col + 1];
    }
    CLEAR(g);
    for (int i = n; i > 0; --i) {
        for (int j = n; j > 0; --j) {
            g[i][j] = g[i + 1][j + 1] + (a[i] == b[j]);
        }
    }
    FILL(dp, 0x3f);
    dp[0][0] = 0;
    REP(i, n + 1) {
        REP(j, n + 1) {
            if (i < n || j < n) {
                int tmp = dp[i][j] + g[i + 1][j + 1];
                dp[i + 1][j] = min(dp[i + 1][j], tmp);
                dp[i][j + 1] = min(dp[i][j + 1], tmp);
            }
        }
    }
    return dp[n][n];
}

int main() {
    cin >> n >> m;
    REP(i, n) {
        scanf("%s", C[n - 1 - i]);
    }
    LL ans = 0;
    REP(i, m - 1) {
        ans += Solve(i);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1152
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
//const ll mod=1000000007;
ll GCD(ll a,ll b) {return b ? GCD(b,a%b):a;}
ll LCM(ll c,ll d){return c/GCD(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
	int n;
	cin>>n;
	V<P> a(n);
	V<int> ans(n*n,-1);
	for(int i=0;i<n;i++){
		cin>>a[i].fi;
		ans[--a[i].fi]=i+1;
		a[i].se=i;
	}
	sort(all(a));
	for(int i=0;i<n;i++){
		 int l=a[i].se;
		 for(int j=0;j<a[i].fi;j++){
			 if(l==0)break;
			 if(ans[j]!=-1)continue;
			 ans[j]=a[i].se+1;
			 l--;
		 }
		 if(l!=0){
			 cout<<"No"<<"\n";
			 return 0;
		 }
	}
	reverse(all(a));
	for(int i=0;i<n;i++){
		int r=n-a[i].se-1;
		 for(int j=a[i].fi+1;j<n*n;j++){
			 if(r==0)break;
			 if(ans[j]!=-1)continue;
			 ans[j]=a[i].se+1;
			 r--;
		 }
		 if(r!=0){
			 cout<<"No"<<"\n";
			 return 0;
		 }
	}
	cout<<"Yes"<<"\n";
	for(int i=0;i<n*n;i++)cout<<ans[i]<<" ";
	cout<<"\n";
}



Measured memory_bytes: 4224
X, N = map(int, input().split())
if N != 0:
    p = list(map(int, input().split()))
else:
    p = []

min_diff = 10000000
ans = 0
for i in range(-200, 201):
    if i not in p:
        if abs(X - i) < min_diff:
            ans = i
            min_diff = abs(X - i)
print(ans)

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

typedef long long ll;
const int maxn = 2e5 + 5;
const ll mod = 1e9 + 7;
ll fast_pow(ll a, ll b){
	ll ret = 1;
	for(;b;b>>=1){
		if(b&1) ret = ret * a % mod;
		a = a * a % mod;
	}
	return ret;
}
ll inv(ll a){return fast_pow(a, mod-2);}
ll fac[maxn], inv_fac[maxn];
inline ll c(int a, int b){
	return fac[a] * inv_fac[b] % mod * inv_fac[a-b] % mod;
}
int n, k;
void init(){
	fac[0] = 1;
	for(int i=1;i<=n;i++) fac[i] = fac[i-1] * i % mod;
	inv_fac[n] = inv(fac[n]);
	for(int i=n;i;i--) inv_fac[i-1] = inv_fac[i] * i % mod;
}
int main(){
	scanf("%d%d",&n,&k);
	k = std::min(n-1, k);
	init();
	ll ret = 0;
	for(int i=0;i<=k;i++){
		ret = (ret + c(n, i) * c(n - 1, n - i - 1) % mod) % mod;
	}
	printf("%lld\n", ret);
	return 0;
}

Measured memory_bytes: 3456
h,w,k=map(int,input().split())
c=[]
total=0
for i in range(h):
  tmp=list(input())
  c.append(tmp)
  total+=tmp.count("#")
ans=0
for i in range(1<<h):
  for j in range(1<<w):
    cnt=0
    for l in range(h):
      for m in range(w):
        if i&(1<<l) and j&(1<<m) and c[l][m]=="#":
          cnt+=1
          #print("cnt",cnt)
    if cnt==k:
      ans+=1
print(ans)


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

int main()
{
    int X;
    cin >> X;
    if (X == 3)
    {
        cout << "YES" << endl;
    }
    else if (X == 5)
    {
        cout << "YES" << endl;
    }
    else if (X == 7)
    {
        cout << "YES" << endl;
    }
    else
    {
        cout << "NO" << endl;
    }
}


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

int		main() {
	int	N;
	int Alice;
	int Bob;

	Alice = 0;
	Bob = 0;
	cin >> N;
	vector<int>	nums(N);
	for (int i = 0; i < N; i++)
	{
		int n;

		cin >> n;
		nums.at(i) = n;
	}
	sort(nums.begin(), nums.end(), greater<int>());
	for (int i = 0; i < N; i += 2)
		Alice += nums.at(i);	
	for (int i = 1; i < N; i += 2)
		Bob += nums.at(i);	
	cout << Alice - Bob << endl;
}


Measured memory_bytes: 256
open Batteries

let scan fmt f =
  Scanf.sscanf (read_line ()) fmt f

let scan_list cnv =
  read_line ()
  |> String.split_on_char ' '
  |> List.map cnv

let rec zip xs ys =
  match xs, ys with
  | [], _ -> []
  | _, [] -> []
  | x::xs, y::ys ->
    (x, y) :: zip xs ys

let n = scan "%d" identity

let dividens m =
  List.map (fun n -> m mod n = 0)@@ List.range 1 `To m
  |> List.filter identity
  |> List.length


let rec aux m =
  if m <= n then
    (if m mod 2 = 1 && dividens m = 8 then 1
     else 0)
    + aux (m+1)
  else
    0

let () =
  Printf.printf "%d\n" @@ aux 1


Measured memory_bytes: 3456
#include <iostream>
#include <set>

using namespace std;

int main() {
    int n;
    int p[8];
    int q[8];
    int kaijou[9] = {1, 1, 2, 6, 24, 120, 720, 5040};
    int used[9] = {1, 0, 0, 0, 0, 0, 0, 0, 0};
    int used2[9] = {1, 0, 0, 0, 0, 0, 0, 0, 0};

    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> p[i];
    }
    for (int i = 0; i < n; i++) {
        cin >> q[i];
    }

    int a = 0;
    for (int i = 0; i < n; i++) {
        int cnt = 0; // unused
        int num = p[i];
        used[ num ] = 1;
        for (int k = num; k > 0; k--) {
            if (used[k] == 0) { cnt++; }
        }
        a += cnt * kaijou[ n-i-1 ];
    }


    int b = 0;
    for (int i = 0; i < n; i++) {
        int cnt = 0; // unused
        int num = q[i];
        used2[ num ] = 1;
        for (int k = num; k > 0; k--) {
            if (used2[k] == 0) { cnt++; }
        }
        b += cnt * kaijou[ n-i-1 ];
    }


    if (a > b) { cout << a-b; }
    else { cout << b-a; }

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string.h>
#include <vector>
#include <map>
#include <algorithm>
using namespace std;
#define ll long long

int main () {
  ll n;
  cin >> n;
  ll l[n];
  for (ll i = 0; i < n; i++) {
    cin >> l[i];  
  } 
  sort(l, l + n);
  ll sum = 0;
  for (ll i = 0; i < n - 1; i++) {
    sum += l[i];  
  } 
  if (sum > l[n - 1]) {
    cout << "Yes" << endl;  
  }
  else {
    cout << "No" << endl;  
  }
    
}

Measured memory_bytes: 256
/*---------------------------------
 *File name: B.cpp
 *Creation date: 2020-05-31 20:52
 *-------------------------------*/
#include<set>
#include<map>
#include<cmath>
#include<queue>
#include<vector>
#include<cstdio>
#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
#define fi first
#define se second
#define pb push_back
#define LL long long
#define PII pair<int, int>
#define Pque priority_queue 
#define loop(c, a, b) for(int c = a; c <= b; ++c)
using namespace std;
const int maxn = 1e5 + 5;
const int inf = 0x3f3f3f3f;
const LL mod = 1e9 + 7;

int main(){
	LL a;
	float b;
	cin >> a >> b;
	LL c = b * 100.1;
	//cout << a << " " << c << endl;
	printf("%lld\n", a * c / 100);
	return 0;
}

Measured memory_bytes: 3788
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<cmath>
#include<tuple>
#include<string>
typedef long long int ll;
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define F first
#define S second
using namespace std;
const ll INF = 10000000000000;

int main() {
  int a,b;
  cin>>a>>b;
  int ans=0;
  int sum=1;
  while(true){
    if(b<=sum){cout<<ans<<endl;break;}
    else{ ans++;sum+=a-1;}
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cmath>
#include <algorithm>
#include <climits>
#include <iomanip>
#define endl "\n"
#define debug(x) cout << #x << " : " << x << endl;
#define FASTIO ios_base::sync_with_stdio(false),cin.tie(0);
typedef long long ll;
using namespace std;

int main()
{
	FASTIO
	
	int x[5];

	int ans = 0;
	for(int i = 0; i < 5; i ++)
	{
		cin >> x[i];
		if(x[i] == 0)
			ans = i + 1;
	}

	cout << ans << endl;
}

Measured memory_bytes: 3688
fn read<T: std::str::FromStr>() -> T {
    use std::io::*;
    let stdin = stdin();
    let mut buf = String::new();
    stdin.lock().read_line(&mut buf);
    buf.trim().parse().ok().unwrap()
}

fn main() {
    let a:i32 = read(); let b = read(); let c:i32 = read(); let d =read();
    let ans = std::cmp::min(a,b) + std::cmp::min(c,d);
    println!("{}", ans);
}


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

using namespace std;

const int MAXN = 1e5 + 5;
const int MOD = 1e9 + 7;

int h, n, w, x, y, x2, y2;
long long fak[2 * MAXN], block[MAXN], from[MAXN];
pair<int,int> tocke[MAXN];

bool cmp(const pair<int,int>&a, const pair<int,int>&b)
{
	if(a.first != b.first)
		return a.first < b.first;
	else
		return a.second < b.second;
}

long long mul(long long a, long long b)
{
	//a %= MOD;
	//b %= MOD;
	return (a * b) % MOD;
}
long long add(long long a, long long b)
{
	//a %= MOD;
	//b %= MOD;
	long long ret = a + b;
	if(ret >= MOD)
		return ret - MOD;
	else if(ret >= 0)
		return ret;
	else
		return ret + MOD;
}

long long qp(long long a, long long pot)
{
	if(pot == 1)
		return a % MOD;
	if(pot % 2 == 0)
		return qp(mul(a, a), pot / 2) % MOD;
	return mul(qp(a, pot - 1), a);
}
long long choose(long long a, long long b)
{
	return mul(fak[a], qp(mul(fak[b], fak[a - b]), MOD - 2));
}

void calc()
{
	fak[0] = 1;
	fak[1] = 1;
	for(int i = 2; i < 2 * MAXN; i++)
		fak[i] = mul(fak[i - 1], i);
}

/*void ltr()
{
	for(int i = 0; i < n; i++)
	{
		x = tocke[i].first, y = tocke[i].second;
		block[i] = choose(x + y, y);
		/*for(int k = 0; k < i; k++)
		{
			x2 = tocke[k].first, y2 = tocke[k].second;
			if(x2 <= x && y2 <= y)
			{
				block[i] -= block[k] * choose(x - x2 + y - y2, x - x2);
			}
		}
	}
}*/

void rtl()
{
	for(int i = n - 1; i >= 0; i--)
	{
		x = tocke[i].first, y = tocke[i].second;
		//cout << x << " " << y << endl;
		block[i] = choose(x + y, y);
		from[i] = choose(h - x + w - y, w - y);
		for(int k = n - 1; k > i; k--)
		{
			x2 = tocke[k].first, y2 = tocke[k].second;
			//cout << x << " " << y << " " << x2 << " " << y2 << endl;
			if(x2 >= x && y2 >= y)
			{
				from[i] = add(from[i], -mul(from[k], choose(x2 - x + y2- y, x2 - x)));
			}
		}
	}
}

int main()
{
	calc();
	cin >> h >> w >> n;
	h--;
	w--;
	for(int i = 0; i < n; i++)
	{
		cin >> tocke[i].first >> tocke[i].second;
		tocke[i].first -= 1;
		tocke[i].second -= 1;
	}
	sort(tocke, tocke + n, cmp);
	//ltr();
	rtl();
	/*for(int i = 0; i < n; i++)
		cout << block[i] << " ";
	cout << endl;
	for(int i = 0; i < n; i++)
		cout << from[i] << " ";*/
	long long blocked = 0;
	for(int i = 0; i < n; i++)
		blocked = add(blocked, mul(block[i], from[i]));
	cout << add(choose(h + w, w), -blocked);
	return 0;
}
/*
4 4 3
1 3
2 3
3 2

....
..x.
xx..
....
*/

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

using namespace std;
typedef long long ll;

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define REPR(i, n) for (ll i = (n); i >= 0; i--)
#define FOR(i, m, n) for (ll i = (m); i < (n); i++)
#define FORR(i, m, n) for (ll i = (m); i >= (n); i--)
#define INF 1e9
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((ll)(x).size())
#define SORT(x) sort((x).begin(), (x).end())
#define dump(x) cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl

int main(int argc, char const *argv[])
{
    ll H, W, h, w;
    cin >> H >> W;
    cin >> h >> w;
    cout << H * W - (h * W + w * H - h * w) << endl;
    return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ldouble = long double;

const ll inf = 1ll << 60;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s) cout << fixed << setprecision(10) << s << endl;


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

	println((a^b ? "No" : "Yes"));
}


Measured memory_bytes: 3520
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;    using vvi = vector<vi>;
using vb = vector<bool>;   using vvb = vector<vb>;
using vl = vector<ll>;     using vvl = vector<vl>;
using vd = vector<double>; using vvd = vector<vd>;

#define REP(i,n) for(ll i = 0; i < (n); ++i)
#define ALL(c) (c).begin(), (c).end()
#define FOR(i,s,e) for (ll i = s; i < (ll)e; i++)
#define TEN(x) ((ll)1e##x)
const ll mod = TEN(9) + 7;

int main() {
#ifdef INPUT_FROM_FILE
	ifstream cin("sample.in");
	ofstream cout("sample.out");
#endif
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(50);
	ll n, m; cin >> n >> m;
	vb p(n, false); p[0] = true;
	vl num(n, 1);
	REP(i, m) {
		ll x, y; cin >> x >> y; x--; y--;
		if (p[x] != 0) {
			p[y] = true;
			p[x] = num[x]!=1;
		}
		num[y]++;
		num[x]--;
	}

	ll cnt = 0;
	REP(i, n) if (p[i]) cnt++;
	cout << cnt << endl;

	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define se second
#define fi first
#define rep(i, l, r) for (ll i = (ll)(l); i < (ll)(r); i++)
#define print(v) for (const auto itr : v){cout << itr << ' ';} cout << endl;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 998244353
#define endl "\n"
#define inf 1e18
using namespace std;
const ll INF = 1e18L + 5;
const ll maxn = 1e6+5, maxn1=2e5+3;
#define MAXN 200005
ll ceel(ll a, ll b)
{
   if (a % b == 0)
       return a / b;
   return a / b + 1;
}
ll modneg(ll a,ll m)
{
    a = a % m;
    if(a<0)
        a=a+m;
    return a;
}
ll powermod(ll x, unsigned ll y, ll p){ ll res = 1; x = x % p; while (y > 0){if (y & 1){res = (res*x) % p;}y = y>>1; x = (x*x) % p;} return res;}
ll lcm(ll a, ll b) { return (a * b) / __gcd(a, b); };



int main()
{

unsigned ll n,i,j,k,a,b,c,d,test,cnt=0,s;
double frac;
cin>>n>>frac;
a=frac*100+0.5;
n*=a;
cout<<n/100;
return 0;
}

Measured memory_bytes: 3696
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	
	int n,k; cin>>n>>k;
	vector<int> v; int x;
	for(int i = 0; i < k; i++){
		cin>>x;
		v.push_back(x);
	}
	int i;
	for(i = n; i <= 1000000; i++){
		bool flag = false;
		int tt = i; int las;
		while(tt){
			las = tt%10;
			tt /= 10;
			for(auto xx : v){
				if(las == xx) flag = true;
			}
		}
		if(!flag) break;
	}
	cout<<i<<"\n";
	
}

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

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    int sum = 0;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        sum += a[i];
    }
    const int m = 4000001;
    bitset<m> dp(1);
    for (int i = 0; i < n; i++) {
        dp = dp | (dp << a[i]);
    }
    int ans = (sum + 1) / 2;
    while (1) {
        if (dp[ans]) {
            cout << ans << endl;
            return 0;
        } else {
            ans++;
        }
    }
}

Measured memory_bytes: 2176
/*
   THE DARK NIGHT RISES
I LOVE YOU 72 AND WILL FOREVER DO SO
Patience, Persistence, Perseverance, Passion, Purpose
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
const int N = 2e5 + 20 ;
#define F first
#define S second
# define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define mk make_pair
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define rep(i,a,b) for(ll i=a;i<b;i++)
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define sz(x)       (int)x.size()
const long long int mod=1e9 + 7;
const long double EPS=1e-12;
#define mem( a, val ) memset(a, val, sizeof( a ) )
#define deci( x ) cout<<fixed<<setprecision( x );
#define bitcount( x ) __builtin_popcountll( x )

const int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};

int solve()
{
	ll a, b ;
	cin >> a >> b ;
	if(a < 10 && b < 10) cout << a*b;
	else cout << -1 ;


}
int main()
{
	fast;
	ll t;
	t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}

	return 0;
}
// Patience, Persistence, Perseverance, Passion, Purpose
// I LOVE YOU 72 AND WILL FOREVER DO SO.

Measured memory_bytes: 256
def main():
    INF = float("inf")

    N, M, *ABC = map(int, open(0).read().split())

    D = [INF, 0] + [INF] * (N - 1)
    E = tuple(zip(*[iter(ABC)] * 3))

    for a, b, c in E:
        D[b] = min(D[b], D[a] - c)

    ans = D[-1]

    for a, b, c in E:
        D[b] = min(D[b], D[a] - c)

    print("inf" if ans != D[-1] else -ans)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  int64_t n;
  cin >> n;
  int64_t a,ans=1e13,cnt=0;
  for(int64_t i=1;i<=2*sqrt(n);i++){
    int64_t a=n/i;
    if(a*i==n){
      ans=min(ans,a+i-2);
    }
  }
  cout << ans;
}

Measured memory_bytes: 256
use std::vec::Vec;

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

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

fn main() {
    let (n, q): (usize, usize) = {
      let mut v: Vec<usize> = read_vec();
      (v[0], v[1])
    };
    let s: Vec<char> = read::<String>().chars().collect();
    let mut v: Vec<(i64, i64)> = Vec::new();

    for _ in 0..q {
        let mut l: Vec<i64> = read_vec();
        v.push((l[0], l[1]));
    }

    let mut t: Vec<i64> = Vec::new();
    t.push(0);

    for j in 1..n {
      let mut count = t[j-1];
      if s[j-1] == 'A' && s[j] == 'C' {
        count += 1;
      }
      t.push(count);
    }

    for (l, r) in v {
      println!("{}", t[r as usize - 1] - t[l as usize - 1]);
    }


}


Measured memory_bytes: 6908
h = int(input())
A = list(map(int, input().split()))
A.insert(0, 0) # 1-origin

def maxHeapify(i):
    left = 2 * i
    right = 2 * i + 1

    if left <= h and A[left] > A[i]:
        largest = left
    else:
        largest = i
    if right <= h and A[right] > A[largest]:
        largest = right

    if largest != i:
        A[i], A[largest] = A[largest], A[i]
        maxHeapify(largest)


for i in range(h // 2, 0, -1):
    maxHeapify(i)

print(' ' + ' '.join([str(i) for i in A[1:]]))


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

#define all(x) (x).begin(),(x).end()
#define init() \
  ios::sync_with_stdio(false); \
  cin.tie(0)

#define MOD 1000000007

using namespace std;

using ll = long long;
using ull = unsigned long long;

template<typename M, typename N>
constexpr common_type_t<M, N> gcd(M a, N b) {
  return a == 0 ? b
    : b == 0 ? a
    : gcd(b, a % b);
}

template <typename M, typename N>
constexpr common_type_t<M, N> lcm(M a, N b) {
  return a * b / gcd(a, b);
}

template <long long MAX>
class CombinationCalculator {
  long long mod_;
  long long fac[MAX];
  long long finv[MAX];
  long long inv[MAX];

public:
  CombinationCalculator(long long mi = MOD): fac(), finv(), inv() {
    mod_ = mi;
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
      fac[i] = fac[i - 1] * i % mod_;
      inv[i] = mod_ - inv[mod_ % i] * (mod_ / i) % mod_;
      finv[i] = finv[i - 1] * inv[i] % mod_;
    }
  }

  long long c(long long n, long long k) const {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % mod_) % mod_;
  }
};

template <long long MAX = 210000>
using CC = CombinationCalculator<MAX>;

template<typename T>
T modpow(T a, T n, T mod = MOD) {
    T res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

template<typename T>
T modinv(T a, T m = MOD) {
    T b = m, u = 1, v = 0;
    while (b) {
        T t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
}

int main() {
  init();

  int x, a;
  cin >> x >> a;

  cout << (x < a? 0 : 10) << endl;

  return 0;
}


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

int main()
{
    ll A, B, C,tmp;
    cin >> A >> B >> C;
    tmp = C;
    repi(i, C, 0)
    {
        if (A == B)
        {
            break;
        }
        B++;
        tmp--;
    }
    cout << tmp << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long; using pii = pair<int, int>;
const int MOD = (int)1e9 + 7, INF = (1 << 27); const ll INFLL = (1LL << 55);
#define FOR(i,a,b) for(int (i)=(a);i<(int)(b);i++)
#define rep(i,n) FOR(i,0,n)
template<typename T> void dbg(T x) { cout << x << "\n"; }
template<typename T, typename U> static void chmin(T &x, U y) { if (y < x) x = y; }
template<typename T, typename U> static void chmax(T &x, U y) { if (x < y) x = y; }

int n, C;
const int M = 200018;

int main() {
    cin.tie(0), ios::sync_with_stdio(0);
    cin >> n >> C;
    static int a[M];
    rep(i, n) {
        int s, t, c; cin >> s >> t >> c;
        a[2 * s - 1]++; a[2 * t]--;
    }
    rep(i, M - 1) a[i + 1] += a[i];
    cout << min(C, *max_element(a, a + M)) << "\n";
    return 0;
}


Measured memory_bytes: 1024
#6 B - Minesweeper
H,W = map(int,input().split())
S = [list(input()) for _ in range(H)]

dh = [0,1,0,-1,1,-1,1,-1]
dw = [1,0,-1,0,1,-1,-1,1]

for h in range(H):
    for w in range(W):
        #マス(h,w)について
        if S[h][w] == '#':
            continue
        else:
            cnt= 0
            for v in range(8):
                nxt_h = h + dh[v]
                nxt_w = w + dw[v]
                if not(-1<nxt_h<H) or not(-1<nxt_w<W):
                    continue
                elif S[nxt_h][nxt_w] == '#':
                    cnt += 1
                S[h][w] = str(cnt)
if H==1 and W==1:
    print(0)
else:
    for i in S:
        print(''.join(i))

Measured memory_bytes: 9168
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using p = pair<int, int>;
#define INF 1001001001
#define PI 3.14159265359
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define repX(i, n , x) for (int i = (int)(x); i < (int)(n); ++i)
#define repB(i, n) for (int i = n; i >= 1; --i)
#define repBX(i, n , x) for (int i = (int)(n); i >= int(X); --i)
#define dup(x,y) (((x)+(y)-1)/(y))

int main() {
    int N;
    string S;
    cin >> N >> S;
    int ans = 0;
    rep(i,N-2){
        if (S.substr(i, 3) == "ABC")ans ++;
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<cstdio>
#include<cstring>
#include<cmath>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(n) rep(i,n)
string s;

int main()
{
    while(cin>>s)
    {
        int length = s.size();
        int joi = 0,ioi = 0;
        rep(i,length-2)
        {
            if(s.substr(i,3)=="IOI") ioi++;
            if(s.substr(i,3)=="JOI") joi++;
        }
        cout << joi << endl;
        cout << ioi << endl;
    }
    return 0;
}

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

using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
typedef tuple<int, int, int> T;
#define FOR(i,s,x) for(int i=s;i<(int)(x);i++)
#define REP(i,x) FOR(i,0,x)
#define ALL(c) c.begin(), c.end()
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl

#define INF 1<<29

template <typename T>
struct BipartiteMatching {
  struct Edge {
    int to, rev; T cap;
    Edge(int to, int rev, T cap) : to(to), rev(rev), cap(cap) { }
  };

  typedef vector<Edge> Edges;
  vector<Edges> G;
  int V, source, sink;
  vector<int> level, iter;
  
  BipartiteMatching(int V1, int V2) {
    V = V1 + V2 + 2, source = V-2, sink = V-1;
    G.resize(V);
    add_sink_source(V1, V2);
  }

  void add_edge(int from, int to) {
    G[from].push_back(Edge(to, (int)G[to].size(), 1));
    G[to].push_back(Edge(from, (int)G[from].size()-1, 0));
  }

  void add_sink_source(int V1, int V2) {
    for (int i = 0; i < V1; i++) add_edge(source, i);
    for (int i = V1; i < V1+V2; i++) add_edge(i, sink);
  }

  void bfs(int source) {
    level.assign(V, -1);
    queue<int> que;
    que.push(source);
    level[source] = 0;
    while (!que.empty()) {
      int v = que.front(); que.pop();
      for (int i = 0; i < (int)G[v].size(); i++) {
	Edge &e = G[v][i];
	if (e.cap > 0 && level[e.to] < 0) {
	  level[e.to] = level[v] + 1;
	  que.push(e.to);
	}
      }
    }
  }

  T dfs(int v, int sink, T flow) {
    if (v == sink) return flow;
    for (int &i = iter[v]; i < (int)G[v].size(); i++) {
      Edge &e = G[v][i];
      if (e.cap > 0 && level[v] < level[e.to]) {
	T d = dfs(e.to, sink, min(e.cap, flow));
	if (d > 0) {
	  e.cap -= d;
	  G[e.to][e.rev].cap += d;
	  return d;
	}
      }
    }
    return 0;
  }

  T dinic() {
    T flow = 0;
    while (true) {
      bfs(source);
      if (level[sink] < 0) return flow;
      iter.assign(V, 0);
      T f;
      while ((f = dfs(source, sink, INF)) > 0) {
	flow += f;
      }
    }
  }
};


int main() {
  // use scanf in CodeForces!
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int X, Y, E;
  cin >> X >> Y >> E;
  BipartiteMatching<int> bp(X, Y);
  REP(i, E) {
    int x, y;
    cin >> x >> y;
    bp.add_edge(x, X+y);
  }
  cout << bp.dinic() << endl;
  return 0;
}

Measured memory_bytes: 3336
require 'pp'
IS_DEBUG = true
# IS_DEBUG = false
def dputs str
	if(IS_DEBUG)
		puts str
	end
end
def dpp str
	if(IS_DEBUG)
		pp str
	end
end

N,_=gets.chomp.split(' ').map{|n| n.to_i}
A = Array.new(N)
0.upto(N-1){|d|
	A[d],_=gets.chomp.split(' ').map{|n| n.to_i}
}
sum = A.inject(0){|i,sum|sum+i}
if(sum % 10 != 0)
	puts sum
else
	INT_MAX = 9999999999999999999
	min = A.map{|i| i%10==0 ? INT_MAX : i}.min
	if(min == INT_MAX)
		puts 0
	else
		puts sum-min
	end
end



Measured memory_bytes: 2044
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        int[] d = new int[N];
        HashMap<Integer, Pair> map = new HashMap<>();
        List<Pair> pairlist = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            d[i] = scan.nextInt();
            if (!map.containsKey(d[i])) {
                Pair p = new Pair();
                p.d = d[i];
                p.count = 0;
                map.put(d[i], p);
                pairlist.add(p);
            }
            Pair p = map.get(d[i]);
            p.count += 1;
        }
        pairlist.sort(new PairComparator());
        int half = N / 2;
        int sum = 0;
        int length = pairlist.size();
        int point = 0;
        for (int i = 0;i < length; i++) {
            Pair p = pairlist.get(i);
            if (sum + p.count < half) {
                sum += p.count;
                continue;
            } else {
                sum += p.count;
                point = i;
                break;
            }
        }
        Pair target = pairlist.get(point);
        int current = sum;
        if (current == half) {
            Pair n = pairlist.get(point + 1);
            System.out.println(n.d - target.d);
        } else if (half < current) {
            System.out.println(0);
        }
    }
    class Pair {
        int d;
        int count;
    }
    class PairComparator implements Comparator<Pair> {
        @Override
        public int compare(Pair o1, Pair o2) {
            if (o1.d == o2.d) {
                return Integer.compare(o1.count, o2.count);
            }
            return Integer.compare(o1.d, o2.d);
        }
    }
}


Measured memory_bytes: 65076
using System;

namespace Example03
{
    class Program
    {
        static void Main(string[] args)
        {
            char[] s = Console.ReadLine().ToCharArray();
            char[] t = Console.ReadLine().ToCharArray();

            int dif = t.Length;

            for (int i = 0; i <= s.Length - t.Length; i++) {
                int score = 0;
                for (int j = 0; j < t.Length; j++) {
                    if (!s[i + j].Equals(t[j])) score++;
                }
                if (dif > score) dif = score;

            }

            Console.WriteLine(dif);
        }

    }
}


Measured memory_bytes: 25884
n, m = map(int, input().split())
number = [None] * n
flag = True

for _ in range(m):
  s, c = map(int, input().split())
  if number[s-1] is None:
    number[s-1] = c
  elif number[s-1] != c:
    flag = False

if flag:
  if n == 1:
    if number[0] is None:
      print(0)
    else:
      print(number[0])
  else:
    if number[0] == 0:
      print(-1)
    else:
      if number[0] is None:
        number[0] = 1
      for i in range(1, n):
        if number[i] is None:
          number[i] = 0
      for i in range(n):
        print(number[i], end='')
      print()
else:
  print(-1)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define MOD	1000000007
#define int	long long
#define pii pair<int,int> 
#define vi vector<int>
using namespace std;

int32_t main(){
	int a, b, c;
	cin >> a >> b >> c;
	
	cout << c << " " << a << " " << b << endl;

	return 0;
}



Measured memory_bytes: 256
//#define DEBUGGING  // Enables DEBUG macro.
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
#define REP(i, n) for (int i = 0; (i64)(i) < (i64)(n); ++i)

#ifndef DEBUGGING
#define DEBUG(...)
#else
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define DEBUG(...)                     \
  do {                                 \
    cerr << " (L" << __LINE__ << ") "; \
    cerr << #__VA_ARGS__ << ": ";      \
    debug(__VA_ARGS__);                \
    cerr << endl;                      \
  } while (0)
#endif

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int N, Q;
  cin >> N >> Q;
  cin.ignore();
  string board;
  getline(cin, board);
  vector<pair<char, char>> spells(Q);
  for (auto& q : spells) {
    cin >> q.first >> q.second;
  }
  int head = -1, tail = N;
  for (int i = Q - 1; i >= 0; --i) {
    char t = spells[i].first, d = spells[i].second;
    DEBUG(i, t, d);
    if (d == 'L') {
      if (head + 1 < N && t == board[head + 1]) ++head;
      if (tail < N && t == board[tail]) ++tail;
    } else {
      if (tail - 1 >= 0 && t == board[tail - 1]) --tail;
      if (head >= 0 && t == board[head]) --head;
    }
  }
  cout << (tail - head - 1) << endl;
}


Measured memory_bytes: 976
#include<stdio.h>
#include<string.h>
#define MAX 20001
typedef struct idx_S{
    int idx;
    int S;
}idx_S;
void Push1(int S[],int x,int *top){
    S[*top]=x;
    (*top)++;
    return;
}
void Push2(idx_S S[],int idx,int s,int *top){
    S[*top].idx=idx;
    S[*top].S=s;
    (*top)++;
    return;
}
int Pop(int S[],int *top){
    (*top)--;
    return S[*top];
}
void Union(idx_S S[],int *top){
    int i;
    for(i=(*top)-1;i>0;i--){
        if(S[i].idx < S[i-1].idx){
            (*top)--;
            S[i-1].idx=S[i].idx;
            S[i-1].S+=S[i].S;
        }
    }
    return;
}
int main(void){
    int i,j,idx,Stack1[MAX];;
    char str[MAX];
    idx_S Stack2[MAX];
    int top1=0,top2=0,sum=0;
    scanf("%s",str);
    for(i=0;i<strlen(str);i++){
        switch(str[i]){
            case '\\':
                Push1(Stack1,i,&top1);
                break;
            case '/' :
                if(top1==0){
                    break;
                }
                idx=Pop(Stack1,&top1);
                sum+=(i-idx);
                Push2(Stack2,idx,i-idx,&top2);
                Union(Stack2,&top2);
                break;
            default:
                break;
        }
    }
    printf("%d\n",sum);
    if(top2==0){
        printf("%d\n",top2);
    }else{
        printf("%d ",top2);
        for(i=0;i<top2-1;i++){
            printf("%d ",Stack2[i].S);
        }
        printf("%d\n",Stack2[top2-1].S);
    }
    return 0;
}


Measured memory_bytes: 2100
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
    #define debug(...) printf(__VA_ARGS__)
#else
    #define debug(...) (void)0
#endif
#define mp make_pair
#define pb push_back
#define LL long long
#define pii pair<int,int>
#define PII pair<long long, long long>
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
const int inf = 0x7fffffff; //beware overflow
const LL INF = 0x7fffffffffffffff; //beware overflow
#define mem(x, y) memset(x, (y), sizeof(x) );
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
template<typename A, typename B>
ostream& operator <<(ostream &s, const pair<A,B> &p) {
     return s<<"("<<p.first<<","<<p.second<<")";
}
template<typename T>
ostream& operator <<(ostream &s, const vector<T> &c) {
    s << "[ ";
    for (auto it : c) s << it << " ";
    s << "]";
    return s;
}
template<typename T>
ostream& operator << (ostream &o, const set<T> &st) {
    o << "{";
    for (auto it=st.begin(); it!=st.end(); it++) o << (it==st.begin() ? "" : ", ") << *it;
    return o << "}";
}
template<typename T1, typename T2>
ostream& operator << (ostream &o, const map<T1, T2> &mp) {
    o << "{";
    for (auto it=mp.begin(); it!=mp.end(); it++) {
        o << (it==mp.begin()?"":", ") << it->fi << ":" << it->se;
    }
    o << "}";
    return o;
}
inline LL getint(){
   LL _x=0,_tmp=1; char _tc=getchar();
   while( (_tc<'0'||_tc>'9')&&_tc!='-' ) _tc=getchar();
   if( _tc == '-' ) _tc=getchar() , _tmp = -1;
   while(_tc>='0'&&_tc<='9') _x*=10,_x+=(_tc-'0'),_tc=getchar();
   return _x*_tmp;
}
#define maxn 100005
char a[maxn];
int main() {
    scanf("%s",a);
    int n = strlen(a);
    if( n&1 ) {

    }else {
    }
    puts( (n&1)&&a[0]!=a[n-1] || (n%2==0)&&a[0]==a[n-1] ? "First":"Second");
}



Measured memory_bytes: 512
n = gets.chomp.to_i
num_p = gets.chomp.tr(' ', '').to_i
num_q = gets.chomp.tr(' ', '').to_i

permutations = [*1..n].permutation(n).to_a.map{|a| a.join('').to_i}.sort

p_idx = permutations.index(num_p) + 1
q_idx = permutations.index(num_q) + 1

puts (p_idx - q_idx).abs

Measured memory_bytes: 10072
#include<math.h>
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define ll long long int
#define py printf("Yes\n")
#define pn printf("No\n")
#define in cin>>
using namespace std;
const int INF = 1001001001;

int main()
{
    int n;
    in n;
    vector<int> d(n);
    rep(i,n)in d[i];
    bool flag[101]={true};
    rep(i,110)
    {
        for(int j=0;j<=n;j++)
        {
            if(i+1==d[j])flag[i+1]=1;
        }
    }
    int ans=0;
    rep(i,101)if(flag[i]==1)ans++;
    cout<<ans-1<<endl;

}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <functional>
#include <ctime>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iomanip>
#include <float.h>
#include <math.h>
using namespace std;
using ll = long long;


unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

class UnionFind {
public:
    vector <ll> par;
    vector <ll> siz;
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);
        for (ll i = 0; i < sz_; ++i) par[i] = i;
    }
    ll root(ll x) {
        while (par[x] != x) {
            x = par[x] = par[par[x]];
        }
        return x;
    }
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) {
        return root(x) == root(y);
    }

    ll size(ll x) {
        return siz[root(x)];
    }
};

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

int main() {
    ll n;
    cin >> n;
    vector<ll> z(100);
    for (int i = 2; i < n+1; i++) {
        ll t = i;
        for (int j = 2; j < 100; j++) {
            while (t%j==0) {
                t/=j;
                z[j]++;
            }
        }
    }
    vector<ll> x(100);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < z[i]+1; j++) {
            x[j]++;
        }
    }
    cout << (x[2]-2) * x[4] * (x[4] - 1) / 2 + x[14] * (x[4]-1) + x[24] * (x[2]-1) + x[74] << endl;
}

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

int main() {
  int N;
  cin >> N;
  
  vector<int> a(N);
  
  for (int i=0; i<N ;i++){
    int ai;
    cin >> ai;
    a.at(i)=ai;
  }
  sort(a.begin(), a.end());
  reverse(a.begin(),a.end());
  
  int sum1,sum2;
  
  sum1=0;
  sum2=0;
  
  for  (int i=0;i<N;i++){
    if (i%2==1){
      sum1+=a.at(i);
    }
    else{
      sum2+=a.at(i);
    }
  }
  cout << sum2-sum1 <<endl;
    
  
}



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


int main(){
	int n, count = 0, result = 0;
	cin >> n;
	long long a[200];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	while (1) {
		for (int i = 0; i < n; i++) {
			if (a[i] % 2 == 0) { count++; a[i] /= 2; }
		}
		if (count == n) { result++; count = 0; }
		else { break; }
	}
	cout << result;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define inp(X) cin >> X
#define out(X) cout << X << endl
#define out16(X) cout << setprecision(16) << X << endl
#define rep(i,n) for(int i=0;i<n;i++ )
#define rep2(i,f,n) for(int i=f;i<n;i++ )
#define MAX(A) *max_element(A.begin(),A.end())
#define MIN(A) *min_element(A.begin(),A.end())
#define SORT(A) sort(A.begin(),A.end())
#define REV(A) reverse(A.begin(),A.end())
typedef long long int ll;
using vi = std::vector<int>;
using vvi = std::vector<std::vector<int>>;
using vd = std::vector<double>;
using vvd = std::vector<std::vector<double>>;
using vll = std::vector<ll>;
using vvll = std::vector<std::vector<ll>>;
using namespace std;
#define MOD 1000000007
#define INF 1000000001
#define LL_INF 1001001001001001001

bool check(vi &v1, vi &v2){
}

int kaijo(int n){
	if(n==1) return 1;
	else return n*kaijo(n-1);
}

int main(void) {
	int n; cin >> n;
	int kj = kaijo(n);
	vi p(n); rep(i,n) cin >> p[i];
	vi q(n); rep(i,n) cin >> q[i];
	vvi nums(kj,vi(n)); rep(i,n) nums[0][i] = i+1;
    rep2(i,1,kj) {
		nums[i] = nums[i-1];
		next_permutation(nums[i].begin(), nums[i].end());
    }
	int a,b;
	rep(i,kj){
		if(p==nums[i]) a=i;
		if(q==nums[i]) b=i;
	}
	out(abs(a-b));

}




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

int main(void){
    int N;
    bool flag = false;
    cin >> N;

    for(int i = 0;i <= 9;i++){
        for(int j = 0;j <= 9;j++){
            if(i*j == N){
                flag = true;
                break;
            }
        }
    }
    
    if(flag)
        cout << "Yes" << endl;

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

Measured memory_bytes: 3620