akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <utility>
#include <vector>
using namespace std;

#ifdef __linux
#define _U(s) s##_unlocked
#else
#define _U(s) _##s##_nolock
#define _CRT_DISABLE_PERFCRIT_LOCKS
#endif
#define gcu _U(getchar)
#define pcu _U(putchar)
#define _DEF(r, n, ...) inline r n(__VA_ARGS__) noexcept
#define _T template <typename T>
#define _HT template <typename H,typename... T>
#define _OP(t) inline operator t()
struct _in {
#ifdef _GLIBCXX_STRING
	_OP(string){string s;for(char c;c=gcu(),c!=' '&&c!='\n'&&c!=EOF;)s+=c;return s;}
#define _S
#endif
	_OP(char){char c=gcu();gcu();return c;}
	_OP(double){double d; scanf("%lf",&d); gcu();return d;}
	_T _OP(T){T n{},m{1},c;if((c=gcu())=='-')m=-1,c=gcu();do{n=10*n+(c-'0'),c=gcu();}while(c>='0'&&c<='9');return m*n;}
} in;
#define _SCAN(...) _DEF(bool,scan,__VA_ARGS__)
#ifdef _S
_SCAN(string &o) {int c{gcu()};if(c==EOF)return false;else{ungetc(c,stdin);string t=move(in);o=t;return true;}}
#endif
_T _SCAN(T &o) {int c{gcu()};return c==EOF?false:(ungetc(c,stdin),o=in,true);}
_HT _SCAN(H &h,T&&... t){return scan(h)&&scan(t...);}
#define _OUT(...) _DEF(void,out,__VA_ARGS__)
#define _OUTL(...) _DEF(void,outl,__VA_ARGS__)
_OUT(bool b){pcu('0'+b);}
_OUT(const char *s){while(*s)pcu(*s++);}
_OUT(char c){pcu(c);}
#ifdef _S
_OUT(string &s){for(char c:s)pcu(c);}
#endif
_T _OUT(T n){static char b[20];char *p=b;T m=n<0?pcu('-'),-1:1;
	if(!n)*p++='0';else while(n)*p++=(char)(n%10*m+'0'),n/=10;while(p!=b)pcu(*--p);}
_OUTL(){out('\n');}
#ifdef _GLIBCXX_VECTOR
	_T _OUT(vector<T> &v){for(T &x:v)out(&x == &v[0]?"":" "),out(x);}
#endif
	_HT _OUT(H &&h, T... t){out(h);out(t...);}
	template <typename... T> _OUTL(T... t){out(t...);outl();}
	struct range{
		int e,b=0,s=1;range(int _b,int _e,int _s):e(_e),b(_b),s(_s){} range(int _b,int _e): e(_e), b(_b){} range(int _e):e(_e){}
		struct it{int v,s; it(int _v,int _s):v(_v),s(_s){} operator int()const{return v;} operator int&(){return v;}int operator*()const{return v;}
			it& operator++(){v+=s;return *this;} }; it begin(){return {b,s};} it end(){return {e,s};}};
#define times(i,n) for(int i=n;i;i--)

struct T { int s, e; };

int main() {
	for (int n; (n = in);) {
		int t {in};
		vector<T> v;
		v.push_back({t, t});
		times(i, --n)
			if (v.back().e + 1 == (t = in))
				v.back().e++;
			else
				v.push_back({t, t});
		for (int i: range(v.size())) {
			if (i)
				out(' ');
			T &o = v[i];
			if (o.s == o.e)
				out(o.s);
			else
				out(o.s, '-', o.e);
		}
		outl();
	}
}


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

using namespace std;

string s;

void solve() {
    int values[26] = {0};
    for (char i : s) {
        values[i - 'a']++;
    }
    for (int i = 0; i < 26; i++) {
        if (values[i] == 0) {
            printf("%c\n", 'a' + i);
            return;
        }
    }
    printf("None\n");
}

int main() {
    cin >> s;
    solve();
    return 0;
}

Measured memory_bytes: 3896
#include <iostream>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <fstream>
#include <bitset>
#include <queue>
#include <stack>
#include <deque>
#include <complex>
#include <iomanip>
#include <stdio.h>
#include <string.h>
#include <random>
#include <functional>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define int long long
const int N = 500000;
const long long MOD = 1e9 + 7;

int n, a[50000];

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    int ans = 1e18;
    for (int i = 0; i <= 100; i++)
    {
        int res = 0;
        for (int j = 0; j < n; j++)
        {
            res += (a[j] - i) * (a[j] - i);
        }
        ans = min(ans, res);
    }
    cout << ans;
}


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

