akhauriyash/Code-Regression huggingface dataset:
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <utility>
#include <iostream>
#include <algorithm>
#include <functional>

using namespace std;

#define INF (1 << 30)
#define INFL (1LL << 62)
#define MOD7 1000000007
#define MOD9 1000000009
#define EPS 1e-10

#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pul pair<ull, ull>
#define all(a) (a).begin(), (a).end()
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);--i)
#define REP(i,n) for (int i=0;i<(n);++i)
#define RREP(i,n) for (int i=(n)-1;i>=0;--i)

void YES() { cout << "YES" << endl; }
void NO() { cout << "NO" << endl; }
void Yes() { cout << "Yes" << endl; }
void No() { cout << "No" << endl; }
void yes() { cout << "yes" << endl; }
void no() { cout << "no" << endl; }
void Taka() { cout << "Takahashi" << endl; }
void Aoki() { cout << "Aoki" << endl; }
void digit(int d) { cout << fixed << setprecision(d); }
void IOup() { cin.tie(0); ios::sync_with_stdio(false); }

int main() {	

	int h, r;

	cin >> h >> r;

	if (h + r == 0) cout << 0;
	else if (h + r > 0) cout << 1;
	else cout << -1;
	cout << endl;
	
	return 0;
}

Measured memory_bytes: 3072
n,k = map(int,input().split())
li = list(map(int,input().split()))

ans = [0]*n
# 地味に遅い
# for i in range(1,n):
#     l = []
#     if k > i:
#         for j in range(i):
#             l.append(abs(li[i]-li[j])+ans[j])
#     else:
#         for j in range(1,k+1):
#             l.append(abs(li[i]-li[i-j])+ans[i-j])
#     ans[i] = min(l)
# print(ans[-1])

for i in range(1,n):
    l = [ abs(li[i]-li[j]) + ans[j] for j in range(max(0,i-k),i)]
    # print(l)
    ans[i] = min(l)
print(ans[-1])

Measured memory_bytes: 20480
import copy
H, W, K = map(int, input().split())
C = list(input() for _ in range(H))
ans = 0
for cnt in range(2**(H+W)):
    h = []
    w = []
    tmp = 0
    for i in range(H):
        if cnt >> i & 1:
            h += [i]
    for i in range(W):
        if cnt >> (i+H) & 1:
            w += [i]
    for i in range(H):
        for j in range(W):
            if (C[i][j] == "#") and (not i in h) and (not j in w):
                tmp += 1
    if tmp == K:
        ans += 1
print(ans)
    

Measured memory_bytes: 9328
#if defined(__GNUC__)
#include <bits/stdc++.h>
#define __int32 __int32_t
// __GNUC__
#else
#include "bits/stdc++.h"
#endif
using namespace std;

#define int long long

#define itn __int32
#define REP(i, n) for(itn (i) = 0; (i) < (n); ++(i))
#define REP2(i, x, n) for(itn (i) = x; (i) < (n); ++(i))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define SORT(x) std::sort(ALL(x))
#define RSORT(x) std::sort(ALL(x), greater<decltype(x)::value_type>())
#define RSORT2(x, T) std::sort(ALL(x), greater<T>())
#define REVERCE(x) std::reverce(ALL(x))
#define ACM(x, y) std::accumulate(ALL(x), y)

#define INT_POW(x, y) [](int a, int b) -> int {int c = a; REP(i, b - 1){c *= a;} return c;}(x, y)
#define INT_POWM(x, y, m) [](int a, int b, int m) -> int {int c = a; REP(i, b - 1){c *= a; c %= m;} return c;}(x, y, m)
#define FCT(x) [](int a) -> int {int r = 1; REP(i, a){r *= i;} return r;}(x)

itn main() {
	std::ios::sync_with_stdio(false);

	int n, m;

	cin >> n >> m;

	if (n == 1 && m == 1) {
		cout << 1;
	}
	else if (n == 1 || m == 1) {
		cout << max(n, m) - 2;
	}
	else {
		cout << (n - 2) * (m - 2);
	}

	return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Globalization;
using System.Diagnostics;
using static System.Console;
using Pair = System.Collections.Generic.KeyValuePair<int, int>;

class Program
{
    static void Main()
    {
        SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().Solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 };
    readonly int mod = 1000000007;
    readonly string alfa = "abcdefghijklmnopqrstuvwxyz";


    void Solve()
    {
        WriteLine((cin.Nextint < 1200) ? "ABC" : "ARC");
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] Scan { get { return ReadLine().Split(); } }
    public int[] Scanint { get { return Array.ConvertAll(Scan, int.Parse); } }
    public long[] Scanlong { get { return Array.ConvertAll(Scan, long.Parse); } }
    public double[] Scandouble { get { return Array.ConvertAll(Scan, double.Parse); } }
    public string Next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return Next;
        }
    }
    public int Nextint { get { return int.Parse(Next); } }
    public long Nextlong { get { return long.Parse(Next); } }
    public double Nextdouble { get { return double.Parse(Next); } }
}

Measured memory_bytes: 2648
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <memory.h>
#include <math.h>
#include <assert.h>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <algorithm>
#include <iostream>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <bitset>

using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define szz(x) ((int)(x).size())
#define rep(i, n) for(int i=0;i<n;i++)
#define all(x) (x).begin(), (x).end()
typedef tuple<int, int, int> t3;
typedef pair<ll, ll> pll;
typedef long double ldouble;
typedef pair<double, double> pdd;

int N;
pii A[5050];
int d[5050][5050];

void solve() {
	scanf("%d", &N);
	for(int i=1;i<=N;i++) scanf("%d%d", &A[i].Fi, &A[i].Se);
	sort(A+1, A+1+N, [&](pii a, pii b) { return a.Fi + a.Se < b.Fi + b.Se; });
	memset(d, -1, sizeof d);
	d[0][0] = 0;
	int ans = 0;
	for(int i=1;i<=N;i++) {
		for(int j=0;j<=i;j++) {
			if(d[i-1][j] != -1) d[i][j] = d[i-1][j];
			if(j && d[i-1][j-1] != -1 && d[i-1][j-1] <= A[i].Fi) {
				int val = d[i-1][j-1] + A[i].Se;
				if(d[i][j] == -1 || d[i][j] > val) d[i][j] = val;
			}
			if(d[i][j] != -1) ans = max(ans, j);
		}
	}
	printf("%d\n", ans);
}

int main(){
	int Tc = 1; // scanf("%d\n", &Tc);
	for(int tc=1;tc<=Tc;tc++){
		solve();
	}
	return 0;
}


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


