akhauriyash/Code-Regression huggingface dataset:
//#pragma once
#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>
#include <numeric>

using namespace std;
#define modd 1000000007


typedef pair<long long, long long> pl;

typedef pair<long long, string> pls;


#define ll long long




/*
class UnionFind {
public:
	vector <ll> par; 
	vector <ll> siz;
	vector <ll> gr;

	// Constructor
	UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL) ,gr(sz_){
		for (ll i = 0; i < sz_; ++i) par[i] = i; 
	}
	void init(ll sz_) {
		par.resize(sz_);
		siz.assign(sz_, 1LL);  // resize だとなぜか初期化されなかった
		for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
	}

	// Member Function
	// Find
	ll root(ll x) { // 根の検索
		while (par[x] != x) {
			x = par[x] = par[par[x]]; // x の親の親を x の親とする
		}
		return x;
	}

	// Union(Unite, Merge)
	bool merge(ll x, ll y) {
		x = root(x);
		y = root(y);
		if (x == y) return false;

		// merge technique（データ構造をマージするテク．小を大にくっつける）
		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 N, M, k, a, b, c, d, e,H, W,Q;
long long A[200000]= {};
long long B[200005] = {};
long long C[20][200] = {};
bool f;
bool ff;
string S[200];
set <long long>sll;
pl buf;
pls bufls;
vector <long long>vl;
vector <pl>vpl;
vector <pls>vpls;
vector <string> vs;

struct ST
{
	long long hajime;
	long long owari;
	long long zahyou;
	int bangou;

	bool operator<(const ST& another) const
	{
		return hajime < another.hajime;//年齢を比較
	};

};



vector <ST> vst;
ST st[200005];

int main() {

	cin >> S[0] >> S[1]>>S[2];

	cout << S[0][0] << S[1][1] << S[2][2] << endl;




	return 0;

}


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

int main() {
  char S;
  cin >> S;
  if(S == 'a'||S == 'b'||S == 'c'||S == 'd'||S == 'e'||S == 'f'||S == 'g'||S == 'h'||
     S == 'i'||S == 'j'||S == 'k'||S == 'l'||S == 'm'||S == 'n'||S == 'o'||S == 'p'||
     S == 'q'||S == 'r'||S == 's'||S == 't'||S == 'u'||S == 'v'||S == 'w'||S == 'x'||
     S == 'y'||S == 'z'){
    cout << "a" << endl;
  }
  else{
    cout << "A" << endl;
  }
}

Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
#define fil(x) memset(x, 0, sizeof(x))
#define fillb(x) memset(x,false,sizeof(x))
#define fillm(x) memset(x, -1, sizeof(x))
#define mp make_pair
#define pll pair<int, int>
#define pf printf
#define sf scanf
#define all(x) x.begin(),x.end()
#define pb push_back
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define np std::string::npos
#define fo(i,n) for(int i=0;i<n;i++)
#define of(i,n) for(int i=n-1;i>=0;i--)
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
#define Inf INFINITY
#define minv(v) *min_element(v.begin(),v.end())
#define maxv(v) *max_element(v.begin(),v.end())
#define cases(cs,t) for(int cs=1;cs<=t;cs++)
#define PI acos(-1)
#define nl endl

typedef unsigned long long lll;
typedef long long ll;
int knigtx8[] = {2, 2, -2, -2, 1, 1, -1, -1}; ///knight move in chess
int knigty8[] = {1, -1, 1, -1, 2, -2, 2, -2}; ///knight move in chess
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1}; ///for 8 directions
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1}; ///for 8 directions
int dx4[] = {0, 0, 1, -1}; ///for 4 directions
int dy4[] = {1, -1, 0, 0}; ///for 4 directions
const int maxx=100005;

//this fuction sorts vector pair according to first element in descending order.
bool sortinrev(const pair<int,int> &a,const pair<int,int> &b)
{
    return a.first>b.first;
}

int atoz(){
    int frnt,bck,nibo,present,i;string s;
        frnt = abs(s[i]-present);
        bck = 26-frnt;
        nibo = min(frnt,bck);
}

template<typename T>inline T Bigmod(T base, T power, T MOD){
    T ret=1;
    while(power)
    {
        if(power & 1)ret=(ret*base)%MOD;
        base=(base*base)%MOD;
        power>>=1;
    }
    return ret;
}

int main()
{
    IOS;
    double r;
    cin>>r;
    cout<<2*PI*r<<endl;
    return 0;
}


Measured memory_bytes: 3804
#include <stdio.h>

int main(){
    int a,b,min,k,count = 0;
    scanf("%d %d %d",&a,&b,&k);
    if(a < b) min = a;
    else min = b;
    int str[min];
    for(int i = min; i > 0; i--){
        if(a % i == 0 && b % i == 0){
            str[count] = i; 
            count++;
        }
        else continue;
    }
    printf("%d\n",str[k-1]);
    return 0;
}


Measured memory_bytes: 128
n, k = map(int, input().split())
a = list(map(int, input().split()))

MOD = 10**9 + 7

ans = 0
for i in range(n):
    x = 0
    for j in range(i+1, n):
        if a[i] > a[j]:
            x += 1
    y = 0
    for j in range(i):
        if a[i] > a[j]:
            y += 1

    ans += x * k * (k + 1) // 2
    ans %= MOD
    ans += y * (k-1) * k // 2
    ans %= MOD
    # print(i, x, y)

print(ans)


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

#define ll long long int
#define ull unsigned long long int
#define db double
#define ld long double
#define MOD 1000000007
#define inf (1LL << 62)
#define pi acos(-1.0)
#define si(a) scanf("%lld",&a)
#define sd(n) scanf("%lf", &n)
#define for1(i, stop) for(ll i = 1; i <= stop; i++)
#define for0(i, stop) for(ll i = 0; i < stop; i++)
#define rep1(i, start) for(ll i = start; i >= 1; i--)
#define rep0(i, start) for(ll i = (start-1); i >= 0; i--)
#define loop(i, start, stop, inc) for(ll i = start; i <= stop; i += inc)
#define pb(v,a) v.push_back(a)
#define pll pair <ll, ll>
#define mp make_pair
#define pbp(v,a,i) v.push_back(make_pair(a,i))
#define srt(v) sort(v.begin(),v.end())
#define rv(v) reverse(v.begin(),v.end())
#define ms(n, i) memset(n, i, sizeof(n))
#define debug printf("Debug\n");
#define en '\n'



#define _fastio  ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);
/*typedef tuple<ll,ll,ll>tpl;

ll bigmod(ll n,ll pow)
{
    if(pow==0)
        return 1;
    if(pow==1)
        return n%MOD;

    ll ans=bigmod(n,pow/2);
    ans=(ans*ans)%MOD;

    if(pow%2==1)
    {
        ans=(ans*n)%MOD;
    }
    return ans%MOD;
}

ll fact[1000005];

ll nCr(ll n,ll r)
{

    ll ans=fact[n];
    ans=(ans*bigmod(fact[r],MOD-2))%MOD;
    ans=(ans*bigmod(fact[n-r],MOD-2))%MOD;
    return ans;
} */