int main(){
  int n,x,t,ans=0;
  cin>>n>>x>>t;
  
  while(n>x){
    ans+=t;
    n -=x;
  }
  ans+=t;
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3584
//入力マクロここから
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules ! input_inner { ( $ next : expr ) => { } ; ( $ next : expr , ) => { } ; ( $ next : expr , $ var : ident : $ t : tt $ ( $ r : tt ) * ) => { let $ var = read_value ! ( $ next , $ t ) ; input_inner ! { $ next $ ( $ r ) * } } ; }
macro_rules ! read_value { ( $ next : expr , ( $ ( $ t : tt ) ,* ) ) => { ( $ ( read_value ! ( $ next , $ t ) ) ,* ) } ; ( $ next : expr , [ $ t : tt ; $ len : expr ] ) => { ( 0 ..$ len ) . map ( | _ | read_value ! ( $ next , $ t ) ) . collect ::< Vec < _ >> ( ) } ; ( $ next : expr , chars ) => { read_value ! ( $ next , String ) . chars ( ) . collect ::< Vec < char >> ( ) } ; ( $ next : expr , usize1 ) => { read_value ! ( $ next , usize ) - 1 } ; ( $ next : expr , $ t : ty ) => { $ next ( ) . parse ::<$ t > ( ) . expect ( "Parse error" ) } ; }
macro_rules ! input { ( source = $ s : expr , $ ( $ r : tt ) * ) => { let mut iter = $ s . split_whitespace ( ) ; let mut next = || { iter . next ( ) . unwrap ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; ( $ ( $ r : tt ) * ) => { let stdin = std :: io :: stdin ( ) ; let mut bytes = std :: io :: Read :: bytes ( std :: io :: BufReader :: new ( stdin . lock ( ) ) ) ; let mut next = move || -> String { bytes . by_ref ( ) . map ( | r | r . unwrap ( ) as char ) . skip_while ( | c | c . is_whitespace ( ) ) . take_while ( | c |! c . is_whitespace ( ) ) . collect ( ) } ; input_inner ! { next , $ ( $ r ) * } } ; }
//入力マクロここまで

fn main() {
    input! {
        n: u64,
        m: u64,
    }

    println!("{}", 2_u64.pow(m as u32) * (n * 100 + m * 1800));
}


Measured memory_bytes: 4352
import java.io.*;
import java.util.*;

public class Main{
	
	public static void main(String[] args) throws Exception{
		pw=new PrintWriter(System.out);
		sc = new MScanner(System.in);
		long x=sc.nextLong();
		long cur=100;
		long ans=0;
		while(cur<x) {
			cur+=(cur/100);
			ans++;
		}
		pw.println(ans);
		pw.flush();
	}
	static PrintWriter pw;
	static MScanner  sc;
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] intArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public long[] longArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public int[] intSortedArr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public long[] longSortedArr(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        shuffle(in);
	        Arrays.sort(in);
	        return in;
		}
		public Integer[] IntegerArr(int n) throws IOException {
	        Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public Long[] LongArr(int n) throws IOException {
	        Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
	static void shuffle(int[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			int tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
	static void shuffle(long[]in) {
		for(int i=0;i<in.length;i++) {
			int idx=(int)(Math.random()*in.length);
			long tmp=in[i];
			in[i]=in[idx];
			in[idx]=tmp;
		}
	}
}

Measured memory_bytes: 32620
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#include<stdlib.h>
#include<stdio.h>
#define test ll t; cin>>t; while(t--)
#define FOR(p,n) for(ll i=p;i<(ll)n;i++)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define ll long long
#define int long long
#define ull unsigned long long
#define MAX 1000005
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define endl '\n'
#define vs vector<string>
#define mii map<int,int>
#define msi map<string,int>
#define vpii vector< pair<int, int > >
#define vpsi vector< pair< string ,int > >
#define forci(p,q) for(int i=p;i<q;i++)
ll gcd(ll a,ll b){ if(b==0) return a;    return gcd(b,a%b);}
ll lcm(ll a,ll b) { return (a/gcd(a,b)*b);}
ull power(ull a, ull b) {a %= mod;  ull res = 1;  while (b > 0) { if (b & 1) res = res * a % mod;  a = a * a % mod;  b >>= 1; }  return res%mod; }
ll modmul(ll x, ll y){return (x*y)%mod;}
ll modadd(ll x, ll y){return (x+y)%mod;}
ll modsub(ll x, ll y){return (x-y+mod)%mod;}
ll fact[1000007]={0};
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<100007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[r],mod-2)))%mod; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
inline long long toint(const std::string &s) {std::stringstream ss; ss << s; long long x; ss >> x; return x;}
inline std::string tostring(long long number) {std::stringstream ss; ss << number; return ss.str();}
inline std::string tobin(long long x) {return std::bitset<63>(x).to_string();}
/*bool prime[MAX];
ull sieve(){memset(prime,true,sizeof(prime));for(ull p=2;p*p<MAX;p++){if(prime[p]==true){for(ull i=2*p;i<MAX;i+=p){prime[i]=false;}}}prime[0]=0;prime[1]=0;
}
int inv[1000001]={0};
void findinverse(){inv[1] = 1;for(int i = 2; i <=1e6 ; ++i)	inv[i] = (mod - (mod/i) * inv[mod%i] % mod) % mod;}
*/
using namespace std;
int solve()
{
	int n,k,q;
	cin>>n>>k>>q;
	int a[n+1];
	forci(1,n+1)	a[i]=k-q;
	while(q--){
		int x;
		cin>>x;
		a[x]++;
	}
	for(int i=1;i<=n;i++){
		if(a[i]>0)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
	
	return 0;
}
signed main()
{
	fastio;
//	test
		solve();
}



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

using namespace std;

const int N=1005,M=5005;
typedef bitset<M> bst;

int n,li[N],mv[M],sum;
vector<int>e[N];
bst vi;

int main(){
	scanf("%d",&n);
	for(int i=2,u;i<=n;i++)scanf("%d",&u),e[u].push_back(i);
	for(int i=1;i<=n;i++)scanf("%d",&li[i]);
	for(int u=n;u>=1;u--){
		vi=1;sum=0;
		for(int v:e[u])vi=(vi<<li[v])|(vi<<mv[v]),sum+=li[v]+mv[v];
		int i=li[u];
		while(i>=0&&!vi[i])i--;
		if(i>=0)mv[u]=sum-i;
		else puts("IMPOSSIBLE"),exit(0);
	}
	puts("POSSIBLE");
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define lli long long int
#define vec2 vector<vector<lli>>
#define fio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define FRE freopen("explicit.in","r",stdin);freopen("explicit.out","w",stdout)
#define pll pair <lli,lli>
#define vll vector <lli>
#define vpll vector <pll>
#define f first
#define s second
#define pb push_back
#define priq priority_queue
#define unm unordered_map
#define pf push_front
#define minii LLONG_MAX
#define all(x) x.begin(), x.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define ld double
#define eb emplace_back
const long double pi = 3.1415926535898;
const lli mod=1e9+7;
//const lli mod=100000000;
using namespace std;
lli lcm (lli a, lli b) {return ((a*b)/__gcd(a,b));}
lli modpower (lli a,lli b)
{
    if(b==0) return 1;
    lli c=modpower(a,b/2)%mod;
    if (b%2) return (((a*c)%mod)*c)%mod;
    else return (c*c)%mod;
}
lli power (lli a,lli b)
{
    if(b==0) return 1;
    lli c=power(a,b/2);
    if (b%2) return (a*c*c);
    else return c*c;
}
bool prime (lli k)
{
    if (k==1||k==0) return 0;
    bool flag=1;
    lli a=sqrt(k);
    for (int i=2;i<=a;i++)
    {
        if (k%i==0)
        {flag=0;break;}
    }
    return flag;
}
lli sieve (int n)
{
    bool qrr[n+1];
    for (int i=0;i<=n;i++)
    qrr[i]=1;qrr[0]=0;qrr[1]=0;
    for (int i=2;i*i<=n;i++)
    {
        if (qrr[i]==1)
        {
            for (int j=2*i;j<=n;j+=i)
            {qrr[j]=0;}
        }
    }
    return 0;
}

int main()
{
    fio;
    
    lli n;
    cin>>n;
    lli x,y,z;
    lli a[100005];
    mem(a,0);
    for (int i=0;i<n;i++)
    {
        cin>>x;
        a[x]++;
    }
    lli sum=0;
    for (int i=1;i<=1e5;i++)
    {
        sum+=a[i]*i;
    }
    lli t;
    cin>>t;
    while (t--)
    {
        cin>>x>>y;
        sum-=x*a[x];
        sum+=a[x]*y;
        a[y]+=a[x];
        a[x]=0;
        cout<<sum<<"\n";
    }
    return 0;
}


Measured memory_bytes: 4460
#include <iostream>
using namespace std;
// aとbとcの最大公約数』　＝　『aとbの最大公約数』と『c』　の最大公約数
int gcd(int a, int b){
    if(b == 0){
        return a;
    }
    return gcd(b, a % b);
}

int main(){
    int k;
    cin >> k;
    int sum = 0;
    for (int a = 1; a <= k; a++){
        for (int b = 1; b <= k; b++){
            for (int c = 1; c <= k; c++){
                sum += gcd(gcd(a, b), c);
            }
        }
    }
    cout << sum << endl;
}

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

   typedef long long ll;
   typedef pair<ll, ll> Pii;
   typedef vector<ll> Vi;
   typedef vector<Vi> VVi;

   const double EPS = (1e-7);
   const ll INF =(1e13);
   const double PI = (acos(-1));
   const ll MOD = ll(1e9) + 7;

   #define REP(i, n) for(ll i = 0; i < (ll)(n); i++)
   #define REPR(i, n) for(ll i = n; i > -1; i--)
   #define FOR(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
   #define ALL(x) (x).begin(),(x).end()
   #define SORT(x) sort((x).begin(), (x).end())
   #define RSORT(x) sort((x).rbegin(), (x).rend())
   #define REVERSE(x) reverse((x).begin(), (x).end())
   #define SZ(x) ((ll)(x).size())
   #define pb push_back
   #define mp make_pair

   //chmax(a, b): a>bならaをbで更新　更新したときにtrueを返す
   //chmin(a, b): a<bならaをbで更新　更新したときにtrueを返す
   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 (b<a) { a=b; return 1; } return 0; }

   #define dump(x) cerr<< #x << "= " << (x) << endl;

   ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
   ll pow(ll a, ll b){if (b == 0) return 1; else if (b % 2 == 0) return pow(a * a, b / 2); else return pow(a * a, b / 2) * a;}
   ll pow(ll a, ll b, ll m){if (b == 0) return 1; else if (b % 2 == 0) return (pow(a * a, b / 2, m) % m); else return (pow(a * a, b / 2) * a) % m;}
   ll residue(ll a, ll m){return ((a % m) + m) % m;};

   ll dx[4]={1,0,-1,0};
   ll dy[4]={0,1,0,-1};

int main(){
  ll a, b, c; cin >> a >> b >> c;
  if((a == b) && (b == c) && (a % 2 == 0)) cout << -1 << endl;
  else{
    ll s= a + b + c;
    ll cnt = 0;
    while((a % 2 == 0) && (b % 2 == 0) && (c % 2 == 0)){
      cnt ++;
      a = (s - a) / 2;
      b = (s - b) / 2;
      c = (s - c) / 2;
    }
    cout << cnt << endl;
  }
}


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

#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__);
#else
#define DEBUG(...) 6;
#endif

template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typename T = decay<decltype(*begin(declval<C>()))>, typename enable_if<!is_same<C, string>::value>::type* = nullptr>
ostream& operator << (ostream &os, const C &c) {bool f = true; os << "["; for (const auto &x : c) {if (!f) os << ", "; f = false; os << x;} return os << "]";}
template<typename T> void debug(string s, T x) {cerr << s << " = " << x << "\n";}
template<typename T, typename... Args> void debug(string s, T x, Args... args) {cerr << s.substr(0, s.find(',')) << " = " << x << " | "; debug(s.substr(s.find(',') + 2), args...);}

#define MAXN 200005

int x[MAXN], y[MAXN];
char u[MAXN];
set<int> xD[MAXN], yL[MAXN], diag1L[2*MAXN], diag1R[2*MAXN], diag2L[2*MAXN], diag2R[2*MAXN];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int n;
    cin >> n;
    vector<int> up, down, right;
    for (int i=0; i<n; i++) {
        cin >> x[i] >> y[i] >> u[i];
        if (u[i] == 'U') {
            up.push_back(i);
        } else if (u[i] == 'D') {
            down.push_back(i);
            xD[x[i]].insert(y[i]);
        } else if (u[i] == 'L') {
            yL[y[i]].insert(x[i]);
            diag1L[x[i] + y[i]].insert(y[i]);
            diag2L[x[i] - y[i] + MAXN].insert(y[i]);
        } else {
            right.push_back(i);
            diag1R[x[i] + y[i]].insert(y[i]);
            diag2R[x[i] - y[i] + MAXN].insert(y[i]);
        }
    }

    int ret = INT_MAX;
    for (int i : up) {
        auto it = xD[x[i]].lower_bound(y[i]);
        if (it != xD[x[i]].end())
            ret = min(ret, (*it - y[i]) * 5);

        it = diag1R[x[i] + y[i]].lower_bound(y[i]);
        if (it != diag1R[x[i] + y[i]].end())
            ret = min(ret, (*it - y[i]) * 10);

        it = diag2L[x[i] - y[i] + MAXN].lower_bound(y[i]);
        if (it != diag2L[x[i] - y[i] + MAXN].end())
            ret = min(ret, (*it - y[i]) * 10);
    }
    for (int i : down) {
        auto it = diag1L[x[i] + y[i]].upper_bound(y[i]);
        if (it != diag1L[x[i] + y[i]].begin())
            ret = min(ret, (y[i] - *(--it)) * 10);

        it = diag2R[x[i] - y[i] + MAXN].upper_bound(y[i]);
        if (it != diag2R[x[i] - y[i] + MAXN].begin())
            ret = min(ret, (y[i] - *(--it)) * 10);
    }
    for (int i : right) {
        auto it = yL[y[i]].lower_bound(x[i]);
        if (it != yL[y[i]].end())
            ret = min(ret, (*it - x[i]) * 5);
    }

    if (ret == INT_MAX)
        cout << "SAFE\n";
    else
        cout << ret << "\n";

    return 0;
}


Measured memory_bytes: 122324
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,x,y,k[2500]={0};
	cin>>n>>x>>y;
	for(int i=1;i<=n-1;i++)
	    for(int j=i+1;j<=n;j++)
	        k[min(j-i,1+abs(x-i)+abs(y-j))]++;
	for(int i=1;i<=n-1;i++)
	    cout<<k[i]<<endl;
 } 

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

typedef long long ll;
typedef pair< int, int > pii;
typedef pair< int, ll > pil;
typedef pair< ll, int > pli;
typedef pair< ll, ll > pll;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< ll > vl;
typedef vector< vl > vvl;
typedef vector< double > vd;
typedef vector< vd > vvd;
typedef vector< pii > vp;
typedef vector< vp > vvp;
typedef vector< bool > vb;
typedef vector< vb > vvb;

template< class T1, class T2 >
bool upmin( T1 &x, T2 v ){
    if( x > v ){
        x = v;
        return true;
    }
    return false;
}

template< class T1, class T2 >
bool upmax( T1 &x, T2 v ){
    if( x < v ){
        x = v;
        return true;
    }
    return false;
}

void solve(){
    int N; cin >> N;
    vi A( N );
    for( int i = 0; i < N; ++i )
        cin >> A[ i ];
    ll ans = 0;
    for( int i = 0; i < N; ++i ){
        ans += A[ i ] / 2;
        if( ( A[ i ] & 1 ) and A[ i + 1 ] )
            --A[ i + 1 ],
            ++ans;
    }
    cout << ans << endl;
}

int main(){
    ios::sync_with_stdio( false );
    solve();
    return 0;
}


Measured memory_bytes: 640
O = input()
E = input()

olen = len(O)
elen = len(E)

word = ""

if olen==elen:
    for i in range(olen):
        word = word + O[i] + E[i]
else:
    for i in range(elen):
        word = word + O[i] + E[i]
    word = word + O[olen-1]

print(word)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
typedef long long int ll;
// #define int long long int
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define FRE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
#define debug(x) cout << #x << " is: " << (x) << endl;
#define debugx(x) cout << #x << " is: " << (x) << endl; exit(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define fa(i,a,n) for(ll i=a;i<n;i++)
#define loop(i,a, n) for(ll i = a; i <= n; i++)
#define loopb(i,a, n) for(ll i = a; i >= n; i--)
#define pb push_back
#define pf push_front
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define setmem(x, k) memset(x, k, sizeof(x))
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define PI 3.1415926535897932384626
#define MOD 1000000007
#define INF 1000111000111000111LL
#define endl "\n"
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef long double ld;
typedef vector<vector<ll>> matrix;
ll dx[] = {0, 1, 0, -1};
ll dy[] = {-1, 0, 1, 0};
const ll N = 3e4+5;
// ll a[N], b[N], dp[N], level[N], vis[N], in[N], out[N];
// vl g[N];
ll n, m;


void solve() {
    cin >> n;
    if(n >= 30){
        cout << "Yes\n";
    }else{
        cout<<"No\n";
    }
}

int32_t main() {
    IOS
    solve();
    cerr<<"Time elapsed : "<<clock()*1000.0/CLOCKS_PER_SEC<<"ms"<<'\n';
    return 0;
}

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

int main() {
    string s;
    cin>>s;
    ll ama[s.length()+1];
    ama[0]=0;
    ll nowama=0;
    ll nowm=1;
    for (int i = 0; i < s.length(); ++i) {
        unsigned long now=s.length()-1-i;
        nowama=(nowama+nowm*stoll(s.substr(now,1)))%2019;
        ama[i+1]=nowama;
        nowm*=10;
        nowm%=2019;
    }
    int count[2019];
    for (int k = 0; k < 2019; ++k) {
        count[k]=0;
    }
    for (int j = 0; j < s.length()+1; ++j) {
        count[ama[j]]++;
    }
    ll ans=0;
    for (int l = 0; l < 2019; ++l) {
        ans+=count[l]*(count[l]-1)/2;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 5316
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>

using namespace std;

int main()
{
	char c1, c2;
	char ans = 'A';

	while (scanf("%c,%c", &c1, &c2) != EOF)
	{
		if (c1 == ans) ans = c2;
		else if (c2 == ans) ans = c1;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1152
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(){

    int N, Y;
    cin >> N >> Y;
    Y /= 1000;

    int x, y, z;

    for(x=0;x<=N;++x){
        for(y=0;y<=N-x;++y){
            z = N - x - y;
            if( 10*x + 5*y + z == Y ) {
                printf("%d %d %d\n", x, y, z);
                return 0;
            }                               
            else if( 10*x + 5*y + z > Y) {
                break;
            }
        }
    }

    cout << "-1 -1 -1" << endl;
    return 0;
    

}


Measured memory_bytes: 384
#include <algorithm>
#include <cmath>
#include <iostream>
#include <set>
#include <string>
#include <vector>

int main() {
  uint32_t N = 0;
  std::cin >> N;

  std::set<std::string> s;
  for (size_t i = 0; i < N; i++) {
    std::string str;
    std::cin >> str;

    s.insert(str);
  }

  std::cout << s.size() << std::endl;

  return 0;
}

Measured memory_bytes: 19152
#include<iostream>
#include<algorithm>
using namespace std;
int N_MAX=80;
int M_MAX=25601;
int main()
{
  int h,w,n,b,p,i,j,k,u;
  int ab[N_MAX][N_MAX];
  bool s[N_MAX][M_MAX],t[N_MAX][M_MAX];
  cin >> h >> w;
  n=h+w-2;
  p=N_MAX*n;
  for(i=0;i<h;i++)
    for(j=0;j<w;j++)
      cin >> ab[i][j];
  for(i=0;i<h;i++)
    for(j=0;j<w;j++){
      cin >> b;
      ab[i][j]-=b;
    }
  for(j=0;j<w;j++){
    fill(s[j],s[j]+p*2+1,0);
    fill(t[j],t[j]+p*2+1,0);
  }
  u=ab[0][0]+p;
  s[0][u]=1;
  for(k=1;k<=n;k++){
    for(j=0;j<w;j++){
      i=k-j;
      if(i<0||i>=h) continue;
      for(u=0;u<=2*p;u++){
        if(j>0&&s[j-1][u]==1){
          t[j][u+ab[i][j]]=1;
          t[j][u-ab[i][j]]=1;
        }
        if(i>0&&s[j][u]==1){
          t[j][u+ab[i][j]]=1;
          t[j][u-ab[i][j]]=1;
        }
      }
    }
    for(j=0;j<w;j++){
      copy(t[j],t[j]+p*2+1,s[j]);
      fill(t[j],t[j]+p*2+1,0);
    }
  }
  for(u=0;u<=p;u++)
    if(s[w-1][p+u]==1||s[w-1][p-u]==1){
      cout << u << endl;
      return 0;
    }
  return 0;
}

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

using namespace std;

int main()
{
    int k;
    cin>>k;
    string s;
    cin>>s;
    if(s.length()<=k){
        cout<<s;
    }else{
        for(int i=0;i<k;i++){
            cout<<s[i];
        }
        cout<<"...";
    }
    return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define err(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)

using namespace std;

typedef long long ll;

int main() {
	int n;
	cin >> n;
	
	int c = 0;
	for (int i = 0; i < n; i++) {
		int t;
		cin >> t;
		c += (t % 2);
	}
	puts(c % 2 ? "NO" : "YES");
	return 0;
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
#include <boost/multi_array.hpp>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/adaptors.hpp>
//#include <vector>
//#include <iostream>

typedef long long ll;
typedef unsigned long long ull;


void Main()
{
	ll T1, T2, A1, A2, B1, B2;
	std::cin >> T1 >> T2;
	std::cin >> A1 >> A2;
	std::cin >> B1 >> B2;

	ll P = (A1 - B1) * T1;
	ll Q = (A2 - B2) * T2;
	if (P > 0) {
		P *= -1;
		Q *= -1;
	}



	if (P + Q == 0)
		std::cout << "infinity" << std::endl;

	if (P+Q < 0)
		std::cout << 0 << std::endl;

	if(P + Q > 0) {
		ll S = -P / (P + Q);
		ll T = -P % (P + Q);
		if (T == 0)
			std::cout << S * 2 << std::endl;
		else
			std::cout << S * 2 + 1 << std::endl;
	}

}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}


Measured memory_bytes: 256
O = raw_input()
E = raw_input()
pw = ''
if len(O) == len(E):
    for (o, e) in zip(O, E):
        pw += o
        pw += e
elif len(O) > len(E):
    for (o, e) in zip(O[:len(E)], E):
        pw += o
        pw += e
    pw += O[-1]
else:
    for (o, e) in zip(O, E[:len(O)]):
        pw += o
        pw += e
    pw += E[-1]
print pw

Measured memory_bytes: 2692
#include <iostream>
#include <iomanip>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define POWER9 1000000000
#define MOD POWER9+7
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483647
#define INT_MAX 2147483647
#define LL_MIN (LL)-9223372036854775807
#define LL_MAX (LL)9223372036854775807
#define PI 3.14159265359

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << setprecision(9);

	string S;
	cin >> S;
	if(S[5]=='1' || S[6]>'4') cout << "TBD" << endl;
	else cout << "Heisei" << endl;

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
long long a[2]={101,103};
long long M[2]={1e9+7,1e9+9};
long long d[2][300010],k[2][300010];
long long R=1,C=1,H[2000010],N[2000010],h[300010];
//評価関数（いまはMIN）
int hyouka(int a,int b){
  if(C<b)return 1;
  if(C<a||b==0)return 0;
  return N[H[a]]<N[H[b]]||N[H[a]]==N[H[b]]&&h[H[a]]<h[H[b]]?1:0;
}
//挿入関数
void hin(long long a){
  int i=C++;
  for(N[H[0]=R]=a;hyouka(0,i/2);i/=2)H[i]=H[i/2];
  H[i]=R++;
}
//取り出す関数
int hout(){
  int rt=H[1],i,j=2,k=H[--C];
  for(i=1;hyouka(i,C);i=j)H[i]=H[j=i*2+1-hyouka(i*2,i*2+1)];
  H[j/2]=k;
  return rt;
}
void init(char *s){//!
  int i,j;
  for(i=0;i<2;i++){
    k[i][0]=1;
    for(j=d[i][0]=0;s[j];j++){
      d[i][j+1]=(d[i][j]*a[i]+(s[j]-'a'+1))%M[i];
      k[i][j+1]=(k[i][j]*a[i])%M[i];
    }
  }
}
long long getlr(int l,int r,int i){
  return (d[i][r]-(d[i][l]*k[i][r-l])%M[i]+M[i])%M[i];
}
void gets(char *s,int *h){
  int i,j;
  for(i=0;i<2;i++){
    for(j=h[i]=0;s[j];j++)h[i]+=k[i][j]*(s[j]-'0');
  }
}
int match(int l,int r,int *h){
  int i,j=1;
  for(i=0;i<2;i++)j*=getlr(l,r,i)-h[i]?1:0;
  return j;
}
int main(){
  int n=0,m,a,b,i,j,l=0,r=1;
  char s[300010],q[5];
  scanf("%*d %d %s",&m,s);
  init(s);//printf("%s\n",s);
  //for(i=0;s[i];i++)printf("%lld ",k[0][i+1]);printf("\n");
  //printf("%lld %lld %lld\n",d[0][3],d[0][4],k[0][2]);return 0;
  //printf("%lld %lld\n",getlr(0,2,0),getlr(2,4,0));return 0;
  for(i=0;i<m;i++){
    scanf("%s",q);
    if(q[0]=='L')l+=q[1]-'-'?1:-1;
    else         r+=q[1]-'-'?1:-1;//printf("%d %d!",l,r);
    h[R]=getlr(l,r,0);
    hin(getlr(l,r,1));//printf("%lld %lld\n",h[R-1],N[R-1]);
  }
  a=hout();
  for(i=1;i<m;i++){
    b=hout();//printf("%lld %lld %lld %lld\n",N[a],N[b],h[a],h[b]);
    if(N[b]==N[a]&&h[b]==h[a])n++;
    a=b;
  }
  printf("%d\n",m-n);
  return 0;
}



Measured memory_bytes: 18556
def schange(s):
    if s=="E":
        return 1
    else:
        return 0

n = int(input())
s = list(map(schange,input()))
ssum = [0]*(n+1)

for i in range(n):
    ssum[i+1] = ssum[i] + s[i]

ans = float('inf')
for i in range(1,n+1):
    turnE = (i-1)-ssum[i-1]
    turnW = ssum[-1] - ssum[i]
    ans=min(ans,turnE+turnW)
    
print(ans)

Measured memory_bytes: 23508
#include <iostream>
#include <vector>
using namespace std;
const int INF = 1e9;

int main() {
	int h, w, k; cin >> h >> w >> k;
	vector<string> s(h);
	for (int i = 0; i < h; ++i) cin >> s[i];

	int t = h-1, pat = 1; while (t--) pat *= 2;
	vector<int> cnt(h), tmp(h);
	int mn = INF;
	for (int p = 0; p < pat; ++p) {
		int cut = __builtin_popcount(p);
		for (int &v:cnt) v = 0;
		bool over = false;
		for (int j = 0; j < w; ++j) {
			for (int &v:tmp) v = 0;
			bool iscut = false;
			for (int i = 0, d = 0; i < h; ++i) {
				if (s[i][j] == '1') ++tmp[d];
				if ((p>>i)&1 || i==h-1) {
					if (tmp[d] > k) { over = true; break; }
					if (cnt[d] + tmp[d] > k) iscut = true;
					++d;
				}
			}
			if (over) break;
			if (iscut) ++cut;
			for (int n = 0; n < h; ++n)
				if (iscut) cnt[n] = tmp[n];
				else cnt[n] += tmp[n];
		}
		if (!over) mn = min(mn, cut);
	}

	cout << mn << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(int argc, char const *argv[]) {
  int a = 0;
  char S[5];
  scanf("%s", S);
  for (int i = 0; i < 4; i++) {
    if (S[i] == '+')
      a++;
    else
      a--;
  }
  printf("%d", a);
  return 0;
}

Measured memory_bytes: 128
Scanf.scanf "%d %d" (fun n k ->
    let ab = Array.init n (fun _ -> Scanf.scanf " %d %d" (fun a b -> a, b)) in

    let check k2 =
        Array.fold_left (fun acc (a, b) ->
            if k2 land a = a then acc + b else acc) 0 ab
    in

    let rec loop i acc =
        let l = 1 lsl i in
        if l > k then acc else
            if k land l = 0 then loop (i + 1) acc else
                let k2 = (k lxor l) lor (l - 1) in
                loop (i + 1) (max acc (check k2))
    in
    loop 0 (check k) |> Printf.printf "%d\n"
)

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

int main() {
  int n; cin >>n;
  vector<int> a(100001);
  int buf;
  int cnt = 0; //100000を超える数のカス。必ず取り除く
  for (int i=0; i<n; i++){
    cin >> buf;
    if (buf<=100000) a.at(buf)++;
    else cnt++;
  }
  // 100000以下の数について良くなければ適宜取り除く
  for (int i=0; i<100001; i++){
    if (a.at(i) < i) cnt += a.at(i);
    else if (a.at(i) > i) cnt += a.at(i) - i;
  }
  int ans = cnt;
  cout <<ans;
  cout <<endl;
}


Measured memory_bytes: 640
import sys

stdin = sys.stdin
na = lambda: map(int, stdin.readline().split())
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())

MAX = int(1e9+7)

def main():
  n = ni()
  h = list(na()) + [MAX]

  cnt = 0
  check = 0
  tmp = []
  for i in range(n):
    hh = h[i]
    if not check:
      check = hh
    if check >= h[i+1]:
      cnt += 1
      check = h[i+1]
    else:
      tmp.append(cnt)
      check = 0
      cnt = 0

  print(max(tmp))

main()

Measured memory_bytes: 14388
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func configure(scanner *bufio.Scanner) {
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 1000005), 1000005)
}
func getNextString(scanner *bufio.Scanner) string {
	scanned := scanner.Scan()
	if !scanned {
		panic("scan failed")
	}
	return scanner.Text()
}
func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}
func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}
func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}
func main() {
	fp := os.Stdin
	wfp := os.Stdout
	extra := 0
	if os.Getenv("I") == "IronMan" {
		fp, _ = os.Open(os.Getenv("END_GAME"))
		extra = 100
	}
	scanner := bufio.NewScanner(fp)
	configure(scanner)
	writer := bufio.NewWriter(wfp)
	defer func() {
		r := recover()
		if r != nil {
			fmt.Fprintln(writer, r)
		}
		writer.Flush()
	}()
	solve(scanner, writer)
	for i := 0; i < extra; i++ {
		fmt.Fprintln(writer, "-----------------------------------")
		solve(scanner, writer)
	}
}
func solve(scanner *bufio.Scanner, writer *bufio.Writer) {
	k := getNextInt(scanner)
	var ans int
	for a := 0; a < k; a++ {
		for b := 0; b < k; b++ {
			for c := 0; c < k; c++ {
				ans += gcd(a+1, gcd(b+1, c+1))
			}
		}
	}
	fmt.Fprintln(writer, ans)
}
func gcd(m, n int) int {
	if n == 0 {
		return m
	}
	return gcd(n, m%n)
}


Measured memory_bytes: 1848
//AUTHOR:BlackBox Inc.//
#include<bits/stdc++.h>
#include<unordered_map>
#include<tr1/unordered_map>
#define ll long long
#define ull unsigned long long
#define vi vector<int>
#define vlli vector<long long int>
#define vvi vector<vector<int>>
#define endl "\n"
#define vpii vector<pair<int,int>>
#define vs vector<string>
#define lin1(x) ll int x; x = scan();
#define lin2(x,y) ll int x, y; x = scan(), y = scan();
#define lin3(x,y,z) ll int x, y, z; x = scan(), y = scan(), z = scan();
#define pb(x) push_back(x)
#define makep(x,y) make_pair(x,y)
#define mx(a,b) (a)>(b)?(a):(b)
#define mn(a,b) (a)<(b)?(a):(b)
#define fori(s,e) for(i=s;i<=e;i++)
#define forj(s,e) for(j=s;j<=e;j++)
#define fork(s,e) for(k=s;k<=e;k++)
#define rep(i,s,e) for(int i=s;i<=e;i++)
#define brep(i,s,e) for(int i=s;i>=e;i--)
#define all(x) x.begin(),x.end()
#define mem(x,y) memset(x,y,sizeof(x));
#define bits1(x) __builtin_popcount(x)
#define pi 3.14159265358979323846264338327950
#define MOD7 1000000007
#define MOD9 1000000009
#define fast std::ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
using namespace std;
using namespace std::tr1;

int main()
{
// #ifndef RAHUL
//     freopen("input.txt","r",stdin);
//     freopen("output.txt","w",stdout);
// #endif

 
int n;
cin>>n;

std::vector<int> v;

for (int i = 0; i < n; ++i)
{
	int x;
	cin>>x;
	v.pb(x);
	/* code */
}

sort(v.begin(),v.end());

int len=v.size();
cout<<v[len-1]-v[0]<<endl;
return 0;
}











Measured memory_bytes: 256
/**
 *
 * AtCoder Beginner Contest 100 - Problema B: Ringo's Favorite Number (https://abc100.contest.atcoder.jp/tasks/abc100_b)
 *
 * Find Ringo favorite number: the n-th smallest integer divide by 100 exactly D times.
 *
 * Ad-hoc solution: the number is n x 100 ^ D, if n < 100; (n + 1) x 100 ^ D, otherwise.
 */
#include <iostream>

using namespace std;

void solve(int D, int N)
{
    int ans = N == 100 ? N + 1 : N;

    while (D--)
        ans *= 100;
    
    cout << ans << endl;
}

int main()
{
    ios::sync_with_stdio(false);

    int D, N;
    cin >> D >> N;

    solve(D, N);

    return 0;
}


Measured memory_bytes: 256
# coding: utf-8


def solve(*args: str) -> str:
    n, m, k = map(int, args[0].split())

    friends = [set() for _ in range(n+1)]
    blocked = [set() for _ in range(n+1)]

    for a, b in map(str.split, args[1:1+m]):
        friends[int(a)].add(int(b))
        friends[int(b)].add(int(a))

    for c, d in map(str.split, args[1+m:1+m+k]):
        blocked[int(c)].add(int(d))
        blocked[int(d)].add(int(c))

    checked = set()

    ret = [0]*(n+1)
    for a in range(1, n+1):
        if a in checked:
            continue

        chain = set()

        stack = list(friends[a])
        while stack:
            b = stack.pop()
            if b in checked:
                continue

            checked.add(b)
            chain.add(b)
            stack.extend(friends[b])

        count = len(chain) - 1
        for i in chain:
            ret[i] += count - len(chain & (friends[i] | blocked[i]))

    return ' '.join(map(str, ret[1:]))


if __name__ == "__main__":
    print(solve(*(open(0).read().splitlines())))


Measured memory_bytes: 105120
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define pb push_back
using ll = long long;
using vin=vector<int>;
using vll=vector<ll>;
using P = pair<int, int>;
const int inf=1e9+7;
const ll INF=1e18;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

int main() {
  int x;
  cin>>x;
  if(400<=x&&x<600)cout<<8<<endl;
  if(600<=x&&x<800)cout<<7<<endl;
  if(800<=x&&x<1000)cout<<6<<endl;
  if(1000<=x&&x<1200)cout<<5<<endl;
  if(1200<=x&&x<1400)cout<<4<<endl;
  if(1400<=x&&x<1600)cout<<3<<endl;
  if(1600<=x&&x<1800)cout<<2<<endl;
  if(1800<=x&&x<2000)cout<<1<<endl;
}

Measured memory_bytes: 3552
#include<stdio.h>
int main()
{
   int A,b;
   scanf("%d%d",&A,&b);

   if(2<=A && A<=13 && 2<=b && b<=13){
        if(A>b) printf("Alice");
        else if(A==b) printf("Draw");
        else  printf("Bob");
   }
   if(A==1 && A<b) printf("Alice");
   if(b==1 && b<A) printf("Bob");
   if(A==1 && b==1) printf("Draw");
    return 0;
}

Measured memory_bytes: 1684
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
constexpr int INF = 2e9;

int main() {
  string vac = "Vacant";
  string left, right;
  int n;
  cin >> n; 
  int l = 0, r = n / 2;
  cout << l << endl;
  cin >> left;
  if (left == vac) return 0;
  cout << r << endl;
  cin >> right;
  if (right == vac) return 0;

  auto ok = [&](string mid, int m) {
    if (left == mid) return (m - l) % 2 == 1;
    else return (m - l) % 2 == 0;
  };

  if (!ok(right, r)) {
    swap(left, right);
    l = r;
    r = n;
  }

  while (r - l > 1) {
    string mid;
    int m = (r + l) / 2;
    cout << m << endl;
    cin >> mid;
    if (mid == vac) break;
    if (ok(mid, m)) right = mid, r = m;
    else left = mid, l = m;
  }
  return 0;
} 

Measured memory_bytes: 3868
#include<bits/stdc++.h>
using namespace std;
#define lld long long int
int main()
{
	lld x,y;
	cin>>x>>y;
	lld lcm = (x*y)/__gcd(x,y);
	lld ans=-1;
	for(lld j=x;j<lcm;j++)
	{
		if(j%y!=0)
		{
			ans = j;
			break;
		}
	}
	cout<<ans<<"\n";
}

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

int main()
{
    int r; cin >> r;
    double s = 2*r*3.1415926; 
    cout << s << endl;
    return 0;
}


Measured memory_bytes: 3788
#include<cstdio>

using namespace std;

int main(){
    int n, k, s;
    int INF = 1000000000;
    scanf("%d %d %d",  &n, &k, &s);
    // printf("%ld\n", s);
    if (s >= n - k + 1){
        int a = n - k + 1;
        int b = s / a;
        int c[a];
        for(int i = 0; i < a; i++){
            if (i < s % a) c[i] = b + 1;
            else c[i] = b;
        }

        for(int i = 0; i < n; i++){
            printf("%d ", c[i % a]);
        }
        puts("");
    }else{
        for(int i = 0; i < n; i++){
            if(i < s + k - 1) printf("%d ", 1);
            else printf("%d ", INF);
        }
        
    }

}

Measured memory_bytes: 1280
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <queue>
#include <iostream>
using namespace std;
#define min(a,b) (a>b?b:a)
int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int n,temp;
	cin>>n;
	int sum=0;
	for(int i=0;i<n;i++){
		cin>>temp;
		sum+=temp-1;
	}
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 256
n = gets.to_i
mass = []
line1 = gets.chomp.split(" ")
line2 = gets.chomp.split(" ")

total1 = 0
for i in 0..n-1
  total1 += line1[i].to_i
end

total2 = 0
max = 0
(0...n).reverse_each do |i|
  total2 += line2[i].to_i
  total = total1 + total2
  
  if max < total
    max = total
  end
  
  total1 -= line1[i].to_i
end

puts max

Measured memory_bytes: 1916
N=parse(Int,readline())
S=readline()

r=0
g=0
b=0
for i in 1:N
    S[i]=='R' && (global r+=1)
    S[i]=='G' && (global g+=1)
    S[i]=='B' && (global b+=1)
end

s=0

for t in 1:(N÷2)
    for i in 1:(N-2t)
        j,k=i+t,i+2t
        if(S[i]!=S[j] && S[i]!=S[k] && S[j]!=S[k] )
            global s+=1
        end
    end
end
print(r*g*b-s)

Measured memory_bytes: 202100
#include <stdio.h>
int main(){
        int a,b,i,is_first=0;
        while(1){
                int is_NA = 1;
                scanf("%d %d",&a,&b);
                if(a==0&&b==0){break;}
                if(is_first){printf("\n");}
                for(i=a;i<=b;i++){
                        if((i%4)==0){
                                if((i%100)==0){
                                        if((i%400)==0){
                                                printf("%d\n",i);
                                                is_NA = 0;
                                        }
                                }else{
                                        printf("%d\n",i);
                                        is_NA=0;
                                }
                        }
                }
                if(is_NA){printf("NA\n");}
                is_first=1;
        }
return 0;
}

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

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  string s;
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5]) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>