const int S=(1<<20)+5;
char buf[S],*H,*T;
inline char Get()
{
    if(H==T) T=(H=buf)+fread(buf,1,S,stdin);
    if(H==T) return -1;return *H++;
}
inline int read()
{
    int x=0;char c=Get();
    while(!isdigit(c)) c=Get();
    while(isdigit(c)) x=x*10+c-'0',c=Get();
    return x;
}

const int N=310;
int A[N][N],n,m;
int pos[N],cnt[N];
bool vis[N];

int main()
{
    n=read();m=read();
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
            A[i][j]=read();
    for(int i=1;i<=n;i++) pos[i]=1;
    int ans=INT_MAX;
    while(true)
    {
        int mx=0,cc=0;
        memset(cnt,0,sizeof(cnt));
        for(int i=1;i<=n;i++)
        {
            while(vis[A[i][pos[i]]]) pos[i]++;
            if(!A[i][pos[i]]) continue;
            cnt[A[i][pos[i]]]++;
            if(cnt[A[i][pos[i]]]>mx)
                cc=A[i][pos[i]],mx=cnt[cc];
        }
        if(!mx) break;
        ans=min(ans,mx);
        vis[cc]=1;
        for(int i=1;i<=n;i++)
            if(A[i][pos[i]]==cc) pos[i]++;
    }
    printf("%d\n",ans);
    return 0;
}

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

using namespace std;

typedef long long ll;

ll N, M, Q, A, B, C, arr[200005];
string s, p;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cin >> N;
	A = 0, B = 0, C = 1e9+2;
	for (int i = 1; i <= N; ++i){
		cin >> arr[i];
		if (arr[i] < 0){
			B++;
			arr[i] *= -1;
		} 
		C = min(C,abs(arr[i]));
		A += arr[i];
	}
	if (B%2!=0){
		A -= 2*C;
	}
	cout << A << '\n';
	
}

Measured memory_bytes: 1024
#include <iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main()
{
	int A;int B;string s;int count = 0;
	cin >> A;cin >> B;cin >> s;
	if (s[A] != '-') {
		cout << "No";return 0;
	}
	for (int i = 0;i <A+1+B;i++) 
	{
		if (i == A)continue;
		int ok = 0;
		for (int j = 0;j < 10;j++)if(s[i] == 48+j)ok++;
		if (ok == 0) { cout << "No"; return 0; }
	}
	if (s.size()==A+B+1)
		cout << "Yes";
	else cout << "No";
}

Measured memory_bytes: 256
N=int(input())
D = {}
for _ in range(N):
  s = input().strip()
  if s not in D:
  	D[s] = 0
  D[s] += 1

M=int(input())
for _ in range(M):
  s = input().strip()
  if s not in D:
  	D[s] = 0
  D[s] -= 1
print(max(list(D.values()) + [0]))

Measured memory_bytes: 3060
def chocolate_bar():
	h, w = map(int, input().split())

	print(min(solve(h, w), solve(w, h)))

def solve(h, w):
	ans = h*w

	for i in range(1, h):
		sa = i*w

		sb1 = (h-i)//2*w
		sc1 = h*w - sa - sb1

		sb2 = (h-i)*(w//2)
		sc2 = h*w - sa - sb2

		ans = min(
			ans,
			max(sa, sb1, sc1) - min(sa, sb1, sc1),
			max(sa, sb2, sc2) - min(sa, sb2, sc2)
			)

	return ans

if __name__ == '__main__':
	chocolate_bar()


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

using namespace std;

#define all(v)				((v).begin()), ((v).end())
#define allr(v)				((v).rbegin()), ((v).rend())
#define sz(v)				((int)((v).size()))
#define ll long long
#define pb					push_back
#define fIO ios_base::sync_with_stdio(0);cin.tie(0);

const ll oo = 1e8;
const double pi = 3.1415926535897;


const double EPS = (1e-7);
int dcmp(double x, double y) {	return fabs(x-y) <= EPS ? 0 : x < y ? -1 : 1;	}


typedef vector<int>                vi;
typedef vector<pair<int,int>>      vii;
typedef vector<ll>                 vll;
typedef vector<double>             vd;
typedef vector< vi >               vvi;
typedef vector< vd >               vvd;
typedef vector<string>             vs;
typedef pair<int, int>             pii;

/**
    * PLEASEEE READDD PROBLEEEM CARFULLY ****
    * Always check for OVERFLOW ll vs int
    * Always check for array bounds
    * Check for function return
    * READ OUTPUT SECTION AGAIN!!!
**/

struct edge{
    int from, to, w;

    edge(){}
    edge(int x, int y, int we): from(x), to(y), w(we){}

    bool operator < (const edge &rhs) const{
        return w > rhs.w;
    }

};

int main(){
    fIO
//    freopen("", "r", stdin);
//    freopen("", "w", stdout);

    int x, n;
    cin >> x >> n;
    int vis[105] = {};

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

        vis[a] = 1;
    }

    int p1 = x, p2 = x;
    if(!vis[x]) return cout << x, 0;
    while(true) {
        p1--;
        p2++;

        if(!vis[p1]) return cout << p1, 0;
        if(!vis[p2]) return cout << p2, 0;
    }
}








Measured memory_bytes: 3612
// header {{{za
#include <bits/stdc++.h>
using namespace std;

// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define INF         INT_MAX/3
#define LLINF       LLONG_MAX/3
#define MOD         (1000000007LL)
#define MODA(a, b)  a=((a)+(b))%MOD
#define MODP(a, b)  a=((a)*(b))%MOD
#define inc(i, l, r)   for(int i=(l);i<(r);i++)
#define dec(i, l, r)   for(int i=(r)-1;i>=(l);i--)
#define pb          push_back
#define se          second
#define fi          first
#define mset(a, b)  memset(a, b, sizeof(a))

using LL  = long long;
using G   = vector<vector<int>>;

int di[] = {0, -1, 0, 1};
int dj[] = {1, 0, -1, 0};
// }}}

