akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;
long long gcd(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd(b,a%b);
  }
}
 
long long lcm(long long x, long long y){
  return (x/gcd(x,y))*y;
}
 
class UnionFind {
    public:
    //各頂点の親の番号を格納する。その頂点自身が親だった場合は-(その集合のサイズ)を入れる。
    vector<int> Parent;
    
    //クラスを作るときは、Parentの値を全て-1にする。
    //以下のようにすると全てバラバラの頂点として解釈できる。
    UnionFind(int N) {
        Parent = vector<int>(N, -1);
    }
    
    //Aがどのグループに属しているか調べる
    int root(int A) {
        if (Parent[A] < 0) return A;
        return Parent[A] = root(Parent[A]);
    }
    
    //自分のいるグループの頂点数を調べる
    int size(int A) {
        return -Parent[root(A)];//先祖をrootで取っておきたい。
    }
    
    //AとBをくっ付ける
    bool connect(int A, int B) {
        //AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
        A = root(A);
        B = root(B);
        if (A == B) {
            //すでにくっついてるからくっ付けない
            return false;
        }
        
        //大きい方(A)に小さいほう(B)をくっ付けたい
        //大小が逆だったらAとBをひっくり返す。
        if (size(A) < size(B)) swap(A, B);
        
        //Aのサイズを更新する
        Parent[A] += Parent[B];
        //Bの親をAに変更する
        Parent[B] = A;
        
        return true;
    }
};
 