int main()
{
    _fastio
    ll a,b,c,k;
    cin>>a>>b>>c>>k;
    if(b<=a)
    {
        while(1)
        {
            if(b>a)
                break;
            else
            {
                b=b*2;
                k=k-1;
            }
        }
    }
    if(c<=b)
    {
        while(1)
        {
            if(c>b)
                break;
            else
            {
                c=c*2;
                k=k-1;
            }
        }
    }
    if(k<0)
        cout<<"No"<<en;
    else
        cout<<"Yes"<<en;
}


Measured memory_bytes: 3588
#include <bits/stdc++.h>
//Fast io
#define io ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
//Class shorthands
#define ll long long
#define db long double
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define mi map<int,int>
#define mii map<pii,int>
//Function Shorthands
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define mp make_pair
#define po pop_back
#define eb emplace_back
//Code Shorthands
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repe(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=b;i>=a;i--)
#define all(a) (a).begin(),(a).end()
#define sz(x) (int)x.size()
//Constants
#define hell 1000000007
#define PI acos(-1.0)
using namespace std;

void solve(){
	string s;
	cin>>s;
	ll ans = 0;
	for(auto i:s) ans+=(i-'0');
	//cout<<ans<<endl;
	if(ans%9) cout<<"No\n";
	else cout<<"Yes\n";
}

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

Measured memory_bytes: 3780
import math

n, k = map(int, input().split())
a = list(map(int, input().split()))

def cond(x):
    s = 0
    for i in range(n):
        s += math.ceil(a[i]/x)-1
    return s <= k

l, r = 0, 10**9
while l+1 < r:
    mid = (l+r)//2
    if cond(mid):
        r = mid
    else:
        l = mid
print(r)

Measured memory_bytes: 104536
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>

using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f3f3f3f3fLL
#define SIZE 8080
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;

typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

long long int MOD = 1000000007;
int N;
int ans[114][114];
int main(){
	int H,W;
	cin>>H>>W;
	cin>>N;
	vi color;
	int sum=0;
	int ans2[114514];
	for(int i=0;i<N;i++){
		int a;
		cin>>a;
		for(int j=0;j<a;j++){
			ans2[sum+j]=i+1;
		}
		sum+=a;
	}
	for(int i=0;i<H;i++){
		if(i%2==0){
			for(int j=0;j<W;j++){
				cout<<ans2[i*W+j]<<" ";
			}
		}else{
			for(int j=0;j<W;j++){
				cout<<ans2[i*W+W-1-j]<<" ";
			}
		}
		cout<<endl;
	}
	//cout<<endl;
}

Measured memory_bytes: 384
S=input()
flag=True
if S[0]=="A":
    if S[2:-1].count("C")==1:
        S=S.replace('A','').replace('C','')
        if S==S.lower():
            flag=True
        else:
            flag=False
    else:
        flag=False
else:
    flag=False
if flag:
    print('AC')
else:
    print('WA')

Measured memory_bytes: 3060
import sys
sys.setrecursionlimit(1000000000)
import math
from fractions import gcd
def lcm(a, b): return a * b // gcd(a, b)
from itertools import count, permutations
from functools import lru_cache
from collections import deque, defaultdict
from pprint import pprint
ii = lambda: int(input())
mis = lambda: map(int, input().split())
lmis = lambda: list(mis())
INF = float('inf')
N1097 = 10**9 + 7

def meg(f, ok, ng):
    while abs(ok-ng)>1:
        mid = (ok+ng)//2
        if f(mid):
            ok=mid
        else:
            ng=mid
    return ok

def get_inv(n, modp):
    return pow(n, modp-2, modp)

def factorials_list(n, modp):    # 10**6
    fs = [1]
    for i in range(1, n+1):
        fs.append(fs[-1] * i % modp)
    return fs

def invs_list(n, fs, modp):     # 10**6
    invs = [get_inv(fs[-1], modp)]
    for i in range(n, 1-1, -1):
        invs.append(invs[-1] * i % modp)
    invs.reverse()
    return invs

def comb(n, k, modp):
    num = 1
    for i in range(n, n-k, -1):
        num = num * i % modp
    den = 1
    for i in range(2, k+1):
        den = den * i % modp
    return num * get_inv(den, modp) % modp

def comb_from_list(n, k, modp, fs, invs):   
    return fs[n] * invs[n-k] * invs[k] % modp

#

class UnionFindEx:
    def __init__(self, size):
        #正なら根の番号、負ならグループサイズ
        self.roots = [-1] * size
    def getRootID(self, i):
        r = self.roots[i]
        if r < 0:   #負なら根
            return i
        else:
            r = self.getRootID(r)
            self.roots[i] = r
            return r
    def getGroupSize(self, i):
        return -self.roots[self.getRootID(i)]
    def connect(self, i, j):
        r1, r2 = self.getRootID(i), self.getRootID(j)
        if r1 == r2:
            return False
        if self.getGroupSize(r1) < self.getGroupSize(r2):
            r1, r2 = r2, r1
        self.roots[r1] += self.roots[r2]    #サイズ更新
        self.roots[r2] = r1
        return True

def main():
    print([1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51][ii()-1])



main()







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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int H,W;
int SY,SX,TY,TX;
string S[101];

