akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define FOR(I,X,Y) for(int I=X;I<Y;I++)
#define REP(I,X,Y) for(int I=Y-1;I>=X;I--)
#define INF 1000000007
using namespace std;

int main(){
  int N,a,b,fennec=0,sunuke=0;
  cin >> N;
  vector<vector<int>> adj(N+1);
  FOR(i,0,N-1){
    cin >> a >> b;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  queue<int> que;
  int bfs1[N+1];
  FOR(i,0,N+1)bfs1[i] = -1;
  que.push(1);
  bfs1[1] = 0;
  while(que.size()){
    for(auto x:adj[que.front()]){
      if(bfs1[x] == -1){
        que.push(x);
        bfs1[x] = bfs1[que.front()]+1;
      }
    }
    que.pop();
  }
  int bfsN[N+1];
  FOR(i,0,N+1)bfsN[i] = -1;
  que.push(N);
  bfsN[N] = 0;
  while(que.size()){
    for(auto x:adj[que.front()]){
      if(bfsN[x] == -1){
        que.push(x);
        bfsN[x] = bfsN[que.front()]+1;
      }
    }
    que.pop();
  }
  FOR(i,1,N+1){
    if(bfs1[i] <= bfsN[i])fennec++;
    else sunuke++;
  }
  if(fennec > sunuke)cout << "Fennec" << endl;
  else cout << "Snuke" << endl;
}


Measured memory_bytes: 6528
# coding: utf-8

N = int(input())
S_P = [input().split() for _ in range(N)]
S_P = [tuple([s_p[0], int(s_p[1]), i]) for i, s_p in enumerate(S_P)]

S_P = sorted(S_P, key=lambda x: x[1])[::-1]
S_P = sorted(S_P, key=lambda x: x[0])
print("\n".join([str(x[2] + 1) for x in S_P]))


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(long long i=0; i<n; i++)
#define repr(i,n,m) for(long long i=m; i<n; i++)
#define mod 1000000007
#define sorti(x) sort(x.begin(), x.end())
#define sortd(x) sort(x.begin(), x.end(), std::greater<long long>())
#define debug(x) std::cerr << (x) << std::endl;
#define roll(x) for (auto&& itr : x) { cerr << (itr) << " "; }

template <class T> inline void chmax(T &ans, T t) { if (t > ans) ans = t;}
template <class T> inline void chmin(T &ans, T t) { if (t < ans) ans = t;}

template <class T>
T inf = numeric_limits<T>::max();

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

  ll N;
  cin >> N;

  ll t1 = N / 500;
  N -= t1 * 500;
  ll t2 = N / 5;
  
  ll ans = t1 * 1000 + t2 * 5;
  cout << ans << endl;
}


Measured memory_bytes: 3636
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>

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

using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define P pair<ll, ll>
#define sz(x) (ll)x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<ll>
#define COUT(x) cout<<(x)<<endl
#define MA map<ll,ll>
#define SE set<ll>
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,VE,greater<ll>>
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl

ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	return gcd(b, a % b);
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
bool prime(ll n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}


