akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

template <typename _Tp> inline _Tp read(_Tp&x){
	char c11=getchar();x=0;while(!isdigit(c11))c11=getchar();
	while(isdigit(c11))x=x*10+c11-'0',c11=getchar();return x;
}

int a[101000],n;

int main(){
	read(n);
	for(int i=1;i<=n;++i)read(a[i]);
	sort(a+1,a+n+1,greater<int>());
	int i,j;
	for(i=1;i<=n&&i+1<=a[i+1];++i);
	j=i+1;
	while(a[j]==i)++j;
	int d=(j-i+1&1)|(a[i]-i&1);
	puts(d?"First":"Second");
	return 0;
}

Measured memory_bytes: 640
// ABC075_C
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>  // std::swap()
using namespace std;
using ll = long long;

#define REP(i, n) for (ll i=0; i < n; i++)  // 0 ~ n-1
#define pll pair<ll, ll>
#define F first
#define S second

class UnionFind {
public:
    vector <ll> par; // 各元の親を表す配列
    vector <ll> siz; // 素集合のサイズを表す配列(1 で初期化)

    // Constructor
    UnionFind(ll sz_): par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);
        for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
    }

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

    // Union(Unite, Merge)
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        // merge technique（データ構造をマージするテク．小を大にくっつける）
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) { // 連結判定
        return root(x) == root(y);
    }

    ll size(ll x) { // 素集合のサイズ
        return siz[root(x)];
    }
};