int main() {
    cin.tie(0);ios::sync_with_stdio(false);
    LL n, k;cin >> n >> k;
    vector<LL> a(n);
    inc(i, 0, n) cin >> a[i];
    LL ans = 0;
    inc(i, 0, n){
        inc(j, i+1, n){
            if(a[i] > a[j]){
                ans += k*(k+1LL)/2LL;
                ans %= MOD;
            }
        }
        inc(j, 0, i){
            if(a[i] > a[j]){
                ans += k*(k-1LL)/2LL;
                ans %= MOD;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


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

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);

        int r = Integer.parseInt(sc.next());
        int c = Integer.parseInt(sc.next());
        int[][] sheet = new int[r+1][c+1];
        for (int i = 0; i < r; i++) {
            for (int j = 0; j < c; j++) {
                sheet[i][j] = Integer.parseInt(sc.next());
                sheet[i][c] += sheet[i][j];
                sheet[r][j] += sheet[i][j];
                sheet[r][c] += sheet[i][j];
            }
        }
        for (int i = 0; i < r+1; i++) {
            String ans = "";
            for (int j = 0; j < c+1; j++) {
                if (j != 0) {
                    ans += " ";
                }
                ans += String.valueOf(sheet[i][j]);
            }
            out.printf("%s\n", ans);
        }
        out.flush();
    }
}


Measured memory_bytes: 65876
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{
	class Program
	{
		static void Main(string[] args)
		{
			var firstLine = Console.ReadLine().Split(' ');
			
			Console.WriteLine(firstLine.Distinct().Count());
		}
	}
}


Measured memory_bytes: 13280
#include <iostream>

using namespace std;

void solve()
{
	int c[3];
	while(cin >> c[0] >> c[1] >> c[2])
	{
		bool flag[11];
		for(int i = 0; i < 11; ++i)
		{
			flag[i] = true;
		}
		for(int i = 0; i < 3; ++i)
		{
			flag[c[i]] = false;
		}
		int sum = c[0] + c[1];
		int count = 0;
		for(int i = 1; i < 11; ++i)
		{
			if(flag[i] == true && sum + i <= 20)
			{
				++count;
			}
		}
		if(count / 7.0 >= 0.5)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
}

int main()
{
	solve();
	return(0);
}

Measured memory_bytes: 0
s = raw_input().split()
n = int(s[0])
q = int(s[1])

process_name = []
process_time = []
for x in xrange(n):
  ps = raw_input().split()
  process_name.append(ps[0])
  process_time.append(int(ps[1]))

total_time = 0
while process_name != []:
  pn = process_name.pop(0)
  pt = process_time.pop(0)
  if pt <= q:
    total_time += pt
    print pn, total_time
  else: 
    total_time += q
    process_name.append(pn)
    process_time.append(pt-q)

Measured memory_bytes: 9332
import numpy as np
a,b,c = map(int,input().split())
b_list = list(map(int,input().split()))
a_list =[]
for _ in range(a):
  a_list.append(list(map(int,input().split())))

ans = 0
for i in range(a):
  if sum((np.array(b_list) * np.array(a_list[i])).tolist()) + c > 0:
    ans +=1
    
print(ans)

Measured memory_bytes: 13544
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
using namespace std;
typedef long long ll;

void solve(){
  ll n, k; cin >> n >> k;
  vector<ll> a(n);
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  for(ll i = 0; i < k; i++){
    vector<ll> b(n);
    for(ll j = 0; j < n; j++){
      ll l = j - a[j], r = j + a[j] + 1;
      if(l < 0){
        b[0]++;
      }
      else{
        b[l]++;
      }
      if(r <= n - 1){
        b[r]--;
      }
    }
    for(int j = 1; j < n; j++){
      b[j] += b[j - 1];
    }
    a = b;
    if(a[0] == n && a[n - 1] == n) break;
  }
  for(int i = 0; i < n; i++){
    cout << a[i] << " ";
  }
  cout << endl;
  return;
}

int main(){
  solve();
  return 0;
}


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

int main()
{
  string str1, str2; cin >> str1 >> str2;
  if (str1[0] == str2[2] and str1[1] == str2[1] and str1[2] == str2[0])
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long int
#define mp make_pair
#define S second
#define F first
ll mod=1e9+7;
#define input_from_file  freopen("input.txt", "r", stdin);

int main()
{
  // input_from_file;
  ll n,k,sum=0;;
  cin>>n>>k;
  vector<ll> wt(n,0),cost(n,0);
  for(int i=0;i<n;i++)  {cin>>wt[i]>>cost[i];sum+=cost[i];}
  vector<vector<ll>>  dp(n+1,vector<ll> (sum+1,1e9));
  for(int i=0;i<=n;i++) dp[i][0]=0;
  ll ans=0,val=1e9;
  for(ll i=1;i<=n;i++){//cout<<cost[i-1]<<endl;
    for(ll j=1;j<=sum;j++){
      if(cost[i-1]>j) dp[i][j]=dp[i-1][j];
      else{
        dp[i][j]=min(dp[i-1][j],dp[i-1][j-cost[i-1]]+wt[i-1]);
        ll diff=k-dp[i][j];
        if(diff>=0 && ans<j){
          ans=j;
        }
      }
    }
  }
  // for(ll i=0;i<=n;i++){
  //   for(ll j=0;j<=sum;j++)
  //     cout<<dp[i][j]<<" ";cout<<endl;
  // }
  cout<<ans;
  return 0;
}

Measured memory_bytes: 80256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(var, begin, end) for (int var = (begin); var <= (end); var++)
#define RFOR(var, begin, end) for (int var = (begin); var >= (end); var--)
#define REP(var, length) FOR(var, 0, length - 1)
#define RREP(var, length) RFOR(var, length - 1, 0)
#define EACH(value, var) for (auto value : var)
#define SORT(var) sort(var.begin(), var.end())
#define REVERSE(var) reverse(var.begin(), var.end())
#define RSORT(var) SORT(var); REVERSE(var)
#define OPTIMIZE_STDIO ios::sync_with_stdio(false);cin.tie(0);cout.precision(10);cout << fixed
#define endl '\n'

const ll MOD = 1e9 + 7;
const ll INF = 1e18;
int n, l;
void warshallfloyd(vector<vector<ll>>& dp) {
  for(int k = 0; k < n; k++)
    for(int i = 0; i < n; i++)
      for(int j = 0; j < n; j++)
        if (dp[i][k] + dp[k][j] < dp[i][j]) {
          dp[i][j] = dp[i][k] + dp[k][j];
        }
}

void solve(istream& cin, ostream& cout) {
  int m;
  cin >> n >> m >> l;
  vector<vector<ll>> dist(n, vector<ll>(n, INF));
  REP(i, m) {
    int a, b, c;
    cin >> a >> b >> c;
    a--;
    b--;
    dist[a][b] = c;
    dist[b][a] = c;
  }
  warshallfloyd(dist);
  vector<vector<ll>> cnt(n, vector<ll>(n, INF));
  REP(i, n) {
    REP(j, n) {
      if (dist[i][j] <= l) {
        cnt[i][j] = 1;
      }
    }
  }
  warshallfloyd(cnt);
  int q;
  cin >> q;
  REP(i, q) {
    int s, t;
    cin >> s >> t;
    ll ans = cnt[s - 1][t - 1];
    if (ans == INF) {
      cout << -1 << endl;
    } else {
      cout << ans - 1 << endl;
    }
  }
}

#ifndef TEST
int main() {
  OPTIMIZE_STDIO;
  solve(cin, cout);
}
#endif


Measured memory_bytes: 2048
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		double xa = sc.nextDouble();
		double ya = sc.nextDouble();
		double xb = sc.nextDouble();
		double yb = sc.nextDouble();
		double xc = sc.nextDouble();
		double yc = sc.nextDouble();

		double a = Math.sqrt((xc-xb)*(xc-xb)+(yc-yb)*(yc-yb));
		double b = Math.sqrt((xa-xc)*(xa-xc)+(ya-yc)*(ya-yc));
		double c = Math.sqrt((xb-xa)*(xb-xa)+(yb-ya)*(yb-ya));

		double cosa = (b*b+c*c-a*a)/(2*b*c);
		double cosb = (c*c+a*a-b*b)/(2*c*a);
		double cosc = (a*a+b*b-c*c)/(2*a*b);

		double ra = a/(Math.sqrt((1+cosb)/(1-cosb))+Math.sqrt((1+cosc)/(1-cosc))+2);
		double rb = b/(Math.sqrt((1+cosc)/(1-cosc))+Math.sqrt((1+cosa)/(1-cosa))+2);
		double rc = c/(Math.sqrt((1+cosa)/(1-cosa))+Math.sqrt((1+cosb)/(1-cosb))+2);

		System.out.println(Math.max(ra,Math.max(rb, rc)));
	}

}


Measured memory_bytes: 23252
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;
using P = pair<int, int>;
ll GCD(ll a, ll b) { return b?GCD(b, a%b):a; }
ll LCM(ll a, ll b) { return a/GCD(a, b)*b; }

const int INF = 1e9+7;

int main() {
    ll n; cin >> n;
    int limit = sqrt(n);
    int ans = INF;
    for(int i = 1; i <= limit+1; ++i) {
        if(n % i == 0) {
            int ch1 = i; int ch2 = n/i;
            string sch1 = to_string(ch1);
            string sch2 = to_string(ch2);
            int schmax = max(sch1.length(), sch2.length());
            chmin(ans, schmax);
        }
    }
    cout << ans << endl;
}

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

int main() {
  int a;
  string s;
  cin >> a >> s;
  
  int ctr1 = 0, ctr2 = 0;
  for (int i = 0; i < s.size(); i++){
    if (s.at(i) == 'R') ctr1++;
    else ctr2++;
  }
  if ( ctr1 > ctr2) cout <<"Yes" << endl;
  else cout << "No" << endl;
}

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

using namespace std;

const int INF = 1e9;
const int N = 1e5;
const int MOD = 1e9 + 7;
const double EPS = 1e-6;

const double PI = acos(-1);


int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    string s;
    int q;
    cin >> s >> q;
    int rotate = 0;
    vector<char> beg, end;
    for (int i = 0; i < q; i++) {
        int t;
        cin >> t;
        if (t == 1) {
            rotate++;
        } else {
            int f;
            char c;
            cin >> f >> c;
            if (f == 1) {
                if (rotate & 1)
                    end.push_back(c);
                else
                    beg.push_back(c);
            } else {
                if (rotate & 1)
                    beg.push_back(c);
                else
                    end.push_back(c);
            }
        }
    }
    if (rotate & 1) {
        reverse(s.begin(), s.end());
        for (int i = end.size() - 1; i >= 0; i--)
            cout << end[i];
        cout << s;
        for (char c : beg)
            cout << c;
    } else {
        for (int i = beg.size() - 1; i >= 0; i--)
            cout << beg[i];
        cout << s;
        for (char c : end)
            cout << c;
    }
}