template<class V> class MaxFlow_Ford {
public:
	struct edge { int to,reve;V cap;};
	static const int MV = 20002;
	vector<edge> E[MV];
	int vis[MV];
	void add_edge(int x,int y,V cap,bool undir=false) {
		E[x].push_back((edge){y,(int)E[y].size(),cap});
		E[y].push_back((edge){x,(int)E[x].size()-1,undir?cap:0});
	}
	V dfs(int from,int to,V cf) {
		V tf;
		if(from==to) return cf;
		vis[from]=1;
		FORR(e,E[from]) if(vis[e.to]==0 && e.cap>0 && (tf = dfs(e.to,to,min(cf,e.cap)))>0) {
			e.cap -= tf;
			E[e.to][e.reve].cap += tf;
			return tf;
		}
		return 0;
	}
	V maxflow(int from, int to) {
		V fl=0,tf;
		while(1) {
			ZERO(vis);
			if((tf = dfs(from,to,numeric_limits<V>::max()))==0) return fl;
			fl+=tf;
		}
	}
};

MaxFlow_Ford<int> mf;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>H>>W;
	FOR(y,H) {
		cin>>S[y];
		FOR(x,W) {
			if(S[y][x]=='S') SY=y,SX=x,S[y][x]='o';
			if(S[y][x]=='T') TY=y,TX=x,S[y][x]='o';
			if(S[y][x]=='o') mf.add_edge(y*100+x+10000,y*100+x,1);
		}
	}
	
	mf.add_edge(20000,SY*100+SX,100001);
	mf.add_edge(TY*100+TX+10000,20001,100001);
	
	FOR(y,H) {
		int x2;
		FOR(x,W) FOR(x2,x) if(S[y][x]=='o' && S[y][x2]=='o') {
			mf.add_edge(y*100+x,y*100+x2+10000,100001);
			mf.add_edge(y*100+x2,y*100+x+10000,100001);
		}
	}
	FOR(x,W) {
		int y2;
		FOR(y,H) FOR(y2,y) if(S[y][x]=='o' && S[y2][x]=='o') {
			mf.add_edge(y*100+x,y2*100+x+10000,100001);
			mf.add_edge(y2*100+x,y*100+x+10000,100001);
		}
	}
	
	int ret=mf.maxflow(20000,20001);
	if(ret>10000) ret=-1;
	
	cout<<ret<<endl;
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}


Measured memory_bytes: 64000
def main(input = $stdin)
  n, w = input.gets.split(" ").map(&:to_i)
  goods = []
  n.times do
    goods << input.gets.split(" ").map(&:to_i)
  end
  arr = Array.new(w + 1, nil)
  arr[0] = 0
  goods.each{|good|
    #arr[0..w - good[1]].each_with_index{|i, idx|
    #  p [arr, i, idx]
    for idx in 0..w - good[1]
      if arr[idx] and (!arr[idx + good[1]] or arr[idx + good[1]] < arr[idx] + good[0])
        arr[idx + good[1]] = arr[idx] + good[0]
      end
    end
  }
  puts arr.select{|i|i}.max
end
main

Measured memory_bytes: 6264
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define VB vector<bool>
#define VP vector<pair<ll,ll>>
#define VVL vector<vector<ll>>
#define VVP vector<vector<pair<ll,ll>>>
#define PL pair<ll,ll>
#define ALL(v) (v).begin(), (v).end()
ll d1[4] = {1, -1, 0, 0};
ll d2[4] = {0, 0, 1, -1};

int main(){
    ll n;
    cin >> n;
    VL v(n);
    rep(i, 0, n) cin >> v[i];
    ll ans = 0;
    map<ll, ll> odd, even;
    for(ll i = 0; i < n; i += 2) odd[v[i]]++;
    for(ll i = 1; i < n; i += 2) even[v[i]]++;
    ll omx = 0, osmx = 0, emx = 0, esmx = 0;
    ll oid = 0, osid = 0, eid = 0, esid = 0;
    auto f = [&](pair<ll, ll> e) {
        if(omx < e.second) {
            osmx = omx;
            osid = oid;
            omx = e.second;
            oid = e.first;
        }else if(osmx < e.second) {
            osmx = e.second;
            osid = e.first;
        }
    };
    auto g = [&](pair<ll, ll> e) {
        if(emx < e.second) {
            esmx = emx;
            esid = eid;
            emx = e.second;
            eid = e.first;
        }else if(esmx < e.second) {
            esmx = e.second;
            esid = e.first;
        }
    };
    for(auto e : odd) f(e);
    for(auto e : even) g(e);
    cerr << oid << " " << eid << endl;
    if(oid == eid) {
        if(-omx + osmx > -emx + esmx) {
            cout << n - (osmx + emx) << endl;
        } else {
            cout << n - (omx + esmx) << endl;
        }
    }else{
        cout << n - (omx + emx) << endl;
    }
    return 0;
}

Measured memory_bytes: 10392
import sys

input = sys.stdin.readline


def main():
    S = input().split()
    A = int(S[0])
    op = S[1]
    B = int(S[2])
    if op == "+":
        print(A + B)
    else:
        print(A - B)


if __name__ == "__main__":
    main()


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

int main(){
	int n;
	cin >> n;
	vector<double> x(n),y(n);
	for(auto &a:x){
		cin >> a;
	}
	for(auto &a:y){
		cin >> a;
	}
	//p = 1
	double sum = 0.0;
	for(int i = 0; i < n; i++){
		sum += fabs(x[i] - y[i]);
	}
	printf("%.10lf\n",sum);
	//p = 2
	sum = 0.0;
	for(int i = 0; i < n; i++){
		sum += pow(fabs(x[i] - y[i]),2);
	}
	printf("%.10lf\n",sqrt(sum));
	//p = 3
	sum = 0.0;
	for(int i = 0; i < n; i++){
		sum += pow(fabs(x[i] - y[i]),3);
	}
	printf("%.10lf\n",pow(sum,1.0/3.0));
	//p = ??????
	sum = fabs(x[0] - y[0]);
	for(int i = 1; i < n; i++){
		if(sum < fabs(x[i] - y[i])) sum = fabs(x[i] - y[i]);
	}
	printf("%.10lf\n",sum);
	return 0;
}