int main() {
    // input(sunippets: inpv, inpn, inps)
    ll N, M, a, b;
    cin >> N >> M;
    vector<pll> vec(M);
    REP(i, M) {
        cin >> a >> b; --a, --b;
        vec[i].F = a;
        vec[i].S = b;
    }

    // calculation
    UnionFind uf(N);
    ll res = 0;
    REP(i, M) {
        uf.init(N);
        REP(j, M) {
            if (j == i) continue;
            uf.merge(vec[j].F, vec[j].S);
        }
        if (uf.size(0) < N) res++;
    }

    cout << res << "\n";

    //return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
const ll mod = 1000000007;

int main(){
	int a,b,n; cin >> a >> b >> n;
	if(a < b) swap(a,b);
	cout << (n+a-1)/a << endl;
}

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

int main() {
    string s,t;
    cin >> s >> t;
    sort(s.begin(),s.end());
    sort(t.begin(),t.end());
    reverse(t.begin(),t.end());
    if(s<t) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
using namespace std;
#define ll long long
#define lowbit(a) ((a) & -(a))
#define clean(a, b) memset(a, b, sizeof(a))
const int mod = 1e9 + 7;
const int inf = 0x3f3f3f3f;
const int maxn = 2e5 + 9;
 
int _;

//========================================================================

//========================================================================
int main()
{
    int a[10];
    for(int i=1;i<=5;i++)
    {
        scanf("%d",&a[i]);
        if(a[i]==0) printf("%d\n",i);
    }
    return 0;
}


Measured memory_bytes: 1736
#include<bits/stdc++.h>
using namespace std;
#define ll long long
struct Interval
{
    ll f,s;

};
ll n;
//Interval ans[n+1];
bool sorti(Interval a,Interval b)
{
       if(a.s<b.s)
    return 1;
   else
    return 0;
}
void merger(Interval arr[],ll n)
{
    ll index=0,i;
    sort(arr,arr+n,sorti);
    for(i=1;i<n;i++)
    {
        if(arr[index].s>=arr[i].f)
        {
            arr[index].f=min(arr[i].f,arr[index].f);
            arr[index].s=max(arr[i].s,arr[index].s);
        }
        else
        {
            arr[index]=arr[i];
            index++;
        }
    }
    for(i=0;i<=index;i++)
        cout<<arr[i].f<<" "<<arr[i].s<<endl;
  /*  for(i=0;i<=index;i++)
    {
        ans.f=arr[i].f;
        ans.s=arr[i].s;
    }*/

}
int main()
{
       char a;
       cin>>a;
       if(a>='A'&&a<='Z')
        cout<<"A"<<endl;
       else
        cout<<"a"<<endl;
}


Measured memory_bytes: 3632
from itertools import permutations

def dist(x0, y0, x1, y1):
    ans = ((x0 - x1) ** 2 + (y0 - y1) ** 2) ** (0.5)
    return ans

def resolve():
    N = int(input())
    x, y, = [], []
    for i in range(N):
        x_tmp, y_tmp = list(map(int, input().split()))
        x.append(x_tmp)
        y.append(y_tmp)
    ans = 0
    ls = list(permutations(list(range(N)), N))
    for l in ls:
        for i in range(len(l)-1):
            ans += dist(x[l[i]], y[l[i]], x[l[i+1]], y[l[i+1]])

    print(ans / len(ls))
    return

resolve()

Measured memory_bytes: 13780
//author-micheal corleone
//the godfather
#include <bits/stdc++.h>
#include <set> 
#include<algorithm>
#include <set> 
#include<algorithm>
#define ll long long int
#define in(n) scanf("%lld",&n)
#define in2(a,b) scanf("%lld %lld",&a,&b)
#define out(n) printf("%lld\n",n)
#define inf 100000000000000
#define endl "\n"
#define precise(x) fixed << setprecision(x) 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
const int MOD =998244353;
#define f(i,a,n) for(int i=a;i<n;i++)
#define pb push_back
 
using namespace std;

bool sortcol( const vector<int>& v1, 
               const vector<int>& v2 ) { 
 return v1[1] < v2[1]; 
}
 ll mod_pow(int a,int b,int M = MOD)
{
    int res = 1;
    
    while(b)
    {
        if(b&1) res=(res*a)%M;
        a=(a*a)%M;
        b>>=1;
    }
    
    return res;
}
 //ll power(ll x, ll y) 
//{ 
  //  ll temp; 
    //if( y == 0) 
     //   return 1; 
    //temp = power(x, y/2); 
    //temp=temp%MOD;
    //if (y%2 == 0) 
     //   return (temp%MOD)*(temp%MOD); 
    //else
      //  return (x%MOD)*(temp%MOD)*(temp%MOD); 
//} 
 
 
ll ncr(ll n,ll r){if(n==1 || r==0)return 1;if(r>n/2)r=n-r;
	ll ans=1;for(ll i=1;i<=r;i++){ans=((ans * n )/i);n--;}return ans;
}
ll ncrsum(ll n,ll r, ll mod){
    if(n==1 || r==0)return 1;
  //  ll ans=1,sum=1;for(ll i=1;i<=r;i++){ans=((((ans * n)%MOD )*modinv(i,MOD))%mod);n--;sum+=ans;sum%=mod;}return sum;
}
 //diamond[2000005],ans[1000006];
 const int maxn=2e5+100;
//vector<int>v[maxn];
ll cost[maxn];


int main()
{
	ios_base::sync_with_stdio(0);
   cin.tie(0);
    cout.tie(0);
     ll t;
    ///cin>>t;
   
    t=1;	
   while(t--)
    {
        ll n,i1,i2,k,m,j,j1,a1,i31,i3,j2,i5,i4,i6,i7,i;
        ll x,y,z;
        ll total=0,cnt=0;
        ll flag=0;
        y=0;
        ll res,res1,ans,res2,q;
        ans=0;
        res1=0,res=0;
        ll s1,s2,s3;
        s2=0;
        ll sum=0,flag1=0;
        s1=0;
        ll k1,k2,k3;
        ll d,h,required,days;
        //cin>>h>>c>>required;
       // cin>>n;
         ll b;
         cin>>n;
         for(i=2;i*i<=n;i++)
         {
         	if(n%i==0)
         	{
         		ll pre=0;
         		cnt=0;
         		while(n%i==0)
         		{
         			cnt++;
         			n=n/i;
         			if(cnt>pre)
         			{
         				ans++;
         				pre=cnt;
         				cnt=0;
					 }
				 }
			 }
		 }
		 if(n>1)
		 {
		 	ans++;
		 }
		 cout<<ans<<endl;
         
     }
    
}
	


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

#define rep(i, a, b) for (int i = (a), i##end = (b); i <= i##end; ++i)
#define per(i, a, b) for (int i = (a), i##end = (b); i >= i##end; --i)

mt19937 Rnd(chrono::high_resolution_clock::now().time_since_epoch().count());

template <typename T>
inline void chkmax(T &x, T y) { if (x < y) x = y; }

template <typename T>
inline void chkmin(T &x, T y) { if (x > y) x = y; }

inline int read() {
  #define nc getchar()
  int x = 0;
  char c = nc;
  while (c < 48) c = nc;
  while (c > 47) x = x * 10 + (c ^ 48), c = nc;
  return x;
  #undef nc
}

typedef long long ll;
int n, m;

int main() {
  cin >> n >> m;
  int now = n;
  rep(i, 1, m) {
    now -= read();
  }
  cout << (now < 0 ? -1 : now) << endl;
  return 0;
}

Measured memory_bytes: 3628
/*#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
# define ll unsigned long long
# define int long long  //comment it out when MLE
//# define endl "\n"
#define gok ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
# define mo 1000000007
//# define MOD 163577857
# define pi acos(-1)
# define fi first
# define se second
#define REP(i,n) for (int i = 1; i <= n; i++)
const ll mod = 1000000007;
const int K = 2;
//typedef vector<vector<int> > matrix;
/*
int add(int a, int b,int mod) {
    a%=mod;
    b%=mod;
	a += b;
	if (a >= mod) a -= mod;
	if(a<0)
    {
        a += mod;
        a %= mod;
    }
	return a;
}

int mul(ll a, int b,int mod) {
    a%=mod;
    b%=mod;
	a *= b;
	a += mod;
	return a % mod;
}
int po(int a,int b,int mod)
{
    if(b==0)
        return 1;
    if(b%2==0)
        return po(mul(a,a,mod),b/2,mod);
    return mul(a,po(mul(a,a,mod),(b-1)/2,mod),mod);
}


ll fact[1000003];
ll inv[1000003];

void fact0()
{
	int i,j;
	fact[0]=1;
	for(i=1;i<=200000;i++)
	{
		fact[i]=i*fact[i-1]%mod;
	}
	inv[0]=1;
	inv[1]=1;
	ll p=mod;
	for (i=2; i<=200000; i++)
		inv[i] = (p - (p/i) * inv[p%i] % p) % p;

	for(i=2;i<=200000;i++)
	{
		inv[i]*=inv[i-1];
		inv[i]%=mod;
	}
}
*/

signed main() {
	gok

  int n;
  cin>>n;
  int a[n];
  vector<int> v,re;
  //int re[n];
  for(int i=0;i<n;i++){
    cin>>a[i];
    if(i!=0)
    {
        int tt = (a[i]^a[i-1]);
        v.push_back(tt);
    }
  }
  int an=0;
  for(int i=1;i<v.size();i+=2)
  {
      an ^= v[i];
  }
 an ^= a[0];
  re.push_back(an);
  for(int i=v.size()-1;i>=0;i--)
  {
      int tt = (re[re.size()-1]^v[i]);
      re.push_back(tt);
  }
  reverse(re.begin(),re.end());

  for(int i=0;i<re.size();i++)
    cout<<re[i]<<" ";












  return 0;
}


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

using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define fore(i,a) for(auto &i:a)

typedef pair <int, int> P;
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
const int  INF = 2147483647;
const ll INFL = 9223372036854775807;
const ll mod = 1000000007;





int main() {
	
	VI v(3);
	REP(i, 3)cin >> v[i];
	sort(ALL(v));
	cout << v[0] * v[1] / 2 << endl;

	return 0;
}



Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("filed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a:f64 = read();
    let b:f64 = read();
    let c:f64 = read();
    let c = c / 180.0 * std::f64::consts::PI;
    let s = a*b*c.sin()/2.0;
    let l = (a*a+b*b - 2.0*a*b*c.cos()).sqrt() + a + b;
    let h = 2.0*s/a;
    println!("{}\n{}\n{}", s, l, h);
}


Measured memory_bytes: 5204
n, _ = gets.chomp.split.map(&:to_i)
x = Array.new(n) { gets.chomp.split.map(&:to_i) }
res = 0
(0..n - 2).each do |i|
  (i + 1..n - 1).each do |j|
    dist2 = x[i].zip(x[j]).map {|y, z| (y - z) ** 2 }.inject(:+)
    res += 1 if Math::sqrt(dist2).to_i == Math::sqrt(dist2)
  end
end
puts res

Measured memory_bytes: 1916
import java.util.*;

class Main{
    public static void main(String[] args){
    	Scanner sc= new Scanner(System.in);
        int a,b,c,d;
    	int n=sc.nextInt();
int tp[]=new int[n];
   for(int i=0;i<(n*(n-1))/2;i++){
	   a=sc.nextInt()-1;b=sc.nextInt()-1;
	   c=sc.nextInt();d=sc.nextInt();
	   if(c>d){
		   tp[a]+=3;
	   }else if(c<d){
		   tp[b]+=3;
	   }else{tp[a]++;
	   tp[b]++;}
	   }
    int flag=1;
    for(int i=0;i<n;i++){
    	for(int j=0;j<n;j++){
        	if(tp[i]<tp[j])flag++;
        		}
    	System.out.println(flag);
    	flag=1;
    }
    }
}

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

int main() {
    string _s, s;
    for (int i = 0; i < 3; i++) {
        if (i == 1) cin >> s;
        else cin >> _s;
    }
    cout << 'A' << s.at(0) << 'C' << endl;
}


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

using namespace std;

typedef long long ll;

const ll M = 998244353;

ll n, k;
ll a[3005];
ll b[3005];
ll ans;

int main()
{
    scanf("%lld%lld", &n, &k);
    for(ll i = 0; i < n; i++)
    {
        scanf("%lld", &a[i]);
    }
    b[0] = 1;
    for(ll i = 0; i < n; i++)
    {
        for(ll j = k; j >= 0; j--)
        {
            if(a[i] + j <= k) b[a[i] + j] += b[j], b[a[i] + j] %= M;
        }
        ans += b[k];
        ans %= M;
        b[0]++;
        b[0] %= M;
    }
    cout<<ans<<endl;
    return 0;
}


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

//----------------------------------------------------------------------
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    //-------------------------------  
    //ll begin_time=clock();
    //-------------------------------
    string s;cin>>s;
    if(s[2]==s[3]&&s[4]==s[5]){
        cout<<"Yes"<<Endl;
    }
    else cout<<"No"<<endl;
    //-------------------------------  
    //ll end_time=clock();cout<<"time="<<end_time-begin_time<<"ms"<<endl;
    //-------------------------------
    return 0;
}
//----------------------------------------------------------------------





























Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <algorithm>
#include <bitset>
#include <iomanip>
#include <cstdio>
#include <new>
#include <vector>
#include <cstdlib>
#include <string>
#include <set>

using namespace std;

int main() {
	int k, x;
	cin >> k >> x;

	if (500 * k >= x) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

}



Measured memory_bytes: 3600
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;


pii point[3010];
bool ex[5010][5010];
int main(){
	int n;
	while(~scanf("%d",&n)){
		if(n==0)break;
		memset(ex, false, sizeof(ex));
		memset(point, 0, sizeof(point));
		for(int i=0;i < n;i++){
			scanf("%d %d",&point[i].first,&point[i].second);
			ex[point[i].second][point[i].first]=true;
		}
		sort(point,point+n);
		/*rep(i,n){
			printf("(x,y) =(%d,%d)\n",point[i].first,point[i].second);
		}*/
			int ans =0;
			for(int i=0;i < n;i++){
				for(int j=i+1;j < n;j++){
					int dx =abs(point[j].first-point[i].first);
					int dy =abs(point[j].second-point[i].second);
					int tmp =dx*dx+dy*dy;
					if(tmp<=ans)continue;
				/*printf("(x1,y1) =(%d,%d)\n",point[i].first,point[i].second);
				printf("(x2,y2) =(%d,%d)\n",point[j].first,point[j].second);
				printf("(dx,dy) = (%d,%d)\n",dx,dy);*/
				int nx1 =point[j].first+dy;
				int ny1 =point[j].second+dx;

				int nx2 =point[i].first+dy;
				int ny2 =point[i].second+dx;
				//
				int mnx1 =(point[j].first-dy);
				int mny1 =(point[j].second-dx);

				int mnx2 =(point[i].first-dy);
				int mny2 =(point[i].second-dx);
				/*printf("(nx1,ny1) =(%d,%d)\n",nx1,ny1);
				printf("(nx2,ny2) =(%d,%d)\n",nx2,ny2);
				printf("(mnx1,mny2) =(%d,%d)\n",mnx1,mny1);
				printf("(mnx1,mny2) =(%d,%d)\n",mnx2,mny2);
				cout <<endl;*/
				if(nx1<=5000&&ny1<=5000&&nx2<=5000&&ny2<=5000&&
				   ex[ny1][nx1]&&ex[ny2][nx2]){
					ans=max(ans,tmp);
				//cout <<ans<<endl;
				continue;
			}
			if(mnx1>=0&&mny1>=0&&mnx2>=0&&mny2>=0&&
			   ex[mny1][mnx1]&&ex[mny2][mnx2]){
				ans=max(ans,tmp);
		}
	}
}
printf("%d\n",ans);
}
return 0;
}

Measured memory_bytes: 25732
#include <bits/stdc++.h>
using namespace std;
int main (){
  int i;
  int n,k,c=0,a=1;
  cin>>n>>k;
  a*=k;
  while(n/a>0){
    a*=k;
    c++;
  }
  cout<<c+1<<endl;
  return 0;
}



Measured memory_bytes: 256
N = int(input())

ans = [0 for _ in range(N)]

for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            n = x**2+y**2+z**2+x*y+y*z+z*x
            if n <= N:
                ans[n-1] += 1


print(*ans, sep="\n")

Measured memory_bytes: 9264
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cctype>
#include<map>
#include<cstring>
#include<bitset>
#include<cassert>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,b) for (int (i)=a;(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long int;

const int inf = 1001001000;
const long long int Inf = 1001001001001001000;



void print(vector<vector<int>> a){
	for (int i = 0; i < a.size(); i++)
	{
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<vector<long long int>> a){
	for (int i=0;i<a.size();i++){
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(vector<long long int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(set<int> a){
	for (auto x:a)
		cout << x << " ";
	cout << endl;
}

//繰り返し2乗法を用いたべき乗.x^nを返す.
long long int pow(long long int x,long long int n){
	long long int res = 1;
	while (n)
	{
		if (n&1){
			res *= x;
		}
		n >>= 1;
		x = x * x;
	}
	return res;
}


int main(){
	string s, t;
	cin >> s >> t;
	int n = s.size();
	int ans = 0;
	rep(i, n)
	{
		if (s[i] != t[i])
			ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3852
import java.util.Scanner;

public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		// 出力
		if ((a * b) % 2 == 0) {
			System.out.println("Even");
		} else {
			System.out.println("Odd");
		}
	}
}


Measured memory_bytes: 35648
//Nihal Mittal - nihal_47
//Strike First , Strike Hard , No Mercy !!
 
/**⠀⠀⠀⠀⠀⠀⣀⣤⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣰⣿⣿⣿⣿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣧⢀⠀⠀⠀⠀
⠀⠀⠀⣿⣿⣿⠋⠀⠀⠀⠀⠀⠙⠀⠙⣿⣿⣿⣷⢳⢀⠀⠀⠀
⠀⠀⣠⣿⣿⣿⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⢀
⠀⠀⣸⣿⣿⣿⠸⠀⠀⠀⠒⠒⠒⠐⠀⠀⢿⣿⣿⣿⣿⣿⠀⠀
⠀⣴⣿⣿⣿⡿⠀⠒⣋⣙⡒⢰⠀⠤⣖⠒⢾⣿⣿⣿⣿⣧⠀⠀
⢺⣿⣿⣿⣿⢀⠀⠀⠉⠉⠉⠸⠀⡇⠉⠉⠀⢿⣿⣿⣿⣄⠀⠀
⠀⠙⣿⣿⣧⢻⠀⠀⠀⠀⠀⠠⠀⠰⠀⠀⠀⣸⠸⣿⣿⠿⠰⠀
⠀⠀⠀⠹⣿⣿⣿⣷⠀⡠⠙⣲⣔⣅⢡⣰⣷⣿⣿⣿⣧⠀⠀⠀
⠀⠀⠀⣼⣿⣿⣿⣿⠀⡿⠭⠭⠭⠭⢿⠀⣿⢻⣿⣿⠃⠀⠀⠀
⠀⠀⠀⠙⠛⣿⢻⠹⣿⠐⠙⠛⠟⠉⢀⣴⡟⢿⣿⡏⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⡟⠀⠀⠻⣦⣤⣶⠾⠋⠀⠀⠁⡦⢄⢀⠀⠀⠀
⠀⠀⠀⠀⡠⠁⡇⠑⢄⠀⠀⠀⠀⠀⠀⠔⠀⠀⠁⠀⠀⠀⠉⠁
⠀⠔⠊⠁⠀⠀⣇⠀⠀⠀⠑⡤⠤⢎⠁⠀⠀⡘⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢢⠠⠀⡠⢆⠀⠀⡠⠙⢄⠀⡸⠀
**/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define mk make_pair
#define pb push_back
#define in insert
#define se second
#define fi first
#define mod 1000000007
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define all(v) (v).begin(),(v).end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define pii pair<ll,ll>
#define vi(x) vector<x>
#define maxn 100005
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
using namespace std;
using namespace __gnu_pbds;
 
signed main()
{
    fast;
  
    ld r;
    cin>>r;
    ld pi = 2*3.141592653589793238463;
    ld ans = pi * r;
    cout<<fixed<<setprecision(2)<<ans;
}

Measured memory_bytes: 3800
#include<stdio.h>
#include<stdlib.h>
typedef struct A{char m;int n,f;}A;
A D[100005];
int N,i,flg=0;
void sw(A *a,A *b)
{
	A c=*a;
	*a=*b;
	*b=c;
}

int pt(int p,int r)
{
	int i,j,pos;
	A x;
	x=D[r];
	i=p-1;
	for(j=p;j<r;j++)
	{
		if(D[j].n<=x.n)
		{
			sw(&D[++i],&D[j]);
		}
	}
	sw(&D[i+1],&D[r]);
	return i+1;
}

void qs(int p,int r)
{
	int q;
	if(p<r)
	{
		q=pt(p,r);
		qs(p,q-1);
		qs(q+1,r);
	}
}


int main()
{
	scanf("%d\n",&N);
	for(i=1;i<=N;i++)
	{
		scanf("%c %d\n",&D[i].m,&D[i].n);
		D[i].f=i;
	}
		
	qs(1,N);
	for(i=2;i<=N;i++)
		if(D[i-1].n==D[i].n&&D[i-1].f>D[i].f)
			flg=1;
	puts(flg?"Not stable":"Stable");
	for(i=1;i<=N;i++)
		printf("%c %d\n",D[i].m,D[i].n);
	return 0;
}



Measured memory_bytes: 2908
import Data.Maybe
import Control.Monad
import qualified Data.ByteString.Char8 as C

readInt' = fst.fromJust.C.readInt
readLnInt = map readInt'.C.words<$>C.getLine
readCsInt n = concat<$>replicateM n readLnInt

x ? (a,b) = if x then a else b
a~>(f,x) = [a] ++ (null x)?([],f x)
half = flip div 2
aliq = ((0==).).mod

main = do
  [n] <- readLnInt
  print $ solve n

solve n = half (calc n 1 + calc n 15 - calc n 3 - calc n 5)

calc n a = a*m*(m+1) where
  m = div n a


Measured memory_bytes: 3776
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
using namespace std;
#ifndef FAST_IO
 #define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);
#endif
#define FILE_IO freopen("input.txt","r",stdin);
#define f first
#define int long long
#define s second
#define endl '\n'
#define all(c) c.begin(),c.end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template<typename T>void print(T t){for(auto &it:t)cout<<it<<" ";}
inline int powerexp(int a,int b,int m){int res=1;while(b){if(b&1)res=res*a%m;a=a*a%m,b>>=1;}return res%m;}
const int MAXN=1e5+1;
bool isprime[MAXN];
int v[MAXN];
void solve(){
   string s;
   cin>>s;
   for(int i=0;i<(int)s.size();i++)if(i%2==0)cout<<s[i];
}
//-----------------------------
//comment from here for TOPCODER 
int32_t main(){
    IOS;
    solve();
    #ifdef LOCAL_DEFINE
    cerr<<"time elapsed "<<(double)clock()/CLOCKS_PER_SEC<<endl;
    #endif
}


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

signed main(){
  int N;
  cin>>N;
  vector<int> L(N);
  rep(i,N)cin>>L[i];
  sort(begin(L),end(L));
  
  int ans=0;
  rep(i,N){
    rep(j,i){
      rep(k,j){
        if(L[k]!=L[j]&&L[j]!=L[i]&&L[k]+L[j]>L[i])ans+=1;
      }
    }
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3644
#include "bits/stdc++.h"
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(s) s.begin(), s.end()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
const int DIV = 1e9+7;

const int MAX_N = 1000;
int par[MAX_N];
int rnk[MAX_N];

void init(int n){
    rep(i,n){
        par[i] = i;
        rnk[i]=0;
    }
}
int find(int x){
    if(par[x] == x){
        return x;
    }
    else{
        return par[x] = find(par[x]);
    }
}
void unite(int x, int y){
    x = find(x);
    y = find(y);
    if(x == y) return;

    if(rnk[x] < rnk[y]){
        par[x] = y;
    }
    else{
        par[y] = x;
        if(rnk[x] == rnk[y]) rnk[x]++;
    }
}
bool same(int x, int y){
    return find(x) == find(y);
}

int n,m;

int main(int argc, char const* argv[])
{
    cin >> n >> m;
    vp edges;
    rep(i,m){
        int a,b;
        cin >> a >> b;
        edges.pb(mp(a-1,b-1));
    }
    int ans = 0;
    rep(i,m){
        init(n);
        rep(j,m){
            if(i == j) continue;
            unite(edges[j].fi, edges[j].se);
        }
        bool fl = false;
        for(int k = 1; k < n; k++){
            if(!same(k-1,k)) fl = true;
        }
        if(fl) ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
 
 
int main() {
 
  string S;
  cin>>S;
  
  int cnt=0;
  for(int i=0;i<S.size();i++){
    if(S.at(i)=='1')
      cnt++;
  }
  
  cout<<cnt<<endl;
  
  return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;
import java.math.*;
public class Main {

	public static void main(String[] args) throws IOException {
		try(BufferedReader kb = new BufferedReader(new InputStreamReader(System.in))){
			for (String in = kb.readLine() ; in != null; in = kb.readLine()) {
				StringTokenizer st = new StringTokenizer(in);
				int x = Integer.parseInt(st.nextToken());
				int y = Integer.parseInt(st.nextToken());
				System.out.println(solve(x,y));
			}
		}
	}

	private static int solve(int x, int y) {
		if(Math.abs(x) == Math.abs(y)){
			return 1;
		}
		else if(x > 0 && y > 0){
			if(x < y) return y-x;
			else return x-y+2;
		}
		else if(x < 0 && y < 0){
			if(x > y) return (y*-1)+x+2;
			else return (x*-1)+y;
		}
		else if (y==0&&x<y){
			return Math.abs(x);
		}
		else if (x==0){
			if(y>x)
			return y;
			else
				return Math.abs(y)+1;
		}
		else if(Math.abs(x) > Math.abs(y) && x<y){
			return Math.abs(x)-y+1;
		}
		else if(Math.abs(x) < Math.abs(y) && x>y){
			return Math.abs(y)-x+1;
		}
		else if(x < y){
			return y - x*-1  + 1;
		}
		else 
			return x - y*-1 + 1;

	}
}


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

public class Main
{
	public static void main(String[] args) { new Main(); }
	FS in = new FS();
	PrintWriter out = new PrintWriter(System.out);
	
	int len;
	char[] str;
	boolean found = false;
	
	Main() {
		len = (str = in.next().toCharArray()).length;
		for (int i = 0; i < len - 1; i++) {
			if (str[i] == str[i + 1]) {
				out.printf("%d %d%n", i + 1, i + 2);
				found = true;
				break;
			}
			if (i < len - 2 && str[i] == str[i + 2]) {
				out.printf("%d %d%n", i + 1, i + 3);
				found = true;
				break;
			}
		}
		if (!found)
			out.printf("%d %d%n", -1, -1);
		out.close();
	}
	
		
	
	class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");
		String next() {
			while (!st.hasMoreTokens()) {
				try { st = new StringTokenizer(br.readLine()); }
				catch (Exception e) {}
			} return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next()); }
		long nextLong() { return Long.parseLong(next()); }
		double nextDouble() { return Double.parseDouble(next()); }
	}
}


Measured memory_bytes: 22228
N = gets.chomp.to_i
W = Array.new(N)
sum = 0

str = gets.split
for x in 0...N
  W[x] = str[x].to_i
  sum += W[x]
end

half = (sum+1)/2
s1 = 0
s1a = 0
s1b = 0
i = 0
while s1 < half
  s1a = s1
  s1 += W[i]
  i += 1
end
s1b = s1

sub1 = sum - s1a*2
sub2 = sum - (sum-s1b)*2

if sub1 < sub2
  puts sub1
else
  puts sub2
end

Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
#define LL long long

const int maxn=1e5+10;
const int mo=1e9+7;

int n,dp[maxn],pre[maxn];
LL A,B,S[maxn];

int main()
{
#ifdef h10
	freopen("C.in","r",stdin);
	freopen("C.out","w",stdout);
#endif
	int i,L=0,R=0;
	scanf("%d%lld%lld",&n,&A,&B);
	if (A>B) swap(A,B);
	for (i=1;i<=n;i++)
		scanf("%lld",&S[i]);
	for (i=3;i<=n;i++)
		if (S[i]-S[i-2]<A) {puts("0"); return 0;}
	S[0]=S[1]-B;
	dp[0]=pre[0]=1;
	for (i=1;i<=n;i++)
	{
		while (S[i]-S[R+1]>=B) R++;
		if (L<=R) dp[i]=(pre[R]+mo-(L?pre[L-1]:0))%mo;
		pre[i]=(pre[i-1]+dp[i])%mo;
		if (S[i]-S[i-1]<A) L=i-1;
	}
	printf("%d\n",(pre[n]+mo-(L?pre[L-1]:0))%mo);
}


Measured memory_bytes: 1792
import java.util.Scanner;
public class Main {
 public static void main(String[]args){
Scanner scan = new Scanner(System.in);
  int A = scan.nextInt();
  int B = scan.nextInt();
  int C = scan.nextInt(); 
  int D = scan.nextInt();
  while ((A>0) && (C>0)){
   C=C-B;
   if (C<=0){
    System.out.println("Yes");
    break;
   }
   A=A-D;
   if (A<=0) {
    System.out.println("No");}
  }
 }
}

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

#define rep(i, n) rep2(i, 0, n)
#define rep2(i, m, n) for (ll i = m; i < (n); i++)

using ll = long long;
using pii = pair<int, int>;
using Vi = vector<int>;

int main() {
  int X;
  cin >> X;
  int ans1 = 1;
  int ans2 = 1;
  for(int b = 2; b<= X; b++){
    for(int p = 2; pow(b,p)<= X; p++){
      ans1 = pow(b,p);
    }
    ans2 = max(ans2,ans1);
  }
  cout << ans2 << endl;
}      
    

Measured memory_bytes: 3944
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define FOR(i, x, y) for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i)
#define FORD(i, x, y) for (decay<decltype(x)>::type i = (x), _##i = (y); i > _##i; --i)
#ifdef zerol
#define dbg(x...) do { cout << "\033[32;1m" << #x << " -> "; err(x); } while (0)
void err() { cout << "\033[39;0m" << endl; }
template<template<typename...> class T, typename t, typename... A>
void err(T<t> a, A... x) { for (auto v: a) cout << v << ' '; err(x...); }
template<typename T, typename... A>
void err(T a, A... x) { cout << a << ' '; err(x...); }
#else
#define dbg(...)
#endif
// -----------------------------------------------------------------------------

const int N = 1E5 + 100;
vector<int> G[N];

int go(int u, int fa) {
    int ret = 0;
    for (int v: G[u]) {
        if (v == fa) continue;
        ret ^= go(v, u) + 1;
    }
    return ret;
}

int main() {
    int n; cin >> n;
    FOR (i, 0, n - 1) {
        int u, v; cin >> u >> v;
        G[u].push_back(v); G[v].push_back(u);
    }
    puts(go(1, 0) ? "Alice" : "Bob");
}

Measured memory_bytes: 10368
import sys
input = sys.stdin.readline
n = int(input())
s = tuple(map(lambda x: ord(x) - ord("a") + 1, input()))
base = 1007
mod = 2**61 - 1

length = n//2
b = [1] * (length + 1)
shash = [0] * (length+1)
for i in range(1, length + 1):
    b[i] = b[i-1] * base % mod
    shash[i] = (shash[i - 1] * base + s[i - 1]) % mod

for ans in reversed(range(1, length+1)):
    # calc hash
    hash_ = 0
    check = {}
    #y = set([])
    for left in range(n - ans + 1):
        if left == 0:
            hash_ = shash[ans]
            check[hash_] = left
            #y.add(hash_)
        else:
            hash_ = base * hash_ - b[ans] * s[left - 1] + s[left + ans - 1]
            hash_ %= mod
            if hash_ in check.keys():
                # print("tmp = ", tmp)
                if check[hash_] <= left - ans:
                    print(ans)
                    # a = check[hash_][tmp-1]
                    # at = "".join(map(lambda x: chr(x + ord("a")), s[a:a+ans]))
                    # for j in range(ans):
                        # if s[a+j] != s[left+j]:
                            # print("Fail")
                            # exit()
                    # print("Success")
                    sys.exit()
            else:
                check[hash_] = left
                #y.add(hash_)
        # print(hash_, s[left:left+ans])
print(0)



Measured memory_bytes: 221860
N,W=map(int,input().split())
DP=[[0 for j in range(W+1)] for i in range(N+1)]
v=[0]*(N+1)
w=[0]*(N+1)
for i in range(1,N+1):
    v[i],w[i]=map(int,input().split())
for i in range(1,N+1):
    for j in range(1,W+1):
        if j<w[i]:
            DP[i][j]=DP[i-1][j]
        else:
            DP[i][j]=max(DP[i-1][j],DP[i-1][j-w[i]]+v[i])
print(DP[N][W])


Measured memory_bytes: 25940
// Package main provides
//
// File:  c.go
// Author: ymiyamoto
//
// Created on Sun Dec 30 22:53:11 2018
//
package main

import "fmt"

func bits(b int) int {
	ret := 0
	for i := byte(0); i < 32; i++ {
		if b&(1<<byte(i)) != 0 {
			ret++
		}
	}
	return ret
}

func main() {
	var N int
	fmt.Scan(&N)

	m := map[byte]int{}
	for i := 0; i < N; i++ {
		var s string
		fmt.Scan(&s)
		m[s[0]]++
	}

	ans := 0
	for i := 0; i < 1<<5; i++ {
		if bits(i) != 3 {
			continue
		}

		t := []byte{'M', 'A', 'R', 'C', 'H'}
		num := 1
		for j := 0; j < 5; j++ {
			if i&(1<<uint8(j)) != 0 {
				num *= m[t[j]]
			}
		}
		ans += num
	}

	fmt.Println(ans)
}


Measured memory_bytes: 5504
#include<stdio.h>

int main(){
	int n,p,x,y,a,b,i;
	while(scanf("%d",&n)!=EOF){
		if(n==0)break;
		a=0;
		for(i=0;i<n;i++){
			scanf("%d%d%d",&p,&x,&y);
			if(x+y>a)a=x+y,b=p;
		}
		printf("%d %d\n",b,a);
	}
	return 0;
}

Measured memory_bytes: 416
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<numeric>
#include<iomanip>
#include<deque>
#include<tuple>
#include<queue>
#include<map>
#include <cstdint>
#include<unordered_map>
#include <boost/multiprecision/cpp_int.hpp>


#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define Endl endl
#define F first
#define S second

namespace mp = boost::multiprecision;

using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;


int main() {
	int n;
	scanf("%d",&n);
	unordered_map<int, int>a;
	rep(i, n) {
		int m;
	    scanf("%d",&m);
		if (a.count(m)) {
			a.erase(m);
		}
		else {
			a[m] = 1;
		}
	}
	cout << a.size() << endl;
}


Measured memory_bytes: 4388
#include <cstdio>
#include <cctype>
#include <cstring>
#define int long long

struct Trie {
    int cnt, root, go[8000000][10], val[8000000];
    Trie() {
        memset(go, 0, sizeof(go));
        memset(val, 0, sizeof(val));
        root = cnt = 0;
    }
    void add(int num, int v) {
        int now = root;
        while(num) {
            int k = num % 10;
            if(!go[now][k]) go[now][k] = ++cnt;
            now = go[now][k], num /= 10;
        }
        val[now] += v;
    }
    int query(int num) {
        int now = root;
        while(num) {
            int k = num % 10;
            if(!go[now][k]) return 0;
            now = go[now][k], num /= 10;
        }
        return val[now];
    }
} b;

int n, k, ans = 0;
int fs[200010];

int read() {
    int ret, f = 1;
    char ch;
    while(!isdigit(ch = getchar())) (ch == '-') && (f = -1);
    for(ret = ch - '0'; isdigit(ch = getchar()); ret *= 10, ret += ch - '0');
    return ret * f;
}

void print(int x) {
    if(x < 0) putchar('-'), x = -x;
    if(x > 9) print(x / 10);
    putchar(x % 10 + '0');
}

signed main() {
    n = read(), k = read();
    for(int i = 1; i <= n; ++i) fs[i] = fs[i - 1] + read();
    b.add(0, 1);
    int j = 0;
    for(int i = 1; i <= n; ++i) {
        if(i >= k) b.add((fs[j] - j + k) % k, -1), ++j;
        ans += b.query((fs[i] - i + k) % k);
        b.add((fs[i] - i + k) % k, 1);
    }
    print(ans);
    return 0;
}

Measured memory_bytes: 689280
// atcoder/abc141/D/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  lli n, m;
  while (cin >> n >> m) {
    vector<lli> v(n);
    cin >> v;

    priority_queue<lli> q;
    each (i, v) q.push(i);

    for (int i = 0; i < m; ++i) {
      lli x = q.top();
      q.pop();
      q.push(x / 2);
    }

    lli sum = 0;
    while (q.size()) {
      sum += q.top();
      q.pop();
    }
    cout << sum << endl;
  }

  return 0;
}


Measured memory_bytes: 2168
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...
    vector<int> a(3);
    cin >> a[0] >> a[1] >> a[2];
    sort(a.begin(), a.end());
    cout << a[2]-a[0] << endl;
    return 0;
}

Measured memory_bytes: 256
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::io::{BufWriter, Write};

// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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")
    };
}

fn solve() {
    input!(
        s: chars,
    );
    let mut a = Vec::new();
    a.resize(s.len(), 0);
    let mut ans = 0;
    let mut tmp = 0;
    for i in 0..s.len() {
        if vec!['A','G','C','T'].contains(&s[i]) {
            tmp += 1;
        }
        else {
            tmp = 0;
        }
        ans = max(ans, tmp);
    }
    println!("{}", ans);
}

fn main() {
    let stack_size = 1 << 28;
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


Measured memory_bytes: 8572
#include <bits/stdc++.h>
#define REP(i,n) for (int i=0;i<(n);i++)
#define All(v) (v).begin(),(v).end()
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
using namespace std;
typedef long long llint;
typedef pair<int, int> P;
const int MOD = (int)1e9 + 7;
const int INF = 999999999;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int pee = -1;
    string s, t;
    cin >> s;
    cin >> t;
    REP(i, s.size()-t.size()+1){
        string tmp = s.substr(i, t.size());
        bool flag = true;
        REP(j, t.size()){
            if(tmp[j] != '?' && tmp[j] != t[j]){
                flag = false;
                break;
            }
        }
        if(flag){
            pee = i;
        }
    }
    if(pee == -1) cout << "UNRESTORABLE\n";
    else{
        int p=0;
        for(p=0; p<pee; p++){
            cout << (s[p]=='?' ? 'a' : s[p]);
        }
        for(; p<pee+t.size(); p++){
            cout << t[p-pee];
        }
        for(; p<s.size(); p++){
            cout << (s[p]=='?' ? 'a' : s[p]);
        }
        cout << "\n";
    }
    return 0;
}


Measured memory_bytes: 256
N, K = [int(i) for i in input().split()]
B = sorted([int(i) for i in input().split()])
D ={}
bag = 0

for i in B:
    if i in D:
        D[i] += 1
    else:
        D[i] = 1

LLL = sorted(list(D.values()))
AA = len(D) - K
if len(D) <= K:
    print(0)
else:
    for i in range(AA):
        bag += LLL[i]
    print(bag)

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

int main(void) {
    int s, m, h;
    cin >> s;
    h = s / 3600;
    s %= 3600;
    m = s / 60;
    s %= 60;
    cout << h << ":" << m << ":" << s << endl;
    return 0;
}

Measured memory_bytes: 1168
import java.util.*;
 
public class Main{
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next().substring(5, 7);
        int ss = Integer.parseInt(s);
        if(ss>4){
            System.out.println("TBD");
        }else{
            System.out.println("Heisei");
        }
    }
}


Measured memory_bytes: 21716
#include <stdio.h>

#define AMAX 2000
#define MMAX 2000

int solve(int ,int );

int A[AMAX],n,Mi[MMAX];

int main(){
  int i,q;
  
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&Mi[i]);
  }
  
  for(i=0;i<q;i++){
    if(solve(0,Mi[i])==1){
      printf("yes\n");
    }
    else{
      printf("no\n");
    }
  }
  return 0;
}

