akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<set>
using namespace std;

int main(){
  int n,s,t;

  while(1){
    cin>>n;
    if(!n)break;

    bool sch[30][51]={false};
    set<int> max[51];

    for(int i=0;i<n;i++){
      max[i].insert(i+1);
      cin>>s;
      for(int j=0;j<s;j++){
	cin>>t;
	sch[t-1][i]=true;
      }
    }

    set<int> maps;

    for(int i=0;i<30;i++){
      for(int j=0;j<n;j++)
	if(sch[i][j])
	  maps.insert(max[j].begin(),max[j].end());

      if(maps.size()==n){
	cout<<i+1<<endl;
	goto NEXT;
      }

      for(int j=0;j<n;j++)
	if(sch[i][j])max[j].insert(maps.begin(),maps.end());

      maps.clear();
    }

    cout<<-1<<endl;

  NEXT:
    ;
  }
}

Measured memory_bytes: 968
#include<iostream>
#include<stack>
#include<queue>
#include<algorithm>
#include<vector>
#include<string>
#include<map>
using namespace std;
typedef long long llong;

int N;
char S[200020];
int Black[100010], White[100010], BlackGroup[100010];
int main()
{
	int count = 0;
	cin >> N;
	for (int i = 0; i < N; i++)
		cin >> S[i];

	int tmpBlack = 0, tmpWhite = 0, tmp;
	for (int i = 0; i < N; i++)
	{
		if (S[i] == '#')
		{
			if (S[i - 1] != '#')
			{
				Black[count] = tmpBlack;
				White[count] = tmpWhite;
				count++;
				tmpBlack++;
				tmp = 1;
			}
			else
			{
				tmpBlack++;
				tmp++;
			}

			if (i == N - 1)
			{
				BlackGroup[count - 1] = tmp;
			}
		}

		else
		{
			tmpWhite++;
			if (i > 1)
			{
				if(S[i - 1] == '#')
				{
					BlackGroup[count - 1] = tmp;
				}
			}
		}
	}


	int ans = 200000;
	int tmpAns;
	
	if (count == 0) ans = 0;
	else
	{
		for (int j = 0; j < count; j++)
		{
			tmpAns = Black[j] + tmpWhite - White[j];
			if (tmpAns < ans) ans = tmpAns;
		}

		if (tmpBlack < ans) ans = tmpBlack;
	}

	cout << ans;

}

Measured memory_bytes: 1664
r = 1299710
p = [1]*r
p[0] = p[1] = 0
for i in range(int(r**0.5)):
	if p[i]:
		p[2*i::i] = [0 for x in range(2*i,r,i)]

while 1:
	n = input()
	if n == 0: break
	l = r = n
	while p[l] == 0: l -= 1
	while p[r] == 0: r += 1
	print r - l

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

from sys import stdin

N = [ x for x in stdin.readline().rstrip()]

flg = 0

type_str = ""

for i in range(4):
    for j in range(i+1,4):
        if N[i] == N[j]:
            type_str = N[i]
            del N[j]
            del N[i]
            flg = 1
            break

    if flg == 1:
        break

if flg == 1 and N[0] == N[1] and type_str != N[0]:
    print("Yes")
else:
    print("No")


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