Measured memory_bytes: 3404
#include<cstdio>
#include<iostream>
using namespace std;
int n,k;
int a[300010];
int main() {
	scanf("%d%d",&k,&n);
	if(~k&1) {
		printf("%d ",k/2);
		for(int i=2; i<=n; i++)
			printf("%d ",k);
	} else {
		for(int i=1; i<=n; i++)
			a[i]=(k+1)/2;
		int last=n;
		for(int i=1; i<=n/2; i++)
			if(a[last]==1) last--;
			else {
				a[last]--;
				for(int j=last+1; j<=n; j++)
					a[j]=k;
				last=n;
			}
		for(int i=1; i<=last; i++)
			printf("%d ",a[i]);
	}
	return 0;
}

Measured memory_bytes: 3456
import java.util.Scanner;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int R=sc.nextInt();
		if(R<1200) {
			System.out.println("ABC");
		}else if(R<2800) {
			System.out.println("ARC");
		}else {
			System.out.println("AGC");
		}
	//	System.out.println("Hello World");
	}

}


Measured memory_bytes: 21844
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(void) {
	string w;
	cin >> w;
	sort(w.begin(),w.end());
	for (int i = 1; i <= w.length(); i++) {
		if (w[i - 1] != w[i]) {
			if ((i - 1) % 2 == 0) {
				cout << "No" << endl;
				return 0;
			}
		}
	}
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
	int m,f,r;

	while(1){
		scanf("%d %d %d", &m, &f, &r);
		if(m == -1 && f == -1 && r == -1){
			return 0;
		}

		if(m <= 50 && m >= -1 && f <= 50 && f >= -1 && r <= 100 && r >= -1){
			if(m == -1 || f == -1){
				printf("F\n");
			}else if(m + f >= 80){
				printf("A\n");
			}else if(65 <= m + f && m + f < 80){
				printf("B\n");
			}else if((50 <= m + f && m + f < 65) || (30 <= m + f && m + f < 50 && r >= 50)){
				printf("C\n");
			}else if(30 <= m + f && m + f < 50){
				printf("D\n");
			}else{
				printf("F\n");
			}
		}else{
			return 0;
		}
	}

	return 0;
}

Measured memory_bytes: 584
#include <bits/stdc++.h>
using namespace std;
  #define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define endl "\n"
  #define all(v) v.begin(),v.end()
  #define double long double
  #define trace1(x)                cerr<<#x<<": "<<x<<endl
  #define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
  #define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
  #define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
  #define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<< ": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
  #define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
  #define cases int testcases;cin>>testcases; while(testcases--)


#define N 100005

int32_t main()
{

    IOS


    int a,b,c,k;
    cin >> a >> b >> c >> k;

    if(k <= a+ b)
    {
      cout << min(a,k);
    }
    else 
    {
      cout << a -1*(k-a-b);
    }


   
    return 0;
}

Measured memory_bytes: 3608
N = int(input())
Word_list = []
ans = 0

for i in range(N):
    Gift = input()
    Word_list.append(Gift)
Word_list.sort()

Before_Word = ""

for i in range(N):
    if Word_list[i] != Before_Word:
        ans += 1
        Before_Word = Word_list[i]

print(ans)

#
# for i in range(N):
#     Gift = input()
#     CHECK = "Nothing"
#     for i in Word_list:
#         if i == Gift:
#             CHECK = "Exist"
#             break
#     if CHECK == "Nothing":
#         Word_list.append(Gift)
#         ans += 1
# # print(Word_list)
# print(ans)


Measured memory_bytes: 24028
# D - Multiple of 2019

from collections import Counter

s = input()

count = 0
counter = Counter([0])

suffix = 0
pow = 1
for i in range(len(s) - 1, -1, -1):
    suffix = (int(s[i]) * pow + suffix) % 2019
    pow = pow * 10 % 2019
    count += counter[suffix]
    counter[suffix] += 1

print(count)


Measured memory_bytes: 9676
#include <cstdio>
#include <string>
#include <string.h>
#include <algorithm>
#include <iterator>
#include <unistd.h>

using namespace std;

long a,b,c,k;

int main(void){
  scanf("%ld%ld%ld%ld", &a, &b, &c, &k);

  long ans = (k%2>0)? (b-a) : (a-b);
  printf("%ld\n", ans);
  fflush(stdout);

  return 0;
}

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

int f(const void *a,const void *b){
  return *(int*)b-*(int*)a;
}

int main(){
  int N,K;
  int H[200002];
  scanf("%d %d",&N,&K);
  for(int i=0;i<N;i++)
    scanf("%d",H+i);
  qsort(H,N,sizeof(int),f);
  long long int ans=0LL;
  for(int i=K;i<N;i++)
    ans+=(long long int)H[i];
  printf("%lld\n",ans);
  return 0;
}

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

// int/long:		-2147483648 - 2147483648 (-2^31 <= int < 2^31)
// long/long long:	-9223372036854775808 - 9223372036854775807 (-2^63 <= long < 2^63)

#define	INF (1<<29)
//536870912

// lower_bound(A.begin(), A.end(), N)
// upper_bound(...

// bit: &/and, |/or, ^/xor, ~/not

#define	MOD 1000000007

int	main() {
	int N;
	cin >>N;
	cout <<N*800-(N/15)*200 <<endl;
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <utility>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>
#include <cstdio>
#include <map>
#include <list>
#include <stdio.h>
#include <sstream>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define all(x) (x).begin(), (x).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
//ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
//ll lcm(ll x, ll y) {return x / gcd(x, y) * y;}
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
const ll mod = 1e9 + 7;
const ll inf = 1LL << 60;
const long double pi = 3.14159265358979323846;

// ****************************************CODE***************************************//

ll n, w, weight[100100], value[100100];
ll dp[110][100100];

int main() {
    cin >> n >> w;
    for(int i = 0; i < n; i++) cin >> weight[i] >> value[i];
    for(int i = 0; i < n+1; i++) for(int j = 0; j < 100100; j++) dp[i][j] = inf;

    dp[0][0] = 0;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < 100100; j++){
            if(j - value[i] >= 0) dp[i+1][j] = min(dp[i+1][j], dp[i][j - value[i]] + weight[i]);
            dp[i+1][j] = min(dp[i+1][j], dp[i][j]);
        }
    }

    ll res = 0;
    for(int i = 0; i < 100100; i++){
        if(dp[n][i] <= w) res = i;
    }

    cout << res << endl;
}