int main(){
  string s;
  cin>>s;
  int len=s.size();
  int t;
  bool flag=true;
  int ans;
  for(int i=len-2;i>0;i-=2){
    t = i/2;
    REP(j,t){
      if(s[j]==s[j+t]){
        continue;
      }else{
        flag=false;
        break;
      }
    }
    if(flag){
      ans = i;
      break;
    }else{
      flag = true;
      continue;
    }
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
#define all(v) v.begin(), v.end()
#define repi(i, n, init) for (ll i = init; i <= (n); i++)
#define repd(i, n, init) for (ll i = (n); i >= init; i--)
#define repm(i, m) for (auto i = m.begin(); i != m.end(); i++)

int main()
{
    ll K, S;
    cin >> K >> S;
    ll ans = 0;
    repi(i, K, 0)
    {
        repi(j, K, i)
        {
            repi(k, K, j)
            {
                if (i + j + k == S)
                {
                    // cout << i << "+" << j << "+" << k << endl;
                    if (i == j && j == k)
                    {
                        ans++;
                    }
                    else if (i == j || j == k)
                    {
                        ans += 3;
                    }
                    else
                    {
                        ans += 6;
                    }
                    // cout << ans << endl;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <stdio.h>
#include <iostream>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <algorithm>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <bitset>
#include <string>
#include <time.h>
using namespace std;
long double esp=1e-11;
//#pragma comment(linker, "/STACK:1024000000,1024000000")
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define cle(a) while(!a.empty())a.pop()
#define mem(p,c) memset(p,c,sizeof(p))
#define mp(A, B) make_pair(A, B)
#define pb push_back
typedef long long int LL;
const long double PI = acos((long double)-1);
const LL INF=0x3f3f3f3f3f3f3f3fll;
const int MOD =1000000007ll;
const int maxn=200100;
LL m[maxn],pre[maxn];
int main()
{
    //freopen("in.txt", "r", stdin);
    //freopen("in1.txt", "w", stdout);
    //::iterator iter;                  %I64d
    //for(int x=1;x<=n;x++)
    //for(int y=1;y<=n;y++)
    //scanf("%d",&a);
    //printf("%d\n",ans);
    int n;
    LL ans=INF;
    scanf("%d",&n);
    for(int x=1;x<=n;x++)
	{
		scanf("%lld",&m[x]);
		pre[x]=pre[x-1]+m[x];
	}
	for(int x=1;x<n;x++)
		ans=min(ans,abs(pre[n]-pre[x]-pre[x]));
	printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 3456
#include <bits/stdc++.h>
#define ll long long 
#include<vector>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
const int mod=1e9+7;
int main(){
	IOS;
	int n;
	cin>>n;
	string s;
int freq=0;
map <string,int> m;
for(int i=0;i<n;i++)
{
	cin>>s;
		auto it=m.find(s);
	if(it!=m.end()){
	it->second++;
	if(it->second>=freq)
	freq=it->second;
	}
	else
	m.insert(make_pair(s,0));
}

vector<string> v;
for(auto i:m){
	if(i.second==freq)
	cout<<i.first<<endl;
}
}

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

const int inf = 1e9;
const ll linf = 1e18;

int main()
{
    int n; cin >> n;
    set<char> s;
    for (int i = 0; i < n; i++) {
        char c; cin >> c;
        s.insert(c);
    }
    cout << (s.size() == 3 ? "Three" : "Four") << endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#define N 10020
#define M 20
using namespace std;

const int c[] = {0, 2, 5, 5, 4, 5, 6, 3, 7, 6};

int A[M];
int f[N][M];

int main(void)
{
    int n, m;
    int i, j, k;

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

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

    for(i = 2; i < n; i ++)
        for(j = 1; j <= m; j ++)
            if(f[i][A[j]])
                for(k = 1; k <= m; k ++)
                    f[i + c[A[k]]][A[k]] = max(f[i + c[A[k]]][A[k]], f[i][A[j]] + 1);

    for(i = n; i; i -= c[A[k]])
    {
        for(j = 1, k = 0; j <= m; j ++)
            if(f[i][A[j]] && f[i][A[k]] <= f[i][A[j]])
                k = j;
        putchar(A[k] + '0');
    }

    return 0;
}

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

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

using Graph = vector<vector<int>>;

ll kzyou(ll a,ll k){//aのk乗を返す
    ll zyou = 1;
    for(ll i = 1;i<=k;i++){
        zyou *= a;
    }
    return zyou;
}
typedef pair<int,int> P;

bool is_prime(int n){//nが素数であるかどうか判定 iで割り切れると素数でない
    if(n == 1) return false;//1は例外
    for(int i = 2;i*i <= n;i++){
        if(n%i == 0) return false;
    }
    
    return true;
}

int main(){
  ll a,b;
  cin >> a >> b;
  ll LCM = (a*b)/gcd(a,b);
  cout << LCM << endl;
 }

Measured memory_bytes: 256
N, A, B = (int(i) for i in input().split()) 

if (N < 1 or 10**4 < N):
    sys.exit(100)
elif A > B:
    sys.exit(100)
elif A < 1:
    sys.exit(100)
elif 36 < B:
    sys.exit(100)

ans = 0
for n in range(1, N+1):
    tmp_sum = 0
    tmp_n = n
    while tmp_n != 0:
        tmp_sum += tmp_n % 10
        tmp_n = tmp_n // 10
    if (A <= tmp_sum and tmp_sum <= B):
        ans += n
print(ans)

Measured memory_bytes: 3064
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;

int main() {
  ll N;
  cin >> N;
  vector<ll> A(N), accum(N);
  ll sum_a = 0;
  for (int i = 0; i < N; i++) {
    cin >> A[i];
    if (i == 0)
      accum[i] = A[i];
    else
      accum[i] = accum[i] + A[i];
  }
  sort(A.begin(), A.end());
  accum[0] = A[0];
  for (int i = 1; i < N; i++) {
    accum[i] = accum[i - 1] + A[i];
  }
  ll ans = 1;
  for (int i = N - 2; i >= 0; i--) {
    if (A[i + 1] <= 2 * accum[i]) {
      ans++;
    } else {
      break;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 4844
#!/usr/bin/env python3
import sys


def solve(N: int, d: "List[int]"):
    p = 0
    for i in range(N):
        for j in range(i+1,N):
            p = p + d[i] * d[j]
    print(p)
        
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    d = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, d)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr
  
N=int(input())
fac_list=factorization(N)
if fac_list[0][0]==1:
  print(0)
else:
  ans=0
  for i in range(len(fac_list)):
    temp=fac_list[i][1]
    j=1
    while temp>=j:
      temp-=j
      ans+=1
      j+=1
  print(ans)


Measured memory_bytes: 9492
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<cstddef>
#include<queue>
#include<math.h>
#include<iomanip>
using namespace std;

int main()
{
    long long n, m, a, b, ans = 0;
    cin >> n >> m;
    vector<pair<long long, long long>> e;
    for(long long i = 0; i < n; ++i){
        cin >> a >> b;
        e.push_back(make_pair(a,b));
    }
    sort(e.begin(), e.end());
    long long i = 0, rest = m;
    while(rest > 0){
        if(rest >= e.at(i).second){
            ans += e.at(i).first * e.at(i).second;
            rest -= e.at(i).second;
        }
        else{
            ans += e.at(i).first * rest;
            break;
        }
        i++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5372
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < (int)(b); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int D; //365
    cin >> D;
    int c[26];
    rep(i, 0, 26) {
        cin >> c[i];
    }
    int s[D][26];
    rep(i, 0, D) {
        rep(j, 0, 26) {
            cin >> s[i][j];
        }
    }

    int t[D];
    rep(i, 0, D) {
        srand(time(NULL));
        t[i] = rand() % 26;
    }

    ll mx_score = -1;
    int cnt = 50;
    while (cnt--) {
        srand(time(NULL));
        int d = rand() % 365;
        int q = rand() % 26;
        int old = t[d];
        t[d] = q;

        ll score[D] = {};
        vector<int> last_day(26, -1);
        rep(i, 0, D) {
            if (i != 0) score[i] = score[i - 1];
            score[i] += s[i][t[i]];
            last_day[t[i]] = i;
            int decrease = 0;
            rep(j, 0, 26) {
                decrease += c[j] * (i - last_day[j]);
            }
            score[i] -= decrease;
        }
        if (mx_score > score[D - 1]) {
            t[d] = old;
        } else {
            mx_score = score[D - 1];
        }
    }

    rep(i, 0, D) cout << t[i] << endl;

    return 0;
}


Measured memory_bytes: 3656
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Programminng
{
    class AOJ_Volume0028
    {
        public static void Main(string[] args)
        {
            int[] count = new int[101];
            int max;
            while (true)
            {
                string s = Console.ReadLine();
                if (string.IsNullOrEmpty(s)) break;

                int value = int.Parse(s);
                count[value]++;
            }
            max = count[0];
            for (int i = 0; i < 100; i++)
            {
                if (max < count[i]) max = count[i];
            }
            for (int i = 0; i < 100; i++)
            {
                if (max == count[i]) Console.WriteLine(i);
            }
        }
    }
}

Measured memory_bytes: 5612
def d_rain_flows_into_dams(N, A):
    first = sum(A) - 2 * sum(A[1::2])
    ans = [first] + [0] * (N - 1)
    for i in range(N - 1):
        ans[i + 1] = 2 * A[i] - ans[i]
    return ' '.join(map(str, ans))

N = int(input())
A = [int(i) for i in input().split()]
print(d_rain_flows_into_dams(N, A))

Measured memory_bytes: 19144
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <iostream>
#include <sstream>
#include <climits>
#include <cfloat>
#include <complex>


typedef long long ll;
const double Eps = 1e-5;

using namespace std;

int main()
{
	int n;
	scanf("%d", &n);
	ll sum = 0;
	for (int i = 0; i < n; ++i)
	{
		int t;
		scanf("%d", &t);
		sum += t;
	}
	printf("%d\n", sum / n);

	return 0;
}

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

int main(){ 
  
  ll N,A,B; cin >> N >> A >> B;
  
  if( A > B){ swap(A,B);}
  
  if( ( A+B ) % 2 == 0 ){ 
    cout << abs(B-A)/2 << endl;
    
    return 0;
  }

  else{
    
    cout << min(A-1,N-B)+1+(B-A-1)/2 << endl;
    
    return 0;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N=105;
int n,a[N];
int main()
{
    scanf("%d",&n);
    int s1=0,s2=0;
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]),s2+=a[i];
    int ans=1e9;
    for(int i=1;i<n;i++)
    {
        s1+=a[i];
        s2-=a[i];
        ans=min(ans,abs(s1-s2));
    }
    printf("%d\n",ans);
}


Measured memory_bytes: 256
// Next Mayor
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1159&lang=jp

#include<iostream>
#include<vector>

using namespace std;

const int NONE = -1;

int N, P;
vector<int> player;
int bowl;
int winner;

bool is_win(int i) {
    for (int nth = 0; nth < N; ++nth) {
        if (nth == i) continue;
        if (player[nth] != 0) return false;
    }
    return true;
}

void pick_up(int i) {
    if (bowl == 0) {
        bowl += player[i];
        player[i] = 0;
        return;
    }
    else if (bowl == 1) {
        bowl--;
        player[i]++;
        if (is_win(i)) winner = i;
        return;
    }
    bowl--;
    player[i]++;
    return;
}

int main() {
    while(cin >> N >> P && N) {
        player.assign(N, 0); 
        bowl = P;
        winner = NONE;
        int i = 0;
        while (true) {
            if (winner != NONE) break;
            pick_up(i);
            i = (i + 1) % N;
        }
        cout << winner << endl;
    }
    return 0;
}

Measured memory_bytes: 3100
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

int main(){
    
    ll ans = 0;
    ll N, M;
    cin >> N;
    vector<string>A(N);
    for(ll i = 0; i < N; i++)cin >> A[i];
    cin >> M;
    vector<string>B(M);
    for(ll i = 0; i < M; i++)cin >> B[i];
    for(ll i = 0; i < N; i++){
        ll tmp = 0;
        for(ll j = 0; j < N; j++)if(A[i] == A[j])tmp++;
        for(ll j = 0; j < M; j++)if(A[i] == B[j])tmp--;
        ans = max(ans, tmp);
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#ifndef LOCAL
#define endl '\n'
#endif

#define fr(i, a, b) for(int i = a; i <= b; i++)
#define pf push_front
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) (int)x.size()
#define rsz resize()
#define lb lower_bound
#define ub upper_bound

typedef long long ll;
typedef long double f80;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

int pct(int x) { return __builtin_popcount(x); }
int pct(ll x) { return __builtin_popcountll(x); } 
int bit(int x) { return 31 - __builtin_clz(x); } // floor(log2(x))
int bit(ll x) { return 63 - __builtin_clzll(x); } // floor(log2(x))
int cdiv(int a, int b) { return a / b + !(a < 0 || a % b == 0); }
ll cdiv(ll a, ll b) { return a / b + !(a < 0 || a % b == 0); }

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

ll rand(ll l, ll r){
	uniform_int_distribution<ll> uid(l, r);
	return uid(rng);
}

#ifdef LOCAL
#define debug(...) cerr << "[L:" << __LINE__ << "][" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#ifndef LOCAL
string to_string(__int128 x) {
	string s = "";
	bool neg = 0;
	if(x < 0) { s += "-"; neg = 1; }
	if(!x) s += '0';
	while(x) {
		int rem = x % 10;
		s += to_string(rem);
		x /= 10;
	}
	reverse(s.begin() + neg, s.end());
	return s;
}
#endif

const int mod = 1e9 + 7; // 998244353;

int pwr(int a,int b) {
	int ans = 1;
	while(b) {
		if(b & 1) ans = (ans * 1LL * a) % mod;
		a = (a * 1LL * a) % mod;
		b >>= 1;
	}
	return ans;
}

/*
	Lookout for overflows!!
	Check array sizes!!
	Clear before test cases!!
	Use the correct modulo!!
	Check for corner cases!!
	Are you forgetting something?!
*/

const int N = 1e5 + 5;
int a[N];
int n, m, v, p;

int good(int idx) {
	vector<int> bad;
	fr(i, 1, n) {
		if(a[i] > a[idx]) bad.pb(a[i] - a[idx]);
	}
	sort(all(bad));
	int tot = max(0, (int)bad.size() - p + 1);
	int maxi = 0;
	ll s = 0;
	fr(i, 0, tot - 1) {
		s += bad[i];
		maxi = max(maxi, bad[i]);
	}
	debug(a[idx], bad);
	return (maxi <= m) && (s <= m * 1LL * v);
}

void solve() {
	cin >> n >> m >> v >> p;
	v = n - v;
	fr(i, 1, n) {
		cin >> a[i];
	}
	sort(a + 1, a + n + 1);
	reverse(a + 1, a + n + 1);
	int l = 0, r = n + 1;
	while(r - l > 1) {
		int m = (l + r) >> 1;
		if(good(m))
			l = m;
		else
			r = m;
	}
	cout << l;
}

int main() {
	ios :: sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t;
	// cin >> t;
	t = 1;
	for(int tt = 1; tt <= t; tt++) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 1680
//#include <bits/stdc++.h>
//#include <stdio.h>
#include<iostream>
#include<cstdio>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>
#include<cctype>
#include<fstream>


#define FOR(i, a, b) for( int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for( int i=(a);i>=(b);i--)
#define LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 600000000 //2000000000
#define LINF 1000000000000000000 //9000000000000000000 大きいとワ―シャルフロイドでオーバーフローを起こす
#define PI 3.14159265358979
#define MAXI 7500000

using namespace std;
typedef long long int ll;
typedef pair< long long int, long long  int> P;

int dy[5] = { 0,0,1,-1,0 };
int dx[5] = { 1,-1,0,0,0 };


int main(void) {
	
	long long int n, l;
	long long int res = 0;
	long long int total = 0;
	long long int final = LINF;
	long long int ans = LINF;

	cin >> n >> l;

	FOR(i, 1, n) {
		total += (l + i - 1);
	}

	FOR(i, 1, n) {
		res = total - (l + i - 1);
		if (final > abs(total - res)) {
			ans = res;
			final = abs(total - res);
		}
	}

	cout << ans << endl;



	
	

	return 0;
}

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

typedef long long ll;

int main(){
  int N;
  cin >> N;
  vector<ll> A(N);
  ll length=0;
  for(int i=0; i<N; i++){
    cin >> A[i];
    length+=A[i];
  }
  ll left=0;
  ll dif=length;
  for(int i=0; i<N; i++){
    left+=A[i];
    ll temp=abs(left-length+left);
    if(dif>temp){
      dif=temp;
    }
  }
  cout << dif <<endl;
}

Measured memory_bytes: 1792
#include<iostream>
#include<math.h>
using namespace std;

int main(){
    long long x;
    cin >> x;
    long long ans;
    double a = x / 11;
    ans = 2 * floor(a);
    if(x % 11 >= 7) ans += 2;
    else if(x % 11 != 0) ans ++;
    cout << ans << endl;
}

Measured memory_bytes: 256
def process():
    s = input()
    t = input()
    ls, lt = len(s), len(t)
    minchanges = float("inf")

    for i in range(ls-lt+1):
        changes = 0
        for j in range(lt):
            changes += 0 if s[i+j] == t[j] else 1
            if changes > minchanges:
                break
        if changes == 0:
            return 0
        #print(i, changes)
        minchanges = min(minchanges, changes)
    return minchanges


print(process())

Measured memory_bytes: 73244
#include <stdio.h>
int main(void){
   int a[1000];
   int i,n;

    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a[i]);
    }
    for(i=(n-1);i>=0;i--){
        printf("%d",a[i]);
        if(i!=0) printf(" ");
    }
    
    printf("\n");
    return 0;
}



Measured memory_bytes: 2052
#include <bits/stdc++.h>
#define int long long
#define f first
#define s second
using namespace std;
int32_t main(){
	if(fopen("input.txt", "r"))
		freopen("input.txt", "r", stdin),
		freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(0),cin.tie(0);
	int x[3];
	cin >> x[0] >> x[1] >> x[2];
	sort(x,x+3);
	int a=x[0],b=x[1],c=x[2];
	if(a==b and a!=c)
		cout << "Yes" << endl;
	else if(a!=b and b==c)
		cout << "Yes";
	else
		cout << "No";
}

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


class Main{
    public static void main(String[] args){
	BufferedReader sc=new BufferedReader(new InputStreamReader(System.in));
	
	try {
	    int n = Integer.valueOf(sc.readLine());
	    for(int i=0; i<n; i++){
		char[] org = sc.readLine().toCharArray();
		char[] msg = sc.readLine().toCharArray();
		for(int j=org.length-1; j>=0; j--){
		    if(org[j] == 'M'){
			for(int k=0; k<msg.length; k++){
			    if(msg[k]>='0' && msg[k]<'9')
				msg[k]++;
			    else if(msg[k]=='9')
				msg[k]='0';
			}
		    }
		    else if(org[j] == 'P')
			for(int k=0; k<msg.length; k++){
			    if(msg[k]>'0' && msg[k]<='9')
				msg[k]--;
			    else if(msg[k]=='0')
				msg[k]='9';
			}
		    else if(org[j] == 'A'){
			String b = new String(msg);
			for(int k=0; k<msg.length; k++)
			    msg[k] = b.charAt(msg.length-1-k);
		    }
		    else if(org[j] == 'E'){
			if(msg.length%2==0)
			    for(int k=0; k<msg.length/2; k++){
				char c = msg[k];
				msg[k] = msg[k+msg.length/2];
				msg[k+msg.length/2] = c;
			    }
			else
			    for(int k=0; k<(msg.length-1)/2; k++){
				char c = msg[k];
				msg[k] = msg[k+(msg.length-1)/2+1];
				msg[k+(msg.length-1)/2+1] = c;
			    }
		    }
		    else if(org[j] == 'C'){
			char c = msg[0];
			for(int k=0; k<msg.length-1; k++)
			    msg[k] = msg[k+1];
			msg[msg.length-1] = c;
		    }
		    else if(org[j] == 'J'){
			char c = msg[msg.length-1];
			for(int k=msg.length-1; k>=1; k--)
			    msg[k] = msg[k-1];
			msg[0] = c;
		    }
		}
		String b = new String(msg);
		System.out.println(b);
	    }
	}catch(Exception e){
	    System.out.println("Error");
	}
    }
}

Measured memory_bytes: 9488
#include <iostream>

using namespace std;

typedef long long ll;

int main() {
    ll N, *T, *A;   cin >> N;
    T = new ll[N], A = new ll[N];
    for (ll i = 0; i < N; i++)
        cin >> T[i] >> A[i];

    ll ans = T[0] + A[0];
    ll x = T[0], y = A[0];

    for (ll i = 1; i < N; i++) {
        ll k = max((x + T[i] - 1) / T[i], (y + A[i] - 1) / A[i]);
        ll x_ = T[i] * k, y_ = A[i] * k;
        ans = x_ + y_;
        x = x_;
        y = y_;
    }

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

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main{
	public static void main(String[] args)throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	    String dataDim = br.readLine();
	    StringTokenizer st = new StringTokenizer(dataDim);
	    StringBuilder sb = new StringBuilder();
	    int N = Integer.parseInt(st.nextToken());
	    System.out.println(N/3);
	}
}

Measured memory_bytes: 21332
#include <iostream>
#include <iomanip>
#include<math.h>
#include<list>
#include <algorithm>
#include<set>
#include<vector>
#include<math.h>
#include<map>
#include<string>
#include <numeric>
#include <queue>
#include <sstream>
#include <bitset>

using namespace std;
using ll = long long;
using vll = vector<long long>;
using sll = set<long long>;

template<typename T>
T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }

template<typename T>
map<T, T> primeFactor(T n) {
	map<T, T> res;
	for (T i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			res[i] ++;
			n /= i;
		}
	}
	if (n != 1) res[n] = 1;
	return res;
}

template<typename T>
bool IsPrimeNumber(T num)
{
	if (num <= 2) return true;
	else if (num % 2 == 0) return false;

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			return false;
		}
	}

	return true;
}

long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}


#define in(x) cin >> x
#define out(x) cout << x
#define outn(x) cout << x << '\n'
#define outs(x) cout << x << ' '
#define rep(i,s,e) for(ll i=s;i<e;i++)
#define repeq(i,s,e) for(ll i=s;i<=e;i++)

int main() {
	ll n, ans = 0;
	std::cin >> n;
	vll x(n), l(n), a(n, 0);
	vector<pair<ll, ll>> y(n);

	rep(i, 0, n) {
		std::cin >> x[i] >> l[i];
		y[i] = make_pair(x[i] + l[i],x[i] - l[i]);
	}
	sort(y.begin(), y.end());

	ll  e = -2e17;
	rep(i, 0, n) {
		if (e <= y[i].second) {
			ans++;
			e = y[i].first;
		}
	}

	outn(ans);


	return 0;
}


Measured memory_bytes: 4096
#include <iostream>

int main() {
	int a, b;
	std::cin >> a >> b;
	std::cout << (a / b) << " " << (a % b) << " ";
	std::cout.setf(std::ios::fixed);
	std::cout.precision(8);
	std::cout << ((double)a/b) << std::endl;
	return 0;
}


Measured memory_bytes: 3280
N = int(input())
ans = [0]*(N+1)

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

for out in ans[1:]:
    print(out)

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

int main(){
    ll x, k, d;
    cin >> x >> k >> d;
    ll kk = abs(x) / d;
    ll ans;
    if(kk <= k && (k - kk) % 2 == 0 ){
        ans = abs(x) - d*kk;
    }
    else if(kk <= k && (k - kk) % 2 == 1 ){
        ans = d*(kk + 1) - abs(x);
    }
    else if(kk > k){
        ans = abs(x) - d*k;
    }
    cout << ans << endl;
}

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

int main()
{
    for (int w; cin >> w;) {
        bool first = true; // flag for output
        for (int x = 1; w; x <<= 1) {
            int result = w & x;
            if (result) {
                if (first) {
                    first = false;
                    cout << result;
                } else
                    cout << " " << result;
                w -= x;
            }
        }
        cout << endl;
    }

    return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define all(vec) vec.begin(),vec.end()
#define mp make_pair
using namespace std;
using ll=long long;
using P=pair<int,int>;
const ll INF=1LL<<30;
const ll LINF=1LL<<61;
const double eps=1e-5;
const ll MOD=1e9+7;
double dp[310][310][310];
int main(){
    int n;cin>>n;
    int c1=0,c2=0,c3=0;
    for(int i=0;i<n;i++){
        int a;cin>>a;
        if(a==1){
            c1++;
        }else if(a==2){
            c2++;
        }else if(a==3){
            c3++;
        }
    }
    for(int i=0;i<=n;i++){
        for(int j=0;j<=n-i;j++){
            for(int k=0;k<=n-i-j;k++){
                if(i+j+k==0)continue;
                double s=0;
                if(i){
                    s+=dp[i-1][j+1][k]*((double)i/(double)n);
                }
                if(j){
                    s+=dp[i][j-1][k+1]*((double)j/(double)n);
                }
                if(k){
                    s+=dp[i][j][k-1]*((double)k/(double)n);
                }
                dp[i][j][k]=(1.0+s)/((double)(i+j+k)/(double)n);
            }
        }
    }
    printf("%.10lf\n",dp[c3][c2][c1]);
}   


Measured memory_bytes: 225536
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author indy256
 */

#include <bits/stdc++.h>

using namespace std;

template<int mod>
struct modint {
    int value;

    modint(long long x = 0) {
        value = normalize(x);
    }

    int normalize(long long x) {
        if (x < -mod || x >= mod)
            x %= mod;
        if (x < 0) x += mod;
        return static_cast<int>(x);
    }

    explicit operator int() const { return value; }

    modint operator-() const { return modint(-value); }

    modint &operator+=(modint rhs) {
        if ((value += rhs.value) >= mod) value -= mod;
        return *this;
    }

    modint &operator-=(modint rhs) {
        if ((value -= rhs.value) < 0) value += mod;
        return *this;
    }

    modint &operator*=(modint rhs) {
        value = normalize(static_cast<long long>(value) * rhs.value % mod);
        return *this;
    }

    modint &operator/=(modint rhs) { return *this *= modint(inverse(rhs.value, mod)); }

    int inverse(int a, int m) {
        int u = 0, v = 1;
        while (a != 0) {
            int t = m / a;
            m -= t * a;
            swap(a, m);
            u -= t * v;
            swap(u, v);
        }
        assert(m == 1);
        return u;
    }

    friend modint operator+(modint lhs, modint rhs) { return lhs += rhs; }

    friend modint operator-(modint lhs, modint rhs) { return lhs -= rhs; }

    friend modint operator*(modint lhs, modint rhs) { return lhs *= rhs; }

    friend modint operator/(modint lhs, modint rhs) { return lhs /= rhs; }

    friend bool operator==(modint lhs, modint rhs) { return lhs.value == rhs.value; }

    friend bool operator!=(modint lhs, modint rhs) { return lhs.value != rhs.value; }
};

constexpr int mod = (int) 1e9 + 7;
using mint = modint<mod>;

void solve(istream &in, ostream &out) {
    int x, y;
    in >> x >> y;
    if (x > y)swap(x, y);
    mint res;
    if ((x + y) % 3 != 0) {
        res = 0;
    } else {
        int n = (x + y) / 3;
        int k = n / 2;
        while (x+1 <= y-1) {
            ++x;
            --y;
            --k;
        }
        if (k < 0 || k > n) {
            res = 0;
        } else {
            res = 1;
            for (int i = 0; i < k; i++) {
                res = res * (n - i) / (i + 1);
            }
        }
    }
    out << (int) res << '\n';
}


int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    std::istream& in(std::cin);
    std::ostream& out(std::cout);
    solve(in, out);
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
static const int MAX = 200000;

int main(){
	int R[MAX],n,i;
	
	cin >> n;
	for(i=0;i<n;i++){
		cin >>R[i];
	}
	
	int maxv = -2000000000;
	int minv = R[0];

	for(i = 1;i<n;i++) {
	maxv = max(maxv,R[i] - minv);
	minv = min(minv,R[i]);
	}

	cout << maxv << endl;
	return 0;
}



Measured memory_bytes: 3872
import heapq


def dijkstra(adj, s):
    INF = 200000
    n = len(adj)
    state, d, p = [False] * n, [INF] * n, [-1] * n
    d[s] = 0
    pq = [(d[s], s)]
    while pq:
        f, u = heapq.heappop(pq)
        state[u] = True
        if d[u] < f:
            continue
        for v, c in adj[u]:
            if state[v]:
                continue
            if d[u] + c < d[v]:
                d[v] = d[u] + c
                p[v] = u
                heapq.heappush(pq, (d[v], v))
    return d


def main():
    n = int(input())
    adj = [[] for _ in range(n)]
    for _ in range(n):
        u, _, *vc = map(int, input().split())
        for v, c in zip(vc[::2], vc[1::2]):
            adj[u].append((v, c))
    dist = dijkstra(adj, 0)
    for i, d in enumerate(dist):
        print(i, d)


if __name__ == '__main__':
    main()



Measured memory_bytes: 68328
/**
	Language: C++ 11
	Author  : ebby21
**/

#include <bits/stdc++.h>

using namespace std;

#define FASTIO() ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
#define DEBUG(var) cerr << '\n' << #var << "\t:\t" << var << '\n'
#define FORF(i, L, U) for (ll i = (L); i <= (U); ++i)
#define FORR(i, U, L) for (ll i = (U); i >= (L); --i)
#define FORE(i, x) for (auto i = (x).begin(); i != (x).end(); ++i)
#define ALL(x) (x).begin(), (x).end()

typedef unsigned int ui;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< ii > vii;

int main() {
	FASTIO();
	int n;
	cin >> n;
	vi a(n), freq(n + 1,0);
	FORF(i, 0, n - 1) {
		cin >> a[i];
		freq[a[i]]++;
	}
	ll  sum = 0;
	FORF(i, 1, n) {
		if (freq[i] >= 2)
			sum += freq[i] * (freq[i] - 1LL) /2LL;
	}
	FORF(i, 0, n - 1) {
		if (freq[a[i]] >= 2) {
			ll ans = sum - (freq[a[i]] - 1);
			cout << ans << '\n';
		} else {
			cout << sum << '\n';
		}
	}
	return 0;
}


Measured memory_bytes: 4224
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<ll,ll> P;
#define pb push_back
#define ft first
#define sd second
#define mp make_pair
#define fr(i,n) for(int i=0;i<(n);i++)
#define Fr(i,n) for(int i=0;i++<(n);)
#define ifr(i,n) for(int i=(n)-1;i>=0;i--)
#define iFr(i,n) for(int i=(n);i>0;i--)

int main(){
    int n,c[22],v[22],ans=0;
    cin>>n;
    fr(i,n) cin>>v[i];
    fr(i,n) cin>>c[i];
    fr(i,n) ans+=max(0,v[i]-c[i]);
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
using namespace std;
static const int MAX_COUNT = 100;

int main()
{
	int n;
	int R[MAX_COUNT];


	cin >> n;

	for (int i = 0; i < n; i++)
	{
		cin >> R[i];
	}

	int v;
	int j;

	for (int k = 0; k < n - 1; k++)
	{
		printf("%d ", R[k]);
	}
	printf("%d\n", R[n - 1]);


	for (int i = 1; i < n; i++)
	{
		v = R[i];
		j = i - 1;

		while (j >= 0 && R[j] >= v)
		{
			R[j+1] = R[j];
			j--;
		}
		R[j + 1] = v;

		for (int k = 0; k < n-1; k++)
		{
			printf("%d ", R[k]);
		}
		printf("%d\n", R[n-1]);

	}

	cin.ignore();
	getchar();

	return 0;
}

Measured memory_bytes: 3220
def main():
    N = int(input())
    L = [0] * (N+1)
    L[0] = 2
    L[1] = 1
    for i in range(2, N+1):
        L[i] = L[i-1] + L[i-2]
    print(L[N])


if __name__ == "__main__":
    main()


Measured memory_bytes: 38256
import itertools
def change(m, x, y):
    m[y][x] ^= 1
    if y>0: m[y-1][x] ^= 1
    if x>0: m[y][x-1] ^= 1
    if x<9: m[y][x+1] ^= 1
    if y<9: m[y+1][x] ^= 1
ans = [[0] * 10 for i in xrange(10)]
for t in xrange(input()):
    m = [map(int, raw_input().split()) for i in xrange(10)]
    for p in itertools.product((0,1), repeat=10):
        mm = [m[i][:] for i in xrange(10)]
        for i in xrange(10):
            if p[i]:
                change(mm, i, 0)
            ans[0][i] = p[i]
        for i in xrange(9):
            for j in xrange(10):
                if mm[i][j]:
                    change(mm, j, i+1)
                    ans[i+1][j] = 1
                else:
                    ans[i+1][j] = 0
        if not any(mm[9]):
            for i in xrange(10):
                print " ".join(map(str, ans[i]))
            break

Measured memory_bytes: 4432
import bisect
from sys import exit, stdin
N = int(stdin.readline().rstrip())
L = sorted([int(_) for _ in stdin.readline().rstrip().split()])

ans = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        ans += bisect.bisect_left(L, L[i]+L[j])-j-1
print(ans)

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

#define rep(i,n) for(i = 0;i < n;++i)
#define all(v) v.begin(), v.end()
using ll = long long;

int main()
{
    ll i,j;
    
    ll v,e;
    cin >> v >> e;
    
    vector<vector<pair<ll,ll>>> graph(v); //グラフ(重み、行き先)
    for(i = 0;i < e;++i){
        ll s,t,w;
        cin >> s >> t >> w;
        graph.at(s).emplace_back(w,t);
        graph.at(t).emplace_back(w,s);
    }
    ll ans = 0; //最小全域木の重さ
    priority_queue<pair<ll,ll>> pq; //優先度付きキュー
    vector<bool> visit(v,false); //連結管理
    ll top = 0; //探索開始点
    visit.at(top) = true;
    for(i = 0;i < graph.at(top).size();++i){ //詰め込む
        ll w = graph.at(top).at(i).first;
        ll g = graph.at(top).at(i).second;
        pq.emplace(-w,g);
    }
    ll remain = v-1; //探索管理(残頂点数)
    while(remain){
        ll w = -pq.top().first;
        ll now = pq.top().second;
        pq.pop();
        if(visit.at(now)) continue; //訪問済みは除く
        visit.at(now) = true;
        --remain;
        ans += w; //重み追加
        for(i = 0;i < graph.at(now).size();++i){
            ll nw = graph.at(now).at(i).first;
            ll next = graph.at(now).at(i).second;
            if(!visit.at(next)) pq.emplace(-nw, next);
        }
    }

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


Measured memory_bytes: 10240
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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

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

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------

ll N;
ll A[1000];

int main() {
  //
  cin >> N;
  rep(i, 0, N) { cin >> A[i]; }

  ll money = 1000;
  ll stock = 0;

  for (ll i = 0; i < N - 1; ++i) {
    if (A[i + 1] > A[i]) {
      ll buy = money / A[i];
      stock += buy;
      money -= A[i] * buy;
    } else if (A[i + 1] < A[i]) {
      money += A[i] * stock;
      stock = 0;
    }
  }

  cout << money + A[N - 1] * stock;
}


Measured memory_bytes: 3624
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
using vl = vector<long long>;
using vs = vector<string>;
using ii = vector<vector<long long>>;
int main() {
	ll a;
	cin >> a;
	vl x(a - 1);
	vl y(a);
	for (int i = 0; i < a - 1; i++) {
		cin >> x[i];
	}
	for (int i = 0; i < a-1; i++) {
		if (i != 0) {
			y[i] = min(x[i], x[i - 1]);
		}
		else {
			y[i] = x[i];
		}
	}
	ll count = 0;
	for (int i = 0; i < a; i++) {
		count += y[i];
	}
	cout << count+x[a-2] << endl;
}

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

int a(string s) {
  int ans = 0;
  int c = 0;
  for(int i = 0;i<(int) s.size();i++) {
    if(s[i] == 'R') {
      c += 1;
      ans = max(ans, c);
    } else {
      c = 0;
    }
  }
  return ans;
}

int main() {
  string s;
  cin >> s;
  cout << a(s);
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
using lli = long long;
using pii = pair<int, int>;

#define rep(i,k,n) for(int i=(k); i != int(n); ++i)
#define sz(x) x.size()
#define all(x) x.begin(), x.end()

#define dbg(x) cout << #x << '=' << x << '\n'
#define dbg2(x, y) cout << #x << '=' << x << ' ' << #y << '=' << y << '\n' 

#define input() (*istream_iterator<int>(cin))
#define strin() (*istream_iterator<string>(cin))
#define output(x) cout << x << '\n' 

int main(){
    ios::sync_with_stdio(false);
    int n = input();
    lli sum = 0;
    for(int i = 1; i <=n; ++i){
        for(int j = 1; j <= n; ++j){
            for(int k = 1; k <= n; ++k) sum += __gcd(__gcd(i, j), k);
        }
    }
    cout << sum;
}

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

int mod = 1'000'000'007;

int main(){
        int n, m;
        cin >> n >> m;
        vector<int> s(n);
        for (int i = 0; i < n; i++) cin >> s[i];
        vector<int> t(m);
        for (int i = 0; i < m; i++) cin >> t[i];
        vector<vector<int>> dp(2001, vector<int>(2001, 0));
        for (int i = 0; i <= n; i++){
            for (int j = 0; j <= m; j++){
                if (i == 0 || j == 0) dp[i][j] = 1;
                else{
                    dp[i][j] = (dp[i-1][j] + dp[i][j-1]) % mod;
                    if (s[i-1] != t[j-1]) dp[i][j] += mod - dp[i-1][j-1];
                }
                dp[i][j] %= mod;
            }
        }
  cout << dp[n][m] << endl;
}



Measured memory_bytes: 16000
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#define REP(i, n) for (ll i = 0; i < n; i++)
#define REP1(i, n) for (ll i = 1; i <= n; i++)
#define RREP(i, n) for (ll i = n - 1; i >= 0; i--)
#define RREP1(i, n) for (ll i = n; i >= 1; i--)
#define FOR(i, a, b, c) for (ll i = a; i <= b; i += c)
#define RFOR(i, a, b, c) for (ll i = a; i >= b; i -= c)
#define MAX(a, b) (a > b ? a : b)
#define MIN(a, b) (a < b ? a : b)
#define INF 1145141919
typedef long long ll;

int main() {
    char o[51], e[51];
    scanf("%s %s", o, e);
    int olen = strlen(o);
    int elen = strlen(e);

    REP(i, elen * 2) {
        if (i % 2 == 0) putchar(o[i / 2]);
        else putchar(e[i / 2]);
    }
    if (olen > elen) putchar(o[olen - 1]);
    return 0;
}

Measured memory_bytes: 128
#!/usr/bin/env python

from collections import deque
import itertools as ite
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

n, q = map(int, raw_input().split())

par = [i for i in range(n + 1)]
rnk = [0 for i in range(n + 1)]

def find(x):
    if par[x] == x:
        return x
    par[x] = find(par[x])
    return par[x]

def same(x, y):
    return find(x) == find(y)

def unite(x, y):
    x_par = find(x)
    y_par = find(y)
    if x_par == y_par:
        return
    
    if rnk[x_par] < rnk[y_par]:
        par[x_par] = y_par
    else:
        par[y_par] = x_par
        if rnk[x_par] == rnk[y_par]:
            rnk[x_par] += 1

for loop in range(q):
    c, x, y = map(int, raw_input().split())
    if c == 0:
        unite(x, y)
    else:
        print int(same(x, y))


Measured memory_bytes: 8504
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define MM 1000000000;
#define mod MM + 7;
#define INF (ll)1e18
#define pi acos(-1.0)
#define MAX 100005
#define NIL -1
int main(){
    ll n; cin >> n;
    ll a[n];
    map<ll, int> mp;
    ll cnt = 0;
    for(ll i = 0; i < n; i++){
        cin >> a[i];
    }
    for(ll i = 0; i < n; i++){
        if(mp[a[i]] == 0){
            mp[a[i]]++;
            cnt++;
        } else {
            mp[a[i]]--;
            cnt--;
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 7296
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text.RegularExpressions;
using System.Diagnostics;
using static System.Math;

//var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
namespace AtCoderSolve
{

    class Solve
    {
        const int mod = 1000000007;
        const int INF = 2147483647;
        const long SINF = 9223372036854775807;

        static int N;
       

        public static void Input()
        {
            var cin = new Solve();
            N = int.Parse(Console.ReadLine());
        }

        static void Main(string[] args)
        {
            Input();
            //var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            //Console.SetOut(sw);

            long[] ans = new long[N + 1];
            ans[0] = 2;
            ans[1] = 1;
            if (N > 1)
            {
                for(var i = 2; i <= N; i++)
                {
                    ans[i] = ans[i - 1] + ans[i - 2];
                }
            }
            Console.WriteLine(ans[N]);
            
            

            //Console.Out.Flush();
        }

        public int[] SplitReader()
        {
            int[] array = Console.ReadLine().Split().Select(int.Parse).ToArray();
            return array;
        }
        public long[] SplitReaderL()
        {
            long[] array = Console.ReadLine().Split().Select(long.Parse).ToArray();
            return array;
        }

    }
}

    



Measured memory_bytes: 13140
#include<iostream>
#include<string>
#include<vector>
#include<numeric>
#include<math.h>
#include<algorithm>
#include<iomanip>
#include<list>
#include<bitset>
using namespace std;

class Switches {
public:
	Switches(const vector<unsigned int>& flag, const vector<unsigned int>& light, const vector<unsigned int>& p);
	~Switches();
	int main_calc();
private:
	void make_pattern(unsigned int x, unsigned int i);
private:
	const vector<unsigned int>& flag;
	const vector<unsigned int>& light;
	const vector<unsigned int>& p;
	vector<unsigned int> pattern;
	int cnt = 0;
};

Switches::Switches(const vector<unsigned int>& flag, const vector<unsigned int>& light, const vector<unsigned int>& p) : flag(flag), light(light), p(p) {
	pattern.clear();
	cnt = 0;
}

Switches::~Switches() {
}

void Switches::make_pattern(unsigned int x, unsigned int i) {
	if (i == flag.size()) {
		pattern.push_back(x);
		return;
	}
	else {
		// iのスイッチはoff
		make_pattern(x, i + 1);
		// iのスイッチはon
		make_pattern(x | flag[i], i + 1);
	}
}

int Switches::main_calc() {

	bool jdg = true;

	// 全てのスイッチのパターンを作成
	make_pattern(0, 0);

	// スイッチのパターンに関するループ
	for (int i = 0; i < pattern.size(); i++) {
		jdg = true;
		// 電球のループ
		for (int j = 0; j < light.size(); j++) {
			// 点灯するかどうかの分岐
			if (p[j] != (bitset<10>(light[j] & pattern[i]).count() % 2)) {
				jdg = false;
				break;
			}
		}
		// 全て点灯する場合
		if (jdg == true) {
			cnt += 1;
		}
	}

	return cnt;
}

int main() {

	unsigned int N, M;
	cin >> N >> M;

	// BIT_FLAGを作成
	vector<unsigned int> BIT_FLAG(N, 0);
	for (unsigned int i = 0; i < N; i++) {
		BIT_FLAG[i] = (1 << i); // (i+1)桁目が 1 となり、それ以外は 0 となる
	}

	// 電球の情報を格納
	vector<unsigned int> BIT_LIGHT(M, 0);
	unsigned int k;
	unsigned int s;
	// 電球のループ
	for (unsigned int i = 0; i < M; i++) {
		cin >> k;
		// スイッチのループ
		for (unsigned int j = 0; j < k; j++) {
			cin >> s;
			BIT_LIGHT[i] |= BIT_FLAG[s - 1];
		}
	}

	// 条件を格納
	vector<unsigned int> p(M, 0);
	for (int i = 0; i < M; i++) {
		cin >> p[i];
	}

	Switches sw(BIT_FLAG, BIT_LIGHT, p);

	cout << sw.main_calc() << endl;

	return 0;
}



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

int main(void) 
{
    int n;
    cin >> n;
    string c;
    cin >> c;

    ll ans = 0;
    int index = 0;
    rep(i,n){
        if(c[n-i-1] == 'R') 
        {
            for(int j = index; j < n-i-1; j++)
            {
                if(c[j] == 'W')
                {
                    c[j] = 'R';
                    c[n-i-1] = 'W';
                    ans++;
                    break;
                }
                index++;
            }
            if(c[n-i-1] == 'R') break;
            continue;
        }
    }

   cout << ans << endl;
}

Measured memory_bytes: 3748