Measured memory_bytes: 976
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Tasks
{
    public class A
    {
        static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            Solve();
            Console.Out.Flush();
        }

        public static void Solve()
        {
            var S = Console.ReadLine();
            var answer = 0;
            var tmp = 0;
            for (var i = 0; i < S.Length; i++)
            {
                if (S[i] == 'R') tmp++;
                else
                {
                    answer = Math.Max(answer, tmp);
                    tmp = 0;
                }
            }
            answer = Math.Max(answer, tmp);

            Console.WriteLine(answer);
        }

        public static class Scanner
        {
            private static Queue<string> queue = new Queue<string>();
            public static T Next<T>()
            {
                if (!queue.Any()) foreach (var item in Console.ReadLine().Trim().Split(" ")) queue.Enqueue(item);
                return (T)Convert.ChangeType(queue.Dequeue(), typeof(T));
            }
            public static T Scan<T>() => Next<T>();
            public static (T1, T2) Scan<T1, T2>() => (Next<T1>(), Next<T2>());
            public static (T1, T2, T3) Scan<T1, T2, T3>() => (Next<T1>(), Next<T2>(), Next<T3>());
            public static (T1, T2, T3, T4) Scan<T1, T2, T3, T4>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>());
            public static (T1, T2, T3, T4, T5) Scan<T1, T2, T3, T4, T5>() => (Next<T1>(), Next<T2>(), Next<T3>(), Next<T4>(), Next<T5>());
        }
    }
}


Measured memory_bytes: 25952
N = int(input())
S = input()
ans = 0
for i in range(1000):
    tmp = str(i)
    while len(tmp) < 3:
        tmp = '0' + tmp
    count = 0
    target = S
    for i in tmp:
        target = target.replace(i,'')
    for k in S:
        if 3 <= count:
            break
        if k == tmp[count]:
            count += 1
    if count == 3:
        ans += 1
print(ans)

Measured memory_bytes: 66620
d,n = map(int,input().split())
if d==0:
    if n <100:
        print(n)
    else:
        print(101)
if d==1:
    if n<100:
        print(100**d*n)
    else:
        print(10100)
if d==2:
    if n<100:
        print(100**d*n)
    else:
        print(100**3+100**2)