#define M 1000000
#define L 14

char H[M][L]; /* Hash Table */

int getChar(char ch){
  if ( ch == 'A') return 1;
  else if ( ch == 'C') return 2;
  else if ( ch == 'G') return 3;
  else if ( ch == 'T') return 4;
}

/* convert a string into an integer value */
long long getKey(char str[]){
  long long sum = 0, p = 1, i;
  for ( i = 0; i < strlen(str); i++ ){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}

int h1(int key){ return key % M; }
int h2(int key){ return 1+(key % (M-1)); }

int find(char str[]){
  long long key ,i,h;
  int x,y;

  key = getKey(str);
  x = h1(key);
  y = h2(key);
  for(i = 0; i < M; i++){
    h = (x + i * y) % M;
    if(strcmp(H[h],str) == 0) return 1;
    else if(strlen(H[h]) == 0) return 0;
  }
  return 0;
}

int insert(char str[]){
  long long key,i,h;
  int x,y;

  key = getKey(str);
  x = h1(key);
  y = h2(key);
  for(i = 0; i < M; i++){
    h = (x + y * i) % M;
    if(strcmp(H[h],str) == 0)return 1;
    else if(strlen(H[h]) == 0){
      strcpy(H[h],str);
      return 0;
    }
  }
  return 0;
}

int main(){
    int i, n, h;
    char str[L], com[9];
    for ( i = 0; i < M; i++ ) H[i][0] = '\0';
    
    scanf("%d", &n);
    
    for ( i = 0; i < n; i++ ){
	scanf("%s %s", com, str);
	
	if ( com[0] == 'i' ){
	    insert(str);
	} else {
	    if (find(str)){
		printf("yes\n");
	    } else {
		printf("no\n");
	    }
	}
    }

    return 0;
}

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

using namespace std;
typedef long long ll;

const ll MOD = 1000000007;

class mint{
    ll n;
public:
    mint(ll m = 0){
        n = ((m % MOD) + MOD) % MOD;
    }
    mint operator-() const {
        return mint(-n);
    }
    mint& operator+=(const mint& m){
        n += m.n;
        if(n >= MOD) n -= MOD;
        return *this;
    }
    mint& operator-=(const mint& m){
        n += MOD - m.n;
        if(n >= MOD) n -= MOD;
        return *this;
    }
    mint& operator*=(const  mint& m){
        n *= m.n;
        n %= MOD;
        return *this;
    }
    mint operator+(const mint& m) const{
        mint res(*this);
        res += m;
        return res;
    }
    mint operator-(const mint& m) const{
        mint res(*this);
        res -= m;
        return res;
    }
    mint operator*(const mint& m) const{
        mint res(*this);
        res *= m;
        return res;
    }
    mint pow(ll t) const{
        if(t == 0) return mint(1);
        mint m = pow(t>>1);
        m *= m;
        if(t & 1 == 1) m *= *this;
        return m;
    }
    // for prime modulo
    mint inv() const{
        return pow(MOD-2);
    }
    mint& operator/=(const mint& m){
        (*this) *= m.inv();
        n %= MOD;
        return *this;
    }
    mint operator/(const mint& m) const{
        mint res(*this);
        res /= m;
        return res;
    }
    friend ostream& operator<<(ostream& os, const mint& m){
        os << m.n;
        return os;
    }
};

ll N,K;
vector<ll> v;
mint fact[100001];
mint inv_fact[100001];

mint comb(ll a, ll b){
    if(a == b) return mint(1);
    if(b==0) return mint(1);
    return fact[a] * inv_fact[b] * inv_fact[a-b];
}

int main(){
    cin >> N >> K;
    for(int i=0;i<N;i++){
        ll a;
        cin >> a;
        v.push_back(a);
    }
    sort(v.rbegin(),v.rend());
    mint ans(0);
    fact[0] = mint(1);
    inv_fact[0] = mint(1);
    for(int i=1;i<=N;i++) fact[i] = fact[i-1] * mint(i);
    for(int i=1;i<=N;i++) inv_fact[i] = fact[i].inv();
    for(int i=0;i<N;i++){
        if(N-i-1 < K-1) break;
        ans += mint(v[i]) * comb(N-i-1, K-1);
    }
    sort(v.begin(),v.end());
    for(int i=0;i<N;i++){
        if(N-i-1 < K-1) break;
        ans -= mint(v[i]) * comb(N-i-1, K-1);
    }
    cout << ans << endl;
    return 0;
}

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
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 vector_finder(std::vector<ll> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

int main() {
  ll N; cin >> N;
  vector<ll> p(N); REP(i, N) cin >> p[i];
  ll ans = 0;
  for(int i = 0; i < N - 1; ++i) {
    if(i + 1 == p[i]) {
        swap(p[i], p[i + 1]);
        ans++;
    }
    if(i == N - 2) {
        if(p[i + 1] == i + 2) {
            ans++;
        }
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
using namespace std;
int main(){
  string S;
  cin>>S;
  for(int i=0;i<4;i++){
    cout<<S[i];
  }
  cout<<" ";
  for(int i=4;i<12;i++){
    cout<<S[i];
  }
  cout<<endl;
  return 0;
}

Measured memory_bytes: 256