const long long MOD = 1000000007;
const long long INF = 1e9;
const long long LINF = 1LL << 50;
#define int long long

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n; cin >> n;
	int sum = 0;
	VE a(n); rep(i, n)cin >> a[i];
	rep(i, n)sum += a[i];
	VE x(n);
	int tmp = 0;
	rep(i, n) {
		if (i % 2 == 1)tmp += a[i];
	}
	x[0] = sum - 2 * tmp;
	rep(i, n - 1) {
		x[i + 1] = 2 * a[i] - x[i];
	}
	rep(i, n) {
		cout << x[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 2944
#include <bits/stdc++.h>
 
using namespace std;
 
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl;
#define DEBUG_MAT(v) cerr<<#v<<endl;for(int i=0;i<v.size();i++){for(int j=0;j<v[i].size();j++) {cerr<<v[i][j]<<" ";}cerr<<endl;}
typedef long long ll;
// #define int ll
 
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(int)(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = (ll)1e18 + 1;
const long double pi = 3.1415926535897932384626433832795028841971L;
#define Sp(p) cout<<setprecision(25)<< fixed<<p<<endl;
// int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
// int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
vi dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};
// vi dx2 = { 1,1,0,-1,-1,-1,0,1 }, dy2 = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
const ll MOD = 1000000007;
// const ll MOD = 998244353;
// #define mp make_pair
//#define endl '\n'


signed main() {
    fio();
    int n, k;
    cin >> n >> k;
    
    vi a(n);
    rep (i, n) cin >> a[i];

    int ok = inf, ng = 0;
    while (ng + 1 < ok) {
        int mid = (ok + ng) / 2;
        ll cnt = 0;
        rep (i, n) {
            if (a[i] > mid) {
                int num;
                if (a[i] % mid == 0) num = a[i] / mid - 1;
                else num = a[i] / mid;
                cnt += num;
            }
        }

        if (cnt <= k) ok = mid;
        else ng = mid;
    }
    cout << ok << endl;
}

Measured memory_bytes: 3928
/**akshaykumar99**/

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
template<typename T> using id_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update> ;
template<typename T> using id_setp = tree<pair<T,T>,null_type,less<pair<T,T>>,rb_tree_tag,tree_order_statistics_node_update> ;
 
#define f(i,x,n) for(i=x;i<n;i++)
#define fr(i,x,n) for(i=x;i>=n;i--)
#define pu push_back           
#define pp pop_back
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SP(x) fixed<<setprecision(x)
#define IOS() ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
const long long MOD=1e9+7;
const long double PI = acos(-1);
const long long INF=INT_MAX;
const long long LINF=LLONG_MAX;
const long long N=2e5+1;
 
typedef long long ll;
typedef long double ld;

int main() 
{
   IOS();
	ll n,i,j,ans=0;
   cin>>n;
   string s;
   cin>>s;
   f(i,0,n-2)
   {
      if(s[i]=='A' && s[i+1]=='B' && s[i+2]=='C')
         ans++;
   }
   cout<<ans<<'\n';
   	
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i = a; i <= b; i++)
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll, ll> pi;
typedef vector<pi> vii;
const int N = 10;
int a[N][N];
int n, m;
int v[N];
ll ans;
int main()
{
    cin >> n >> m;
    FOR(i, 1, n - 1) v[i] = i + 1;
    FOR(i, 1, m)
    {
        int x, y;
        cin >> x >> y;
        a[x][y] = 1;
        a[y][x] = 1;
    }
    do
    {
        bool ok = 1;
        if(a[1][v[1]] == 0) ok = 0;
        FOR(i, 1, n - 2)
        {
            if(a[v[i]][v[i + 1]] == 0)
            {
                ok = 0;
                break;
            }
        }
        if(ok) ans++;
    }while(next_permutation(v + 1, v + n));
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
n,k=map(int,input().split())
mod=10**9+7
ans=0
d=[0]*(k+1)
for i in range(k,0,-1):
	c=k//i
	t=pow(c,n,mod)
	t+=(d[i]//mod+1)*mod-d[i]
	t%=mod
	ans+=t*i
	ans%=mod
	for j in range(1,int(i**.5)+1):
		if i%j==0:
			d[j]+=t
			if j!=i//j:
				d[i//j]+=t
print(ans)


Measured memory_bytes: 12068
#include <iostream>
#include <algorithm>
#include <cmath>
#include <climits>
#include <vector>
#include <cstring>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <string.h>
#include <iomanip>
using namespace std;
#define int long long
#define ull unsigned long long
#define F first
#define S second
#define nl "\n"
#define ld long double
#define div 1000000007
#define pi 3.14159265358979323846
#define pb push_back
int a[150];
int k;
int dp[150][5][2];

int f(int pos,int n,int cnt,bool flag)
{
    if(cnt>k)
        return dp[pos][cnt][flag]=0;
    if(pos==n)
    {
        if(cnt==k)
            return dp[pos][cnt][flag]=1;
        else
            return dp[pos][cnt][flag]=0;
    }
    if(dp[pos][cnt][flag]!=-1)
        return dp[pos][cnt][flag];
    int limit=9;
    if(flag==false)
        limit=a[pos];
    int res=0;
    for(int i=0;i<=limit;i++)
    {
        int ncnt=cnt;
        if(i!=0)
            ncnt++;
        if(flag || i<limit)
            res+=f(pos+1,n,ncnt,true);
        else
            res+=f(pos+1,n,ncnt,false);
    }
    return dp[pos][cnt][flag]=res;
}

void solve()
{
    string s;cin>>s;
    cin>>k;
    for(int i=0;i<s.length();i++)
        a[i]=s[i]-'0';
    int n=s.length();
    memset(dp,-1,sizeof(dp));
    int ans=f(0,n,0,0);
    cout<<ans<<nl;
}

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);

    int t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}


Measured memory_bytes: 3636
#include<stdio.h>
int main(void)
{
  int flag=0,i,N,Snin=0,l[100000],r[100000];


  scanf("%d",&N);

  for(i=1; i<=N; i++){
    scanf("%d %d",&l[i],&r[i]);
  }

  for(i=1; i<=N; i++){
    Snin=Snin+r[i]-l[i]+1;
  }  
 
  printf("%d\n",Snin);
  
  return 0;
}


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

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)

template<class T> bool umin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool umax(T &a, T b) { return a < b ? (a = b, true) : false; }

using namespace std;

bool is_pal(const string& s)
{
	forn(i, s.size()/2)
	{
		if (s[i] != s[s.size() - 1 - i])
			return false;
	}
	return true;
}

int main(int argc, char** argv) 
{
#ifdef HOME
	if(IsDebuggerPresent())
	{
		freopen("../in.txt", "rb", stdin);
		freopen("../out.txt", "wb", stdout);
	}
#endif
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.precision(10);
	cout << fixed;
	string S;
	cin >> S;

	bool ok = is_pal(S) && is_pal(S.substr(0, S.length()/2));
	if (ok)
		cout << "Yes\n";
	else
		cout << "No\n";

	return 0;
}


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

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

  int lastIndex = s.length() - 1;
  string replacementChar = std::to_string(s.length() - 2);
  string ans = s.replace(1, lastIndex - 1, replacementChar);

  cout << ans << endl;
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var n, m int
	fmt.Scan(&n, &m)

	k := make([]int, m)
	s := make([][]int, m)
	for i := 0; i < m; i++ {
		fmt.Scan(&k[i])
		var tmp int
		for j := 0; j < k[i]; j++ {
			fmt.Scan(&tmp)
			s[i] = append(s[i], tmp)
		}
	}

	p := make([]int, m)
	for i := 0; i < m; i++ {
		fmt.Scan(&p[i])
	}

	var cnt int
	for b := 0; b < 1 << uint(n); b++ {
		ok := true
		for i := 0; i < m; i++ {
			var swSum int
			for _, sw := range s[i] {
				isOn := b & (1 << uint(sw-1)) > 0
				if isOn {
					swSum++
				}
			}
			if swSum % 2 != p[i] {
				ok = false
				break
			}
		}
		if ok {
			cnt++
		}
	}
	fmt.Println(cnt)
}

Measured memory_bytes: 512
#include<iostream>
#include<numeric>
#include<vector>
#include<string>
#include<queue>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= (int)end; --i)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
template<typename T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return 0;}
template<typename T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return 0;}