Measured memory_bytes: 80640
#include<bits/stdc++.h>
using namespace std;
 
using lint=long long;
const lint INF=(lint)1e18;

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

   int N; cin>>N;
   lint K; cin>>K;
   vector<int> a(N);
   for(int i=0;i<N;i++) cin>>a[i];
   sort(a.begin(),a.end());

   int negative=0,zero=0,positive=0;
   vector<int> b,c;
   for(int i=0;i<N;i++){
      if(a[i]<0) b.push_back(-a[i]),negative++;
      else if(a[i]==0) zero++;
      else c.push_back(a[i]),positive++;
   }
   sort(b.begin(),b.end());
   sort(c.begin(),c.end());

   auto check=[&](lint x)
   {
      lint cnt=0;
      if(x==0){
         cnt=(lint)N*(N-1)/2-(lint)negative*(negative-1)/2-(lint)positive*(positive-1)/2;
      }else if(x<0){
         for(auto I:b){
            lint need;
            if(I==1) need=-x; else need=(-x+I-1)/I;
            cnt+=c.end()-lower_bound(c.begin(),c.end(),need);
         }
      }else{
         cnt=(lint)N*(N-1)/2-(lint)negative*(negative-1)/2-(lint)positive*(positive-1)/2;
         for(int i=0;i<b.size();i++){
            cnt+=upper_bound(b.begin(),b.begin()+i,x/b[i])-b.begin();
         }
         for(int i=0;i<c.size();i++){
            cnt+=upper_bound(c.begin(),c.begin()+i,x/c[i])-c.begin();
         }
      }
      return cnt>=K;
   };
   lint ng=-INF-1,ok=INF;
   while(ok-ng>1){
      lint mid=(ng+ok)/2;
      (check(mid)? ok:ng)=mid;
   }
   cout<<ok<<endl;
   return 0;
}


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

