akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define lli long long int
#define ulli unsigned long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define loop(i,a,b) for(lli i=a;i<b;i++)
#define initialize(array,size,value) for(lli i=0;i<size;i++) array[i]=value
#define couta(array,size) for(lli i=0;i<size;i++) cout<<array[i]<<" "
#define vl vector<lli>
#define vp vector< pair <lli,lli> >
#define sl set<lli>
#define msp multiset < pair < long long , long long > > S;
#define pll pair<lli, lli>
#define mll map<lli, lli>            //for( map<lli, lli>::iterator i=temp.begin();i!=temp.end();i++)cout<<i->fi<<" "<<i->se<<endl;
#define mvl map<lli, vl>
#define umll unordered_map<lli, lli>
#define vt vector<pair<lli, pll >  >
#define vf vector<pair<pll,pll > >
#define qu queue<lli>
#define pq priority_queue<lli>
#define dq deque <lli>
#define ptr vector<lli>::iterator
#define bs(array,x) binary_search(array.begin(),array.end(),x) // also valid for set and multiset
#define lb(array,x) lower_bound(array.begin(),array.end(),x)
#define ub(array,x) upper_bound(array.begin(),array.end(),x)
#define nobw(array,i,j) upper_bound(array.begin(), array.end(), j)-lower_bound(array.begin(), array.end(), i) //number of numbers between i & j
#define vc clear()
#define endl '\n'
#define sp system("pause");
#define INF 9223372036854775807
#define MINF -9223372036854775808
typedef tree<pll,null_type,less<pll>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;
//string binary = bitset<32>(n).to_string();  
int main()
{
 	ios::sync_with_stdio(0);
    cin.tie(0);
    string s;
    cin>>s;
    sort(s.begin(),s.end());
    if(s[0]==s[1] && s[1]!=s[2] && s[2]==s[3])cout<<"Yes";
    else cout<<"No";
    return 0;
}

Measured memory_bytes: 256
/*

*/
#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);cout << setprecision(12)
#define rep(i,a,n) for (ll i=a;i<n;i++)
#define per(i,a,n) for (ll i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((ll)(x).size())
#define cin1(x) cin >> x
#define cin2(x, y) cin >> x >> y
#define cin3(x, y, z) cin >> x >> y >> z
#define cin4(x, y, z, _) cin >> x >> y >> z >> _
#define cin5(x, y, z, p, q) cin >> x >> y >> z >> p >> q
#define cou(x) cout << x
#define cous(x) cout << x << " "
#define coul(x) cout << x << "\n"
#define ret(x) return x
#define MAX 5000001
#define start int main() {   fastio
#define finish ret(0); }
#define Test ll _t; cin1(_t); rep(w, 0, _t)
#define minv(v) *min_element(v.begin(),v.end())
#define maxv(v) *max_element(v.begin(),v.end())
#define cntv(v,a) count(v.begin(),v.end(),a)
struct point{    int x, y, ind;   char ch;  };
typedef long long ll;
typedef vector<ll> VI;
typedef pair<ll,ll> PII;
typedef double db;
//mt19937 mrand(random_device{}());
const ll mod=1000000007;
//ll rnd(ll x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}ret(res);}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll fact[13];
void factorial() {   fact[0]=1;  rep(i, 1, 12) fact[i]=(fact[i-1]*i);  }
vector <ll> sie; //for sieve function
ll spf[MAX+7];  //for sieve function
void sieve() {    rep(i, 2, MAX)  {  if (spf[i] == 0) {  spf[i] = i;   sie.pb(i);  }    for (ll j=0; j<SZ(sie) && i*sie[j] <= MAX && sie[j] <= spf[i]; j++)   spf[i * sie[j]] = sie[j]; }   }
bool cmp(point A, point B){   if(A.x != B.x) ret(A.x < B.x);  ret(A.y < B.y);   }
// head collected
// Don't use variable name as --> prev, time, _t, w, y1

struct po{
    ll year, ind;
};
ll n, m, t, a, _, an, col = 9999999999999999999.0, re, __;
vector < ll > adj[100005];
ll vis[100007];
bool xoss(po A, po B){
    ret( A.year < B.year );
}
string ans[100007];

void bfs(ll u)
{
    vis[ u ] = 1;
    queue < ll > q;
    q.push( u );

    while( !q.empty() ){
        u = q.front();
        rep(i, 0, SZ(adj[ u ])){
            ll v = adj[ u ][ i ];
            if (vis[ v ])
                continue;
            vis[ v ] = 1;
            q.push( v );
        }
        q.pop();
    }
}

start;

    cin2(n, m);

    rep(i, 0, m){
        cin3(_, __, a);
        adj[ _ - 1].pb(__ - 1);
        adj[ __ - 1 ].pb(_ - 1);
    }

    rep(i, 0, n){
        if(vis[ i ])
            continue;
        an++;
        bfs( i );
    }

    coul(an);

finish



/*



2 5 4 8 7 3 2 9 6
3 8 6 5 9 2 7 1 4
7 2 9 6 4 1 8 3 5
8 2 3 7 2 5 1 4 9
9 7 5 3 1 4 6 2 8
4 1 2 9 6 8 3 5 7
6 3 2 4 5 7 9 8 2
5 9 8 2 3 6 4 7 1
2 4 7 1 8 9 5 6 3






*/







Measured memory_bytes: 9076
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    class AtCoderr
    {
        static void Main(string[] args)
        {
            int[] s = ReadLine().Split(' ').Select(int.Parse).ToArray();
            WriteLine(Max(0, s[0] - (s[1] * 2)));
        }
    }
}


Measured memory_bytes: 13396
#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;cin>>s;
    int n = s.size();
    int a=n/2;
    int res = 0;
    for(int i=0;i<a;i++){
        char t=s[i],u=s[n-1-i];
        if(u!=t)res++;
    }
    cout<<res<<endl;
}

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


int main() {
	int A, B, C;
	cin >> A >> B >> C;
	cout << C << " " << A << " " << B;

}

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

using namespace std;

#define min(a,b) a > b ? b : a

int main()
{
    int n;
    scanf("%d",&n);
    int* hei = new int[n];
    for(int i=0;i<n;i++)
    scanf("%d",&hei[i]);
    int* ans = new int[n];//it tells the cost to reach i+1th stone
    ans[0]=0;
    ans[1]= abs(hei[1]-hei[0]);
    for(int i=2;i<n;i++)
    ans[i]=min(ans[i-1]+abs(hei[i]-hei[i-1]), ans[i-2]+abs(hei[i]-hei[i-2]));
    cout<<ans[n-1];
    return 0;
}