int main() {
  int n;
  cin >> n;
  vector<int> x(n), x_copy(n);
  for(int i=0; i<n; i++) {
    cin >> x.at(i);
    x_copy.at(i) = x.at(i);
  }
  sort(x_copy.begin(),x_copy.end());
  int mid1 = x_copy.at(n/2-1);
  int mid2 = x_copy.at(n/2);
  for(int i=0; i<n; i++) {
    if(x.at(i) <= mid1)
      cout << mid2 << endl;
    else
      cout << mid1 << endl;
  }
  return 0;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
#define N 300
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> PP;
int G[N][N];
int SIRO[N],idx[N],g[N];
int n,m,l,s,T;


int dijkstra(){
  vector<vector<int> >D(1<<l,vector<int>(n,T+1));   
  priority_queue<PP,vector<PP>,greater<PP> >Q;

  Q.push(PP(0,P(0,s)));
  D[0][s] = 0;
  
  int res = 0;
  while(!Q.empty()){
    PP t = Q.top();Q.pop();
    int cost = t.first;
    int bit = t.second.first;
    int pos = t.second.second;
    if(D[bit][pos]<cost)continue;
    if(cost + G[pos][s]<=T)res = max(res,__builtin_popcount(bit));
    
    for(int j=0;j<l;j++){
      int i = g[j];
      int ncost= cost+G[pos][i];
      int nbit = bit;
      if(bit>>idx[i]&1)continue;
      nbit|=1<<idx[i], ncost+=+SIRO[i];
      if(D[nbit][i]>ncost){
	Q.push(PP(ncost,P(nbit,i)));
	D[nbit][i] = ncost;
      }
    }
  }
  return res;
}

int main(){
  while(1){
    cin>>n>>m>>l>>s>>T;
    if(!n&&!m&&!l&&!s&&!T)return 0;
    s--;

    for(int i=0;i<N;i++){
      for(int j=0;j<N;j++) G[i][j] = T+1;
      G[i][i] = 0;
    }
    
    for(int i=0,a,b,c;i<m;i++){
      cin>>a>>b>>c;a--,b--;
      G[a][b] = G[b][a] = c;
    }
    
    for(int k=0;k<n;k++)
      for(int i=0;i<n;i++)
	for(int j=0;j<n;j++)
	  G[i][j] = min(G[i][j],G[i][k]+G[k][j]);
    
    for(int i=0,j,e;i<l;i++){
      cin>>j>>e,SIRO[j-1]=e,idx[j-1] = i,g[i] = j-1;
    }
    cout<< dijkstra()<<endl;
  }
  return 0;
}

Measured memory_bytes: 92024
#include <bits/stdc++.h>
#pragma gcc optimize("ofast")
using namespace std;

#define ll long long //data types used often, but you don't want to type them time by time
#define ull unsigned long long
#define ui unsigned int
#define mod 1000000007
#define us unsigned short
#define IOS ios_base::sync_with_stdio(0); //to synchronize the input of cin and scanf
#define INF LONG_MAX
#define PI 3.1415926535897932384626
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define rep(x,j,n)for(int x=j;x<n;x++)
typedef vector<pair<ll,ll>> vpi;
typedef vector<ll> vi;
typedef vector<vi> vvi;

ll modexp(ll a,ll b,ll m)
{
    ll r=1;
    a=a%m;
    while(b>0)
    {
        if(b&1){r=(r*a)%m;}
        b=b>>1;
        a=(a*a)%m;
    }
    return r%m;
}
int main(){
    string a,b; cin>>a>>b;
    vvi dp(a.size()+1,vi(b.size()+1,0));
    for(ll i=1;i<=a.size();i++)
    {
        for(ll j =1;j<=b.size();j++)
        {
            if(a[i-1]==b[j-1])dp[i][j] = dp[i-1][j-1]+1;
            else
            {
                dp[i][j] = max(dp[i-1][j],dp[i][j-1]);
            }
            
        }
    }
    //cout<<dp[a.size()][b.size()]<<endl;
    //ll cnt = 1;
    string s="";
    ll i = a.size(), j =b.size();
    while(i>0&&j>0)
    {
        if(a[i-1]==b[j-1])
        {
            s.pb(a[i-1]);
            i--;j--;
        }
        else if(dp[i-1][j]>dp[i][j-1])i--;
        else j--;
    }
    reverse(s.begin(),s.end());
    cout<<s<<endl;
    return 0;
}


Measured memory_bytes: 70784
package main

import (
	"bufio"
	"fmt"
	"os"
)

type op struct {
	cmd, arg string
}

var wtr = bufio.NewWriter(os.Stdout)

func main() {
	var n int
	fmt.Scan(&n)
	query := make([]op, n)
	dict := make(map[string]int, 0)
	ans := make([]string, 0)
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	for i := 0; i < n; i++ {
		sc.Scan()
		query[i].cmd = sc.Text()
		sc.Scan()
		query[i].arg = sc.Text()
	}
	for i := 0; i < n; i++ {
		if query[i].cmd == "insert" {
			dict[query[i].arg]++
		} else { // find命令
			v := dict[query[i].arg]
			res := "yes"
			if v == 0 {
				res = "no"
			}
			ans = append(ans, res)
		}
	}
	for i := range ans {
		fmt.Fprintln(wtr, ans[i])
	}
	_ = wtr.Flush()
}



Measured memory_bytes: 104048
#include <iostream>

using namespace std;

int main() {
  int N, M, C;
  cin >> N >> M >> C;
  int num_array[M];
  int feature_array[N][M];
  for (int i=0; i<M; i++) {
    cin >> num_array[i];
  }
  for (int j=0; j<N; j++) {
    for (int k=0; k<M; k++) {
      cin >> feature_array[j][k];
    }
  }
  int sum;
  int count = 0;
  for (int a=0; a<N; a++) {
    sum=0;
    for (int b=0; b<M; b++) {
      sum += feature_array[a][b]*num_array[b];
    }
    if (sum + C > 0) {
      count += 1;
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
    int a,b;
	
	scanf("%d %d", &a, &b);
	
	if (a<b){
	    puts("a < b");
	} else if(a == b){
	    puts("a == b");
    }else{
	    puts("a > b");
	}
	
	return 0;
}

Measured memory_bytes: 580
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<cstdio>
#define N 200010
#define M 525000 
#define LL long long
#define mo 924844033
#define P(a) putchar(a)
#define fo(i,a,b) for(i=a;i<=b;i++)
#define fd(i,a,b) for(i=a;i>=b;i--)
using namespace std;
struct note{
	int to,next;
};note edge[N*2];
int tot,head[N];
LL i,j,k,l,n,m,ans;
LL u,v,L,len; 
LL jc[N],ny[N],fa[N];
LL siz[N],f[N],h[N];
LL f1[M],f2[M];
LL w[M],_w[M],Rev[M];
LL Ans[N];
LL read(){
	LL fh=1,rs=0;char ch;
	while((ch<'0'||ch>'9')&&(ch^'-'))ch=getchar();
	if(ch=='-')fh=-1,ch=getchar();
	while(ch>='0'&&ch<='9')rs=(rs<<3)+(rs<<1)+(ch^'0'),ch=getchar();
	return fh*rs;
}
void write(LL x){
	if(x>9)write(x/10);
	P(x%10+'0');
}
void lb(int x,int y){
	edge[++tot].to=y;
	edge[tot].next=head[x];
	head[x]=tot;
}
LL ksm(LL x,LL y){
	LL rs=1;
	for(;y;y>>=1,x=(x*x)%mo)
	if(y&1)rs=(rs*x)%mo;
	return rs;
}
void pre_(){
	int i;
	jc[0]=jc[1]=ny[0]=ny[1]=1;
	fo(i,2,N-10)jc[i]=(jc[i-1]*i)%mo;
	ny[N-10]=ksm(jc[N-10],mo-2);
	fd(i,N-11,2)ny[i]=(ny[i+1]*(i+1))%mo; 
}
LL C(LL n,LL m){
	if(n<m)return 0;
	return ((jc[n]*ny[m])%mo*ny[n-m])%mo;
}
void add(LL &x,LL y){
	x=(x+y+mo)%mo; 
}
void dg(int x){
	int i;
	siz[x]=1;
	for(i=head[x];i;i=edge[i].next)
	    if(fa[x]^edge[i].to){
	    	fa[edge[i].to]=x;
	    	dg(edge[i].to);
	    	f[siz[edge[i].to]]++;
	    	siz[x]+=siz[edge[i].to];
		}
	if(x^1)f[n-siz[x]]++;
}
void NTT(LL *y,LL *w){
	LL i,h,k;
	fo(i,0,L-1)
	if(i<Rev[i])
	swap(y[i],y[Rev[i]]);
	for(h=2;h<=L;h<<=1){
		for(i=0;i<L;i+=h){
			fo(k,i,i+(h>>1)-1){
				LL u=y[k],t=(w[L/h*(k-i)]*y[k+(h>>1)])%mo;
				y[k]=(u+t)%mo;
				y[k+(h>>1)]=((u-t)%mo+mo)%mo;
			}
		}
	}
}
int main(){
	n=read();
	fo(i,1,n-1){
		u=read();v=read();
		lb(u,v);lb(v,u);
	}
	pre_();
	dg(1);
	fo(i,1,n)f[i]=(f[i]*jc[i])%mo;
	fo(i,0,n)h[i]=ny[i];
	len=0;
	for(L=1;L<(n+1)*2;L<<=1)len++;
	w[0]=w[L]=1;
	w[1]=ksm(5,(mo-1)/L);
	fo(i,1,L-1) w[i]=w[i-1]*1ll*w[1]%mo;
	fo(i,0,L) _w[i]=w[L-i];
	fo(i,0,L-1)Rev[i]=Rev[i>>1]>>1|(i&1)<<len-1;
	fo(i,0,n)f1[i]=f[n-i];
	fo(i,n+1,L-1)f1[i]=0;
	fo(i,0,n)f2[i]=h[i];
	fo(i,n+1,L-1)f2[i]=0;
	NTT(f1,w);
	NTT(f2,w);
	fo(i,0,L-1)f1[i]=f1[i]*f2[i]%mo;
	NTT(f1,_w);
	LL inv=ksm(L,mo-2);
	fo(i,0,L-1)f1[i]=(f1[i]*inv)%mo;
	fo(i,1,n)Ans[i]=(f1[n-i]*ny[i])%mo;
	fo(i,1,n)Ans[i]=(n*C(n,i)%mo-Ans[i]+mo)%mo;
	fo(i,1,n)write(Ans[i]),P('\n');
	return 0;
}

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

typedef long long   ll;
const ll mod = 1e9 + 7;

#define speedup_IO      ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define forn(i,a,n)     for(ll i = a; i < n; i++)
#define ford(i,n,a)     for(ll i = n-1; i >= a; i--)
#define pb              push_back
#define lb              lower_bound
#define ub              upper_bound
#define pll             pair<ll,ll>
#define all(a)          (a).begin(),(a).end()
#define reset(a,x)      memset(a,x,sizeof(a))

ll mypow(ll base, ll exp) {ll res = 1; while (exp) {if (exp & 1) res = (res * base) % mod; exp >>= 1, base = (base * base) % mod;} return res;}
ll gcd(ll a, ll b)  { return b ? gcd(b, a % b) : a;            }
ll mult(ll a, ll b) { return ((a % mod) * (b % mod)) % mod;    }
ll add(ll a, ll b)  { return (a % mod + b % mod) % mod;        }
ll sub(ll a, ll b)  { return (a % mod + mod - b % mod) % mod;  }

const ll inf = 1e18;
const int nax = 1e5 + 5;
const int SZ = 2;
const int MOD = 1e9 + 7;

int main()
{
	speedup_IO;
	ll n,m;
	cin>>n>>m;

	ll p[m];
	string s[m];
	map<ll,bool>Map;
	map<ll,ll>Cnt;

	forn(i,0,m)
	{
		cin>>p[i]>>s[i];
		if(s[i] == "AC" && !Map[p[i]])
			Map[p[i]] = i+1;

		if(!Map[p[i]])
			Cnt[p[i]]++;
	}

	ll cnt = 0,ans = 0;
	for(auto x:Map)
	{
		if(x.second)
			cnt++;
	}

	for(auto x:Cnt)
	{
		if(Map[x.first])
			ans+=(x.second);
	}	

	cout<<cnt<<" "<<ans;
	return 0;
}

Measured memory_bytes: 14336
#include <bits/stdc++.h>
using namespace std;
using ll=long long int;
using ld=long double;
using VI=vector<ll>;
using VD=vector<ld>;
using VVI=vector<VI>;
using VC=vector<char>;
using VVC=vector<VC>;
using VS=vector<string>;
using PLL =pair<ll, ll>;
using PLD=pair<ld, ld>;
using VPLL=vector<PLL>;
#define REP(i, n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i, n) for(ll i=(ll)(n)-1;i>=0;i--)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element((x).begin(),(x).end())
#define MIN(x) *min_element((x).begin(),(x).end())
#define SORTR(x) sort((x).rbegin(),(x).rend())
#define SORT(x) sort((x).begin(),(x).end())
#define SUM(x) accumulate((x).begin(),(x).end(), 0)
#define FILL(x, a) fill(x.begin(),x.end(),a)
#define EACH(i, x) for(typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)

const long long int INF = 1e18;
const ld EPS = 1e-10;
const int MOD = int(1e9) + 7;
template<class T>
bool chmax(T &a, const T &b) {
	if (a < b) {
		a = b;
		return 1;
	}
	return 0;
}
template<class T>
bool chmin(T &a, const T &b) {
	if (b < a) {
		a = b;
		return 1;
	}
	return 0;
}
template<class BidirectionalIterator>
bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle, BidirectionalIterator last) {
	reverse(middle, last);
	return next_permutation(first, last);
}
#define COUT(x) cout<<x<<"\n"

void Main() {
	ll H, W;
	ll result = 0;
	cin >> H >> W;
	VVC grid(H, VC(W, '.'));
	REP(j, H) {
		REP(i, W) {
			cin >> grid[j][i];
		}
	}
	VVI L(H, VI(W, 0)), R(H, VI(W, 0));
	VVI U(H, VI(W, 0)), D(H, VI(W, 0));
	//初期
	REP(j, H) {
		if (grid[j][0] == '.')L[j][0] = 1;
		if (grid[j][W - 1] == '.')R[j][W - 1] = 1;
	}
	REP(i, W) {
		if (grid[0][i] == '.')U[0][i] = 1;
		if (grid[H - 1][i] == '.')D[H - 1][i] = 1;
	}
	//前処理
	REP(j, H) {
		for (ll i = 1; i < W; i++) {
			/*LRに関して*/
			if (grid[j][i] == '.') {
				L[j][i] = L[j][i - 1] + 1;
			}
			ll ri=W-i-1;
			if(grid[j][ri]=='.'){
				R[j][ri]= R[j][ri + 1] + 1;
			}
		}
	}
	REP(i, W) {
		for (ll j = 1; j < H; j++) {
			/*UDに関して*/
			if (grid[j][i] == '.') {
				U[j][i] = U[j-1][i] + 1;
			}
			ll dj=H-j-1;
			if(grid[dj][i]=='.'){
				D[dj][i] = D[dj+1][i] + 1;
			}
		}
	}
	//比較
	ll tmp = 0;
	REP(j, H) {
		REP(i, W) {
			if (grid[j][i] == '#') tmp = 0;
			else tmp = L[j][i] + R[j][i] + U[j][i] + D[j][i] - 3;
			result = max(tmp, result);
		}
	}
	cout << result << "\n";
	return;
}

int main() {
	std::cin.tie(0);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}


Measured memory_bytes: 129536
#include <cstdio>
#include <cstdint>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>

int main() {
  size_t S, T, U, N, O, D;
  scanf("%zu %zu %zu %zu %zu %zu", &S, &T, &U, &N, &O, &D);

  std::vector<size_t> e(T), c(T);
  for (size_t i = 0; i < T; ++i)
    scanf("%zu %zu", &e[i], &c[i]);

  std::vector<size_t> h(N), a(N);
  for (size_t i = 0; i < N; ++i)
    scanf("%zu %zu", &h[i], &a[i]);

  size_t M = S;
  std::vector<std::vector<size_t>> cal0(U+1, std::vector<size_t>(M+1));
  for (size_t i = 0; i < T; ++i)
    for (size_t k = U+1; k--;)
      for (size_t j = M+1; j--;)
        if (j + e[i] <= M && k + 1 <= U) {
          if (k > 0 && cal0[k][j] == 0) continue;
          cal0[k+1][j+e[i]] = std::max(cal0[k+1][j+e[i]], cal0[k][j]+c[i]);
        }

  // for (size_t i = 0; i <= U; ++i)
  //   for (size_t j = 0; j <= M; ++j)
  //     fprintf(stderr, "%zu%c", cal0[i][j], j<M? ' ':'\n');

  auto cal = cal0[U];

  size_t X = 10000;
  std::vector<size_t> hap(X+1);
  for (size_t i = 0; i < N; ++i)
    for (size_t j = 0; j <= X; ++j)
      if (j + a[i] <= X)
        hap[j+a[i]] = std::max(hap[j+a[i]], hap[j]+h[i]);

  std::vector<std::vector<int>> dp(D+1, std::vector<int>(S+1, -1));
  dp[0][S] = 0;
  for (size_t i = 0; i < D; ++i) {
    for (size_t j = 0; j <= S; ++j) {
      if (dp[i][j] < 0) continue;
      for (size_t k = 0; k <= j; ++k) {
        size_t nj = j - k + O;
        if (nj > S) nj = S;
        if (cal[k] == 0) continue;
        int h = hap[cal[k]];
        dp[i+1][nj] = std::max(dp[i+1][nj], dp[i][j]+h);
      }
    }
  }

  // for (size_t i = 0; i <= D; ++i)
  //   for (size_t j = 0; j <= S; ++j)
  //     fprintf(stderr, "%d%c", dp[i][j], j<S? ' ':'\n');

  int res = *std::max_element(dp[D].begin(), dp[D].end());
  printf("%d\n", res);
}



Measured memory_bytes: 2948
#include <iostream>
using namespace std;
int main(void){
  long long N, A, B;
  cin >> N >> A >> B;
  
  long long C = A + B;
  
  long long ans = 0;
  long long ball = 0;
  ans += (N / C) * A;
  
  if(N % C < A) ans += N%C;
  else ans += A;
  
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;

namespace AtCoderBiginnerContest154
{
	class Question1
	{
		static void Main(string[] args)
		{
			var strings = ReadStringArray();
			var numbers = ReadIntArray();
			var target = ReadString();

			if (target == strings[0])
			{
				Console.WriteLine($"{numbers[0] - 1} {numbers[1]}");
			}
			else
			{
				Console.WriteLine($"{numbers[0]} {numbers[1] - 1}");
			}
		}

		public static int ReadInt()
			=> int.Parse(Console.ReadLine());

		public static int[] ReadIntArray()
			=> Console.ReadLine().Split().Select(x => int.Parse(x)).ToArray();

		public static long ReadLong()
			=> long.Parse(Console.ReadLine());

		public static long[] ReadLongArray()
			=> Console.ReadLine().Split().Select(x => long.Parse(x)).ToArray();

		public static string ReadString()
			=> Console.ReadLine();

		public static string[] ReadStringArray()
			=> Console.ReadLine().Split();
	}
}


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

int main(){
    int N;cin >> N;
    vector<int> V(N),C(N);
    for(int i = 0; i < N ; i++){
        cin >> V[i];
    }
     for(int i = 0; i < N ; i++){
        cin >> C[i];
    }

    int ans = 0;
    for(int i = 0 ; i < (1<<N) ; i++){
        int tmp = 0;
        for(int j = 0 ; j < N ; j++){
            if(i & (1<<j)){
                tmp += V[j] - C[j];
            }
        }
        if(ans < tmp)ans = tmp;
    }

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

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

int main() {
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    if (a == b || b == c || a == c) {
        if (a == b && b == c) {
            printf("No");
            return 0;
        }
        printf("Yes");
        return 0;
    }
    printf("No");
    return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <cstdlib>
int main() {
	int a, b;
	scanf("%d %d", &a, &b);
	if (a > 0) {
		printf("Positive\n");
	}
	else if(a == 0 || b >= 0) {
		printf("Zero\n");
	}
	else {
		if ((b - a) % 2==1) printf("Positive\n");
		else printf("Negative\n");
	}
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define LL long long
#define endl '\n'
using namespace std;

#define MAX 100000

vector<int> G[MAX];
int N;
bool visited[MAX];
int prenum[MAX], parent[MAX], lowest[MAX], timer;

void dfs(int current, int prev)
// current:現在のノード，prev:親
{
    // ノードcurrentを訪問した直後の処理
    // prenum:今のノードの発見の順番
    // lowest:現在のノードと子孫のノードから行ける最小のノードが行ける値(ここでは暫定)
    prenum[current] = lowest[current] = timer;
    timer++; // 次のノードが通る時のためにインクリメント

    visited[current] = true; // 現在のノードに行ったことにする

    int next;

    for (int i = 0; i < G[current].size(); i++) { // 現在のノードから行けるノードをすべて周る
        next = G[current][i]; // 次のノードの値
        if (!visited[next]) { // 次のノードに行ったことがないとき
            // ノードcurrentからノードnextへ訪問する直前の処理
            parent[next] = current; // 現在のノードを次のノードの親とする

            dfs(next, current); // 次のノードでdfsを行う

            // ノードnextの探索が終了した直後の処理
            lowest[current] = min(lowest[current], lowest[next]);
        } else if (next != prev) { // 次のノードに行ったことがない∧次のノードが親でもないとき
            // エッジcurrent --> nextがBackedgeの場合の処理
            lowest[current] = min(lowest[current], prenum[next]);
        }
    }
    // ノードcurrentの探索が終了した直後の処理
}

void art_points()
{
    for (int i = 0; i < N; i++) {
        visited[i] = false; // すべての頂点に行ったことが無いとする
    }
    timer = 1;
    // lowestの計算
    dfs(0, -1); // 0 == root

    set<int> ap;
    int np = 0;
    for (int i = 1; i < N; i++) {
        // ノードiの親p
        int p = parent[i];
        if (p == 0) { // 親が根のときはnpをインクリメント
            np++;
        } else if (prenum[p] <= lowest[i]) { // もし親の発見の順番の方が早いときは親は関節点(親とつながっているのは自分だけだから)
            ap.insert(p);
        }
    }
    if (np > 1) {
        ap.insert(0); // 親が根のときは
    }
    for (set<int>::iterator it = ap.begin(); it != ap.end(); it++) {
        cout << *it << endl; // 関節点を言う
    }
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int m;
    cin >> N >> m; // N:頂点の数，m:辺の数

    for (int i = 0; i < m; i++) {
        int s, t; // 辺s<->t
        cin >> s >> t;
        // Gに経路を記録
        G[s].push_back(t);
        G[t].push_back(s);
    }
    art_points();

    return 0;
}


Measured memory_bytes: 6944
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    int n;
    while(cin>>n){
    int a[n],b[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
        int x= a[i];
        b[x-1]=i+1;
    }
    for(int j=0;j<n;j++){
        cout<<b[j]<<" ";
    }
    cout<<endl;
    }
}


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

// 展望台
struct Bill {
    int height;
    bool isMax;
};

// C - Peaks
int main() {
    int N, M;
    cin >> N >> M;

    // vector<int> H(N);
    vector<Bill> Bills(N);
    for (int i = 0; i < N; i++) {
        int H;
        cin >> H;
        Bills.at(i).height = H;
        Bills.at(i).isMax = true;
    }

    // それぞれの道を取得し比較
    for (int i = 0; i < M; i++) {
        int A, B;
        cin >> A >> B;
        if (Bills.at(A -1).height == Bills.at(B -1).height) {
            Bills.at(A - 1).isMax = false;
            Bills.at(B - 1).isMax = false;
        } else if (Bills.at(A -1).height > Bills.at(B -1).height) {
            Bills.at(B - 1).isMax = false;
        } else if (Bills.at(A -1).height < Bills.at(B -1).height) {
            Bills.at(A - 1).isMax = false;
        }
    }

    int count = 0;
    for (int i = 0; i < N; i++) {
        if (Bills.at(i).isMax) {
            count++;
        }
    }
    cout << count;
}


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

int main() {
 int long long N  ;
 cin >> N;
 int long long x;
 int long long  ans = N;
  for (int long long  i=1;i<10000000;i++){
    if (N%i==0){
      x=N/i;
      ans = min(ans,i+x-2);
    }
  }
  cout << ans;
}


Measured memory_bytes: 256
import sys

class Node:
    __slots__ = ['key', 'left', 'right']
    def __init__(self, key):
        self.key = key
        self.left = self.right = None

root = None

def insert(key):
    global root
    x, y = root, None
    while x: x, y = x.left if key < x.key else x.right, x
    if y is None: root = Node(key)
    elif key < y.key: y.left = Node(key)
    else: y.right = Node(key)

def inorder(node):
    return inorder(node.left) + f' {node.key}' + inorder(node.right) if node else ''
def preorder(node):
    return f' {node.key}' + preorder(node.left) + preorder(node.right) if node else ''

input()
for e in sys.stdin:
    if e[0] == 'i': insert(int(e[7:]))
    else: print(inorder(root)); print(preorder(root))



Measured memory_bytes: 63476
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;

char a[100], b[100];

int main() {
	scanf("%s", a);
	scanf("%s", b);
	int i, l1 = strlen(a), l2 = strlen(b);
	for(i = 0; i < l2; i++) printf("%c%c", a[i], b[i]);
	if(l1 > l2) printf("%c", a[l1-1]);
	return 0;
}


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

using namespace std;

typedef long long int ll;
typedef pair<int,int> P;

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

const ll mod = 1e9+7;
const ll INF = 1e9;

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool valid(int lx,int ux,int ly,int uy,int x,int y){
	return lx<=x&&x<ux&&ly<=y&&y<uy; 
}
ll power(ll x,ll p){
	if(p==0)return 1;
	ll res=power(x*x%mod,p/2);
	if(p%2==1)res=res*x%mod;
	return res;
}

int main()
{
	int n;
	cin>>n;
	cout<<(n-1)/2<<endl;
	return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <string>
#include <vector>
#include <utility>
#include <complex>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <tuple>
#include <bitset>
#include <limits>
#include <algorithm>
#include <array>
#include <random>
#include <complex>
#include <regex>
#include <iomanip>
using namespace std;
typedef long double ld;
typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define fcout cout << fixed << setprecision(10)
#define rep(i,n)    for(int i=0; i<(int)n; i++)
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define all(x) x.begin(), x.end()
#define F first
#define S second
const ll inf = 1e18;
const ll mod = 1e9 + 7;

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

// mod. m での a の逆元 a^(-1) を計算する。
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

ll modpow(ll a, ll n){
    ll res = 1;
    while(n>0){
        if(n&1){
            res = res * a % mod;
        }
        a = a * a % mod;
        n >>=1;
    }
    return res;
}

int d;
ll ans=0;
int c[26]; // 満足度の下がりやすさ、（d-最終日）* cだけその日の終わりに引かれる。

int s[365][26]; // d日目にタイプiのコンテストを開いた時の上昇量
int t[365];

void solve(){
    int day=1;
    vint last[26];
    int last_num[26] = {0};
    rep(i,26) last[i].pb(0);
    rep(i,d){
        ans += s[i][t[i]];
        last[t[i]].pb(day);
        last_num[t[i]]++;
        rep(j,26){
            ans -= c[j] * (day - last[j][last_num[j]]);
        }
        day++;
        // cout << ans << endl;
    }
}

int main(){
    cin >> d;
    rep(i, 26) cin >> c[i];
    rep(i,d) rep(j,26) cin >> s[i][j];
    rep(i,d){
        cin >> t[i];
        t[i]--;
    }

    solve();

    int m;
    cin >> m;
    int md, mq;
    rep(i,m){
        cin >> md >> mq;
        t[--md] = --mq;
        ans = 0;
        solve();
        cout << ans << endl;
    }
}



Measured memory_bytes: 3636
N = int(input())
E = [[int(l) for l in input().split()] for _ in range(N-1)]
M = int(input())
L = [[int(l) for l in input().split()] for _ in range(M)]

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.root = [-1]*(n+1)
        self.rnk = [0]*(n+1)
        
    def find_root(self, x):
        if self.root[x] < 0:
            return x
        else:
            self.root[x] = self.find_root(self.root[x])
            return self.root[x]
        
    def unite(self, x, y):
        x = self.find_root(x)
        y = self.find_root(y)
        if x == y:
            return
        elif self.rnk[x] > self.rnk[y]:
            self.root[x] += self.root[y]
            self.root[y] = x
        else:
            self.root[y] += self.root[x]
            self.root[x] = y
            if self.rnk[x] == self.rnk[y]:
                self.rnk[y] += 1
                
    def isSameGroup(self, x, y):
        return self.find_root(x) == self.find_root(y)

C = [0]*M
for i in range(N-1):
    uf = UnionFind(N)
    for e in E:
        if e == E[i]:
            continue
        uf.unite(e[0], e[1])
    for l in range(M):
        if uf.isSameGroup(L[l][0], L[l][1]):
            continue
        C[l] |= 1 << i

import itertools

ans = 0
L = [int(i) for i in range(M)]
for m in range(M+1):
    for P in itertools.combinations(L, m):
        white = 0
        for j in P:
            white |= C[j]
        if m%2:
            ans -= 1 << N-1-bin(white).count("1")
        else:
            ans += 1 << N-1-bin(white).count("1")
print(ans)

Measured memory_bytes: 43896
a = str(input())
b = a[0:int((len(a)-1)/2)]
c = a[int((len(a)+1)/2):int(len(a))]
c = c[::-1]

if b != c:
	print('No')
elif b != b[::-1]:
	print('No')
elif c != c[::-1]:
	print('No')
else:
	print('Yes')

Measured memory_bytes: 3064
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
 
public class Main {
 
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		List<Double> list = new ArrayList<Double>();
		for (int i = 0; i < N; i++) {
			list.add(Double.parseDouble(sc.next()));
		}
 
		double ans = list.stream().mapToDouble(s -> 1.0 / s).sum();
 
		ans = 1.0 / ans;
		
		PrintWriter out = new PrintWriter(System.out);
		out.println(ans);
		out.flush();
	}
 
}

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

int main(){
    int64_t n, x;
    cin >> n >> x;
    int64_t a[100010];
    for(int i=0; i<n; i++){
        cin >> a[i];
    }
    int64_t ans = 0;
    if(a[0]>x){
        ans += (a[0]-x);
        a[0]=x;
    }

    for(int i=1; i<n; i++){
        if(a[i]+a[i-1] > x){
            ans += (a[i]-x+a[i-1]);
            a[i] = x-a[i-1];
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	cout << c - d + b << " " << d + c - a << " " << a - d + b << " " << b + c - a << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
        int n, k; cin >> n >> k;
        vector<int> v;
        for (int x = 0; x < n; ++x){
            int q; cin >> q;
            v.push_back(q);
        }
        sort(v.begin(), v.end(), greater<int>());
        int mn = INT_MAX;
        for (int x = 0; x < v.size() - (k-1); ++x){
            mn = min(mn, v[x] - v[x + (k - 1)]);
        }
        cout << mn << endl;
    return 0;
}


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

#define MAX 2000000
#define NIL -1

void maxHeapify(int list[], int i, int H){
    int l, r, largest;
    l = 2 * i;
    r = 2 * i + 1;
// 左の子、自分、右の子で値が最大のノードを選ぶ
    if ( l <= H && list[l] > list[i] ) largest = l;
    else largest = i;
    if ( r <=  H && list[r] > list[largest] ) largest = r;
    if ( largest != i ){// i の子の方が値が大きい場合
        swap(list[i], list[largest]);
        maxHeapify(list, largest, H);
    }
}

void insert(int S[], int k, int SEnd){
    if ( SEnd == 1 ){
        S[1] = k;
        return;
    }
    else{
        S[SEnd] = k;
        while( SEnd != 1 && S[SEnd/2] < S[SEnd]){
            swap(S[SEnd/2], S[SEnd]);
            SEnd = SEnd/2;
        }
        return;
    }
}

void extractMax(int S[], int SEnd){
    cout << S[1] << endl;
    S[1] = S[SEnd-1];
    S[SEnd-1] = NIL;
    maxHeapify(S, 1, SEnd-1);
}

int main(){
    
    string order;
    int k, SEnd = 1 , S[MAX+1];
    
    for(int i = 0; i < MAX+1; i++){
        S[i] = NIL;
    }
    
    while(1){
        
        cin >> order;
        
        if ( order == "end" ) break;
        
        if ( order == "insert" ) {
            cin >> k;
            insert(S, k, SEnd);
            SEnd++;
        }
        if ( order == "extract" ) {
            extractMax(S, SEnd);
            SEnd--;
        }
    }
    
    return 0;
}




Measured memory_bytes: 11028
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
total_before = sum(A)

for i in range(N):
    if A[i] >= B[i]:
        A[i] -= B[i]
        B[i] = 0
    else:
        B[i] -= A[i]
        A[i] = 0
        
    A[i+1] = max(0, A[i+1] - B[i])

total_after = sum(A)
print(total_before - total_after)

Measured memory_bytes: 19116
#include<iostream>
using namespace std;
const long long m=1e9+7;
long long n,x;
long long qpow(long long a,long long n)
{
	long long ans=1;
	while(n)
	{
		if(n&1) ans=(ans*a)%m;
		a=(a*a)%m;
		n>>=1;
	}
	return ans;
}
long long c(long long n,long long r)
{
	long long ans=1,ans1=1;
	for(long long i=n-r+1;i<=n;i++)
	ans=(ans*i)%m;
	for(long long i=2;i<=r;i++)
	ans1=(ans1*i)%m;
	ans1=qpow(ans1,m-2);
	ans=(ans*ans1)%m;
	return ans;
}
int main()
{
	int a,b;
    cin>>n>>a>>b;
	x=qpow(2,n)	;
	x=(x-1-c(n,a)-c(n,b)+2*m)%m;
	cout<<x<<endl;
	return 0;
} 

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

#define vec vector
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define Str(x) to_string(x)
#define len(s) (int)s.size()
#define int long long
typedef long long ll;
typedef double d;
typedef long double lld;
typedef string str;
typedef unsigned long long ull;
typedef unsigned int ui;

const int MAXN = 2e5 + 228;

int dp[MAXN][2], arr[MAXN], kek[MAXN];

 main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> arr[i];
        kek[i] = arr[i];
    }
    for (int i = 0; i < MAXN; i++)
    {
        dp[i][0] = dp[i][1] = -1e18;
    }
    dp[1][0] = kek[1] + kek[2];
    dp[1][1] = -kek[1] - kek[2];
    for (int i = 2; i < n; i++)
    {
        for (int j = 0; j <= 1; j++)
        {
            for (int g = 0; g <= 1; g++)
            {

                kek[i] = arr[i];
                kek[i+1] = arr[i+1];
                if (j == 1)
                {
                    kek[i] *= (-1);
                }
                int flex = kek[i];
                if (g == 1)
                {
                    kek[i] *= (-1);
                    kek[i+1] *= (-1);
                }
                dp[i][g] = max(dp[i][g], dp[i-1][j] - flex + kek[i] + kek[i+1]);
            }
        }
    }
    cout << max(dp[n-1][0], dp[n-1][1]);
    return 0;
}

Measured memory_bytes: 5760
//B - Sum of Three Integers
//Hiia
#include <stdio.h>
#include <stdlib.h>//rannsuu, zettaichi(absolute)
#include <time.h>
//srand((unsigned int) time(0));
#include <math.h>//koudona keisann
#include <string.h>//hairetsu
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
typedef long long ll;
//#define N 998244353
#define pi 3.1415926535897932384626433832

int gcd(int m,int n){if((0==m)||(0==n))return 0;while(m!=n)if(m>n)m=m-n;else n=n-m;return m;}
int lcm(int m,int n){if((0==m)||(0==n))return 0;return(m*n/gcd(m, n));}
int fact(int x){if(x==1) return(x);else return(x*fact(x-1));}//Kaijou x!
int ruijou(int base,int exponent){int i,answer=1;i=exponent;while(i!=0){answer=answer*base;--i;}return answer;}//ruijou base^exponent

long long int llgcd(long long int m,long long int n){if((0==m)||(0==n))return 0;while(m!=n)if(m>n)m=m-n;else n=n-m;return m;}
long long int lllcm(long long int m,long long int n){if((0==m)||(0==n))return 0;return(m*n/llgcd(m, n));}
long long int llfact(long long int x){if(x==1) return(x);else return(x*llfact(x-1));}//Kaijou
int llruijou(long long int base,long long int exponent){long long int i,answer=1;i=exponent;while(i!=0){answer=answer*base;--i;}return answer;}//ruijou base^exponent

int main()
{
  ll k,s,ans=0;
  scanf("%lld %lld", &k,&s);
  for(ll i = 0; i <= min(s,k); i++) {  //x
    if(0<=s-i && s-i<=k){     //y+z=s-x=s-i, y,s no kumiawase ha...
      ans+=s-i+1;
    }
    else if(k<s-i && s-i<=2*k){
      ans+=2*k-(s-i)+1;
    }
  }

  /*for(ll x = 0; x <= k; x++) {
    for(ll y = 0; y <= k; y++) {
      for(ll z = 0; z <= k; z++) {
        if(x+y+z==s){
          ans++;
        }
      }
    }
  }*/

  printf("%lld\n", ans);

  return 0;
}


Measured memory_bytes: 1688
#include <stdio.h>
int main(void)
{
    while (1) {
        int res, i, n, a[110]={0};
        scanf("%d", &n);
        if (n==0) break;

        for(i=1;i<=n;++i) {
            char s[4];
            scanf("%s", s);
            a[i]=a[i-1]^(1+(*s=='l'));
        }

        res=0;
        for(i=0;i+2<=n;++i) {
            if (a[i]==0 && a[i+2]==3 && (a[i+1]==1 || a[i+1]==2)) ++res;
            else if (a[i]==3 && a[i+2]==0 && (a[i+1]==1 || a[i+1]==2)) ++res;
        }
        printf("%d\n", res);
    }
    return 0;
}

Measured memory_bytes: 604
#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for(long long i=0;i<(n);i++)
#define REP1(i,n) for(long long i=1;i<=(n);i++)
#define REP2D(i,j,h,w) for(long long i=0;i<(h);i++) for(long long j=0;j<(w);j++)
#define REP2D1(i,j,h,w) for(long long i=1;i<=(h);i++) for(long long j=1;j<=(w);j++)
#define PER(i,n) for(long long i=((n)-1);i>=0;i--)
#define PER1(i,n) for(long long i=(n);i>0;i--)
#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define FORE(i,a,b) for(long long i=(a);i<=(b);i++)
#define ITE(arr) for(auto ite=(arr).begin();ite!=(arr).end();++ite)
#define ALL(a) ((a).begin()),((a).end())
#define RANGE(a) (a),((a)+sizeof(a))
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define YNPRT(b) cout<<((b)?"Yes":"No")<<endl
#define ENTER printf("\n")
#define REV(arr) reverse(ALL(arr))
#define PRT(a) cout<<(a)<<endl

#ifdef DEBUG
#define DBPRT(a) cout << "[Debug] - " << #a << " : " << (a) << endl
#define DBSTART if(1){
#define DBEND }
#define PRTLST(arr,num) REP(_i,num) cout<<_i<<" - "<<arr[_i]<<endl;
#define PRTLST2(arr2,d1,d2) REP(_i,d1) REP(_j,d2) cout<<_i<<","<<_j<<" : "<<arr2[_i][_j]<<endl;
#define PRTLST2D(arr2,d1,d2) do{cout<<"L\t";REP(_i,d2) cout<<_i<<"\t"; cout<<endl; REP(_i,d1){cout<<_i<<"\t";REP(_j,d2){cout<<arr2[_i][_j]<<"\t";}cout<<endl;}}while(0);
#else
#define DBPRT(a) if(0){}
#define DBSTART if(0){
#define DBEND }
#define PRTLST(arr,num) if(0){}
#define PRTLST2(arr2,d1,d2) if(0){}
#define PRTLST2D(arr2,d1,d2) if(0){}
#endif

#define TOSUM(arr,sum,n) {sum[0]=arr[0];REP1(i,n-1) sum[i]=sum[i-1]+arr[i];}

#define MIN(target,v1) (target)=min(target,v1)
#define MAX(target,v1) (target)=max(target,v1) 
#define P1 first
#define P2 second
#define PB push_back
#define UB upper_bound
#define LB lower_bound
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int INF_INT = 2147483647;
const ll INF_LL = 9223372036854775807LL;
const ull INF_ULL = 18446744073709551615Ull;
const ll P = 92540646808111039LL;
const int Move[4][2] = {-1,0,0,1,1,0,0,-1};
const int Move_[8][2] = {-1,0,-1,-1,0,1,1,1,1,0,1,-1,0,-1,-1,-1};
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p) {os<<"( "<<p.P1<<" , "<<p.P2<<" )";return os;}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {ITE(v) os << (ite-v.begin()) << " : " << *ite <<endl;return os;}
template<typename T>
ostream& operator<<(ostream& os,const set<T>& v) {os<<" { ";ITE(v) {os<<*ite;if(ite!=--v.end()){os<<" , ";}} os<<" } ";return os;}
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const map<T1,T2>& m) {ITE(m) {os<<ite->P1<<"\t\t|->\t\t"<<ite->P2<<endl;} return os;}

//---------------------
#define MAXN 100000
//---------------------

ll n;
string s,t;

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

	REP(i,2*n){
		printf("%c",(i%2)?t[i/2]:s[i/2]);
	}

	ENTER;
	return 0;
}









Measured memory_bytes: 256
N = int(input())
S = sorted([int(input()) for _ in range(N)])
sum_S = sum(S)
if sum_S % 10 != 0:
    print(sum_S)
    exit()
for s in S:
    if s % 10 == 0:
        continue
    print(sum_S - s)
    exit()
else:
    print(0)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
int main() {
int N,M;
  cin>>N>>M;
 vector <int> L(M);
  vector <int> R(M);
  for (int i = 0; i < M;i++){
    cin >> L.at(i) >> R.at(i);
  }
  sort(L.begin(),L.end());
  sort(R.begin(),R.end());
  if(R[0]-L[M-1]<0){
    cout << 0 <<endl;
  }
  else{
    cout <<R[0]-L[M-1]+1<<endl;
  }
  
 
}

Measured memory_bytes: 1024
N = int(input())
aa = []
bb = []
cc = []
aDP = [0]*N
bDP = [0]*N
cDP = [0]*N
for i in range(N):
    a,b,c = [int(x) for x in input().split()]
    aa.append(a)
    bb.append(b)
    cc.append(c)
aDP[0] = aa[0]
bDP[0] = bb[0]
cDP[0] = cc[0]
for i in range(1,N):
    aDP[i] = max(bDP[i-1] + aa[i],cDP[i-1]+aa[i])
    bDP[i] = max(aDP[i-1] + bb[i],cDP[i-1]+bb[i])
    cDP[i] = max(bDP[i-1] + cc[i],aDP[i-1]+cc[i])
print(max(max(aDP[N-1],bDP[N-1]),cDP[N-1]))

Measured memory_bytes: 70488
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define PI 3.14159265
void swap(ll arr[], ll x, ll y)
{
    ll temp=arr[x];
    arr[x]=arr[y];
    arr[y]=temp;
}
void print_arr(ll arr[],ll n)
{
    cout<<'\n';
    for(ll i=0; i<n; i++)
    {
        cout<<arr[i]<<' ';
    }
    cout<<'\n';
}
ll w[100];
ll cost[100];
ll dp[100][100001];
ll solve(ll rem, ll n)
{
  if(rem<0)
  {
      return INT_MIN;
  }
  if(rem==0){
    return 0;
  }
  if(n<0)
  {
      return 0;
  }
  if(dp[n][rem]!=-1)
  {
      return dp[n][rem];
  }
  ll a=0;
  ll b=0;
  if(w[n]<=rem)
  {
      a=cost[n]+solve(rem-w[n],n-1);
  }
  b=solve(rem,n-1);
  dp[n][rem]=max(a,b);
  return dp[n][rem];

}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    t=1;
    while(t--)
    {
        int n;
        cin>>n;
        int rem;
        cin>>rem;
        for(int i=0;i<n;i++)
        {
            for(int j=0;j<=rem;j++)
            {
                dp[i][j]=-1;
            }
        }
        for(int i=0;i<n;i++)
        {
            cin>>w[i]>>cost[i];
        }
        ll ans=0;
        ans=solve(rem,n-1);
        cout<<ans;
    }
    //cerr << "Time elapsed :" << clock() * 1000.0 / CLOCKS_PER_SEC << " ms" << '\n';
    return 0;
}


Measured memory_bytes: 78336
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define pdd pair<double,double>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll) (x).size()
#define pq priority_queue<ll>
#define pqg priority_queue<ll,vector<ll>,greater<ll>>
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) sort(v.begin(),v.end());v.erase(unique(v.begin(),v.end()),v.end())
// #define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , dy[4] ={0,1,0,-1};
 
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; }
 