int main()
{
    int n;
    cin >> n;
    ll ans = 1;
    ll max = 1000000000000000000;
    rep(i, n)
    {
        ll a;
        cin >> a;
        if (a == 0)
        {
            ans = 0;
            break;
        }
        if (ans == -1)
        {
            continue;
        }
        ll current = ans * a;
        if (current > max || current < ans)
        {
            ans = -1;
        }
        else
        {
            ans = current;
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define ll long long
using namespace std;
struct aaa{
	int x,y,d;
}a[500010];
int n,m,t1,tot,e[500010],hd[500010],nt[500010],f[500010],b[500010];
void build(int x,int y){
	tot++;
	e[tot]=y;
	nt[tot]=hd[x];hd[x]=tot;
}
void dfs(int x,int dep,int co){
	int i;
	if(!b[x])b[x]=co;
	if(dep<=f[x])return;
	f[x]=dep;
	for(i=hd[x];i;i=nt[i])dfs(e[i],dep-1,co);
}
int main(){
	int i,x,y;
	scanf("%d%d",&n,&m);
	for(i=1;i<=m;i++){
		scanf("%d%d",&x,&y);
		build(x,y);build(y,x);
	}
	scanf("%d",&t1);
	for(i=1;i<=t1;i++)scanf("%d%d%d",&a[i].x,&a[i].d,&a[i].y);
	for(i=t1;i;i--){
		dfs(a[i].x,a[i].d,a[i].y);
	}
	for(i=1;i<=n;i++)printf("%d\n",b[i]);
}

Measured memory_bytes: 11392
#include<bits/stdc++.h>
#define pb           push_back
#define pii          pair<int,int>
#define vi           vector<int>
#define vpii         vector<pair<int,int>>
#define gph          map<int, vector<int>>
#define mp           make_pair
#define FOR(i, n) for (int i = 0; i <  (int)(n); i++)
#define FOR1(i, n) for (int i = 1; i <= (int)(n); i++)
#define FORD0(i, n) for (int i = (int)n; i >= 0; i--)
#define FORD1(i, n) for (int i = (int)n; i >= 1; i--)
#define FORS(i, n) for(; i < (int)(n); i++)
#define debug(X) { cout << #X << " = " << (X) << endl; }
#define printArr(A,n) { cout << #A << " = "; FOR(i,n) cout << A[i] << ' '; cout << endl; }
using namespace std;
//#define int long long int

vi len((int)3e5);
int n;
bool check(int x){
    //debug(x);
    map<int, int> s;
    int prev = len[0];
    priority_queue<int> q;
    FOR1(i, n-1){
        if(len[i] <= prev){
            if(x == 1)return false;
            s[len[i]] += 1; 
            q.push(len[i]);
            int j = len[i];
            while(j >= 1 && s[j] == x){
                if(j == 1)return false;
                s[j] = 0;
                j--;
                q.push(j);
                s[j]++;
            }
        }else{
            // do nothing here
            // everything after prev should be 0
            while(!q.empty() && q.top() > prev){
                s[q.top()] = 0;
                q.pop();
            }
        }
        //update prev at the end
        prev = len[i];
    }
    return true;
}
signed main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);

    //freopen("in16.txt", "r" , stdin);
    cin >> n;
    FOR(i, n)cin >> len[i];
    int s = 1, e= n;
    int ans =n;
    while(s <= e){
        int mid = (s + e) >> 1;
        if(check(mid)){
            e = mid -1;
            ans = mid;
        }else{
            s = mid + 1;
        }
    }
    cout << ans;
}




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

using namespace std;
using ll = long long;

int main() {
  ll x;
  cin >> x;
  ll a = 0;
  ll b = x / 500;
  a += 1000 * b;
  x -= b * 500;
  b = x / 5;
  a += 5 * b;
  cout << a << endl;
  return 0;
}

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

long long N, A[1 << 18];

int main() {
	cin >> N;
	for (int i = 1; i <= N; i++) cin >> A[i];

	long long cl = 2, cr = 2;
	for (int i = N; i >= 1; i--) {
		cl = (cl + A[i] - 1) / A[i]; cl *= A[i];
		cr = cr / A[i]; cr *= A[i];
		cr += (A[i] - 1);
	}
	if (cl > cr) cout << "-1" << endl;
	else cout << cl << " " << cr << endl;
	return 0;
}

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

using namespace std;

int main(){
	int x = 0;
	int n;
	string s;
	cin >> n >> s;
	
	int ans = 0;
	for(int i = 0;i < n;i++){
		if(s[i] == 'I'){
			x++;
		}else{
			x--;
		}
		ans = max(ans, x);
	}
	
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define debug(x)      cerr << "L" << __LINE__ << ": " << #x << " = " << (x) << endl
#define debugvec(v)   rep(i, v.size()) cerr << "L" << __LINE__ << ": " << #v << "[" << i << "] = " << v[i] << endl;
#define debugvec2(v)  cerr << "L" << __LINE__ << ": " << #v << " = { "; rep(i, v.size()) cerr << v[i] << (i + 1 == v.size() ? "" : ", "); cerr << " }" << endl;
typedef long long ll;  /* 10^18 くらいまでいける */

int main(){
  int n;
  cin >> n;
  vector<int> x(n);
  rep (i, n) cin >> x[i];

  // sort(x.begin(), x.end());

  float p = accumulate(x.begin(), x.end(), 0.0) / x.size();

  int p_ceil = ceil(p);
  int p_floor = floor(p);

  // debug(p);

  int ans_ceil = 0;
  rep(i, n){
    ans_ceil += pow((x[i]-p_ceil), 2);
  }
  int ans_floor = 0;
  rep(i, n){
    ans_floor += pow((x[i]-p_floor), 2);
  }

  int ans = min(ans_floor, ans_ceil);

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
/*
// Sample code to perform I/O:

#include <iostream>

using namespace std;

int main() {
	int num;
	cin >> num;										// Reading input from STDIN
	cout << "Input number is " << num << endl;		// Writing output to STDOUT
}

// Warning: Printing unwanted or ill-formatted data to output will cause the test cases to fail
*/

// Write your code here
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define mod 1000000009
typedef pair<int,int> pp;
#define ff first 
#define ss second 
#define pb push_back
#define lb lower_bound 
#define ub upper_bound

int main(){ 
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
	int l,r,d,ans=0;
	cin>>l>>r>>d;
	for(int i=l;i<=r;i++){
	    if(i%d==0) ans++;
	} 
	cout<<ans;
    
}

Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <iomanip>

using namespace std;

#define sz(a) static_cast<int>((a).size())
#define f first
#define s second
#define els(v) for (auto &el : (v))


#ifdef KIRYA
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#endif

template<typename T>
void _dbg(const char* _s, T _h) {
    cerr << _s << " = " << _h << "\n";
}

template<typename T, typename... Ts>
void _dbg(const char*_s, T _h, Ts... _t) {
    int _b = 0;

    while (((_b += *_s == '(') -= *_s == ')') != 0 || *_s != ',')
        cerr << *_s++;

    cerr << " = " << _h << ",";
    _dbg(_s + 1, _t...);
}

const int64_t INF = static_cast<int64_t>(1e9) + 7;
const int64_t LINF = INF * INF;
const int MAXN = static_cast<int>(1e6) + 17;

double dist(const vector<pair<int, int>>& vec) {
    int n = vec.size();
    double ans = 0;
    for (int i = 0; i < n - 1; ++i) {
        ans += pow(pow(vec[i].first - vec[i + 1].first, 2) + pow(vec[i].second - vec[i + 1].second, 2), 0.5);
    }
    return ans;
}

void solve() {
    int n;
    cin >> n;
    vector<pair<int, int>> vec(n);
    for (int i = 0; i < n; ++i) {
        cin >> vec[i].first >> vec[i].second;
    }
    sort(vec.begin(), vec.end());
    double sum = 0;
    int cnt = 0;
    do {
        sum += dist(vec);
        ++cnt;
    } while (next_permutation(vec.begin(), vec.end()));
    cout << setprecision(10) << sum / cnt << '\n';
}

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

    int q = 1;

    for (int i = 0; i < q; ++i) {
        solve();
    }
}

Measured memory_bytes: 512
#include <iostream>
#include<vector>
using LL = long long;
using namespace std;

int main() {
	LL N;
	cin >> N;
	vector<LL> A(N), B(N);
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	LL sum = 0;
	for (int i = 0; i < N; i++) {
		sum = sum ^ A[i];
	}
	for (int i = 0; i < N; i++) {
		B[i] = sum ^ A[i];
	}
	for (int i = 0; i < N; i++) {
		cout << B[i]  << " ";
	}
	cout << endl;
	return 0;
}

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

int main()
{
	int n, t;

	bool check;

	cin >> n;

	for (int i = 1; i <= n; i++)
	{
		check = false;

		if (i % 3 == 0)
		{
			check = true;
		}
		else
		{
			t = i;

			for (int j = 0; j <= 5; j++)
			{
				if (t % 10 == 3)
				{
					check = true;
				}

				t /= 10;
			}
		}

		if (check == true)
		{
			cout << ' ' << i;
		}
	}

	cout << endl;

	return 0;
}


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

#define pb push_back
#define mp make_pair

const int MOD = 1e9+7;
const int MAX_N=1e5+10;

int N, K;
set<int> has[118];

void solve()
{
	int ans = 0;
	for(int i=1;i<=N;++i)if(has[i].empty()){
		ans++;
	}
	cout << ans << '\n';
}

int main()
{
	ios::sync_with_stdio(false);
	cin >> N >> K;
	int d, a;
	for(int i=0;i<K;++i){
		cin >> d;
		for(int j=0;j<d;++j){
			cin >> a;
			has[a].insert(i);
		}
	}
	solve();
	return 0;
}


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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  long long a, b, k;
  cin >> a >> b >> k;
  
  for(int i = 0; i < k; i++){
    if(i % 2 == 0){
      if(a % 2 == 1) a--;
      a /= 2;
      b += a;
    }
    else{
      if(b % 2 == 1) b--;
      b /= 2;
      a += b;
    }
  }
  
  cout << a << " " << b << '\n';
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int i;
  int length;
  int c;
  scanf("%d",&length);

  int A[length];
  for(i = 0 ; i < length ; i++){
    scanf("%d" , &A[i]);
  }

  for(c = 0 ; c < length ; c++){
    printf("%d",A[c]);
     if(length - 1 != c)printf(" ");
  }
  printf("\n");



  /*insertion sort start*/
  int v;
  int j;
  for(i = 1 ; i < length ; i++){
    int v = A[i];
    int j = i - 1;
    while (j >= 0){
      if(A[j] < v)break;
      A[j+1] = A[j];
      j--;
    }
    A[j+1] = v;

    for(c = 0 ; c < length ; c++){
      printf("%d",A[c]);
       if(length - 1 != c)printf(" ");
    }
    printf("\n");
  }



  return 0;
}



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

using namespace std;

#define sqr(x) ((x) * (x))
#define all(v) (v).begin(), (v).end()
#define vi vector<int>
#define vvi vector<vi>

typedef long long ll;

int main() {
  int r, D, cur;
  cin >> r >> D >> cur;
  for (int i = 0; i < 10; i++) {
    cur = r * cur - D;
    cout << cur << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#define MAX 2000001
#define VMAX 10000

void CountingSort(short A[],short B[],int C[],int n){
    int i,j;

    for(i=1;i<=n;i++){
      scanf("%d",&A[i]);
    }

    for(i=0;i<=VMAX;i++){
    C[i] = 0;
    }

  for(i=1;i<=n;i++){
    C[A[i]]++;
  }

  for(i=1;i<=VMAX;i++){
    C[i] += C[i-1];
  }

  for(j=n;j>=1;j--){
    B[C[A[j]]] = A[j];
    C[A[j]]--;
  }

  }


int main(){
  unsigned short *A, *B;
  int C[VMAX+1];
  int n, i, j;

  scanf("%d",&n);

  A = malloc(sizeof(short)*n+1);
  B = malloc(sizeof(short)*n+1);

  /* your code */

  CountingSort(A,B,C,n);
 

  for(i=0;i<n;i++){
    if(i)printf(" ");
    printf("%d",B[i+1]);
  }
  printf("\n");

  return 0;
}




Measured memory_bytes: 9596
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt();
		sc.close();
		System.out.println(Math.max(A + B, Math.max(A - B, A * B)));
	}
}


Measured memory_bytes: 21972
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,k = inpl()
cnt = 0
while True:
    if n >= k ** cnt:
        cnt += 1
    else:
        print(cnt)
        break

Measured memory_bytes: 5624
n, t = (int(i) for i in input().split())
b = [int(i) for i in input().split()]
x = 0
for i in range(n-1):
    if b[i+1] - b[i] < t:
        x += (b[i+1] - b[i])
    else:
        x += t
print(x+t)

Measured memory_bytes: 25196
n=int(input())
lis=[]
lit=[]
for i in range(n):
    s,t=map(str,input().split())
    lis.append(s)
    lit.append(t)
a=input()
lit = [int(s) for s in lit]
for i in range(lis.index(a)+1):
    del lit[0]
print(sum(lit))

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>

using namespace std;

int main() {
	int n, a;
	int gusu = 0;
	int kisu = 0;

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a;
		a % 2 == 0 ? gusu++ : kisu++;
	}

	while (1) {
		int tmp1 = gusu;
		int tmp2 = kisu;
		gusu = gusu / 2 + gusu % 2 + kisu / 2;
		kisu = kisu % 2;

		if (tmp1 == gusu && tmp2 == kisu) {
			break;
		}
	}

	cout << (gusu + kisu == 1 ? "YES" : "NO") << endl;




	return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int i,j,k,n,m;
int main(){
	string s;
	cin>>s;
	for(int i=0;i<s.size();i++)
		if(s[i]!=s[s.size()-i-1])++m;
	cout<<m/2<<endl;
	return 0;
}

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

int main()
{
    int w,h,x,y,r;
    cin>>w>>h>>x>>y>>r;
    if(x<r||x>w-r||y<r||y>h-r)cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
}


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

int main() {
   
   ll n;
   cin>>n;
   
   double arr[n];
   for(ll i=0;i<n;i++)
   cin>>arr[i];
   
   if(n==1)
   {
       cout<<arr[0];
       return 0;
   }
   sort(arr,arr+n);
   
   double mean=(arr[0]+arr[1])/2.0;
   
   for(ll i=2;i<n;i++)
   {
       mean=(mean+arr[i])/2.0;
   }
   printf("%.6f",mean);
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan=new Scanner(System.in);
		long a=scan.nextLong();
		long b=scan.nextLong();
		long x=scan.nextLong();
		long y=scan.nextLong();
		long c=a*x;
		long d=a*y;
		long e=b*x;
		long f=b*y;
		long res=Math.max(Math.max(c, e), Math.max(d, f));
		System.out.println(res);
	
	
	}

}


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