Measured memory_bytes: 1024
use std::io::stdin;

fn main() {
    let mut line = String::new();
    stdin().read_line(&mut line).ok();
    let lhw: Vec<isize> = line.split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect();
    line.clear();
    stdin().read_line(&mut line).ok();
    let hw: Vec<isize> = line.split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect();
    println!("{}", (lhw[0] - hw[0]) * (lhw[1] - hw[1]));
}


Measured memory_bytes: 4352
#include <stdio.h>
int main(void){
    int a,b,total=0;
    scanf("%d%d",&a,&b);
    for(int i=0;i<2;i++){
        if(a>b){
            total+=a;
            a--;
        }
        else{
            total+=b;
            b--;
        }
    }
    printf("%d",total);
    return 0;
}


Measured memory_bytes: 128
from collections import defaultdict

H,W,M = map(int,input().split())
dic = defaultdict(bool)
h_c = [ 0 for _ in range(H) ]
w_c = [ 0 for _ in range(W) ]

for _ in range(M):
  h,w = map(int,input().split())
  h -= 1
  w -= 1
  h_c[h] += 1
  w_c[w] += 1
  dic[(h,w)] = True

h_cans,w_cans = [],[]
h_max,w_max = max(h_c),max(w_c)
for i in range(H):
  if h_c[i] == h_max:
    h_cans.append(i)

for i in range(W):
  if w_c[i] == w_max:
    w_cans.append(i)

ans = h_max + w_max - 1
for h in h_cans:
  for w in w_cans:
    if not dic[(h,w)]: 
      print(ans+1)
      exit()

print(ans)

Measured memory_bytes: 198656
import math
n = int(input())
x = input().split()
y = input().split()

d1 = 0
d2 = 0
d3 = 0
d = []
for i in range(n):
    d1 += abs(float(x[i]) - float(y[i])) **1
    d2 += abs(float(x[i]) - float(y[i])) **2
    d3 += abs(float(x[i]) - float(y[i])) **3
    d.append(abs(float(x[i]) - float(y[i])))

print('{}'.format(d1))
print('{}'.format(d2**(1/2)))
print('{}'.format(d3**(1/3)))
print('{}'.format(max(d)))



Measured memory_bytes: 5720
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;


public class Main {
	public static void main(String[] args) throws IOException{

		Scanner sc = new Scanner(new InputStreamReader(System.in));
		sc.next();
		String s = sc.next();

		String[] line = s.split("",0);

		System.out.println("A"+line[0]+"C");
	}
}


Measured memory_bytes: 23892
#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <limits.h>
#include <assert.h>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <math.h>
#include <stack>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long int
#define db double
#define ldb long double
#define MOD 1000000007
#define Fi first
#define Se second
#define INF INT_MAX
#define NINF INT_MIN
#define L_INF LLONG_MAX
#define L_NINF LLONG_MIN
#define gc getchar
#define sz(x) (int)(x).size()
#define pii pair<int,int>
#define pll pair<ll,ll>

void fsscan(){ios_base::sync_with_stdio(false);cin.tie(NULL);}

void scani(int &x)
{
    register int c = gc();x = 0;int neg = 0;
    for(;((c<48 || c>57) && c != '-');c = gc());
    if(c=='-') {neg=1;c=gc();}
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
    if(neg) x=-x;
}

ll gcd(ll a,ll b)
{
    if (a == 0)
        return b;
    return gcd(b%a, a);
}