void solve() {
    int N;
    cin >> N;
    vector<ll> K(N), L(N), R(N);
    rep(i, 0, N) {
        cin >> K[i] >> L[i] >> R[i];
        --K[i];
    }
    vector<vector<ll>> ldiffs(N), rdiffs(N);
    ll ans = 0;
    rep(i, 0, N) {
        if (L[i] >= R[i]) {
            ldiffs[K[i]].push_back(L[i] - R[i]);
            ans += R[i];
        } else {
            rdiffs[K[i]].push_back(R[i] - L[i]);
            ans += L[i];
        }
    }
    priority_queue<ll, vector<ll>, greater<ll>> lque, rque;
    rep(i, 0, N) {
        for (auto& diff : ldiffs[i]) {
            lque.push(diff);
            ans += diff;
        }
        while ((int)lque.size() > i + 1) {
            ll min_diff = lque.top();
            lque.pop();
            ans -= min_diff;
        }
    }
    rrep(i, N, 0) {
        for (auto& diff : rdiffs[i]) {
            rque.push(diff);
            ans += diff;
        }
        while ((int)rque.size() > N - i - 1) {
            ll min_diff = rque.top();
            rque.pop();
            ans -= min_diff;
        }
    }
    cout << ans << endl;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int T;
    cin >> T;
    rep(i, 0, T) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 24396
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<char> vchar;
typedef vector<vector<char>> vvchar;
typedef vector<int> vint;
typedef vector<vector<int>> vvint;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef priority_queue<long long> prque;
#define ain(i,n,a) for(long long i=0;i<(long long)(n);i++){cin>>a[i];}
#define aout(i,n,a) for(long long i=0;i<(long long)(n);i++){if(i){cout<<" ";}cout<<a[i];if(i==n-1){cout<<endl;}}
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define vsort(v) sort((v).begin(),(v).end())
#define vrsort(v) sort((v).rbegin(),(v).rend())
#define vreverse(v) reverse((v).begin(),(v).end())
#define pf(a) push_front(a)
#define pb(a) push_back(a)
#define INF 1998021900
#define MOD 1000000007
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  //input
  ll n,k,i;cin>>n>>k;vll a(n);ll sum=0;
  for(i=0;i<n;i++){
    cin>>a[i];sum+=a[i];
  }
  //caricurate
  ll sq=sqrt(sum);prque soin;
  for(i=sq;i>0;i--){
    if(sum%i==0){soin.push((sum/i));soin.push(i);}
  }
  
  while(!soin.empty()){
    ll pk=soin.top();soin.pop();ll g=0;ll f=0;vll c(n);
    for(i=0;i<n;i++){
      c[i]=a[i]%pk;g+=c[i];
    }
    vsort(c);
    for(i=n-(g/pk)-1;i>-1;i--){
      f+=c[i];
    }
    if(f<k+1){cout<<pk<<endl;return 0;}
  }
}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#include<set>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define brep(index,num) for(int index=num-1;index>=0;index--)
#define brep1(index,num) for(int index=num;index>0;index--)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef long long ll;
typedef long double ld;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int x,y;
	scan(x>>y);
	if(x+y==2) prin(1000000);
	else prin(max(0,(4-x)*100000)+max(0,(4-y)*100000));
	return 0;
}


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

using namespace std;

// Utility
#define rep(i,n) for(int i = 0; i < (n); ++i)

// Sorting
void insertionSort(int n,int*a,int g=1){for(int i=g;i<n;++i){int v=a[i],j=i-g;while(j>=0&&a[j]>v){a[j+g]=a[j];j-=g;}a[j+g]=v;}}
void shellSort(int n,int*a){vector<int>G;for(int h=1;;){if(h>n)break;G.push_back(h);h=3*h+1;}for(int i=G.size()-1;i>=0;--i)insertionSort(n,a,G[i]);}
int bubbleSort(int n,int*a){int s=0,j;bool f=1;for(int i=0;f;++i){f=0;for(j=n-1;j>=i+1;--j){if(a[j]<a[j-1]){swap(a[j],a[j-1]);f=1;s++;}}}return s;}
int selectionSort(int n,int*a){int s=0,j,m;for(int i=0;i<n-1;++i){m=i;for(j=i;j<n;++j)if(a[j]<a[m])m=j;swap(a[i],a[m]);if(i!=m)++s;}return s;}

// Searching
int binarySearch(int n,int*a,int k){int m,l=0,r=n;while(l<r){m=l+(r-l)/2;if(k<a[m])r=m;else if(a[m]<k)l=m+1;else return m;}return-1;}

// Mathematics
int gcd(int a,int b){!b?a:gcd(b,a%b);}
int lcm(int a,int b){return a/gcd(a,b)*b;}

// Visualization
void printArray(int n,int*a){for(int i=0;i<n;++i)printf(i>0?" %d":"%d",a[i]);printf("\n");}

int main(){
	char c; cin >> c;
	cout << (char)(c+1) << endl;
}

Measured memory_bytes: 256
//
//  main.cpp
//  Problem Code
//
//  Created by Algo张伯威 on 2020/4/24.
//  Copyright © 2020 Algo张伯威. All rights reserved.
//

#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <map>
#include <cstdlib>
#include <vector>
#include <iostream>
#include <set>
using namespace std;

char s[20], t[20];

int main() {
    scanf("%s%s", s, t);
    int n, m;
    n = strlen(s);
    m = strlen(t);
    if(n != m - 1) {
        printf("No\n");
        return 0;
    }
    for(int i = 0; i < n; i++) {
        if(s[i] != t[i]){
            printf("No\n");
            return 0;
        }
    }
    printf("Yes\n");
    
    return 0;
}






















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

using ll = long long;
#define rep(i, n) for (long long i = 0; i < (n); ++i)
#define repr(i, a, b) for (auto i = (a); i < (b); ++i)
#define itr(x, c) for (auto&& x : (c))
#define updatemax(t, v) ((t) = std::max((t), (v)))
#define updatemin(t, v) ((t) = std::min((t), (v)))
#define endl _endl
const char _endl = (cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), cout.precision(16), '\n');