#define INF 2000000000
#define ll long long

int N;
int X[200201], Y[200201];

int main()
{
	scanf("%d", &N);
	int mx1 = -INF, mx2 = -INF, mx3 = -INF, mx4 = -INF;
	for(int i=1; i<=N; i++)
	{
		scanf("%d %d", &X[i], &Y[i]);
		mx1 = max(mx1, -X[i]-Y[i]);
		mx2 = max(mx2, -X[i]+Y[i]);
		mx3 = max(mx3, +X[i]-Y[i]);
		mx4 = max(mx4, +X[i]+Y[i]);
	}
	int res = 0;
	for(int i=1; i<=N; i++)
	{
		res = max(res, mx1+X[i]+Y[i]);
		res = max(res, mx2+X[i]-Y[i]);
		res = max(res, mx3-X[i]+Y[i]);
		res = max(res, mx4-X[i]-Y[i]);
	}
	printf("%d", res);
	return 0;
}

Measured memory_bytes: 5360
# coding: utf-8
# Your code here!
N = int(input())
lst =[]
#lst = [list(map(int,input().split())) for i in range(N)]
for i in range(N):
    a,b = map(int,input().split())
    lst.append([a,b,a+b])

lst.sort(key=lambda x:(x[2],x[0],x[1]), reverse=True)
#print(lst)

count = 1
Takahashi = 0
Aoki = 0
for i in lst:
    if count % 2 == 1:
        Takahashi += i[0]
    else:
        Aoki += i[1]
    count+=1
print(Takahashi-Aoki)