int main()
{
    fsscan();
    string s;
    cin>>s;
    if((s[2]==s[3]) && (s[4] == s[5]))
    cout<<"Yes";
    else
        cout<<"No";
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;

public class Main {
	final int _intMax = Integer.MAX_VALUE; // =2147483647>10^9
	final int _intMin = Integer.MIN_VALUE;
	final long _longMax = Long.MAX_VALUE; // =9223372036854775807L>10^18
	final long _longMin = Long.MIN_VALUE;
	static boolean bElapsed = false;

	void solve() {
		int[] ia = readNums();
		Arrays.sort(ia);
		int d = ia[2] - ia[0];
		int e = ia[2] - ia[1];
		int ans = 0;
		ans += d / 2;
		d %= 2;
		ans += e / 2;
		e %= 2;
		if (d > 0 && e > 0) {
			ans++;
			d--;
			e--;
		}
		if (d > 0 || e > 0) {
			ans += 2;
		}
		pln(ans);
	}

	int pint(String s) {
		return Integer.parseInt(s);
	}

	long plong(String s) {
		return Long.parseLong(s);
	}

	String readLine() {
		try {
			return _in.readLine();
		} catch (IOException e) {
			throw new RuntimeException(e);
		}
	}

	int readNum() {
		String line = readLine();
		return pint(line);
	}

	String[] readFlds() {
		String line = readLine();
		return line.split(" ");
	}

	int[] readNums() {
		String[] flds = readFlds();
		int[] nums = new int[flds.length];
		for (int i = 0; i < flds.length; i++) {
			nums[i] = pint(flds[i]);
		}
		return nums;
	}

	void p(char c) {
		_out.print(c);
	}

	void pln(char c) {
		_out.println(c);
	}

	void p(double d) {
		_out.print(d);
	}

	void pln(double d) {
		_out.println(d);
	}

	void p(long l) {
		_out.print(l);
	}

	void pln(long l) {
		_out.println(l);
	}

	void p(String s) {
		_out.print(s);
	}

	void pln(String s) {
		_out.println(s);
	}

	static BufferedReader _in;
	static PrintWriter _out;

	public static void main(String[] args) {
		long start = System.currentTimeMillis();
		_in = new BufferedReader(new InputStreamReader(System.in));
		_out = new PrintWriter(System.out);
		new Main().solve();
		_out.flush();
		long end = System.currentTimeMillis();
		if (bElapsed) {
			System.err.println((end - start) + "ms");
		}
	}
}


Measured memory_bytes: 21204
N=int(input())
P=[int(x)-1 for x in input().split()]
T=[0]*N

for i in range(N):
	if P[i]==i:
		T[i]=1

for i in range(1,N):
	if T[i]==T[i-1]==1:
		T[i]=0

print(sum(T))

Measured memory_bytes: 13880
import java.util.*;

public class Main {

	public static void main(String[] args) {
	
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();
		if(a % k  == 0 || b % k == 0) {
			System.out.println("OK");
		} else {
			System.out.println(b / k - a / k >=1 ? "OK" : "NG");	
		}
	}
}

Measured memory_bytes: 35724
import static java.lang.Integer.parseInt;
import static java.lang.Math.pow;
import static java.lang.System.out;
import java.io.File;
import java.util.Scanner;

public class Main {

    public static void main(String args[]) {
        new Main().right();
    }

    public void right() {
        try (Scanner scan = new Scanner(System.in)) {
            scanInData(scan);
        } catch (Exception e) {
            System.exit(0);
        }
    }

    public void right(String inDataPath) {
        try (Scanner scan = new Scanner(new File(inDataPath))) {
            scanInData(scan);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    public void scanInData(Scanner scan) {
        int dataCount = parseInt(scan.nextLine());
        for (int i = 0; i < dataCount; i++) {
            String[] data = scan.nextLine().split(" ");
            printJudgeTriangle(parseInt(data[0]), parseInt(data[1]), parseInt(data[2]));
        }
    }

    public void printJudgeTriangle(int a, int b, int c) {
        if (judgeTriangle(a, b, c) || judgeTriangle(b, c, a) || judgeTriangle(c, a, b)) {
            out.println("YES");
        } else {
            out.println("NO");
        }
    }

    public boolean judgeTriangle(int x, int y, int z) {
        return pow(x, 2) + pow(y, 2) == pow(z, 2);
    }
}

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

#define mp make_pair
#define pb push_back
#define ll long long int
#define sd(x) scanf("%lld",&x)
#define inf 1000000000000000000
#define pll pair<ll,ll>
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define bits(x) __builtin_popcountll(x)
#define ld long double
#define test() ll test; cin>>test; while(test--)
#define fi first
#define se second


void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif


inline ll GCD(ll x, ll y) {
    if(x<y) swap(x,y);
    if(x==0) return y;
    if(y==0) return x;
    return GCD(x%y,y);
}

ll phi(ll n) {
    ll result = n;
    for (ll i = 2; i * i <= n; i++) {
        if(n % i == 0) {
            while(n % i == 0)
                n /= i;
            result -= result / i;
        }
    }
    if(n > 1)
        result -= result / n;
    return result;
}

ll power(ll x, ll n, ll mod) {
    ll res = 1;
    x %= mod;
    while(n) {
        if(n&1) {
            res = ((res*x)%mod+mod)%mod;
        }
        x = ((x*x)%mod+mod)%mod;
        n>>=1;
    }

    return res;
}

const int MAXN = 1e6+5;

ll fact[MAXN]={0};

int main() {
    fastio;

    fact[0] = 0;
    fact[1] = 0;

    for(ll i=1;i<MAXN;i++) {
        for(ll j=i;j<MAXN;j+=i) {
            fact[j]++;
        }
    }

    ll sum = 0;

    ll n;cin>>n;
    for(ll i=1;i<n;i++) {
        sum += fact[n-i];
    }

    cout<<sum<<endl;
    
}




Measured memory_bytes: 11460
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
#include <cassert>
#include <random>

using namespace std;
typedef long long ll;

vector<int> g[101010];
int memo[101010];
bool flag = 0;
int cnt[2];

void dfs(int v, int color) {
    for (int nv : g[v]) {
        if (memo[nv] == color) {
            flag = 1;
            continue;
        } else if (memo[nv] == (color + 1) % 2) {
            continue;
        } else if (memo[nv] == -1) {
            int new_color = (color + 1) % 2;
            memo[nv] = new_color;
            cnt[new_color] += 1;
            dfs(nv, new_color);
        }
    }
}

int main() {
    int n, m;
    cin >> n >> m;
    int a, b;
    for (int i = 0; i < m; i++) {
        cin >> a >> b;
        a--; b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    for (int i = 0; i < n; i++) {
        memo[i] = -1;
    }
    memo[0] = 0;
    cnt[0] = 1;
    cnt[1] = 0;
    dfs(0, 0);
    if (flag) {
        cout << (long long) n * (n-1) / 2 - m << endl;
    } else {
        cout << (long long) cnt[0] * cnt[1] - m << endl;
    }

    return 0;
}


Measured memory_bytes: 6912
#pragma region template
#include <bits/stdc++.h>
#define all(a) (a).begin(),(a).end()
#define rep(i,n) for(ll i=0,i##_len=(n);i<i##_len;i++)
#define rep2(i,a,b) for(ll i=(a),i##_len=(b);i<=i##_len;i++)
#define rrep(i,n) ll i=(n);ll now=-1;while(i--&&(now++||1))
#define Yes(n) cout<<((n)?Yes:No)
#define vint vector<int>
#define vll vector<ll>
#define vstr vector<string>
#define vbl vector<bool>
#define pb push_back
using namespace std;
using ll = long long;

static inline void ignore_ret(int x) {x++;}
template<class T> inline bool chmax(T&a,const T&b){if(a<b){a=b;return true;}return false;}
template<class T> inline bool chmin(T&a,const T&b){if(a>b){a=b;return true;}return false;}
template<class T> inline T gcd_vec(vector<T>v){T r=v.at(0);for(T i=1;i<v.size();i++)r=gcd(r,v.at(i));return r;}
template<class T> inline T lcm_vec(vector<T>v){T r=v.at(0);for(T i=1;i<v.size();i++)r=lcm(r,v.at(i));return r;}
template<class T> inline T factorial(T n){if(n==0)return 1;T r=1;for(T i=2;i<=n;i++)r*=i;return r;}
template<class T> inline T nCr(T n,T k){if(n<k||n<0||k<0)return 0;T r=1;k=min(k,n-k);for(T i=n-k+1;i<=n;i++)r*=i;return r/factorial(k);}
template<class T> inline T dot_product(vector<T>u,vector<T>v){T r=0;for(T i=0;i<u.size();i++)r+=u.at(i)*v.at(i);return r;}
template<class T> inline T sum(vector<T>v){return reduce(all(v),0LL);}
#pragma endregion template

void solve(ll N, string S) {
  rep(i, S.size()) {
    S.at(i) = (S.at(i) - 'A' + N) % 26 + 'A';
  }
  cout << S << endl;
}

int main() {
  ll N;
    ignore_ret(scanf("%lld",&N));
    string S;
    cin >> S;
  solve(N, S);
  return 0;
}


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

int main ( void  ) {
	int k;
	int ans = 0;
	std::cin >> k;
	for ( int i = 2 ; i <= k ; i+= 2 ) {
		for ( int i = 1 ; i <= k ; i += 2 ) 
			ans++;
	}
	std::cout << ans << std::endl;
}

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

int main(){
    set<int> st{1,3,5,7,8,10,12};
    set<int> st2{4,6,9,11};
    int x,y;
    cin >> x >> y;
    bool flag = 0;
    if(st.count(x)==1&&st.count(y)==1){
        flag = 1;
    }
    if(st2.count(x)==1&&st2.count(y)==1){
        flag = 1;
    }
    if(flag)cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

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

struct dice {
	int N[6];
	char num[5];
};
struct dice DICE = { 1, 2, 3, 4, 5, 6, 4, 3, 0, 2, 1 };

void check_a(int l1, char *str);
void check_b(int l1, char *str);
void rot(char *str);

int main(void) {
	char str[100];
	char v[2][24];
	int i, num;
	scanf("%d%d%d%d%d%d", &DICE.N[0], &DICE.N[1], &DICE.N[2], &DICE.N[3], &DICE.N[4], &DICE.N[5]);
	for (i = 0; i < 6; i++) {							//6面の値の取得
		if (DICE.N[i] < 0) { DICE.N[i] = 0; }			//0以下の場合は0とする
		if (DICE.N[i] > 100) { DICE.N[i] = 100; }		//100以上の場合は100とする
	}
	getchar();											//改行の読み飛ばし
	scanf("%d", &num);									//質問数の取得
	if (num < 1) { num = 1; }							//質問数の下限値は1
	if (num > 24) { num = 24; }							//質問数の上限値は24
	getchar();											//改行の読み飛ばし
	for (i = 0; i < num; i++) {
//		scanf("%d%d", &v[0][i], &v[1][i]);				//上面と前面の値の取得
//		getchar();										//改行の読み飛ばし
	}
	for (i = 0; i < num; i++) {

		scanf("%d%d", &v[0][i], &v[1][i]);				//上面と前面の値の取得
		getchar();										//改行の読み飛ばし

		check_a(v[0][i], str);							//上面の位置取得
		rot(str);										//
		check_b(v[1][i], str);							//前面の位置取得
		rot(str);										//
		printf("%d\n", DICE.N[DICE.num[3]]);			//右面の値
	}
	return 0;
}
void check_a(int l1, char *str) {
	int i, j = 0, k = 5;
	for (i = 0; i < 6; i++) {							//求めたい値が何番目に格納されているか調べる
		if (l1 == DICE.N[i]) {
			j = i;
			break;
		}
	}
	for (i = 0; i < 5; i++) {							//上で一致した番号がダイスのどの位置にあるか調べる
		if (j == DICE.num[i]) {
			k = i;
			break;
		}
	}
	switch (k) {
	case 0:
		strcpy(str, "");
		break;
	case 1:
		strcpy(str, "EN");
		break;
	case 2:
		strcpy(str, "N");
		break;
	case 3:
		strcpy(str, "WN");
		break;
	case 4:
		strcpy(str, "NN");
		break;
	default:
		strcpy(str, "S");
		break;
	}
}
void check_b(int l1, char *str) {
	int i, j = 0, k = 5;
	for (i = 0; i < 6; i++) {							//求めたい値が何番目に格納されているか調べる
		if (l1 == DICE.N[i]) {
			j = i;
			break;
		}
	}
	for (i = 0; i < 5; i++) {							//上で一致した番号がダイスのどの位置にあるか調べる
		if (j == DICE.num[i]) {
			k = i;
			break;
		}
	}
	switch (k) {
	case 0:
		strcpy(str, "");
		break;
	case 1:
		strcpy(str, "E");
		break;
	case 2:
		strcpy(str, "");
		break;
	case 3:
		strcpy(str, "W");
		break;
	case 4:
		strcpy(str, "");
		break;
	default:
		strcpy(str, "EE");
		break;
	}
}
void rot(char *str) {
	int i = 0;
	while (str[i] != '\0') {
		switch (str[i]) {
		case 'N':
			DICE.num[0] = DICE.num[2];
			DICE.num[2] = DICE.num[4];
			DICE.num[4] = 5 - DICE.num[0];
			break;
		case 'S':
			DICE.num[4] = DICE.num[2];
			DICE.num[2] = DICE.num[0];
			DICE.num[0] = 5 - DICE.num[4];
			break;
		case 'E':
			DICE.num[3] = DICE.num[2];
			DICE.num[2] = DICE.num[1];
			DICE.num[1] = 5 - DICE.num[3];
			break;
		case 'W':
			DICE.num[1] = DICE.num[2];
			DICE.num[2] = DICE.num[3];
			DICE.num[3] = 5 - DICE.num[1];
			break;
		default:
			break;
		}
		i++;
	}
}


Measured memory_bytes: 2044
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    bool even = true;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        even &= a[i] % 2 == 0;
    }
    cout << (even ? "second" : "first") << endl;
}


Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<algorithm>

using namespace std;

int main(void) {
	int H, W;
	cin >> H >> W;
	vector<string> str(H);
	for (int i = 0; i < H; i++) cin >> str[i];

	map<char, int> ma;
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++) ma[str[i][j]]++;
	}

	int Q = 0, D = 0, S = 0;
	for (auto itr = ma.begin(); itr != ma.end(); itr++) {
		if (itr->second % 4 == 0) Q++;
		else if (itr->second % 2 == 0) D++;
		else S++;
	}

	if (H % 2 == 1 && W % 2 == 0) {
		int buf;
		buf = H;
		H = W;
		W = buf;
	}

	if (H % 2 == 0 && W % 2 == 0) {
		if (D != 0 || S != 0) cout << "No" << endl;
		else cout << "Yes" << endl;
	}
	else if (H % 2 == 0 && W % 2 == 1) {
		if (2 * D > H || S != 0) cout << "No" << endl;
		else cout << "Yes" << endl;
	}
	else {
		if (2 * D > H + W - 2 || S > 1) cout << "No" << endl;
		else cout << "Yes" << endl;
	}
	system("pause");
	return 0;
}

Measured memory_bytes: 504
from functools import reduce

def f(a):
    i = 0
    a,r = divmod(a, 2)
    while r == 0:
        i += 1
        a,r = divmod(a, 2)
    return i

n = int(input())
print(reduce(lambda x,y:x+y, map(f, map(int, input().split()))))


Measured memory_bytes: 4452
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#define int long long
#define mod 1000000007
#define for0(i, n) for(int i = 0; i < (n); i++)
#define for1(i, n) for(int i = 1; i <= (n);i++)
#define mp make_pair
using namespace std;
int n, m, v, p, a[123456], b[123456], ans;
signed main() {
	cin >> n >> m >> v >> p;
	for1(i, n) cin >> a[i];
	sort(a + 1, a + n + 1); ans = p;
	for1(i, n)b[i] = a[i] + b[i - 1];
	for1(i, n - p) {
		int aim = a[i] + m;
		if (aim < a[n - p + 1]);
		else if (m*(v - p - i + 1) <= aim * (n - p - i + 1) - (b[n - p + 1] - b[i]))ans++;
	}
	cout << ans << endl;
}

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

int main(void){
  int n;
  cin >> n;
  int prev = -1;
  int res = 0;
  for(int i = 1;i <= n;++i){
    int a;
    cin >> a;
    if(prev == -1 && i == a){
      prev = i;
    }else if(prev != -1 && i != a){
      int len = i - prev;
      res += (len+1)/2;
      prev = -1;
    }
  }
  if(prev != -1){
    res += (n-prev+2)/2;
  }
  cout << res << endl;
  return 0;
}


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

using namespace std;

const int maxn=1e5+10;

int n;
int ne[maxn],f[maxn];
char ch[maxn];

int main()
{
	scanf("%s",ch+1);
	n=strlen(ch+1);
	
	if(ch[1]=='0'||ch[n]=='1'){
		printf("-1");
		return 0;
	}
	
	int la=0;
	for(int i=1;2*i<=n;i++){
		if(ch[i]=='1')ne[la]=i,la=i;
		if(ch[i]!=ch[n-i]){
			printf("-1");
			return 0;
		}
	}
	
	for(int i=ne[0];ne[i];i=ne[i]){
		f[i]=ne[i];
		for(int j=i+1;j<ne[i];j++)f[j]=ne[i];
	}
	
	for(int i=la;i<n;i++)f[i]=n;
	
	for(int i=1;i<n;i++)
		printf("%d %d\n",i,f[i]);
	
	return 0;
}

Measured memory_bytes: 2048
n = int(input())
lis = [list(map(int,input().split())) for _ in range(n)]

cnt = 0
flg = 0

for i in lis:
    if i[0]==i[1]:
        cnt += 1
        if cnt >= 3:
            flg = 1
    else:
        cnt = 0

if flg == 1:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 9124
#include<algorithm>
#include<climits>
#include<cmath>
#include<cstdlib>
#include<iomanip>
#include<iostream>
#include<numeric>
#include<string>
using namespace std;

long gcd(long x, long y) { if (x > y) { return gcd(y, x); } long r; while (y != 0) { r = x % y; x = y; y = r; }return x; }
long lcm(long x, long y) { return(x / gcd(x, y)) * y; }
void indexsort(long* first, long* last, long* func) { sort(first, last, [&](long a, long b) {return func[a] < func[b]; }); }
//--------------------

int main() {
	 
	long N , X; cin >> N >> X;
	long m[10000]; for (int i = 1; i <= N; i++) cin >> m[i];
	long res = 0;


	sort(m + 1, m + N + 1);

	X -= accumulate(m + 1, m + N + 1, 0);
    
	res += X / m[1];

	cout << res + N << endl;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
a = sorted(a)

ax = a[-1]
az = 10 ** 9 + 1
for i in range(n-1):
  val = abs(ax/2 - a[i])
  az = min(az, val)
  #print(az, val)
  if az == val:
    ay = a[i]
  
print(ax, ay)
  
  



Measured memory_bytes: 62704
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>//pair
#include<cmath>//abs,sqrt
#include<cstring>
#include<map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) cout<<arg<<"\n"
#define prin2(arg1,arg2) cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
const int INF=1e+9;
const ll INFLL=1e+17;
int main(){
  int n;cin>>n;
  int l[201];
  n*=2;
  rep(i,n) cin>>l[i];
  sort(l,l+n);
  int res=0;
  rep(i,n/2){
    res+=l[2*i];
  }
  prin(res);
  

  return 0;
}


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

int main(){
    int H, W;
    cin >> H >> W;
    while((H!=0)||(W!=0)){
        for(int i=0; i<H; i++){
            for(int j=0; j<W; j++){
                cout << "#";
            }
            cout << endl;
        }
        cout << endl;
        cin >> H >> W;
    }
    return 0;
}


Measured memory_bytes: 3016
object Main{
	def main(args:Array[String]){
		val s = new java.util.Scanner(System.in)
		val n = s.nextInt
		val a = Array.fill(n)((s.nextLong,s.nextInt)).sortBy(_._2)
		//println(a.mkString(" "))
		val b = new Array[(Long,Int)](n)
		b(0) = a(0)
		for(i <- 1 until n) {
			b(i) = (b(i - 1)._1 + a(i)._1,a(i) _2)
		}
		//println(b.mkString(" "))
		println(if(b.exists(o => o._1 > o._2)) "No" else "Yes")
	}
}


Measured memory_bytes: 124404
#include <bits/stdc++.h>
#include <cstring>
#include <limits>
using namespace std;
#define lli long long int
#define X first
#define Y second
#define fw(i, start, end) for (lli i = start; i < end; ++i)
#define fe(i, start, end) for (lli i = start; i <= end; ++i)
#define L(T)  \
    lli T;    \
    cin >> T; \
    while (T--)
#define FASTIO                   \
    ios::sync_with_stdio(false); \
    cin.tie(nullptr);            \
    cout.tie(nullptr);
int main()
{
    FASTIO
    //   L(T)
    lli n;
    cin >> n;
    lli a[n + 6][3];
    memset(a, 0, sizeof a);
    fw(i, 1, n + 1)
    {
        cin >> a[i][0] >> a[i][1] >> a[i][2];
    }
    // fw(i, 0, n + 1)
    // {
    //     cout << a[i][0] << "  " << a[i][1] << "  " << a[i][2] << "  "
    //          << "\n";
    // }
    lli b[n + 6][3];
    memset(b, 0, sizeof b);
    fw(i, 1, n+1)
    {
        b[i][0] = a[i][0] + max(b[i - 1][1], b[i - 1][2]);
        b[i][1] = a[i][1] + max(b[i - 1][0], b[i - 1][2]);
        b[i][2] = a[i][2] + max(b[i - 1][0], b[i - 1][1]);
    }
    // fw(i, 0, n + 1)
    // {
    //     cout << b[i][0] << "  " << b[i][1] << "  " << b[i][2] << "  "
    //          << "\n";
    // }
    lli maax = max(b[n][0], max(b[n][1], b[n][2]));
    cout << maax << "\n";
    return 0;
}

Measured memory_bytes: 4992
#include<iostream>
#include<string>
#include<algorithm>
#include<functional>
#include<cmath>

using namespace std;

int a[3009];
int N;

int f(int m)
{
	int r = 0;
	for (int i = 0; i < N; i++)
	{
		r += m % a[i];
	}
	return r;
}

int main()
{
	cin >> N;
	
	long long ans = 0;
	for (int i = 0; i < N; i++)
	{
		int t;
		cin >> t;
		ans += t - 1;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll x,y,a,b,c,i,sum=0;
    cin>>x>>y>>a>>b>>c;
    ll ra[a],ga[b],ca[c];
    for(i=0;i<a;i++) cin>>ra[i];
    for(i=0;i<b;i++) cin>>ga[i];
    for(i=0;i<c;i++) cin>>ca[i];
    sort(ra,ra+a); sort(ga,ga+b);sort(ca,ca+c);
    ll f1=a-1;
    ll f2=b-1;
    ll f3=c-1;
    ll n=x+y;
    ll ans[n],e=0;
    while(x!=0 || y!=0)
    {
        if(x!=0)
        {
            ans[e++]=ra[f1--];
            x--;
        }      
        if(y!=0)
        {
          ans[e++]=ga[f2--];
          y--;
        }
    }
    sort(ans,ans+n);
    for(i=0;i<n;i++)
    {
      if(f3>=0)
      {
        if(ans[i]<ca[f3])
        ans[i]=ca[f3--];
      }
      else
      break;
    }
    sum=accumulate(ans , ans+n , sum);
    cout<<sum;
}

Measured memory_bytes: 3968
import static java.lang.System.out;
import java.lang.Math;
import java.io.InputStream;
import java.io.IOException;
import java.util.NoSuchElementException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.Collections;

public class Main {
    public static void main(String args[]) {
        new Main().run();
    }

    MyInput in = new MyInput();
    public void run() {
        int N = in.nextInt();
        int K = in.nextInt();
        long ans = 1;
        for(int i = 0; i < N; i++) {
            if(ans < K) ans *= 2;
            else ans += K;
        }
        out.println(ans);
    }
}

class MyInput {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr= 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if(ptr < buflen) {
            return true;
        }else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch(IOException e) {
                e.printStackTrace();
            }
            if(buflen <= 0) {
                return false;
            }
        }
        return true;
    }

    public int readByte() {
        if (hasNextByte()) return buffer[ptr++];
        else return -1;
    }

    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <=126;
    }

    private void skipUnprintable() {
        while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;
    }

    public boolean hasNext() {
        skipUnprintable();
        return hasNextByte();
    }

    public String next() {
        if(!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }

    public long nextLong() {
        if(!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if(b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true) {
        if('0' <= b && b <= '9') {
            n *= 10;
            n += b - '0';
        }else if(b == -1 || !isPrintableChar(b)) {
            return minus ? -n : n;
        }else {
            throw new NumberFormatException();
        }
            b = readByte();
        }
	}

    public int nextInt() {
        long nl = nextLong();
        if(nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}



Measured memory_bytes: 21076
/**
 * Author: Behradm
 * Created: 04-04-2020 16:29:03
**/
#include <bits/stdc++.h>
using namespace std;
#define LOCAL

typedef long long ll;
typedef long double ld;
typedef vector<ld> vi;

#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ld)(x).size())

#ifdef LOCAL
	#define debugi(x) cerr << "{" << #x << "}: " << (x) << '\n'
	#define debug(v, begin, end) cerr << "{ | "; for(auto i = begin; i < end; i++){cerr << #v << "[" << i << "]: " << v[i] << " | ";} cerr << " }\n"
	#define debugp(a, b) cerr << "\n{ " << a << " " << b << " }\n"
#else
	#define debugi(x) 42
	#define debug(v, begin, end) 42
	#define debugp(a, b) 42 
#endif

const int maxn = 10001;
ld n, m, a[maxn];

int32_t main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cout.precision(6);
	cout << fixed;
	cin >> n >> m;
	ld s = 0;
	for(int i = 0; i < n; i++){
		cin >> a[i];
		s += (ld)a[i];
	}

	s = s/(4.0*m);
	ld c = 0;
	for(int i = 0; i < n; i++){
		if((ld)a[i] < s)
			c++;
	}

	ld can = n-c;
	if(can < m){
		cout << "No\n";
	} else{
		cout << "Yes\n";
	}
	return 0;
}



Measured memory_bytes: 256
#include <iostream> 
#include <vector>
#include <algorithm>

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)n; i++) 

int main() {
   int N;
   cin >> N;
   
   int a = N % 10;
   if (a == 2 || a == 4 || a == 5 || a == 7 || a == 9) {
      cout << "hon" << endl;
   } else if (a == 0 || a == 1 || a == 6 || a == 8) {
      cout << "pon" << endl;
   } else cout << "bon" << endl;
}


Measured memory_bytes: 3636
N=int(input())
a=list(map(int,input().split()))
cnt=0
r=0
sum=0
for l in range(N):
    while r<N and sum^a[r]==sum+a[r]:
        sum+=a[r]
        r+=1
        if r>=N:break
    cnt+=r-l
    if l==r:
        r+=1
    else:
        sum-=a[l]
print(cnt)


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

int syc(long i,long Min,long Max){
	if(Min <= i && i <= Max){
		return 1;
	}else{
		exit(1);
		//return 0;
	}
}

struct rest{
	int number;
    string name[30];
	int point;
	int ten;
};

int main(){
	
	int n;
	cin >> n ;
	syc(n,1,100);
	struct rest _rest[n];
	struct rest temp;
	
	for(int i=0;i<n;i++){
		_rest[i].number=i+1;
		cin >> _rest[i].name[0] >> _rest[i].point;
		_rest[i].ten=1;
	}
	
	for(int i=0;i<n-1;i++){
		for(int j=i+1;j<n;j++){
			if(_rest[i].name[0] < _rest[j].name[0]){
				_rest[i].ten++;
			}else if(_rest[i].name[0]==_rest[j].name[0] && _rest[i].point > _rest[j].point){
				_rest[i].ten++;
			}else{
				_rest[j].ten++;
			}	
		}
	}
	
	for(int i=0;i<n-1;i++){
		for(int j=i+1;j<n;j++){
			if(_rest[i].ten<_rest[j].ten){
				temp=_rest[i];
				_rest[i]=_rest[j];
				_rest[j]=temp;
			}
			
		}
	}
	
	for(int i=0;i<n;i++){
		cout << _rest[i].number << endl;
	}
	return 0;
}


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

int main() {
    int N;
    cin >> N;
    map<long long, long long> B, C;
    long long A;
    for (int i = 0; i < N; i++){
        cin >> A;
        B[A + i]++;
        C[i - A]++;
    }
    long long ans = 0;
    for (auto b: B) {
        int target = b.first;
        int pairs = b.second;
        ans += pairs * C[target];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 37780
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <cassert>

using namespace std;


#define all(c) ((c).begin()), ((c).end())
#define debug(c) cerr << "> " << #c << " = " << (c) << endl;
#define iter(c) __typeof((c).begin())
#define tr(i, c) for (iter(c) i = (c).begin(); i != (c).end(); i++)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)

#define mp make_pair
#define fst first
#define snd second
#define pb push_back


const double EPS = 1e-10;


typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef complex<double> P;


int main(){
	int w, n; cin >> w >> n;
	vi x(w);
	rep(i, w) x[i] = i + 1;
	rep(i, n) {
		int a, b; char c; cin >> a >> c >> b;
		swap(x[a - 1], x[b - 1]);
	}
	rep(i, w) cout << x[i] << endl;
	
	return 0;
}

Measured memory_bytes: 0
from collections import deque

INF = 1000000
N,T,A=map(int,input().split())
T -= 1
A -= 1
G = [ [] for i in range(N) ]
DT = [ INF for _ in range(N) ]
DA = [ INF for _ in range(N) ]
for i in range(N-1):
    h1,h2=map(int,input().split())
    h1 -= 1
    h2 -= 1
    G[h1].append(h2);
    G[h2].append(h1);

DT[T] = 0
DA[A] = 0

q = deque()

# BFS
q.append(T)
while len(q) > 0:
    v = q.popleft()
    for nv in G[v]:
        if DT[nv] == INF:
            DT[nv] = DT[v] + 1
            q.append(nv)

q.clear()
q.append(A)
while len(q) > 0:
    v = q.popleft()
    for nv in G[v]:
        if DA[nv] == INF:
            DA[nv] = DA[v] + 1
            q.append(nv)

max_da = 0
for i in range(N):
    #print(i, " T:", DT[i], " A:", DA[i])
    if DA[i] - DT[i] >= 1 :
        max_da = max(DA[i], max_da)
print(max_da-1)



Measured memory_bytes: 29396
long M=1e9+7,s[1<<17],a,i,f;
long p(long a,int b){return b?b%2?p(a*a%M,b/2)*a%M:p(a*a%M,b/2)%M:1;}
main(n)
{
	for(scanf("%d",&n);~scanf("%d",&a);s[a]++);
	if(n%2)for(f|=*s-1;++i<n;)f|=(i%2?s[i]:s[i]-2)?1:0;
	else for(f|=*s;++i<n;)f|=(i%2?s[i]-2:s[i])?1:0;
	printf("%d\n",f?0:p(2,n/2));
}


Measured memory_bytes: 896
#include <iostream>

int main(){
	int Hills[10],i,j,n;

	for(i=0;i<10;i++){
	std::cin>>Hills[i];
		}
	for(i=0;i<9;i++){
		for(j=i+1;j<10;j++){
           if(Hills[i]<Hills[j]){
	         n=Hills[i];
			 Hills[i]=Hills[j];
			 Hills[j]=n;
			   }
			}
		}
	for(i=0;i<3;i++){
		std::cout<<Hills[i]<<std::endl;
		}

	
		return 0;
		}

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

int main(void)
{
    string str;
    cin >> str;

    for(int i = 0; i < str.size(); i++)
    {
        if((i % 2) == 0) cout << str.at(i);
    }

    cout << endl;

    return 0;
}

Measured memory_bytes: 512
#include <cmath>
#include <iostream>
using namespace std;
int n, a[256];
int main() {
	while (cin >> n, n) {
		for (int i = 0; i < n; i++) cin >> a[i];
		int mi, mj, mk; long double v = 1e+300L;
		for (int i = 0; i < 16; i++) {
			for (int j = 0; j <	16; j++) {
				for (int k = 0; k < 16; k++) {
					int b[257] = { 0 }, c[257] = { 0 }; b[0] = i;
					for (int l = 1; l <= n; l++) b[l] = (j * b[l - 1] + k) % 256;
					for (int l = 0; l < n; l++) c[(a[l] + b[l + 1]) % 256]++;
					long double res = 0;
					for (int l = 0; l < 256; l++) {
						if (c[l]) res -= c[l] * log(1.0L * c[l] / n);
					}
					if (v - 1e-13L > res) v = res, mi = i, mj = j, mk = k;
				}
			}
		}
		cout << mi << ' ' << mj << ' ' << mk << endl;
	}
}

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

long long int a[100005]={0}, b[100005]={0}, c[100005]={0};

int main(){
    long long int n;
    cin >> n;
    for(int i=0;i<n;++i)cin >> a[i];
    for(int i=0;i<n;++i)cin >> b[i];
    for(int i=0;i<n;++i)cin >> c[i];

    sort(a, a+n);
    sort(b, b+n);
    sort(c, c+n);

    long long int ans = 0;
    long long int ai = 0, ci = 0;
    for(long long int i=0;i<n;++i){
        while(ci < n && c[ci] <= b[i])ci++;
        while(ai < n && a[ai] < b[i])ai++;
        ans += (n - ci) * ai;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define endl "\n"
#define inf 1000000007
#define FOR(i, a, b) for(int i=a; i<b; i++)
int dp[1000001] = {0};

void solve(){
	int a, b;
  cin>>a>>b;
  if(a>9 || b>9) cout<<"-1";
  else cout<<a*b;
}
signed main(){
	#ifdef _DEBUG
		freopen("input.txt", "r", stdin);
    	freopen("output.txt", "w", stdout);
	#endif
	
	ios::sync_with_stdio(false);
	cin.tie(0);
	int t=1;
	//cin>>t;
	while(t--){
		solve();
	}
	return 0;
 
}

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

int N, M, S, T, A[1 << 18], B[1 << 18], dp[1 << 18][3];
vector<int> X[1 << 18];

int main() {
	cin >> N >> M;
	for (int i = 0; i < M; i++) {
		cin >> A[i] >> B[i];
		X[A[i]].push_back(B[i]);
	}
	cin >> S >> T;
	for (int i = 1; i <= N; i++) { dp[i][0] = (1 << 30); dp[i][1] = (1 << 30); dp[i][2] = (1 << 30); }

	queue<pair<int, int>> Q;
	dp[S][0] = 0; Q.push(make_pair(S, 0));

	while (!Q.empty()) {
		int pos1 = Q.front().first, pos2 = Q.front().second; Q.pop();

		for (int to : X[pos1]) {
			if (dp[to][(pos2 + 1) % 3] > dp[pos1][pos2] + 1) {
				dp[to][(pos2 + 1) % 3] = dp[pos1][pos2] + 1;
				Q.push(make_pair(to, (pos2 + 1) % 3));
			}
		}
	}

	if (dp[T][0] == (1 << 30)) cout << "-1" << endl;
	else cout << dp[T][0] / 3 << endl;
	return 0;
}

Measured memory_bytes: 13952
#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
  int r,n;
  while(cin>>n>>r){
    deque<int>A,B,C;
    r(i,n)C.push_back(i);
    int a[r];
    r(i,r)cin>>a[i];
    for(int i=0;i<r;i++){
      int c=0;
      r(i,n/2)B.push_back(C.front()),C.pop_front();
      while(C.size())A.push_back(C.front()),C.pop_front();
      while(1){
        if(A.size()==0&&B.size()==0)break;;
        if(c==0){
            r(j,a[i]){
              if(A.size())C.push_back(A.front()),A.pop_front();
          }
          c=1;
        }
        else{
            r(j,a[i]){
              if(B.size())C.push_back(B.front()),B.pop_front();
          }
          c=0;
        }
      }
    }
    cout<<C.back()<<endl;
  }
}


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

const int N=105;
int n,m,x,y,s1[N][N],s2[N][N];
char s[N][N];
short dp[N][N][N][N];

template<class T>void up(T&x,int y){x>y?:x=y;}
inline int GetL(int Li,int L,int R){return s1[Li][R]-s1[Li][L-1];}
inline int GetC(int Co,int L,int R){return s2[Co][R]-s2[Co][L-1];}

int main(){
//	freopen("agc004_e.in","r",stdin);freopen("agc004_e.out","w",stdout);
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++){
		scanf("%s",s[i]+1);
		for(int j=1;j<=m;j++){
			if(s[i][j]=='E')x=i,y=j;
			s1[i][j]=s1[i][j-1]+(s[i][j]=='o');
			s2[j][i]=s2[j][i-1]+(s[i][j]=='o');
		}
	}
	for(int l=0;l<y;l++)for(int r=0;r<m-y+1;r++){
		for(int u=0;u<x;u++)for(int d=0;d<n-x+1;d++){
			
			int now=dp[l][r][u][d];
			int lx1=d+1,rx1=n-u;
			int ly1=r+1,ry1=m-l;
			// inside the boundry
			int lx2=x-u-1,rx2=x+d+1;
			int ly2=y-l-1,ry2=y+r+1;
			// outside the boundry
			
			int LX = max(lx1, lx2 + 1), RX = min(rx1, rx2 - 1);
			int LY = max(ly1, ly2 + 1), RY = min(ry1, ry2 - 1);
			up (dp[l + 1][r][u][d], now + (ly2 < ly1 ? 0 : GetC (ly2, LX, RX)));
			up (dp[l][r + 1][u][d], now + (ry2 > ry1 ? 0 : GetC (ry2, LX, RX)));
			up (dp[l][r][u + 1][d], now + (lx2 < lx1 ? 0 : GetL (lx2, LY, RY)));
			up (dp[l][r][u][d + 1], now + (rx2 > rx1 ? 0 : GetL (rx2, LY, RY)));
			
		}
	}
	printf("%d\n",(int)dp[y-1][m-y][x-1][n-x]);
	return 0;
}

Measured memory_bytes: 211328
def main():
    v = [int(i) for i in input().split()]
    k = int(input())

    # ans = 0
    # for i, m in enumerate(sorted([a, b, c], reverse=True)):
    #     if i == 0:
    #         ans += m * (2 ** k)
    #     else:
    #         ans += m
    #
    # print(ans)

    mx = max(v)
    v.remove(mx)

    ans = mx * (2 ** k) + sum(v)
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
#include <vector>
#include <numeric>
#include <map>
#include <cmath>
#include <iomanip>
#include <queue>
#include <set>
using ll =long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vs = vector<string>;


int main() {
    ll N;
    cin >> N;
    ll a = N;
    ll b, tmp;
    vs alphabet = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r",
                   "s", "t", "u", "v", "w", "x", "y", "z"};
    vs ans;

    while(1){
        tmp = a;
        a = a/26;
        b = tmp%26;
        if(b == 0){
            a = a-1;
            b = 26;
        }
        ans.push_back(alphabet.at(b-1));
        if(a == 0){
            break;
        }
    }
    string out;
    for(ll i = ans.size()-1; i>=0; i--){
        out += ans.at(i);
    }
    cout << out << endl;
}

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

int main() {
	string str;
	cin >> str;

	int op;
	cin >> op;

	for (int i = 0; i < op; i++)
	{
		string op_s;
		cin >> op_s;

		if (op_s == "replace")
		{
			int a, b;
			string p;
			cin >> a >> b >> p;
			str.replace(a, p.size(), p);
		}
		else if (op_s == "reverse")
		{
			int a, b;
			cin >> a >> b;

			for (int x = a,y = b; x<y; x++, y--) {
				char c = str[x];
				str[x] = str[y];
				str[y] = c;
			}
		}
		else if (op_s == "print")
		{
			int a, b;
			cin >> a >> b;

			for (int x = a; x <= b; x++)
				cout << str[x];
			cout << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9+7;
const double EPS = 1e-11;
const double PI = 2 * acos(0.0);
using ll = long long;
using ull =  unsigned long long;

#define input freopen("input.txt", "r", stdin)
#define output freopen("output.txt", "w", stdout)
#define fast_io ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);
#define pf printf
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x)
#define sii(x,y) scanf("%d %d",&x,&y)
#define sll(x,y) scanf("%lld %lld",&x,&y)

#define pii pair<int,int>
#define nl '\n'
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define ALL(v) v.begin(),v.end()
#define uniq(a) a.erase(unique(a.begin(), a.end()), a.end())
#define out(x) cout <<"#x = "<<x<<endl
#define outt(x,y) cout <<"# "<<x<<" "<<y<<endl
#define mem(array,value) memset(array,value,sizeof(array))

const int MX = 1e3+2;

char grid[MX][MX];
bool vis[MX][MX];
int n,m;
bool valid(int x,int y)
{
	return (x>=1 && x<=n && y>=1 && y<=m && grid[x][y]=='.');
}
//int c=0;
ll dp[MX][MX];

int solve(int i,int j)
{
	if(!valid(i,j))return 0;
	if(i==n && j==m)return 1;
	if(vis[i][j])return dp[i][j];
	vis[i][j]=1;
	dp[i][j]= (solve(i,j+1)%MOD + solve(i+1,j)%MOD)%MOD;
	return dp[i][j];
}
int main()
{
	
	fast_io
	cin >>n>>m;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			cin >>grid[i][j];
		}
	}
	cout << solve(1,1)<<endl;
	return 0;

}


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

int main() {
  int N,K,x=1,i=0;
  cin >> N >> K;
  while(x<K&&i<N){
    x*=2;
    i++;
  }
  while(i<N){
    x+=K;
    i++;
  }
  cout << x << endl;
  
}

Measured memory_bytes: 256