const string YES = "Yes";
const string NO = "No";
void solve(long long N, std::vector<long long> a) {
  ll s4 = 0, s2 = 0, s1 = 0;
  rep(i, N)++(a[i] % 4 == 0 ? s4 : a[i] % 2 == 0 ? s2 : s1);
  cout << (s4 >= s1 || (s4 == s1 - 1 && s2 == 0) ? YES : NO) << endl;
}

int main() {
  long long N;
  scanf("%lld", &N);
  std::vector<long long> a(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &a[i]);
  }
  solve(N, std::move(a));
}


Measured memory_bytes: 3936
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cmath>

using namespace std;

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

//10^9 + 7
const ll MOD = 1000000007;

int main() {
	string S;
	cin >> S;
	string ans = "Yes";
	ll loopTime = S.size() / 2;
	if (S.size() % 2 == 0) {
		rep(i, loopTime) {
			if (S[0] == 'h' && S[1] == 'i') {
				S.erase(S.begin(), S.begin() + 2);
			}
			else {
				ans = "No";
				break;
			}

		}
	}
	else {
		ans = "No";
	}

	cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define Int int32_t
#define all(c) c.begin(), c.end()
#define FAST ios_base::sync_with_stdio(false) , cin.tie(NULL);
#define pii pair< int , int >
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define bitcnt(n) __builtin_popcountll(n)
#define setpre(n) cout << fixed << setprecision(n)
#define tr(c) for(auto x : c )cout << x << " ";
#define ol(c, s, e) for(int pos=s; pos<e ; pos++) cout << c[pos] << " ";
#define PI acos(-1LL)

#ifndef CF
string to_string(const string& s){
    return '"' + s + '"';
}
string to_string(const char* s) {
    return to_string((string) s);
}
string to_string(bool b) {
    return (b ? "true" : "false");
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename T>
string to_string(vector<T> v){
    bool first = true;
    string res = "{";
    for(const auto& x: v){
        if(!first) res+=", ";
        first = false;
        res+=to_string(x);
    }
    res+="}";
    return res;
}
void bug() { cerr << endl; }
template<typename Head, typename... Tail>
void bug(Head H, Tail... T) {
    cerr << " " << to_string(H);
    bug(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", bug(__VA_ARGS__);
#endif

const int M = 1000000007;
const int N = 2e6 + 5;
const long long INF = 1e18 + 37;

void solve() {
    int n;
    cin >> n;
    int ans = 0;
    for(int i=1; i<=n; i++){
        int x;
        cin >> x;
        if(x&1 && i&1){
            ans++;
        }
    }
    cout << ans << endl;
}

signed main(){
    FAST
    int tc = 1;
//    TODO : check for tc
//    cin >> tc;
    for (int t = 1; t <= tc; t++) {
        solve();
    }
}


Measured memory_bytes: 3568
#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""
input:
6
1 2 2 3
2 2 3 4
3 1 5
4 1 6
5 1 6
6 0

output:
1 1 12
2 2 11
3 3 8
4 9 10
5 4 7
6 5 6
"""
import sys

UNVISITED, VISITED_IN_STACK, POPPED_OUT = 0, 1, 2


def generate_adj_matrix(v_info):
    for v_detail in v_info:
        v_index, adj_num, *adj_list = map(int, v_detail)
        # assert len(adj_list) == adj_num
        init_adj_table[v_index].extend(sorted(adj_list, reverse=True))
    return init_adj_table


def graph_dfs(v_init):
    global time

    # init the first node of overall graph iterations(times >= 1)
    stack.append(v_init)
    color[v_init] = VISITED_IN_STACK
    d_time[v_init] += time
    # init end

    while stack:
        current = stack[-1]
        v_table = adj_table[current]
        color[current]=VISITED_IN_STACK
        # if adj is None, current's adj(s) have been all visited
        adj = v_table.pop() if v_table else None

        if adj:
            if color[adj] is UNVISITED:
                color[adj] = VISITED_IN_STACK
                time += 1
                d_time[adj] += time
                stack.append(adj)
        else:
            stack.pop()
            color[current] = POPPED_OUT
            time += 1
            f_time[current] += time

    return None


def dfs_start():
    global time
    for i in range(vertices):
        if color[i + 1] == UNVISITED:
            # print('round: ', i + 1)
            graph_dfs(i + 1)
            time += 1


if __name__ == '__main__':
    _input = sys.stdin.readlines()
    vertices = int(_input[0])
    v_info = map(lambda x: x.split(), _input[1:])
    init_adj_table = tuple([] for _ in range(vertices + 1))
    # assert len(vertex_info) == vertex_num

    # config length = (vertex_num + 1)
    stack = []
    color = [UNVISITED] * (vertices + 1)
    d_time, f_time = ([0] * (vertices + 1) for _ in range(2))

    adj_table = generate_adj_matrix(v_info)
    # timing start from 1
    time = 1
    dfs_start()

    for index, v in enumerate(zip(d_time[1:], f_time[1:]), 1):
        print(index, *v)

Measured memory_bytes: 7784
#include <bits/stdc++.h>
typedef long long ll;

using namespace std;

vector<vector<pair<int, int>>> G(100005);
vector<int> d;

void dfs(int u, int d_to_root) {
  for(auto p : G[u]) {
    int v = p.first;
    int w = p.second;
    // cout << "v: " << v << ", w: " << w << endl;
    if (d[v] != -1) continue;
    d[v] = d_to_root + w;
    dfs(v, d[v]);
  }
}

int main() {
  int n;
  cin >> n;
  for(int i = 1; i < n; ++i) {
    int u, v, w;
    cin >> u >> v >> w;
    G[u].push_back(make_pair(v, w%2));
    G[v].push_back(make_pair(u, w%2));
  }

  d.assign(n+1, -1);
  // d[1] = 0;
  for (int i = 1; i <= n; ++i) {
    if (d[i] != -1) continue;
    dfs(i, 0);
  }

  for (int i = 1; i <= n; ++i) {
    int color = d[i]%2;
    cout << color << endl;
  }

  return 0;
}

Measured memory_bytes: 7552
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
int main() {
	int r, s, p, result = 0;
	vector<int> exitOrders; // 出られるまでの移動+待機の時間
	cin >> r >> s >> p;
	for (int i = 0; i < p; i++) {
		int x, y; cin >> y >> x;
		exitOrders.push_back((r - y + 1) + (abs(s - x) + (x <= s ? 1 : 0))); // 通路から出口への移動回数+シートから通路への移動回数
	}
	sort(exitOrders.begin(), exitOrders.end()); // 早いもの順にソート
	for (auto& order : exitOrders) result = max(result + 1, order); // 後述するかも (簡単に言うと、順番かぶってたら待っててもらう)
	cout << result << endl;
	return 0;
}


Measured memory_bytes: 4956
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
using P = pair<int,int>;
  
int main()
{
  int N;
  cin >> N;

  vector<int> A(N);
  REP(i, N) cin >> A[i];
  
  int cnt = 0;
  REP(i,N){
    if(A.at(i)%2==1){
      cnt++;
    }
  }
  if(cnt%2 == 1){
    cout << "NO" << endl;
  }else{
    cout << "YES" << endl;
  }
}

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

#define all(vec)                vec.begin(),vec.end()
#define rall(vec)               vec.rbegin(),vec.rend()
#define sz(r)                    r.size()
#define rem1(v, i)             (v.erase(v.begin()+i))
#define rem2(v, i, j)          (v.erase(v.begin()+i, v.begin()+j+1))
#define rev(v, i, j)             (reverse(v.begin()+i, v.begin()+j+1))
#define digits(i)               (int)((log(i)/log(10))+1)
#define dround(num)       (int)floor(num+0.5)  // Rounds num to int (int)num+(<.5 to 0, > .5 to 1)
#define first_bit_index(num) __builtin_ctz(num) // count trailing zeros
#define last_bit_index(num)  __builtin_clz(num) // count leading zeros
#define UNDEFINED_BIT       32
#define test_bit(num, bit)   ((num & 1 << bit) != 0)
#define num_bits(num)       __builtin_popcount(num)
#define pb push_back
#define pf push_front
#define ins insert

#define inf   INT_MAX
#define mn_inf  INT_MIN
#define endl '\n'
using namespace std;
#define init ios_base::sync_with_stdio(false); cin.tie(nullptr);
typedef long long ll;

int main()
{
	init
	// #ifndef ONLINE_JUDGE
	//     freopen("input.txt", "r", stdin);
	// //    freopen("output.txt", "w", stdout);
	// #endif
	int n; cin >> n;
	map<string,int> mp;
	int maxx = 0;
	for (int i = 0; i < n; ++i)
	{
		string s;cin >> s;
		if(mp.find(s) == mp.end())
			mp[s] = 0;
		mp[s]++;
		maxx = max(maxx,mp[s]);
	}
	for(auto& p : mp)
	{
		if(p.second == maxx)
			cout << p.first <<"\n";
	}
	return 0;
}

Measured memory_bytes: 23808
import java.util.*;

public class Main {

    public static void main(String[] args) {
//        long startTime = System.currentTimeMillis();
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int M = scanner.nextInt();
        List<Long> A = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            A.add(scanner.nextLong());
        }
        List<Map.Entry<Integer, Long>> BC = new ArrayList<>();
        for (int i = 0; i < M; i++) {
            Map.Entry<Integer, Long> entry =
                    new AbstractMap.SimpleEntry<>(scanner.nextInt(), scanner.nextLong());
            BC.add(entry);
        }
        scanner.close();

        // A sort
        Collections.sort(A);

        // BC sort
        Collections.sort(BC, (o1, o2) -> o2.getValue().compareTo(o1.getValue()));

        // B count
        long bCount = 0;
        // B C
        List<Long> replaceList = new ArrayList<>();
        for (Map.Entry<Integer, Long> entry : BC) {
            int b = entry.getKey();
            long c = entry.getValue();
            for (int j = 0; j < b; j++) {
                replaceList.add(c);
                bCount++;
                if (replaceList.size() == N) {
                    break;
                }
            }
            if (replaceList.size() == N) {
                break;
            }
        }
        Collections.sort(replaceList);
        Collections.reverse(replaceList);

//        System.out.println(BC);

        for (int i = 0; i < bCount; i++) {
            long a = A.get(i);
            long bc = replaceList.get(i);
            if (a < bc) {
                A.set(i, bc);
//                System.out.println(A);
            } else {
                break;
            }
        }

        long sum = 0;
        for (long l : A) {
            sum += l;
        }

        System.out.println(sum);

//        System.out.println(System.currentTimeMillis() - startTime);
    }


}


Measured memory_bytes: 103380
#include  <iostream>
#include <map>

using namespace std;
int N[27];

int main() {
	char S[27];
	
	cin >> S;
	int i = 0;
	while (S[i] != '\0') {
		switch (S[i]) {
		case 'a':
			N[1]++;
			break;
		case 'b':
			N[2]++;
			break;
		case 'c':
			N[3]++;
			break;
		case 'd':
			N[4]++;
			break;
		case 'e':
			N[5]++;
			break;
		case 'f':
			N[6]++;
			break;
		case 'g':
			N[7]++;
			break;
		case 'h':
			N[8]++;
			break;
		case 'i':
			N[9]++;
			break;
		case 'j':
			N[10]++;
			break;
		case 'k':
			N[11]++;
			break;
		case 'l':
			N[12]++;
			break;
		case 'm':
			N[13]++;
			break;
		case 'n':
			N[14]++;
			break;
		case 'o':
			N[15]++;
			break;
		case 'p':
			N[16]++;
			break;
		case 'q':
			N[17]++;
			break;
		case 'r':
			N[18]++;
			break;
		case 's':
			N[19]++;
			break;
		case 't':
			N[20]++;
			break;
		case 'u':
			N[21]++;
			break;
		case 'v':
			N[22]++;
			break;
		case 'w':
			N[23]++;
			break;
		case 'x':
			N[24]++;
			break;
		case 'y':
			N[25]++;
			break;
		case 'z':
			N[26]++;
			break;
		}
		i++;
	}

		for (int i = 1; i <= 26; i++) {
			if (N[i] > 1) {
				cout << "no" << endl;
				break;
			}
			else if((N[i] == 1 || N[i] == 0) && i == 26){
				cout << "yes" << endl;
			}
		}

	return 0;
}

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

struct dat{
	int num;
	int p;
	int y;
};

int dat_sort(const void *a, const void *b) {
  return ((struct dat *)a)->y - ((struct dat *)b)->y;
}

int main( void ){
	struct dat city[100001];
	int n,m,pref[100001],id[100001],pcnt[100001]={0};
	int i;

	scanf("%d%d",&n,&m);
	for(i=0;i<m;i++){
		scanf("%d%d",&city[i].p,&city[i].y);
		city[i].num = i;
		pref[i]=city[i].p;
	}

	qsort( city, m, sizeof(city[0]), dat_sort );
	for(i=0;i<m;i++){
		id[ city[i].num ] = ++pcnt[ city[i].p ];
	}
		
	for(i=0;i<m;i++)
		printf("%06d%06d\n",pref[i],id[i]);
	return 0;
}

Measured memory_bytes: 3944
#include<iostream>
#include<vector>
#include<ctype.h>
#include<string>
using namespace std;

int alphabetCount[26];

int main(){
    char ch;
    while(cin>>ch){
        int num;
        if(isalpha(ch)){
            if(islower(ch)){
                num = ch-'a';
            } 
            else num = ch-'A';
            alphabetCount[num]++;
        }
    }

    for(int i=0;i<26;++i){
        char ch = (char)('a'+i); 
        cout<<ch<<" : "<<alphabetCount[i]<<endl;
    }
    return 0;
}



Measured memory_bytes: 3084
/* AtCoder コピペ */
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repEq(i, n) for (int i = 0; i <= (int)(n); i++)
#define repVector(i, v) for (auto i = v.begin(); i != v.end(); ++i)

#define ifBetween(n, a, b) if (n > a && n < b)
#define ifBetweenEq(n, a, b) if (n >= a && n <= b)

int main() {
	int N, K, X, Y;
  	int total = 0;

  	cin >> N;
  	cin >> K;
  	cin >> X; // K泊目までの料金
  	cin >> Y; // K泊目以降の料金
  
  	if (N > K) {
      rep(i, K) {
      	total += X;
      }
      
      rep(i, N - K) {
      	total += Y;
      }
    } else {
      rep(i, N) {
      	total += X;
      }   
    }

  	cout << total << endl;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	_ "container/heap"
	"fmt"
	"os"
	"strconv"
)

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func ceil(a, b int) int {
	if a%b == 0 {
		return a / b
	} else {
		return a/b + 1
	}
}

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func lcm(a, b int) int {
	return a / gcd(a, b) * b
}

// Sort
type RuneSlice []rune

func (a RuneSlice) Len() int           { return len(a) }
func (a RuneSlice) Less(i, j int) bool { return a[i] < a[j] }
func (a RuneSlice) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

type Num struct {
	bit, use, nuse, diff int
}

type ByDiff []Num

func (a ByDiff) Len() int           { return len(a) }
func (a ByDiff) Less(i, j int) bool { return a[i].diff > a[j].diff }
func (a ByDiff) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

// Main
const MOD = int(1e+9) + 7
const INF = 1 << 60

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	defer wtr.Flush()
	N, K := sc.nextInt(), sc.nextInt()
	A := sc.nextIntSlice(N)
	C := make([]int, 41)
	for j := 40; j >= 0; j-- {
		bit := 1 << uint(j)
		count := 0
		for i := 0; i < N; i++ {
			if A[i]&bit > 0 {
				count++
			}
		}
		C[j] = count
	}
	ans := 0
	// dはKと一致しなかった桁(-1は全て一致)
	for d := 40; d >= -1; d-- {
		if d != -1 && K&(1<<uint(d)) == 0 {
			continue
		}
		sum := 0
		for e := 40; e >= 0; e-- {
			bit := 1 << uint(e)
			if e > d {
				if K&bit > 0 {
					sum += bit * (N - C[e])
				} else {
					sum += bit * C[e]
				}
			} else if e == d {
				sum += bit * C[e]
			} else {
				sum += bit * max(C[e], N-C[e])
			}
		}
		ans = max(ans, sum)
	}

	fmt.Fprintln(wtr, ans)
}


Measured memory_bytes: 3072
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s1 = sc.next();
		sc.close();
		System.out.println(count(s1));
	}
	
	private static int count(String str){
		char[] array = str.toCharArray();
		int c = 0;
		if(array[0] == '1') c++;
		if(array[1] == '1') c++;
		if(array[2] == '1') c++;
		
		return c;
	}

}

Measured memory_bytes: 21588
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <bitset>
#include <numeric>
#include <math.h>
#include <tuple>
#include <queue>
#include <set>

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

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

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

    int A, B;

    cin >> A >> B;

    if(B % A ==0){
        cout << A + B << endl;
    }else{
        cout << B - A << endl;
    }


    return 0;
}


Measured memory_bytes: 256
def dense(a, b):
	return b / (a+b)

def resolve():
	a, b, c, d, e, f = map(int, input().split())
	ws = set()
	ss = set()
	for i in range(31):
		for j in range(31):
			if a*100*i + b*100*j <= f:
				ws.add(a*100*i + b*100*j)
	for i in range(3001):
		for j in range(3001):
			if c*i + j*d <= f:
				ss.add(c*i + j*d)
	ans_w, ans_s = -1, 0
	lim = e / (100+e)
	for wv in ws:
		for sv in ss:
			if wv + sv > f:
				continue
			if wv + sv == 0:
				continue
			if lim >= dense(wv, sv):
				if dense(ans_w, ans_s) <= dense(wv, sv):
					ans_w, ans_s = wv, sv
	print(ans_w + ans_s, ans_s)
resolve()

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

#define REP(i, n) for (int (i) = 0 ; (i) < (int)(n) ; ++(i))
#define REPN(i, m, n) for (int (i) = m ; (i) < (int)(n) ; ++(i))
#define REP_REV(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define REPN_REV(i, m, n) for (int (i) = (int)(n) - 1 ; (i) >= m ; --(i))

#define INF 2e9
#define INF_LL 1LL<<60
#define ll long long
#define MOD 1e9+7
#define MAX_V
const double PI=3.14159265358979323846;

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
#define print_line(vec, n) {for(int i=0;i<(n-1);i++) cout << (vec)[i] << " "; cout << (vec)[(n)-1] << endl;}
template<class T> void print(const T& x){cout << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }
struct PreMain {PreMain(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}} premain; 

ll dp[100001];

int main(){
    int N, W;
    cin >> N >> W;
    vector<int> w(N), v(N);
    REP(i, N) cin >> w[i] >> v[i];

    REP(i, 100001) dp[i] = INF;
    dp[0] = 0;

    REP(i, N) REPN_REV(j, v[i], 100001) {
        dp[j] = min(dp[j], dp[j-v[i]] + w[i]);
    }

    for(int i = 100000; i>=0; i--) {
        if (dp[i] <= W) {
            cout << i << endl;
            return 0;
        }
    }

    return 0;
}

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

int main() {
  string O, E;
  cin >> O >> E;
  if (O.length() == E.length()) {
    for (int i = 0; i < O.length(); i++) {
      cout << O[i] << E[i];
    }
  }
  else {
    for (int i = 0; i < E.length(); i++) {
      cout << O[i] << E[i];
    }
    cout << O[O.length() - 1];
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define Rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef int64_t intl;

int main(){
  intl M,N;
  cin >> N >> M;
  vector <intl> A (M);
  intl sum=0;
  Rep(i,M){
    cin >> A.at(i);
    sum += A.at(i);
  }
  if ( sum > N) {
    cout << -1 ;
  }
  else{
    cout << N - sum;
  }
}

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

int main() {
  int N;
  cin >> N;
  vector<int> a(N);

  for (int i = 0; i < N; i++) cin >> a[i];

  std::sort(a.begin(), a.end());

  int a_sum = 0, b_sum = 0;
  for (int i = 0; i < N; i++) {
    if (i % 2 == 0) a_sum += a[i];
    else b_sum += a[i];
  }

  cout << std::abs(b_sum - a_sum) << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long m=1e9+7;
int main()
{
	int h,w;
	cin>>h>>w;
	long long A[h+2][w+2];
	for(int i=0;i<h+2;i++)
	{
		for(int j=0;j<w+2;j++)
		{
			A[i][j]=0;
		}
	}
	string s;
	for(int i=0;i<h;i++)
	{
		cin>>s;
		for(int j=0;j<w;j++)
		{
			if(s[j]=='.')
			A[i+1][j+1]=1;
		}
	}
	for(int i=1;i<=h;i++)
	{
		for(int j=1;j<=w;j++)
		{
			if(i==1 && j==1)
			continue;
			if((i==1 && j==2) ||(i==2 && j==1))
			{
				continue;
				
			}
			if(A[i][j]==1)
			{
				A[i][j]=(A[i-1][j]+A[i][j-1])%m;
			}
			else
			A[i][j]=0;
		}
	}
	cout<<A[h][w];
	
}

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

int main() {

	int n; cin >> n;
	string s; cin >> s;

	vector<int> e_num(n, 0), w_num(n, 0);
	for (int i = 0; i < n; i++) {
		if (s[i] == 'E') e_num[i]++;
		else w_num[i]++;		
		if (i == 0) continue;
		e_num[i] += e_num[i - 1];
		w_num[i] += w_num[i - 1];
	}

	int ans = 2147483647;;
	for (int i = 0; i < n; i++) {
		int tmp = 0;
		tmp += e_num[n - 1] - e_num[i];
		tmp += w_num[i - 1];
		ans = min(ans, tmp);
	}

	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3076
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <list>
#include <time.h>
#include <math.h>
#include <random>
#include <deque>
#include <queue>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>
#include <sstream>
#include <chrono>
#include <cstring>
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double db;

#define ft first
#define sd second
#define flag bool fl=true

#define mod 1000000007
#define N 100001
#define MX 1000000001
#define MXX 1000000000000000001

#define pb push_back
#define For(i, a, b) for(int i=a;i<=b;i++)
#define T int t, qq=0; cin>>t; while(qq++<t)
#define fast ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define scarr(array, size) for(int i=0;i<size;i++) cin>>array[i]

#define deg(rad) (rad*180.0)/pi
#define pi acos(-1)
#define log(n) (int)log2(n)
#define logg(a)(b) log(b)/log(a)


/*
//----------useful_functions----------

long long extended_euclid(ll a, ll b, ll &x, ll &y){//ax+by=c
    if(b==0)
    {
        x=1, y=0;
        return a;
    }

    ll x1, y1;
    ll d=extended_euclid(b, a%b, x1, y1);
    x=y1;
    y=x1-y1*(a/b);
    return d;
}
long long bigMod(ll a, ll b){//(a^b)%mod
    ll ans=1;
    while(b)
    {
        if(b%2==1) ans=(ans*a)%mod;
        a=(a*a)%mod;
        b/=2;
    }
    return ans%mod;
}
long long modInverse(ll a, ll b){//a*x=1 mod b
    ll x, y;
    ll gcd=extended_euclid(a, b, x, y);

    if(gcd==1) return ((x%b)+b)%b;
    else return 1;
}
long long nCr(ll n, ll r){//n<=1e6
    //declare globally-> ll fact[1000001];
    fact[1]=1;
    for(ll i=2;i<1000001;i++)
        fact[i]=(i*fact[i-1])%mod;

    return (fact[n]*modInverse(fact[r], mod)*modInverse(fact[n-r], mod))%mod;
}
long long josephus(ll n, ll k){//k'th person is killed out of n in the circle
    if(n==1) return 1;
    else return (josephus(n-1, k)+k-1)%n+1;
}

vector<int> sieve(ll n){
    bool fl[n+1];
    vector<int> primes;
    for(int i=0;i<=n;i++) fl[i]=false;

    for(int i=3;i*i<=n;i+=2)
        for(int j=i+i;j<=n;j+=i)
            fl[j]=true;

    primes.pb(2);
    for(int i=3;i<=n;i+=2) if(!fl[i]) primes.pb(i);
    return primes;
}
*/

int main()
{
    int n;
    cin>>n;

    int a[n];
    for(int i=0;i<n;i++)
        cin>>a[i];

    ll sum=0;
    for(int i=0;i<n;i++)
    {
        int x;
        cin>>x;
        sum+=x;
    }

    int b[n-1];
    for(int i=0;i<n-1;i++) cin>>b[i];

    for(int i=0;i<n-1;i++)
        if(a[i+1]-a[i]==1) sum+=b[a[i]-1];

    cout<<sum<<endl;
//        cout<<"Case "<<qq<<": ";
}


Measured memory_bytes: 3652
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;
int a[233333],n,b,cnt[233];
char s[2333];
int main()
{
	scanf("%d",&n);
	for (int i=1;i<=n;++i) 
	{
		scanf("%d",&a[i]);
		int tmp=0;
		while (a[i]&&(a[i]&1)==0) a[i]/=2,++tmp;
		if (tmp>=2) ++cnt[2];
		else ++cnt[tmp];
	}
	if (cnt[2]>=cnt[0]||cnt[0]==cnt[2]+1&&cnt[1]==0) printf("Yes\n");
	else printf("No\n");
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
using namespace std;
int cnt[1000006][2];
bool del[1000006];
vector <int> G[1000006];
char s[1000006];
queue <int> q;
int read(){
	int cnt = 0;
	char ch = getchar();
	while (ch < '0' || '9' < ch)
		ch = getchar();
	while ('0' <= ch && ch <= '9'){
		cnt = cnt * 10 + ch - '0';
		ch = getchar();
	}
	return cnt;
}
int main(){
	int n = read(), m = read();
	cin >> s;
	for (int i = 1; i <= m; ++ i){
		int u = read(), v = read();
		cnt[u][s[v - 1] == 'B'] ++;
		cnt[v][s[u - 1] == 'B'] ++;
		G[u].push_back(v);
		G[v].push_back(u);
	}
	int del_cnt = 0;
	for (int i = 1; i <= n; ++ i)
		if (cnt[i][0] == 0 || cnt[i][1] == 0){
			del[i] = true;
			++ del_cnt;
			q.push(i);
		}
	while (! q.empty()){
		int u = q.front();
		q.pop();
		for (int i = 0; i < G[u].size(); ++ i){
			int v = G[u][i];
			if (! del[v]){
				cnt[v][s[u - 1] == 'B'] --;
				if (cnt[v][0] == 0 || cnt[v][1] == 0){
					++ del_cnt;
					del[v] = true;
					q.push(v);
				}
			}
		}
	}
	if (del_cnt == n)
		cout << "No" << endl;
	else
		cout << "Yes" << endl;
}


Measured memory_bytes: 33920
#include <iostream>


#include <stdlib.h>
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <string>
#include <vector>
using namespace std;
#include <stdio.h>
#include <vector> 
#include <map> 
#include <algorithm>
#include <functional>


#include<iostream>
using namespace std;
int main()
{
	int nn[1000];
	int a, c;
	std::string s;
	cin >> a;

	double d = 0;

	for (int i = 0; i < a; ++i) {
		cin >> nn[i];

		d += 1.0 / nn[i];
	}

	printf("%f\n", 1.0 / d);


	return 0;
}



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

int main() {
  int N;
  cin >> N;
  int ans = 0;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    while (a % 2 == 0) {
      ans++;
      a /= 2;
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m;
	cin>>n>>m;
	int h[n];
	for(int i=0;i<n;i++){
		cin>>h[i];
	}
	int x,y;
	int ans[n]={0};
	for(int i=0;i<m;i++){
		cin>>x>>y;
		if(h[x-1]>h[y-1]){
		//	ans[x-1]=1;
			ans[y-1]=-1;
		}
		if(h[y-1]>h[x-1]){
			//ans[y-1]=1;
			ans[x-1]=-1;
		}
		if(h[x-1]==h[y-1]){
			ans[y-1]=-1;
			ans[x-1]=-1;
		}
	}
/*	for(int i=0;i<n;i++){
		cout<<ans[i]<<endl;
	}*/
	int count =0;
	for(int i=0;i<n;i++){
		if(ans[i]==0){
			count++;
		}
	}
	cout<<count<<endl;
	return 0;
	
}


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

int main() {
   int n, u, k, v, g[100][100];
   cin >> n;
   for(int i=0; i<n; i++) {
       for(int j=0; j<n; j++) {
           g[i][j]=0;
        }
    }
   for(int i=0; i<n; i++) {
       cin >> u >> k;
       for(int j=0; j<k; j++) {
           cin >> v;
           g[u-1][v-1]=1;
       }
    }
    for(int i=0; i<n; i++) {
        for(int j=0; j<n; j++) {
            if(j) cout << " ";
            cout << g[i][j];
        }
        cout << endl;
    }
}


Measured memory_bytes: 3104