struct Timer{
    chrono::system_clock::time_point start, end;
    Timer(){ start = chrono::system_clock::now(); }
    ~Timer(){
        end = chrono::system_clock::now();
        auto msec = chrono::duration_cast<chrono::milliseconds>(end - start).count();
        cerr<<"time : "<<msec<<" ms"<<endl;
    }
};


signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    // Timer TM;
    while(true){
        ll n;
        cin>>n;
        if(n==0) break;
        vll v(n);
        ll sum=0;
        ll m=LLINF,M=-LLINF;
        rep(i,n){
            cin>>v[i];
            chmax(M,v[i]);
            chmin(m,v[i]);
            sum+=v[i];
        }
        cout<<(sum-m-M)/(n-2)<<endl;
    }
    return 0;
}


Measured memory_bytes: 3188
//gauravsinghh
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long int
#define ld long double
#define db double
#define pii pair<int,int>
#define pll pair<long long,long long>
#define sii set<int>
#define sll set<long long>
#define vii vector<int> 
#define vll vector<long long>
#define mii map<int,int>
#define mll map<long long, long long>
#define lob lower_bound
#define upb upper_bound
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define pf push_front
#define ins insert
#define mp make_pair
#define w(t) cin >> t;while(t--)
#define on cout<<"\n"
#define o2(a,b) cout<<a<<" "<<b
#define os cout<<" "
#define bitcount __builtin_popcount
#define gcd __gcd
#define endl "\n"
#define present(s,x) (s.find(x) != s.end()) 
#define cpresent(s,x) (find(all(s),x) != s.end()) 
#define ford(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++) 
#define fors(container, it, a, b) for(__typeof(container.begin()) it = a; it != b; it++) 
#define MOD 1000000007
#define EPSILON 1e-9
#define PI 3.14159265358979323846
#define inf 999999999999999999
#define siz 100005
#define fbo find_by_order
#define ook order_of_key
#define sz(s) (int)s.size()
#define mem(n,m) memset(n,m,sizeof(n))
#define rep(i,n) for(ll i = 0; i < n; i++)
#define ren(i,n) for(ll i = n-1; i >= 0; i--)
#define all(x) x.begin(),x.end()
#define fo(i, a, b) for(int i = a; i <= b; i++)
#define ffo(i, a, b) for(int i = a; i >= b; i--)
#define MAX 100005
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;