Measured memory_bytes: 3060
/*
    問題をよく読もう！
    論理的に考えよう！
    サンプルを確認しよう!
    絶対に諦めるな！
    工夫をしろ！
    配列は少し多めにとっておく

    Twitterは終わるまでログアウト！
    （間違えて解法をツイートしてはいけないから）

*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <functional>
using namespace std;
#define rep(i, n) for(int i=0; i<n; ++i)
typedef long long ll;
//必要な宣言

int main() {
  int n;
  cin >> n;
  ll training = 1;

  for(int i=1; i<=n; ++i) {
    training *= i;
    training %= 1000000007;
  }

  cout << training << endl;

  return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

n = int(input())

def bs(ok, ng, solve):
    while abs(ok - ng) > 1:
        mid = (ok + ng) // 2
        if solve(mid):
            ok = mid
        else:
            ng = mid
    return ok

ans = bs(ok=n, ng=0, solve=(lambda x: x * 1.08 >= n))
if int(ans * 1.08) == n:
    print(ans)
else:
    print(':(')


Measured memory_bytes: 38384
// AtCoder Beginner Contest 138
// C - Alchemist
#include <bits/stdc++.h>
using namespace std;

int main() {
  int n;
  cin >> n;
  
  vector<float> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v.at(i);
  }
  sort(v.begin(), v.end());

  double value = v.at(0);
  for (int i = 1; i < n; i++) {
    value += v.at(i);
    value /= 2;
  }

  cout << value << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false), cin.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'

using namespace std;

main()
{
    fast;
    int n,a,ans=0,i;
    cin>>n;
    map<int,int> f;
    for (i=0;i<n;i++)
    {
        cin>>a;
        f[a-1]++;
        f[a]++;
        f[a+1]++;
        ans=max({ans,f[a-1],f[a],f[a+1]});
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 4736
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <limits>

const int N = 102;

long m[N][N], p[N+1];

int matrixChainOrder(int n){

  for(int i=1; i<n; i++){ m[i][i] = 0; }

  for(int l=2; l<n; l++){
    for(int i=1; i < n - l + 1; i++){
      int j = i+l-1;
      m[i][j] = std::numeric_limits<long>::max();
      for(int k=i; k<=j-1; k++){
        m[i][j] = std::min(m[i][j], m[i][k] + m[k+1][j] + p[i-1]*p[k]*p[j]);
      }
    }
  }
  return m[1][n - 1];
}

int main(){
  int n ;
  std::cin >> n; //number of matrix

  for(int i=1; i<=n; i++){
    std::cin >> p[i-1] >> p[i];
  }
  // for (int i = 0; i <=n; ++i) std::cout << p[i] << std::endl;
  std::cout << matrixChainOrder(n + 1) << std::endl;

  return 0;
}



Measured memory_bytes: 3156
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(int i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(int i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define uniq(x) (x).erase(unique((x).begin(), (x).end()), (x).end())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    vector<int> a(n), b;
    rep(i, n) cin >> a[i];
    
    rep(i, n) {
        if (i < ((n + 1) / 2)) {
            printf("%d%s", a[n - (i * 2 + 1)], ((i == (n - 1)) ? "\n" : " "));
        }
        else {
            printf("%d%s", a[(i - n / 2) * 2 - n % 2], ((i == (n - 1)) ? "\n" : " "));
        }
    }
    
    return 0;
}


Measured memory_bytes: 2944
#include <bits/stdc++.h>
    
using namespace std;
    
#define endl "\n"
#define ll unsigned long long
#define int long long int
#define vi vector <int >
#define pii pair <int, int>
#define pdd pair< double, double>
#define piii pair < pii, int > 
#define pll pair<ll, ll >
#define vii vector < pii >
#define viii vector < piii >
#define vll vector <ll >
#define umap unordered_map
#define pb push_back
#define pq priority_queue
#define forn(i, n) for(int i = 0; i < (int)n; i++)
#define rep(i,b,c) for(int i = (int)b; i < (int)c; i++)
#define double long double
#define a first
#define b second

const int N = 10010;
int n, m;
vi dp((1 << 13 + 10), - 1);
vi arr(1010);
vector <vi >  a(1010);
int ak[1010];

int f(int bitmask){
    if(bitmask == 0){
        return 0;
    }

    if(dp[bitmask] != -1 ) return dp[bitmask];

    int ans = INT_MAX;
    int aux;
    forn(i, m){
        if(!(ak[i]&bitmask)) continue;
        aux = bitmask;
        for(auto x:a[i]){
            if(bitmask&(1 << x))
                bitmask = bitmask^(1 << x);
        }
        ans = min(ans, arr[i] + f(bitmask));
        bitmask = aux;
    }
    return dp[bitmask] = ans;
}

int32_t main(){
    int k, ax, aux = 0;
    scanf("%lld%lld",&n,&m);
    forn(i, m){
        scanf("%lld%lld",&arr[i],&ax);
        ak[i] = 0;
        forn(j, ax){
            scanf("%lld",&k);
            aux = aux | (1 << k);
            ak[i] = ak[i] | (1 << k);
            a[i].pb(k);
        }
    }

    int bitmask = 0;
    rep(i, 1, n + 1){
        bitmask = bitmask|(1 << i);
    }

    if(aux != bitmask){
        printf("-1\n");
        return 0;
    }
    
    int ans =  f(bitmask);

    if(ans >= INT_MAX){
        printf("-1\n");
    }else{
        printf("%lld\n",ans);
    }

    return 0;
}

Measured memory_bytes: 65920
/*
  AOJ 00608
  Title:
  @kankichi573
*/
#include <stdio.h>
#define min(x,y) (((x)<(y))?(x):(y))

int A,B,C,D,P;

int calc_y(int n)
{
  if(n < C)
    return(B);
  return(B+(n-C)*D);
}

main()
{
  int min_,x,y;;
  
  scanf("%d",&A);
  scanf("%d",&B);
  scanf("%d",&C);
  scanf("%d",&D);
  scanf("%d",&P);

  x = A*P;
  y = calc_y(P);
  min_=min(x,y);
    
  printf("%d\n",min_);
  return(0);
}

Measured memory_bytes: 596
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
a = [list(map(int,input().split())) for _ in range(n)]
ans=0
for i in range(n):
    su = 0
    for j in range(m):
        su += b[j] * a[i][j]
    
    if su + c > 0:
        ans += 1
print(ans)

Measured memory_bytes: 3060
n = int(input())
l = list(map(int, input().split()))

ans = 0
for i in range(n-2):
    for j in range(i+1, n-1):
        for k in range(j+1, n):
            ll = [l[i], l[j], l[k]]
            ll.sort()
            if l[i]==l[j] or l[j]==l[k] or l[k]==l[i]:
                continue
            if ll[2] >= ll[0]+ll[1]:
                continue
            ans += 1
print(ans)

Measured memory_bytes: 9140
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<map>
#include<algorithm>

using namespace std;

const long long INF = 198000000002;
const int maxn = 9905;
long long d[maxn][maxn];
long long dd[110];

struct edge{
	long long from;
	long long to;
	long long dist;
}es[maxn];

bool negative_bool(long long n, long long m){
	memset(dd, 198000000001, sizeof(dd));
	bool flag;
	
	for(int i = 0; i < n-1; i++){
		flag = false;
		for(int j = 0; j < m; j++){
			if(dd[es[j].to] > dd[es[j].from] + es[j].dist){
				dd[es[j].to] = dd[es[j].from] + es[j].dist;
				flag = true;
			}
		}
		if(!flag) break;
	}
	
	for(int i = 0; i < m; i++)
		if(dd[es[i].to] > dd[es[i].from] + es[i].dist){
			return true;
		}
		
	return false;
}