Measured memory_bytes: 32064
#include <cmath>
#include <functional>
#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>
#include <sstream>
#include <cstring>
#include <bits/stdc++.h>
#include <iostream>
#define FAST ios::sync_with_stdio(0); cin.tie(0);
#define ll long long
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define for0(i, n) for (int i = 0; i < (int)(n); ++i) // 0 based indexing
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i) // 1 based indexing
#define forc(i, l, r) for (int i = (int)(l); i <= (int)(r); ++i) // closed interver from l to r r inclusive
#define forr0(i, n) for (int i = (int)(n) - 1; i >= 0; --i) // reverse 0 based.
#define forr1(i, n) for (int i = (int)(n); i >= 1; --i) // reverse 1 based
#define enterarray(a,n) for(int i=0;i<(int)(n);++i)cin>>a[i];
#define ins insert
const int MOD =998244353;
const int MX = int(2e6+9);
using namespace std;
ll f[200004];
int even(ll num){
    if(num%2==0)return 1;
    else return 0;
}
void printvector(vector<int> v){
    int i;
    for0(i,v.size())cout<<v[i]<<" ";
}
void solve(){
    ll n,m,i,j,k;
    ll a[200005],b[200005];
    ll ans=0,res=0;
    bool flag=true;
    vector<ll> v;
    string s1,s2;
    //set<ll> s;
    float d,t,s;
    cin>>d>>t>>s;
    if((d/t)<=s)cout<<"Yes";
    else cout<<"No";

}
 
int main()
{
    FAST;
   int t;
    t=1;
    while(t--)
    {
        solve();
        cout<<"\n";
    }
}

    

Measured memory_bytes: 3764
def attack(hp,attack):
    result = hp - attack
    return result

input = list(map(int, input().split()))
hp_takahashi = input[0]
attack_takahashi = input[1]
hp_aoki = input[2]
attack_aoki = input[3]
result = 10

while result > 1:
    hp_aoki = attack(hp_aoki,attack_takahashi)
    if hp_aoki < 1:
        print("Yes")
        break
    else:
        hp_takahashi = attack(hp_takahashi,attack_aoki)
        if hp_takahashi < 1:
            print("No")
            break

Measured memory_bytes: 9144
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
using datas=pair<ll,ll>;
using ddatas=pair<double,double>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
#define For(i,a,b) for(i=a;i<(ll)b;i++)
#define bFor(i,a,b) for(i=a;i>=(ll)b;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N-1,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define endl "\n"
#define pb push_back
#define output(v) do{bool f=0;for(auto outi:v){cout<<(f?" ":"")<<outi;f=1;}cout<<endl;}while(0)
const ll mod=1000000007;
const ll inf=1LL<<60;
const double PI = acos(-1);
const double eps = 1e-9;
template<class T> inline bool chmax(T& a,T b){bool x=a<b;if(x)a=b;return x;} 
template<class T> inline bool chmin(T& a,T b){bool x=a>b;if(x)a=b;return x;} 

void startupcpp(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
}

double distance(ddatas& x,ddatas& y){
  double a=x.first-y.first,b=x.second-y.second;
  return sqrt(a*a+b*b);
}

ll modinv(ll a) {
  ll b=mod,u=1,v=0,t;
  while(b){
    t=a/b;
    a-=t*b; swap(a,b);
    u-=t*v; swap(u,v);
  }
  return (u+mod)%mod;
}

ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}

vec modncrlistp,modncrlistm;

ll modncr(ll n,ll r){
  ll i,size=modncrlistp.size();
  if(size<=n){
    modncrlistp.resize(n+1);
    modncrlistm.resize(n+1);
    if(!size){
      modncrlistp[0]=modncrlistm[0]=1;
      size++;
    }
    For(i,size,n+1){
      modncrlistp[i]=modncrlistp[i-1]*i%mod;
      modncrlistm[i]=modinv(modncrlistp[i]);
    }
  }
  return modncrlistp[n]*modncrlistm[r]%mod*modncrlistm[n-r]%mod;
}

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

ll gcd(ll a,ll b){if(!b)return a;return (a%b==0)?b:gcd(b,a%b);}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

ll countdigits(ll n){
  ll ans=0;
  while(n){n/=10;ans++;}
  return ans;
}

ll sumdigits(ll n){
  ll ans=0;
  while(n){ans+=n%10;n/=10;}
  return ans;
}
void judgement(int a){
  if(a){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  if(a){
    cout<<"YES"<<endl;
  }else{
    cout<<"NO"<<endl;
  }
}

int main(){
  ll i,j,N,H,W,ans;
  cin>>N;
  rep(i,50001){
    j=i*108/100;
    if(j==N){
      cout<<i<<endl;
      return 0;
    }
  }
  cout<<":("<<endl;
  return 0;
}

Measured memory_bytes: 256
/* {{{ Shinobu kawaii */
/*
  ______   __        _                  __                 
.' ____ \ [  |      (_)                [  |                
| (___ \_| | |--.   __   _ .--.   .--.  | |.--.   __   _   
 _.____`.  | .-. | [  | [ `.-. |/ .'`\ \| '/'`\ \[  | | |  
| \____) | | | | |  | |  | | | || \__. ||  \__/ | | \_/ |, 
 \______.'[___]|__][___][___||__]'.__.'[__;.__.'  '.__.'_/ 

*/
/* }}} */

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

// #define int long long

/* cpp template {{{ */

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) (v).begin(), (v).end()

/* REPmacro */
#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

/* typedef */
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vector<int> > vii;
typedef pair<int, int> pii;
typedef double D;

/* const */
const int INF = 999999999;
const double EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; std::cin >> x; return x;}
template <typename T>
void print(std::vector<T>& v, char c = ' ') {
  REP(i, v.size()) {
    if (i != 0) std::cout << c;
    std::cout << v[i];
  }
  std::cout << '\n';
}
template <typename T>
void print(T x) {
  std::cout << x << '\n';
}

/* }}} */

bool input(vi& l, D& v1, D& v2) {
  char c;
  REP(i, 10) cin >> l[i] >> c;
  cin >> v1 >> c >> v2;
  return cin.eof();
}

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  vi l(10); D v1, v2;

  while (!input(l, v1, v2)) {
    D b = accumulate(ALL(l), 0.0);
    D y = v1 * b / (v1 + v2);
    D sum = 0;
    REP(i, 10) {
      sum += l[i];
      if (y <= sum) {
        print(i + 1);
        break;
      }
    }
  }

  return 0;
}

Measured memory_bytes: 1236