int solve(int i,int m){
  if(A[i]==m){
    return 1;
  }
  if(i+1==n){
    return 0;
  }
  if(solve(i+1,m-A[i])||solve(i+1,m)){
    return 1;
  }
  return 0;
}

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

int main(void) {
    int n;
    string s;
    cin >> n >> s;
    int ans = 0;
    int ptr = 0;
    while (ptr < n) {
        if (s[ptr++] == 'A') {
            if (s[ptr] == 'B') {
                ptr++;
                if (s[ptr] == 'C') {
                    ans++;
                    ptr++;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3548
#n=int(input())
#a,b=map(int,input().split())
#l=list(map(int,input().split()))
#l=[list(map(int,input().split())) for i in range(n)]
s=list(input())
t=list(input())
count=0
for si, vi in zip(s,t):
    if si!=vi:
        count+=1
print(count)


Measured memory_bytes: 12496
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if ((a * b) % 2 == 0)
            System.out.println("Even");
        else
            System.out.println("Odd");
    }
}

Measured memory_bytes: 21712
#include <bits/stdc++.h>
#include <stdio.h>
 
using namespace std;
 const int M=1e9+7;

#define int long long
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(i, a) for (auto &i: (a))
#define sz(x) (int)(x).size()
#define all(v) v.begin(), v.end()
int mod(int x){ 
return ((x%M+M)%M);
}
int add(int a,int b)
{
    return mod(mod(a)+mod(b));
}
int mul(int a,int b)
{
    return mod(mod(a)*mod(b));
}
void solve();

signed main () {
    cout.precision(10);
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
    #endif
   
       int t;
       cin>>t;
       int ans=0,num=0;
       while(t--)
       {
           int a,b;
           cin>>a>>b;
           if(a==b)
           ans++;
           else
           {
               ans=0;
           }
           
           if(ans==3 && num==0)
           num=ans;
           
           
       }
         if(num==3)
         cout<<"Yes"<<endl;
         else
         {
             cout<<"No"<<endl;
         }
         
    return 0;
}

Measured memory_bytes: 3668
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
const Int MOD = 1000000007;
const Int MAX = 300000;
Int POW2[MAX];
int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    POW2[0] = 1;
    for (int i = 1; i < MAX; i++) POW2[i] = POW2[i - 1] * 2 % MOD;
    int N; cin >> N;
    vector<int> C(N); for (auto &c : C) cin >> c;
    sort(begin(C), end(C));
    Int ans = 0;
    for (int i = 0; i < N; i++) {
        Int n = N - 1 - i;
        Int t = 0;
        if (n != 0) {
            t = POW2[n - 1] * (n + 2) % MOD;
        } else {
            t = 1;
        }
        t = t * C[i] % MOD * POW2[i] % MOD;
        ans = (ans + t) % MOD;
    }
    ans = ans * POW2[N] % MOD;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3456
N = int(input())
W = [input() for x in range(N)]
counter=0
def isunique(seq):
    return len(seq) == len(set(seq))

if isunique(W) == False:
    print("No")
else:
    for i in range(N-1):
        if W[i][-1]==W[i+1][0]:
            counter += 0
        else:
            counter += 1
    if counter ==0:
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 3060