int main()
{
	long long V, E;
	while(scanf("%lld%lld", &V, &E) != EOF){
		for(long long i = 0; i < V; i++)
			for(long long j = 0; j < V; j++){
				if(i == j) d[i][j] = 0;
				else d[i][j] = INF;
			}
					
		for(long long i = 0; i < E; i++){
			long long a, b, c;
			scanf("%lld%lld%lld", &a, &b, &c);
			d[a][b] = c;
			es[i].from = a; es[i].to = b; es[i].dist = c;
		}
		
		if(negative_bool(V, E)){
			printf("NEGATIVE CYCLE\n");
			continue;
		}
		
		for(long long k = 0; k < V; k++)
			for(long long i = 0; i < V; i++)
				for(long long j = 0; j < V; j++){
					if((d[i][k] < 0&&d[k][j] == INF)||(d[k][j] < 0&&d[i][k] == INF)) continue;
					d[i][j] = min(d[i][j], d[i][k]+d[k][j]);
				}
					
		long long i, j;							
		for(i = 0; i < V; i++){
			for(j = 0; j < V-1; j++){
			 	if(d[i][j] == INF) printf("INF ");
			 	else printf("%lld ", d[i][j]);
			}
			if(d[i][j] == INF) printf("INF\n");
			else printf("%lld\n", d[i][j]);
		}
		
	} 
	return 0;
}


/*4 6
0 1 6
1 2 3
2 0 -4
1 3 4
2 3 1
3 2 7*/


Measured memory_bytes: 3872
# 1 "a.cpp"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "a.cpp"
# 1 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp" 1
       
# 11 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp"
# 1 "/home/tysm/dev/cpplib/bin/../stdlib/bits/stdc++.h" 1
 #include<bits/stdc++.h>
# 12 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp" 2
# 1 "/home/tysm/dev/cpplib/bin/../stdlib/ext/pb_ds/assoc_container.hpp" 1
 #include<ext/pb_ds/assoc_container.hpp>
# 13 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp" 2
# 1 "/home/tysm/dev/cpplib/bin/../stdlib/ext/pb_ds/tree_policy.hpp" 1
 #include<ext/pb_ds/tree_policy.hpp>
# 14 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp" 2
# 23 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp"
using namespace std;
using namespace __gnu_pbds;

using ii = pair<int64_t, int64_t>;
using tt = tuple<int64_t, int64_t, int64_t>;

using vi = vector<int64_t>;
using vd = vector<double>;
using vb = vector<bool>;
using vii = vector<ii>;
using vtt = vector<tt>;

using vvi = vector<vi>;
using vvd = vector<vd>;
using vvb = vector<vb>;
using vvii = vector<vii>;
using vvtt = vector<vtt>;
# 60 "/home/tysm/dev/cpplib/bin/../include/cpplib/stdinc.hpp"
template<typename T>
ostream &operator<<(ostream &lhs, const vector<T> &rhs)
{
    if(is_floating_point<T>::value)
        lhs << fixed << setprecision(10);
    for(size_t i = 0; i < rhs.size(); ++i) {
        if(i)
            lhs << ' ';
        lhs << rhs[i];
    }
    return lhs;
}

template<typename T, size_t N>
ostream &operator<<(ostream &lhs, const array<T, N> &rhs)
{
    if(is_floating_point<T>::value)
        lhs << fixed << setprecision(10);
    for(size_t i = 0; i < rhs.size(); ++i) {
        if(i)
            lhs << ' ';
        lhs << rhs[i];
    }
    return lhs;
}
# 2 "a.cpp" 2


int32_t main(){
    (ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL));
    int64_t d, t, s;
    cin >> d >> t >> s;
    cout << (s*t >= d? "Yes" : "No") << "\n";
    return 0;
}


Measured memory_bytes: 3644
#include <stdio.h>

int main(void) {
	int a, b, sum, d;
	
	while (scanf("%d %d", &a, &b) > 0) {
		sum = a + b;
		
		d = 0;
		do {
			sum /= 10;
			d++;
		} while (sum > 0);
		
		printf("%d\n", d);
	}
	
	return 0;
}

Measured memory_bytes: 596
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;

#define dbg(x) cerr << #x"=" << x << endl;
typedef long long LL;
const int MAX_N = 2*1e3+100;
int s[MAX_N], t[MAX_N];
const int MOD = 1e9+7;
LL f[MAX_N][MAX_N];
int n,m;

int main(){
	//freopen("in.txt", "r", stdin);
    cin >> n >> m;
    for(int i = 1; i <= n; ++i) cin >> s[i];
    for(int i = 1; i <= m; ++i) cin >> t[i];
    memset(f, 0, sizeof f);
    LL ans = 0;
    for(int i = 0; i <= n; ++i) f[i][0] = 1;
    for(int i = 0; i <= m; ++i) f[0][i] = 1;
    for(int i = 1; i <= n; ++i){
        for(int j = 1; j <= m; ++j){
            f[i][j] = (f[i][j-1] + f[i-1][j]) % MOD;
            if(s[i] != t[j]){
                f[i][j] = (f[i][j] - f[i-1][j-1] + MOD) % MOD;
            }
        }
    }
    cout << f[n][m] << endl;
    return 0;
}


/*
f[i][j]表示s和t的i位之前和j位之前的答案
f[i][j]
*/


Measured memory_bytes: 34816
n, m = map(int, input().split())
lss = [[int(_) for _ in input().split()] for _ in range(m)]
lsp = list(map(int, input().split()))

ans = 0

for i in range(2 ** n):
    b = bin(i)
    sb = str(b)[2:].zfill(n)
    onoff = list(sb)

    cnt = [0] * m

    for j in range(m):
        for k in lss[j][1:]:
            if onoff[k - 1] == '1':
                cnt[j] += 1
    
    for l in range(m):
        if cnt[l] % 2 == lsp[l]:
            if l == m - 1:
                ans += 1
        elif cnt[l] % 2 != lsp[l]:
            break

print(ans)

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

int main() {
  //input
  string S;
  cin >> S;
  //calc & output
  int len = S.size();
  rep(i,len) {
    cout << 'x';
  }
  cout << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int num;
	int hour;
	int minute;
	int sec;

	scanf("%d", &num);

	hour = num / 3600;
	minute = (num - (hour * 60 * 60)) / 60;
	sec = num % 60;

	printf("%d:%d:%d\n", hour, minute, sec);

	return 0;
}