//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")

void io_set() {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}

bool comp(const pair < ll, ll >&a, const pair < ll, ll >&b){
    return ((a.ss < b.ss) || (a.ss == b.ss && a.ff < b.ff));
}

signed main(){ 
    IOS
    //io_set();
    ll n, x;
    cin >> n;
    ll a[n];
    rep(i, n){
        cin >> a[i];
    }
    ll s = 0;
    rep(i, n){
        cin >> x;
        if(a[i] > x){
            s += (a[i]-x);
        }
    }
    cout << s << endl;
    return 0;
}



Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using static System.Console;

namespace AtCoder
{
    class Program
    {
        static void Main()
        {
            WriteLine(ReadLine().GroupBy(s => s).All(s => s.Count() == 2) ? "Yes" : "No");
        }
    }
}


Measured memory_bytes: 13280
#include <algorithm>
#include <iostream>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
#include <iterator>
#include <map>
#include <set>
#include <iomanip>
#include <vector>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using Graph = vector<vector<int>>;
int dx[] = {0, 1, 0, -1};
int dy[] = {1, 0, -1, 0};
#define INF 100000000000
#define MAX 200001
#define MOD 998244353

void dfs(int s, Graph &G, vector<int> &visited, vector<ll> &cnt){
    visited[s] = 1;
    cnt[(s - 1) / 100000] += 1;
    for(auto v: G[s]){
        if(visited[v]) continue;
        dfs(v, G, visited, cnt);
    }
}

int main(){
    int N, S;
    cin >> N >> S;
    vector<int> A(N);
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }
    vector<vector<ll>> dp(N + 1, vector<ll>(S + 1, 0));
    dp[0][0] = 1;
    for(int i = 0; i < N; i++){
        for(int j = 0; j <= S; j++){
            if(j - A[i] >= 0){
                dp[i + 1][j] += dp[i][j - A[i]];
                dp[i + 1][j] %= MOD;
            }
            dp[i + 1][j] += 2 * dp[i][j];
            dp[i + 1][j] %= MOD;
        }
    }
    cout << dp[N][S] << endl;
}

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

using namespace std;

int main()
{
    int a,b;
    cin>>a>>b;
    int x,s=0;
    for(int i=0;i<b;i++)
    {

        cin>>x;
        s+=x;
    }
    if(s>=a)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }

    return 0;
}


Measured memory_bytes: 256