Measured memory_bytes: 592
N=int(input())
S=input()
iD = 10**9+7
aT={}
for s in S:
    if s in aT:
        aT[s]+=1
    else:
        aT[s]=1
iT = 1
for s in aT:
    iT *= aT[s]+1
print((iT - 1)%iD)


Measured memory_bytes: 3188
#include <iostream>

int main(void)
{
	uint32_t a = 0;
	uint32_t b = 0;

	while (std::cin >> a >> b)
	{
		uint32_t a2 = a;
		uint32_t b2 = b;
		if (a < b)
		{
			uint32_t tmp = a;
			a = b;
			b = tmp;
		}
		uint32_t r = 0;
		while (r = (a % b))
		{
			if (r == 0)
			{
				break;
			}
			a = b;
			b = r;
		}
		std::cout << b << " " << a2/b*b2 << std::endl;
	}

	return 0;
}

Measured memory_bytes: 3092
/*

 Remember, Hope is a good thing... May be the best of things... and No Good thing ever Dies !!!

*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define IOS ios::sync_with_stdio(0); cout.tie(0);
#define endl "\n"
#define MOD 1000000007
#define MOD1 1e18
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define FOR(i,a,b) for(ll i=a;i<=b;i++)
#define ROF(i,a,b) for(ll i=a;i>=b;i--)
typedef long double ld;
const ll inf=(1LL<<60)-1;
const ll mxn=1e5;
int dx[]= {-1,1,0,0};
int dy[]= {0,0,-1,1};
long long ans,a[100005];
ll mod(ll x)
{
    ll res=x%MOD;
    while(res<0)
        res+=MOD;
    return res;
}
ll bigmod(ll x,ll n)
{
    ll res=1;
    while(n>0)
    {
        if(n&1)
            res=(res*x)%MOD;
        x=(x*x)%MOD;
        n>>=1;
    }
    return res;
}
/*
sort(v.begin(),v.end(),[&](const pair<ll,ll>&a,const pair<ll,ll>&b)
   {
       if(a.first==b.first)
           return a.second<b.second;
       else
           return a.first>b.first;
   });
   */
void solve()
{
    //freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
    string a,b,c;
    cin>>a>>b>>c;
    vector<char>va,vb,vc;
    for(ll i=0;i<a.size();i++)
    {
        va.push_back(a[i]);
    }
    for(ll i=0;i<b.size();i++)
    {
        vb.push_back(b[i]);
    }
    for(ll i=0;i<c.size();i++)
    {
        vc.push_back(c[i]);
    }
    char t='a';
    while(true)
    {
        if(t=='a')
        {
            if(va.empty())
            {
                cout<<"A";
                return;
            }
            t=va.front();
            va.erase(va.begin());
        }
        if(t=='b')
        {
            if(vb.empty())
            {
                cout<<"B";
                return;
            }
            t=vb.front();
            vb.erase(vb.begin());
        }
        if(t=='c')
        {
            if(vc.empty())
            {
                cout<<"C";
                return;
            }
            t=vc.front();
            vc.erase(vc.begin());
        }
    }
}
int main()
{
    IOS;
    //ll t;
    //cin>>t;
    //while(t--)
    solve();
    return 0;
}


Measured memory_bytes: 3648
(setq cnt 0)
(setq n(read))
(setq m(read))
(setq c(read))
(setq b(loop for i from 1 to m collect(read)))
(loop for i from 1 to n do(if(>(loop for j from 1 to m sum(*(read)(nth(1- j)b)))(- 0 c))(incf cnt)))
(princ cnt)

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

using namespace std;

#define endl "\n"
#define pb(s) push_back(s)
#define mp(a,b) make_pair(a,b)
#define f first
#define s second
#define ALL(v) v.begin(), v.end()
#define ALLA(arr, sz) arr, arr + sz
#define SORT(v) sort(ALL(v))
#define REVERSE(v) reverse(ALL(v))
#define SORTA(arr, sz) sort(ALLA(arr, sz))
#define REVERSEA(arr, sz) reverse(ALLA(arr, sz))
#define PI 3.14159265358979323846264338327950L
#define MOD 1000000007

typedef long long ll;


void solve()
{
    string o,e;
    cin>>o>>e;

    for(int i=0;i<o.size();++i){
        if(i==e.size())cout<<o[i]<<endl;
        else cout<<o[i]<<e[i];
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    //int t;
    //cin>>t;
    //while(t--)
    solve();
    return 0;
}


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

ll solve(ll n, ll m) {
  if (!(n % 3)) return 0;
  ll ans = m;
  for (int i = 1; i < n; ++i) {
    ll v[] = {(n - i) * m, i * (m / 2), i * (m - m / 2)};
    sort(v, v + 3);
    ans = min(ans, v[2] - v[0]);
  }
  return ans;
}

int main() {
  ll n, m;
  cin >> n >> m;
  cout << min(solve(n, m), solve(m, n)) << endl;
}


Measured memory_bytes: 256
def skill_up(books_costs, books_knowledge, target):
    def add_book(aggr_knowledge, aggr_cost, idx):
        for i, algo in enumerate(books_knowledge[idx]):
            aggr_knowledge[i] += algo
        aggr_cost += books_costs[idx]
        return aggr_knowledge, aggr_cost

    def remove_book(aggr_knowledge, aggr_cost, target, idx):
        potential_comb = True
        for i, algo in enumerate(books_knowledge[idx]):
            aggr_knowledge[i] -= algo
            potential_comb &= aggr_knowledge[i] >= target
        aggr_cost -= books_costs[idx]
        return aggr_knowledge, aggr_cost, potential_comb
    
    def min_cost_skill_up(aggr_knowledge, aggr_cost, idx, target):
        if idx == len(books_knowledge):
            return aggr_cost

        min_cost = aggr_cost

        min_cost = min(min_cost, min_cost_skill_up(aggr_knowledge, aggr_cost, idx+1, target))

        aggr_knowledge, aggr_cost, potential_comb = remove_book(aggr_knowledge, aggr_cost, target, idx)
        if potential_comb:
            min_cost = min(min_cost, min_cost_skill_up(aggr_knowledge, aggr_cost, idx+1, target))
        aggr_knowledge, aggr_cost = add_book(aggr_knowledge, aggr_cost, idx)

        return min_cost

    aggr_knowledge = [0 for _ in range(len(books_knowledge[0]))]
    aggr_cost = 0
    for i in range(len(books_knowledge)):
        aggr_knowledge, aggr_cost = add_book(aggr_knowledge, aggr_cost, i)

    if not all([algo_knowledge >= target for algo_knowledge in aggr_knowledge]):
        return -1

    return min_cost_skill_up(aggr_knowledge, aggr_cost, 0, target)


book_count, algorithm_count, target = map(int, input().split(' '))
books_knowledge = [[0 for _ in range(algorithm_count)] for _ in range(book_count)]
books_costs = [0 for _ in range(book_count)]

for i in range(book_count):
    book = list(map(int, input().split(' ')))
    books_costs[i] = book[0]
    books_knowledge[i] = book[1:]

print(skill_up(books_costs, books_knowledge, target))


Measured memory_bytes: 9332
#include <cstdio>

int main()
{
    int a, b;
    int length = 0;
    int c;
    a = getchar();
    length++;
    while((c = getchar()) != '\n'){
        b = c;
        length++;
    }
    length = length % 2;
    if((length == 0 && a != b) || (length == 1 && a == b)){
        printf("Second\n");
    }else{
        printf("First\n");
    }

    
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <utility>
#define FR first
#define SE second
#define last last2
 
using namespace std;
 
typedef long long ll;
 
typedef pair<ll,ll> pr;
 
vector <pr> a[1<<18];
pr p[1<<18],q[1<<18];
 
int ch[1<<18][2];
ll v[1<<18],d[1<<18];
 
void dfs(int x,int dep) {
  a[x].clear();
  int ls=ch[x][0],rs=ch[x][1];
  if (ls) {
    d[ls]=d[x]+v[ls];d[rs]=d[x]+v[rs];
    dfs(ls,dep);
    dfs(rs,dep);
    int s1=0,s2=0;
    if (a[rs].size()) {
    int r=0;
    for(int i=0;i<a[ls].size();i++) {
        while (r<a[rs].size()-1&&a[rs][r+1].FR+a[ls][i].SE-2*d[x]<=dep) r++;
        if (a[rs][r].FR+a[ls][i].SE-2*d[x]<=dep) p[++s1]=pr(a[ls][i].FR,a[rs][r].SE); 
      }
    }
    if (a[ls].size()) {
    int r=0;
    for(int i=0;i<a[rs].size();i++) {
        while (r<a[ls].size()-1&&a[ls][r+1].FR+a[rs][i].SE-2*d[x]<=dep) r++;
        if (a[ls][r].FR+a[rs][i].SE-2*d[x]<=dep) q[++s2]=pr(a[rs][i].FR,a[ls][r].SE); 
    }
    }
    int l=1,r=1;
    ll last=(ll)(1e17);
    for(int i=1;i<=s1+s2;i++)
      if (l<=s1&&(r>s2||p[l]<q[r])) {
        if (p[l].SE<last) {
          a[x].push_back(p[l]);
          last=p[l].SE;
        }
        l++;
      }
      else {
        if (q[r].SE<last) {
            a[x].push_back(q[r]);
            last=q[r].SE;
          }
        r++;
      }
  }
  else a[x].push_back(pr(d[x],d[x]));
}
 
int main() {
  int n;
  scanf("%d",&n);
  for(int i=2;i<=n;i++) {
    int x,y;
    scanf("%d%d",&x,&y);
    if (!ch[x][0]) ch[x][0]=i; else ch[x][1]=i;
    v[i]=y;
  }
  int l=0,r=1<<30;
  while (l<r) {
    int m=((l+r)>>1);
    dfs(1,m);
    if (a[1].size()) r=m; else l=m+1;
  }
  printf("%d\n",l);
  return 0;
}


Measured memory_bytes: 38440
n=int(input())
count=0
ans=[]
for i in range(1,n+1):
    count+=i
    ans.append(i)
    if count==n:
        break
    elif count>n:
        x=count-n
        del ans[x-1]
        break

for i in range(len(ans)):
    print(ans[i])

Measured memory_bytes: 41712
#include <bits/stdc++.h>
#define REP(r,x,y) for(register int r=(x); r<(y); r++)
#ifdef sahdsg
#define DBG(...) printf(__VA_ARGS__)
#else
#define DBG(...) (void)0
#endif
#define EPS 1e-6
using namespace std;
int main() {
	int n; scanf("%d", &n);
	char ch;
	int r=0,b=0;
	REP(i,0,n) {
		do ch=getchar(); while(ch<=' ');
		if(ch=='R')r++; else b++;
	}
		if(r>b) puts("Yes");
		else puts("No");
	
	return 0;
}

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

// 重みつき Union-Find 木
// https://qiita.com/drken/items/cce6fc5c579051e64fab
struct UnionFind {
    vector<int> par;
    vector<int> wei;
    UnionFind(int n=0): par(n,-1), wei(n,0) {}
    int find(int x) {
        if (par[x] < 0) return x;
        int px = find(par[x]);
        wei[x] += wei[par[x]];
        par[x] = px;
        return px;
    }
    int weight(int x) {
        find(x);
        return wei[x];
    }
    bool unite(int x, int y, int w) {
        w += wei[x]-wei[y];
        x = find(x); y = find(y); 
        if (x == y) return false;
        if (par[x] > par[y]) {
            swap(x, y); 
            w = -w;
        }
        par[x] += par[y];
        par[y] = x;
        wei[y] = w;
        return true;
    }
    bool same(int x, int y) {
        return find(x) == find(y);
    }
    int size(int x) {
        return -par[find(x)];
    }
    int diff(int x, int y) {
        return weight(y) - weight(x);
    }
};

int main() {
    int n, m;
    cin >> n >> m;
    UnionFind uf(n);
    rep(i, m) {
        int l, r, d;
        cin >> l >> r >> d;
        l--; r--;
        if (uf.same(l, r)) {
            if (d != uf.diff(l, r)) {
                cout << "No" << endl;
                return 0;
            }
        } else {
            uf.unite(l, r, d);
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 4040
#include <iostream>
#include <cstdio>
#include <vector>
#include <stack>
#include <math.h>

using namespace std;

typedef long long int ll;
typedef long double ld;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define vsort(a) sort(a.begin(), a.end())
#define rev(a) reverse(a.begin(), a.end())

const int MOD = 1000000007;
const int INF = INT_MAX;



int main(){

    
    int n;
    cin >> n;
    int d[n];
    rep(i,n) cin >> d[i];

    sort(d, d+n);

    cout << d[n/2] - d[n/2-1] << endl;
    

}





//              g++ -std=c++1z

Measured memory_bytes: 640
#include <stdio.h>

int main(void){
	int a, b;
	int add, sub, mul;
	int max;
	
	scanf("%d %d", &a, &b);
	add = a + b;
	sub = a - b;
	mul = a * b;
	
	if(add >= sub && add >= mul){
		max = add;
	}else if(sub >= add && sub >= mul){
		max = sub;
	}else{
		max = mul;
	}
	
	printf("%d\n", max);
	return 0;
}

Measured memory_bytes: 128