akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace __gnu_pbds; 
using namespace std;
using   ll=long long;
using   ld=long double;

#define fast        	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ordered_set 	tree<pll, null_type,less<pll>, rb_tree_tag,tree_order_statistics_node_update>

#define endl        	"\n"
#define pb          	push_back
#define mp          	make_pair
#define F           	first
#define S           	second
#define int             long long int

#define ALL(v)      	v.begin(),v.end()
#define ALLR(v)     	v.rbegin(),v.rend()
#define pii         	3.14159265358979323
#define inf     		LLONG_MAX
#define ones(x)     	__builtin_popcount(x)
#define fill(a,b)   	memset(a,b,sizeof(a))
#define mod 			1000000007

ll mod_pow(ll a,ll b) 
{
    ll res = 1;
    while(b)	
    {
        if(b&1) 	
        {
        	res=(res*a)%mod;
        }
        a=(a*a)%mod;
        b>>=1;
    }
    return res;
}

ll mod_inverse(ll a) 
{
	return mod_pow(a , mod-2);
}

void solve()
{
	string s;
	
	cin >> s;
	
	map<int , int> f;
	
	f[0] = 1;
	
	reverse(ALL(s));
	
	int ten = 1;
	int rem = 0;
	int ans = 0;
	
	for(int i = 0; i < s.size(); ++i) {
		rem = (rem + ten*(s[i]-'0')) % 2019;
		ten = ten*10;
		ten %= 2019;
		
		ans += f[rem];
		
		f[rem]++;
	}
	
	cout << ans;
}

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


Measured memory_bytes: 3680
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <iostream>
#include <cmath>
#define maxn 100009
using namespace std;
int n,a[maxn],x;
vector<int>odd,eve;
long long s1[maxn],s2[maxn];
int main(){
    long long ans=0;
    scanf("%d%d",&n,&x);
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
    }
    for(int i=2;i<=n;i++){
        if(a[i]+a[i-1]<=x)
            continue;
        if(a[i]+a[i-1]>x)
            ans+=a[i]+a[i-1]-x;
        int cut=a[i]+a[i-1]-x;
        a[i]=max(0,a[i]-cut);
        //cout<<i<<" "<<a[i]<<endl;
    }
    cout<<ans<<endl;
    //system("pause");
    return 0;
}



Measured memory_bytes: 640
#include<stdio.h>

int main(){
    int i,l,r,d,count=0;
    scanf("%d%d%d",&l,&r,&d);
    for(i=l;i<=r;i++){
        if(i%d==0){
            count++;
        }
    }
    printf("%d\n",count);
    return 0;
}

Measured memory_bytes: 1728
A, B, C, D, E, F = list(map(int, input().split()))

s1 = set()
for i in range(0, 31, A):
    for j in range(0, 31, B):
        if 0 < i + j and i * 100 + j * 100 <= F:
            s1.add(i + j)

s2 = set()
for i in range(0, F, C):
    for j in range(0, F, D):
        if i + j <= F:
            s2.add(i + j)

max_concent = 0
total = 0
sugar = 0
for ab in s1:
    for cd in s2:
        if cd <= E * ab and cd <= F - 100 * ab:
            if max_concent <= cd / ab:
                max_concent = cd / ab
                total = 100 * ab + cd
                sugar = cd


print(total, sugar)


Measured memory_bytes: 3188
import java.util.*;

class Main
{
    public static void main (String[] args)
    {
        Scanner sc = new Scanner (System.in);
        
        int[] array = new int[5];
        
        int count = 0;
        for (int i = 0; i < array.length; i++) {
            array[i] = sc.nextInt();
            if (array[i] == 0) {
                count = i + 1;
            }
        }
        

            System.out.println(count);
        
    }
}

Measured memory_bytes: 35832
//in the name of god
#include <bits/stdc++.h>
using namespace std;
#define MAX_N (int)1e5+20
#define INF 1e9+20
#define pb push_back
#define F first
#define S second
typedef long long LL;
typedef pair<int,int> pii;
const int delta=(int)1e9+7;
int n,m,a[70][70]; string s[70];
int x[]={-1,0,1,1,1,0,-1,-1},y[]={1,1,1,0,-1,-1,-1,0};
int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin>>n>>m;
	for(int i=1;i<=n;++i) cin>>s[i],s[i]="."+s[i]+".";
	for(int i=1;i<=n;++i){
		for(int j=1;j<=m;++j){
			if(s[i][j]!='#') continue;
			for(int e=0;e<8;++e){
				++a[i+x[e]][j+y[e]];
			}
		}
	}
	for(int i=1;i<=n;++i){
		for(int j=1;j<=m;++j){
			if(s[i][j]!='#') s[i][j]=(char)(a[i][j]+48);
		}
	}
	for(int i=1;i<=n;++i){
		for(int j=1;j<=m;++j){
			cout<<s[i][j];
		}
		cout<<endl;
	}
	return cout<<endl,0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        s = s.replace("BC","*");
        char[] sl = s.toCharArray();
        long ans = 0;
        int chain = 0;
        for(char c: sl){
            if(c == 'A'){
                chain++;
            }else if(c == '*'){
                ans += chain;
            }else{
                chain = 0;
            }
        }
        System.out.println(ans);
    }
}


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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}

int main() {
  int N, D; cin >> N >> D;
  int ans = 0;
  int a = 2 * D + 1;
  if(N % a == 0) {
    ans = N / a;
  } else {
    ans = N / a + 1;
  }

  cout << ans << endl;
}

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




int main(){ 
      int mm=0;
      vector<int> nn;
      while(1){
            int aaaaa;
            cin >> aaaaa;
            if(aaaaa==0) break;
            if(mm < aaaaa) mm= aaaaa;
            nn.push_back(aaaaa);
      }

      //与えられた最大のｎで篩      
      vector<int> res,ytg;
      vector<bool> is_prime(mm+1,true);
      for(int p=2;p<=mm;p++){
            if(!is_prime[p]) continue;
            for (int k = p*2;k<=mm;k+=p) is_prime[k] = false;
            res.push_back(p);
            if(res.size()>4){
                  if(res[res.size()-1-1]==res[res.size()-1]-2){
                        if(res[res.size()-1-2]==res[res.size()-1-1]-4){
                              if(res[res.size()-1-3]==res[res.size()-1-2]-2){
                                    ytg.push_back(p);
                              }
                        }
                  }
            }
            
      }

      //for(int i=0;i<(int)ytg.size();i++){
      //      cout << ytg[i] << endl;
      //}

      for(int i=0;i<nn.size();i++){
            int ans;
            ans=ytg[distance(ytg.begin(),upper_bound(ytg.begin(),ytg.end(),nn[i]))-1];
            cout << ans << endl;


      }
}


Measured memory_bytes: 8312
#define  _USE_MATH_DEFINES

#define  rep(i, n) for(int i = 0; i < n; i++)
#define  repx(i, a, n) for(int i = a; i < n; i++)
#define  loop while(1)
#define  lli long long int
 
#include <iostream>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <utility>
#include <set>
  
using namespace std;
 
int main() {

  int n;
  cin >> n;

  vector<vector<int>> v(2, vector<int>(n, 0));
  rep(i, 2) rep(j, n) cin >> v[i][j];

  vector<lli> sum(3, 0);
  lli maxdiff = 0;
  lli tmp;

  rep(i, n) {
    tmp = abs(v[0][i] - v[1][i]);
    rep(j, 3) sum[j] += pow(tmp, j + 1);
    maxdiff = max(maxdiff, tmp);
  }

  printf("%.10lf\n", (double)sum[0]);
  printf("%.10lf\n", sqrt(sum[1]));
  printf("%.10lf\n", cbrt(sum[2]));
  printf("%.10lf\n", (double)maxdiff);

  return 0;
}



Measured memory_bytes: 3460
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define RNG(i,from,to) for(int i=(from); i<(int)(to); i++)
#define gcd(i,j) __gcd((i), (j))
typedef long long ll;
typedef pair<int, int> pii;
template<typename S, typename T> string to_string(pair<S, T> p) { return "("+to_string(p.first)+","+to_string(p.second)+")"; }
template<typename T> string to_string(T p[2]) { return "["+to_string(p[0])+","+to_string(p[1])+"]"; }
template<typename T> void println(T e){ cout << to_string(e) << endl; }
template<typename T> void println(const vector<T>& v){ cout << "[";for(const auto& e : v){ cout << to_string(e) << ","; }cout << "]";cout << endl; }
template<typename T> void println(const vector<vector<T>>& vv){ for(const auto& v : vv){ println(v); } }
template<typename Iter> void println(Iter first, Iter last){ for(auto it=first; it != last; it++){ cout << *it << " "; }; cout << endl; }
const ll DVSR = 1e9+7;


int main(int argc, char const *argv[])
{
  ll N, res = 0; cin >> N;
  vector<ll> AS(N);
  REP(i, N) cin >> AS[i];
  REP(i, N-1) {
    RNG(j, i+1, N) {
      res = max(res, abs(AS[i] - AS[j]));
    }
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(a) (a).begin(), (a).end()
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1, (i)>=0; (i)--)
#define ios() cin.tie(0), ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
ll const MOD = 1e9+7;
ll const INF = 1e18;
using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> v(26, 100);
    REP(i, n){
        string s;
        cin >> s;
        vector<int> u(26, 0);
        for(auto j : s){
            u[j - 'a']++;
        }
        REP(i, 26){
            v[i] = min(v[i], u[i]);
        }
    }
    REP(i, 26){
        REP(j, v[i]){
            cout << (char)(i + 'a');
        }
    }
    cout << endl;

    return 0;
}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};

#[allow(unused_imports)]
use std::io::Write;

fn main() {
    input!{
      a: usize,
      b: usize,
    }
    if b%a == 0 {
        println!("{}", a+b);
    } else {
        println!("{}", b-a);
    }
}


Measured memory_bytes: 4352
#include<stdio.h>
int main(void){
	int m,f,r;
	int sum=0;
	while(1){
		scanf("%d %d %d",&m,&f,&r);
		if(m==-1&&f==-1&&r==-1){
			break;
		}
		if(m<=50&&f<=50&&r<=100){
			sum=m+f;
			
			if(m==-1||f==-1){
				printf("F\n");
			}else if(sum>=80){
				printf("A\n");
			}else if(sum<80&&sum>=65){
				printf("B\n");
			}else if(sum<65&&sum>=50){
				printf("C\n");
			}else if(sum<50&&sum>=30&&r>=50){
				printf("C\n");
			}else if(sum<50&&sum>=30){
				printf("D\n");
			}else if(sum<30){
				printf("F\n");
			}
		}
	}
	return 0;
}

Measured memory_bytes: 584
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const string ln = "\n";
constexpr int INF = 1001001001;
constexpr int MOD = 1000000007;

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

  ll n;
  cin >> n;
  vector<ll> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> b[i];
  }

  priority_queue<ll> need, over;
  for (int i = 0; i < n; i++) {
    if (a[i] < b[i]) {
      need.push(b[i] - a[i]);
    } else {
      over.push(a[i] - b[i]);
    }
  }

  ll ans = 0;

  ll prev = 0;
  while (!need.empty()) {
    ll t = need.top();
    need.pop();
    ans++;

    while (prev < t && !over.empty()) {
      prev += over.top();
      over.pop();
      ans++;
    }

    if (t > prev) {
      ans = -1;
      break;
    }

    prev -= t;
  }

  cout << ans << ln;

  return 0;
}

Measured memory_bytes: 2936
#include <cstdio>

const int MOD = (int)1e9 + 7;
const  int kN = 200000 + 5;
int c[kN], n;
int left[kN];

int main() {
  scanf("%d", &n);
  int m = 0;
  for (int i = 1; i <= n; ++ i) {
    int x;
    scanf("%d", &x);
    if (x != c[m]) c[++ m] = x;
  }
  // end with index i
  // left bracket a_i
  int way = 1;
  for (int i = 1; i <= m; ++ i) {
    int tmp = left[c[i]];
    left[c[i]] = (left[c[i]] + way) % MOD;
    way = (way + tmp) % MOD;
  }
  printf("%d\n", way);
}


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

using namespace std;

char arry[6][6];

int main() {
    int h, w, k;
    cin >> h >> w >> k;
    int cnt = 0;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            cin >> arry[i][j];
            if (arry[i][j] == '#') cnt++;
        }
    }

    // そもそも黒がk個ない
    if (cnt < k) {
        cout << 0;
        return 0;
    }

    int ans = 0;
    // 線を1本ずつ引いて試す
    for (int i = 0; i <= pow(2, h); i++) {
        for (int j = 0; j <= pow(2, w); j++) {
            cnt = 0;
            for (int row = 0; row < h; row++) {
                if (i >> row & 1) {
                    for (int col = 0; col < w; col++) {
                        if (j >> col & 1) {
                            if (arry[row][col] == '#') {
                                cnt++;
                            }
                        }
                    }
                }
            }
            if (cnt == k) ans++;
        }
    }
    cout << ans;
}


Measured memory_bytes: 4092
#include<bits/stdc++.h>
using namespace std;
struct node{
    int data;
    node* next;
};
node *root=NULL;
void appended(int data){
    if(root==NULL){
        root=new node;
        root->data=data;
        root->next=NULL;
    }
    else{
        node* currentNode=root;
        while(currentNode->next!=NULL)
            currentNode=currentNode->next;
        node* newNode=new node;
        newNode->data=data;
        newNode->next=NULL;
        currentNode->next=newNode;
    }
}
void print(){
    node* currentNode=root;
    while(currentNode!=NULL){
        cout<<currentNode->data<<" ";
        currentNode=currentNode->next;
    }
    cout<<endl;
}



int main(){
    int n,k,cnt=0;
    set<int>st;
    cin>>n>>k;
    while(k--){
        int d;
        cin>>d;

        for(int i=1; i<=d; i++){
            int x;cin>>x;
            st.insert(x);
        }
    }
    int len=st.size();
    cout<<n-len<<endl;
}







Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fst first
#define snd second
#define all(cont) cont.begin(), cont.end()
#define foreach(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define fore(i,a,b) for(int i=a,almo5t=b;i<almo5t;++i)
#define SZ(x) ((int)x.size())
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
#define FIN std::ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

const int N = 0;

typedef long long int ll;

using namespace std;

int main(){
    string in;cin>>in;
    cout<<in[0]<<in.size()-2<<in[in.size()-1];
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <map>
#include <algorithm>
#include <string>
#include <vector> 
#include <numeric>
#include <cmath>
#include <queue>
#include <iomanip>
#include <functional>


#define CHMAX(a,b) a = std::max(a,b)
#define CHMIN(a,b) a = std::min(a,b)
#define MAXMIN(a,b,c) std::max(a,min(b,c))
#define CHABS(a) a = std::abs(a) 
#define COUT(a) std::cout << a << std::endl
#define CERR(a) std::cerr << a << std::endl
#define FOR(n) for(lli i = 0; i < n; i++)

using namespace std;
using lli = long long int;
using pll = pair<lli, lli>;
using tlll = tuple<lli, lli, lli>;
using vll = vector<lli>;

lli mod197 = 1000000007LL;
lli INF = 10000000000000;

// ax + by = gcd(a,b) 最大公約数
template< typename T >
T extgcd(T a, T b, T& x, T& y) {
	T d = a;
	if (b != 0) {
		d = extgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
	else {
		x = 1;
		y = 0;
	}
	return d;
}

int main(void) {

	lli n, sum = 0;
	cin >> n;
	for (lli i = 1; i <= n; i++) {
		if (i % 3 == 0 || i % 5 == 0) {
		}
		else {
			sum += i;
		}
	}

	cout << sum << endl;

	return 0;
}

Measured memory_bytes: 3564
fun main(args: Array<String>) {
    val (h, w) = readLine()!!.split(' ').map { it.toInt() }
    val c = (0..9).map { readLine()!!.split(' ').map { it.toInt() }.toMutableList() }
    for (k in 0..9) {
        for (i in 0..9) {
            for (j in 0..9) {
                val costIKJ = c[i][k] + c[k][j]
                if (c[i][j] > costIKJ) {
                    c[i][j] = costIKJ
                }
            }
        }
    }
    val ans = (1..h).map {
        readLine()!!.split(' ').map { it.toInt() }.map {
            if (it == -1) {
                0
            } else {
                c[it][1]
            }
        }.sum()
    }.sum()
    println(ans)
}

Measured memory_bytes: 43320
#include <cstdio>

int main() {
    int n,m;
    std::scanf("%d%d",&n,&m);

    int gyoretsu[n][m];

    int retsubekutoru[m];


    for (int i = 0;i<n;i++) {
        for (int j = 0;j<m;j++) {
            std::scanf("%d",&gyoretsu[i][j]);
        }
    }

    for (int i = 0;i<m;i++) {
        std::scanf("%d",&retsubekutoru[i]);
    }


    for (int i = 0;i<n;i++) {
        int sum = 0;
        for (int j = 0;j<m;j++) {
            //std::printf("%d\n",gyoretsu[i][j]*retsubekutoru[j]);
            sum+=gyoretsu[i][j]*retsubekutoru[j];
        }
        std::printf("%d\n",sum);
    }


}


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

int A[55];
bool boleh[55];
int B[55];
int C[55];
int indx[55];
long long ncr[55][55];

long long ncrUpTo[55][55];

int cnt2[(1<<18)+5];

int main(){
    int N, K, S, T;
    scanf("%d%d%d%d", &N, &K, &S, &T);

    if( ((S&T) == S) && ((S|T) == T) ){
    }else{
        printf("0");
        return 0;
    }

    memset(ncr, 0, sizeof(ncr));
    ncr[0][0] = 1;
    for(int i = 1; i <= N; i ++){
        ncr[i][0] = 1;
        for(int j = 1; j <= i; j ++){
            ncr[i][j] = ncr[i-1][j] + ncr[i-1][j-1];
        }
    }

    ncrUpTo[0][0] = 0;
    for(int i = 1; i <= N; i ++){
        ncrUpTo[i][0] = 0;
        for(int j = 1; j <= N; j ++){
            ncrUpTo[i][j] = ncrUpTo[i][j-1] + ncr[i][j];
        }
    }

    for(int i = 0; i < N; i ++){
        scanf("%d", &A[i]);
        boleh[i] = true;
        //printf("A[%d]=%d\n", i, A[i]);
    }

    int L = 0;
    for(int i = 0; i < 20; i ++){
        if( (S&(1<<i)) == (T&(1<<i)) ){
            for(int j = 0; j < N; j ++){
                if( (S&(1<<i)) != (A[j]&(1<<i)) ){
                    boleh[j] = false;
                    //printf("boleh[%d]=false\n", j);
                }
            }
        }else{
            indx[L ++] = i;
        }
    }

    for(int i = 0; i < L; i ++){
        for(int j = 0; j < N; j ++){
            if(A[j]&(1<<indx[i])){
                B[j] |= (1<<i);
            }
        }
    }

    int M = 0;
    for(int i = 0; i < N; i ++){
        if(boleh[i]){
            C[M ++] = B[i];
        }
    }

    for(int i = 0; i < M; i ++){
        //printf("C[%d]=%d\n", i, C[i]);
    }

    memset(cnt2, 0, sizeof(cnt2));
    long long ans = 0;
    list<int> s;
    for(int U = 0; U < (1<<L); U ++){
        long long f = 0;

        s.clear();
        for(int i = 0; i < M; i ++){
            if(!cnt2[U&C[i]]){s.emplace_back(U&C[i]);}
            cnt2[U&C[i]] ++;
        }

        for(int j: s){
            int cnt = cnt2[j];
            f += ncrUpTo[cnt][K];
            cnt2[j] = 0;
        }

        int temp = __builtin_popcount(U);
        if(temp&1){
            ans -= f;
        }else{
            ans += f;
        }
    }

    printf("%lld", ans);
    return 0;
}


Measured memory_bytes: 4868
#include <bits/stdc++.h>
  
using namespace std;
  
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
  
#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
  
#define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update> 
  
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
  
const int inf = int(1e9);
const int mod = inf + 7;
const int N = 1e6 + 555; // TL MB
const double PI = acos(-1.0);
 
void mul(ll &x, ll y){
	x *= y;
	// if(x >= mod) x %= mod;
}
 
void add(ll &x, ll y){
	x += y;
	if(x >= mod) x -= mod;
	if(x < 0) x += mod;
}
ll bp(ll a, ll n){
	ll r = 1;
	while(n){
		if(n & 1) mul(r, a);
		mul(a, a);
		n >>= 1;
	}
	return r;
}

void solve()
{
	int a, b;
	cin >> a >> b;
	int cx = max(a, b);
	while(cx--){
		cout << min(a, b);
	}
	
}

 
 
int main()
{
    Red;
  	// int T; cin >> T; while(T--)
    solve();
    return 0;
}

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

int main()
{
    string x;
    cin >> x;
    if(x.at(0)==x.at(1)&&x.at(1)==x.at(2))
        cout << "Yes";

    else if (x.at(1) == x.at(2) && x.at(2) == x.at(3))
    {
        cout << "Yes";
    }
    else
    {
        cout << "No";
    }
}


Measured memory_bytes: 256
#include <stdio.h>

int main()
{
	long long A, B, N;
	scanf("%lld %lld %lld", &A, &B, &N);
	if (N / B >= 1) N = N / B * B - 1;
	printf("%lld\n", A * N / B - A * (N / B));	
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 1704
#include <iostream>
#include <cstdio>
#define int long long
#define N 3002
using namespace std;
const int mod=1000000007;
int n,m,i,j,f[N][N][2];
int read()
{
	char c=getchar();
	int w=0;
	while(c<'0'||c>'9') c=getchar();
	while(c<='9'&&c>='0'){
		w=w*10+c-'0';
		c=getchar();
	}
	return w;
}
signed main()
{
	n=read();m=read();
	for(i=1;i<=n;i++) f[0][i][0]=1;
	f[0][0][1]=1;
	for(i=1;i<=m;i++){
		for(j=0;j<=n;j++){
			if(j<n){
				if(j) f[i][j][0]=(f[i][j][0]+f[i-1][j+1][0])%mod;
				f[i][j][1]=(f[i][j][1]+f[i-1][j+1][1]+(j==0)*f[i-1][j+1][0])%mod;
			}
			if(j>0){
				if(j!=1) f[i][j][0]=(f[i][j][0]+f[i-1][j-1][0])%mod;
				f[i][j][1]=(f[i][j][1]+f[i-1][j-1][1])%mod;
			}
			if(j<n){
				if(j) f[i][j][0]=(f[i][j][0]+f[i-1][j][0])%mod;
				f[i][j][1]=(f[i][j][1]+f[i-1][j][1])%mod;
			}
			if(j>0){
				if(j!=1) f[i][j][0]=(f[i][j][0]+f[i-1][j][0])%mod;
				f[i][j][1]=(f[i][j][1]+f[i-1][j][1]+(j==1)*f[i-1][j][0])%mod;
			}
		}
	}
	int ans=0;
	for(i=0;i<=n;i++) ans=(ans+f[m][i][1])%mod;
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 141056
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
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; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

struct UnionFind {
    vector<int> par, cnt;

    UnionFind(int n): par(n, -1), cnt(n) {}
    int find(int x) {
        if (par[x]<0) return x;
        return par[x] = find(par[x]);
    }
    bool same(int i, int j) {
        // iとjが同じグループかどうかを判別する
        return find(i) == find(j);
    }
    int size(int x) {
        return -par[find(x)];
    }

    bool unite(int x, int y) {
        // iとjを併合する
        x = find(x);
        y = find(y);
        bool ok = (-par[x]>cnt[x] || -par[y]>cnt[y]);
        if (x == y) {
            cnt[x]++;
        } else if (par[x] > par[y]) {
            par[y] += par[x];
            par[x] = y;
            cnt[y] += cnt[x]+1;
        } else {
            par[x] += par[y];
            par[y] = x;
            cnt[x] += cnt[y]+1;
        }
        return ok;
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    V<int> x(n), y(n);
    for (int i = 0; i < n; i++) cin >> x[i] >> y[i];

    priority_queue< P<int, P<int, int> > > pq;
    V<int> ord(n); iota(ALL(ord), 0);
    sort(ALL(ord), [&](int i, int j) {
        return x[i] < x[j];
    });
    for (int i = 1; i < n; i++) {
        pq.push(make_pair(x[ord[i - 1]] - x[ord[i]], make_pair(ord[i], ord[i - 1])));
    }
    sort(ALL(ord), [&](int i, int j) {
        return y[i] < y[j];
    });
    for (int i = 1; i < n; i++) {
        pq.push(make_pair(y[ord[i - 1]] - y[ord[i]], make_pair(ord[i], ord[i - 1])));
    }
    
    UnionFind uni(n);

    ll ans = 0;
    while (!pq.empty()) {
        P<int, P<int, int> > q = pq.top(); pq.pop();
        if (!uni.same(q.second.first, q.second.second)) {
            uni.unite(q.second.first, q.second.second);
            ans -= (ll)q.first;
        }
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 6132
#include <bits/stdc++.h>
#include <numeric>
using namespace std;
#define ll long long
#define mod 100000007
#define rep(i, n) for (int i = 0; i < n; ++i)
using Graph = vector<vector<int>>;
#define grepq priority_queue<double, std::vector<double>, std::greater<double>>
#define all(v) v.begin(),v.end()
ll INF = 10010001010;

ll lcm(ll a,ll b)
{
    return a * b / __gcd(a, b);
}

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

int main(){
    ll N;
    cin >> N;
    vector<ll> A(N);
    int count = 1;
    for (int i = 0; i < N; i++)
    {
        cin >> A[i];
        if(count == A[i]){
            count++;
        }
    }
    if(count == 1){
        cout << -1 << endl;
        return 0;
    }
    cout << N - count +1 << endl;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define f(i,n)  for(ll i=0;i<n;i++)
#define fb(i,n) for(ll i=n-1;i>=0;i--)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef pair<int,int> pii;
int main()
{
	IOS;
	//int t; cin>>t;
	//ll M=pow(10,9)+7;
	int t=1;
	while(t)
	{
		string s,T; cin>>s>>T;
		int count=0;
		for(int i=0;i<s.length();i++)
		{
			if(s[i]!=T[i]) count++;
		}
		cout<<count;
		t--;
	}
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vector<int>> vvi;

#define ALL(x) x.begin(), x.end()
#define mp(x, y) make_pair(x, y)
#define FOR(i, __, ___) for(int i = __; i < ___; i++)


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

	int k;
	cin >> k;
	while (k--) {
		cout << "ACL";
	}

	return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <map>
#include <algorithm>
#include <string>
#include <vector> 
#include <numeric>
#include <cmath>
#include <queue>


#define CHMAX(a,b) a = std::max(a,b)
#define CHMIN(a,b) a = std::min(a,b)
#define CHABS(a) a = std::abs(a) 
#define COUT(a) std::cout << a << std::endl
#define CERR(a) std::cerr << a << std::endl
#define FOR(n) for(lli i = 0; i < n; i++)

using namespace std;
using lli = long long int;
using pll = pair<lli, lli>;
using tlll = tuple<lli, lli, lli>;

lli mod197 = 1000000007LL;

// ax + by = gcd(a,b) 最大公約数
template< typename T >
T extgcd(T a, T b, T& x, T& y) {
	T d = a;
	if (b != 0) {
		d = extgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
	else {
		x = 1;
		y = 0;
	}
	return d;
}

lli N, M;

pll arbait[100000];

int main(void) {

	cin >> N >> M;

	priority_queue<lli> q;

	FOR(N) {
		cin >> arbait[i].first >> arbait[i].second;
	}

	sort(arbait,arbait + N);

	lli count = 0;
	lli ans = 0;

	for (int i = M - 1; i >= 0; i--) {
		
		for (; count < N && arbait[count].first <= M - i; count++) {
			q.push(arbait[count].second);
		}

		if (!q.empty()) {
			lli a = q.top();
			q.pop();
			ans += a;
		}
	}

	COUT(ans);

	return 0;
}

Measured memory_bytes: 2936
using System;
class Program
{
	static void Main(string[] args)
	{
		int N = int.Parse(Console.ReadLine());
            string A = Console.ReadLine();
            string B = Console.ReadLine();
            string C = Console.ReadLine();

            int count = 0;

            for(int i=0; i<N; i++)
            {
                if(A[i] != B[i] && B[i] != C[i] && A[i] != C[i])
                {
                    count += 2;
            
                }
                else if(A[i] == B[i] && B[i] == C[i] && A[i] == C[i])
                {

                }
                else
                {
                    count++;
                }

            }

            Console.WriteLine(count + "");
	}
}

Measured memory_bytes: 11092
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n)for(int i=0;i<(int)(n);i++)
#define PI 3.141592653589793
//vector < vector<int>>a(0, vector<int>(0));二次元配列宣言


int main()
{
	int a, b;
	int i;
	int ans=-1;
	cin >> a >> b;
	int tmp;
	if (a > b)
	{
		tmp = a;
		a = b;
		b = tmp;
	}
	for (i = a; i < b; i++)
	{
		if ((a - i) * (-1) == b - i)
		{
			ans = i;
			break;
		}
	}
	if (ans == -1)
		cout << "IMPOSSIBLE" << endl;
	else
		cout << ans << endl;
}

Measured memory_bytes: 3552
//  ROAD TO GREEN
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>
#include <queue>
#include <set>
#include <bitset>

#define ll long long
#define uint unsigned int
#define ull unsigned ll
#define mp make_pair
#define pb push_back
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define speedhack() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define do(x) for(int i = 1; i <= x; i++){ solve(); }
#define s(x) x.size()

using namespace std;
const ll MAXN = 2e9+2;
const ll SIZE = 1e5+2;
const ll mod = 1e9+7;
vector<bool> used(SIZE,false);
map<int,int> mapp;



void solve(){
	int n,m;
	cin >> n >> m;
	vector<int> v;
	for(int i = 1; i <= n; i++){
		int x; cin >> x;
		v.push_back(x);
	}
	sort(all(v));
	for(int i = 0; i < m; i++){
		int x,y;
		cin >> x >> y;
		mapp[y] += x;
	}
	ll ans = 0;
	for(int i = 0; i < n; i++){
		if(!mapp.empty()){
			if(mapp.rbegin()->first > v[i]){
				v[i] = mapp.rbegin()->first;
				mapp.rbegin()->second--;
				if(mapp.rbegin()->second == 0){
					mapp.erase(mapp.rbegin()->first);
				}
			}
		}
		ans += v[i];
	}
	cout << ans << endl;
}

int main(){ 
	speedhack()
	// int it; cin >> it;
	int it = 1;
	do(it);
	return 0;
}


Measured memory_bytes: 5368
a=input()
b=a[::-1]
p=0

for i in range(len(a)):
  if a[0] !='A':
    a=a[1:]
  else:
    break
    
for i in range(len(a)):
  if a[-1] !='Z':
    a=a[:-1]
  else:
    break
    
    
print(len(a))

Measured memory_bytes: 9504
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repit(it, li) for(auto it=li.begin(); it!=li.end(); it++)
using namespace std;
using ll = long long;
using P = pair<int,int>;

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

   cout<<((n+1)/2)<<endl;
   return 0;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int MN=100100;
const LL MOD=1e9+7;
int n,a[MN],cnt[MN]={0},pos[10]={0};
LL fac[MN],inv[MN];
LL QuickPow(LL x,LL y)
{
    LL res=1;
    while(y)
    {
        if(y&1)res=(res*x)%MOD;
        x=(x*x)%MOD;
        y>>=1;
    }
    return res;
}
int main()
{
    fac[0]=1;int N=MN-10;
    for(int i=1;i<=N;i++)fac[i]=(i*fac[i-1])%MOD;
    inv[N]=QuickPow(fac[N],MOD-2);
    for(int i=N-1;i>=0;i--)inv[i]=((inv[i+1])*(i+1))%MOD;
    scanf("%d",&n);
    for(int i=1;i<=n+1;i++)scanf("%d",&a[i]),cnt[a[i]]++;
    int d=0,flag=0;
    for(int i=1;i<=n+1;i++)if(cnt[a[i]]==2&&(!flag))flag=1,d=i;else if(cnt[a[i]]==2&&flag)d=i-d+1;
    for(int k=1;k<=n+1;k++)
    {
        if(n+1-d<k-1)printf("%lld\n",(fac[n+1]%MOD*inv[k]%MOD*inv[n+1-k]%MOD)%MOD);
        else printf("%lld\n",((fac[n+1]%MOD*inv[k]%MOD*inv[n+1-k]%MOD)%MOD-(fac[n+1-d]%MOD*inv[k-1]%MOD*inv[n-d-k+2]%MOD)%MOD+MOD)%MOD);
    }
    return 0;
}


Measured memory_bytes: 3584
#include <bits/stdc++.h>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>
using namespace std; 
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
inline bool EQ(double a, double b) { return fabs(a-b) < 1e-9; }
const int INF = 1<<29;
typedef long long int ll;
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n>>b)&1; }
inline void set_bit(int & n, int b) { n |= two(b); }
inline void unset_bit(int & n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) { int res = 0; while(n && ++res) n-=n&(-n); return res; }
template<class T> void chmax(T & a, const T & b) { a = max(a, b); }
template<class T> void chmin(T & a, const T & b) { a = min(a, b); }
const int MOD=1000000007;

bool isPowerOfTwo (ll x)  
{  
    return x && (!(x&(x-1)));  
}
bool isPrime(int n) 
{ 
    if (n <= 1)  return false; 
    if (n <= 3)  return true; 
    if (n%2 == 0 || n%3 == 0) return false; 
  
    for (int i=5; i*i<=n; i=i+6) 
        if (n%i == 0 || n%(i+2) == 0) 
           return false; 
  
    return true; 
}
int highestPowerof2(unsigned int n) 
{ 
    // Invalid input 
    if (n < 1) 
        return 0; 
  
    int res = 1;
    for (int i=0; i<8*sizeof(unsigned int); i++) 
    { 
        int curr = 1 << i; 
        if (curr > n) 
           break; 
  
        res = curr; 
    } 
  
    return res; 
} 
long long binpow(long long a, long long b) {
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
const int dx[] = {1,0,-1,0,1,1,-1,-1};
const int dy[] = {0,-1,0,1,1,-1,-1,1};
/*lcm(gcd(N1, M), gcd(N2, M), ..., gcd(Nk, M)) = gcd(lcm(N1, ..., Nk), M)
gcd(lcm(N1, M), lcm(N2, M), ..., lcm(Nk, M)) = lcm(gcd(N1, ..., Nk), M).

If gcd(N1, N2) = 1, then
gcd(N1·N2, M) = gcd(N1, M)·gcd(N2, M)
lcm(N1·N2, M) = lcm(N1, M)·lcm(N2, M)/M.

lcm(M, N, P) · gcd(M, N) · gcd(N, P) · gcd(P, M) = NMP · gcd(N, M, P).
*/
////////////////////////////////////////////////////////////////////

int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);  
  cout.tie(NULL);
  ll t=1;
  while(t--)
  {
    int n;
    cin>>n;
    int a[n],b[n];
    REP(i,n){cin>>a[i];b[i]=a[i];}
    sort(a,a+n);
    int x=a[n/2 - 1];
    int y=a[n/2];
    REP(i,n)
    {
        if(b[i]<=x)cout<<y<<"\n";
        else cout<<x<<"\n";
    }
  }  
  return 0;
}
/* Look for:
* the exact constraints (multiple sets are too slow for n=10^6 :( )
* special cases (n=1?)
* 1LL<<i and not 1<<i
* overflow (int vs ll?)
* array bounds
* if you have no idea just guess the appropriate well-known algo instead of doing nothing :/
*/

Measured memory_bytes: 5160
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f

#include <iostream>
#include <cstdio>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
  
using namespace std;
  
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P> PP;
  
static const double EPS = 1e-8;
  
static const int tx[] = {0,1,0,-1};
static const int ty[] = {-1,0,1,0};

int power[100001];

struct Node{
  int par;
  int diff;
  Node() : par(0),diff(0) {}
  Node(int p,int d) : par(p),diff(d) {}
};

class UnionFindTree {
private:
  Node* nodes;
public:
  UnionFindTree(int n){
    nodes = new Node[n]();
    for(int i=0;i<n;i++){
      nodes[i].par = i;
    }
  }

  ~UnionFindTree(){
    delete[] nodes;
  }

  Node find(int x){
    if(nodes[x].par == x){
      return nodes[x];
    } else {
      Node ret = find(nodes[x].par);
      return nodes[x] = Node(ret.par,ret.diff + nodes[x].diff);
    }
  }

  void unite(int x,int y,int up){
    Node rx = find(x);
    Node ry = find(y);
    if (rx.par == ry.par){
      return;
    }

    //rx.par == rx
    //ry.par == ry
    nodes[rx.par].par = ry.par;
    nodes[rx.par].diff = (power[y] - power[x] - up) + (ry.diff - rx.diff);
  }

  int dist(int x,int y){
    Node rx = find(x);
    Node ry = find(y);
    if(rx.par != ry.par) return INF;
    return (ry.diff - rx.diff) + (power[y] - power[x]);
  }

  bool same(int x,int y){
    return find(x).par == find(y).par;
  }
};

int main(){
  int total_players;
  int total_queries;
  while(~scanf("%d %d",
               &total_players,
               &total_queries)){
    
    UnionFindTree uft(total_players+1);
    memset(power,0,sizeof(power));
    for(int query_i = 0; query_i <total_queries; query_i++){
      string command;
      cin >> command;
      if(command == "IN"){
        int players[2];
        int up;
        cin >> players[0] >> players[1] >> up;
        power[players[0]] += up;
        power[players[1]] += up;
        uft.unite(players[0],players[1],up);
      }
      else if(command == "COMPARE"){
        int players[2];
        cin >> players[0] >> players[1];
        if(!uft.same(players[0],players[1])){
          printf("WARNING\n");
        }
        else{
          printf("%d\n",uft.dist(players[0],players[1]));
        }
      }
    }
  }
}

Measured memory_bytes: 2324
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>
#define rep(i, x, n) for(int i = x; i < n; i++)
using namespace std;
const long long INF = 1LL << 60;
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
const int MOD = 1000000007;

int main() {
    int N, K;
    cin >> N >> K;
    int res = 0;
    while(N > 0) {
        N /= K;
        res++;
    }
    cout << res << endl;
}

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

using namespace std;

#define RPT(i, b, e) for (int i = (b); i <= (e); i++)
#define RPT0(i, n) RPT(i, 0, n - 1)
#define RPT1(i, n) RPT(i, 1, n)

int N;
string S, T;
int ans;

void resolve()
{
    cin >> N;
    cin >> S >> T;

    RPT0(i, N) cout << S[i] << T[i];
    cout << endl;
}

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, m, n) for(int (i) = (m); (i) < (n); ++i)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
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; }
typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1e9+7;
const ll LINF = 1LL<<60;

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

    vector<vector<int>> mp(m, vector<int>(n, 0));
    rep(i, m) {
        int k;
        cin >> k;
        rep(j, k) {
            int s;
            cin >> s;
            --s;
            mp[i][s] = 1;
        }
    }

    vector<int> p(m);
    rep(i, m) {
        cin >> p[i];
    }

    int res = 0;
    for (int bit = 0; bit < (1 << n); bit++) {
        int flag = 1;
        rep(i, m) {
            int sum = 0;
            for (int j = 0; j < n; j++) {
                if (bit & (1 << j)) {
                    if (mp[i][j]) {
                        sum++;
                    }
                }
            }
            if (sum % 2 != p[i]) {
                flag = 0;
            }
        }
        if (flag) res++;
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

using namespace std;

typedef long long ll;

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;
}

bool is_palindrome(const int start, const int end, const string S) {
    const int len = end - start + 1;
    for (int i = 0; i < len; i++) {
        if (S[start + i] != S[end - i]) {
            return false;
        }
    }
    return true;
}

int main(void) {
    string S;
    cin >> S;
    int slen = (int) S.size();
    S = " " + S;

    if (is_palindrome(1, (slen - 1) / 2, S) && is_palindrome((slen + 3) / 2, slen, S) && is_palindrome(1, slen, S)) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
N = int(input())
S1 = input()
S2 = input()
mod = 10 ** 9 + 7

# False->tate True->yoko
if S1[0] == S2[0] :
    ret = 3
    pre = False
    i = 1
else :
    ret = 6
    pre = True
    i = 2

while i < N :
    cur = (S1[i] != S2[i])
    if not pre :
        ret *= 2
    elif pre and cur :
        ret *= 3
    
    ret %= mod
    
    if cur :
        i += 2
    else :
        i += 1
    pre = cur
    
print(ret)

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

const int N = 11, Q = 51;

int n, m, q, A[N];
int a[Q], b[Q], c[Q], d[Q];
int ans;

void dfs(int dep, int pre) {
	if (dep == n+1) {
		int ret = 0;
		for (int i = 0; i < q; ++i) {
			if (A[b[i]] - A[a[i]] == c[i]) ret += d[i];
		}
		ans = max(ret, ans);
		return;
	}
	for (int i = pre; i <= m; ++i) {
		A[dep] = i;
		dfs(dep+1, i);
	}
}

int main() {
	scanf("%d%d%d", &n, &m, &q);
	for (int i = 0; i < q; ++i) {
		scanf("%d%d%d%d", a+i, b+i, c+i, d+i);
	}
	dfs(1, 1);
	printf("%d\n", ans);
}


Measured memory_bytes: 3828
#include <iostream>
using namespace std;
#define MAX 100000

int parent(int i)
{
  return i / 2;
}
int left(int i) { return i * 2; }
int right(int i) { return i * 2 + 1; }

int main()
{
  int H, i, A[MAX + 1];

  cin >> H;

  for(i=1;i<=H;i++){
    cin >> A[i];
  }

  for (i = 1; i <= H; i++)
  {
    cout << "node " << i << ": key = " << A[i] << ", ";
    if (parent(i) >= 1)
      cout << "parent key = " << A[parent(i)] << ", ";
    if (left(i) <= H)
      cout << "left key = " << A[left(i)] << ", ";
    if(right(i) <=H )
      cout << "right key = " << A[right(i)] << ", ";
    cout << endl;
  }
}



Measured memory_bytes: 3088
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_DEPRECATE

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <cassert>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>
#include <iomanip>
#include <fstream>
#include <iterator>
#include <bitset>

using namespace std;

typedef long long ll;
typedef pair<int, int> Pii;
typedef pair<ll, ll> Pll;

#define FOR(i,n) for(int i = 0; i < (n); i++)
#define sz(c) ((int)(c).size())
#define ten(x) ((int)1e##x)
#define tenll(x) ((ll)1e##x)
template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

ll sum[301];
ll dp[301][301];

ll f(ll x, ll y) {
	ll ret = 0;
	int curry = 0;
	while (x || y) {
		curry = (x % 10 + y % 10 + curry >= 10);
		ret += curry + (x % 10) * (y % 10);
		x /= 10;
		y /= 10;
	}
	return ret;
}

int main() {
	int n; cin >> n;
	vector<int> a(n);
	FOR(i, n) cin >> a[i];
	FOR(i, n) sum[i + 1] = a[i] + sum[i];
	FOR(i, n) dp[i][i + 1] = 0;
	for (int dist = 2; dist <= n; dist++) {
		for (int start = 0; start + dist <= n; start++) {
			ll cur = LLONG_MAX;
			for (int sp = 1; sp < dist; sp++) {
				ll tmp = f(sum[start + dist] - sum[start + sp], sum[start + sp] - sum[start]);
				tmp += dp[start][start + sp] + dp[start + sp][start + dist];
				cur = min(cur, tmp);
			}
			dp[start][start + dist] = cur;
		}
	}

	cout << dp[0][n] << endl;

	return 0;
}

Measured memory_bytes: 1900
#coding: UTF-8
A, B=map(int,input().split())
if A==1:
    if B==1:
        print("Draw")
    else:
        print("Alice")
elif B==1:
    print("Bob")
else:
    if A>B:
        print("Alice")
    elif B>A:
        print("Bob")
    else:
        print("Draw")

Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
#include<string>
#include<sstream>

typedef long long ll;

#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define FORR(i,a,b) for(int i=b-1;i>=a;i--)

#define DEBUG(x) cout<<#x<<": "<<x<<endl

using namespace std;
int main() {
  int n[3][3];
  REP(i,3) REP(j,3) cin >> n[i][j];
  bool jud = true;
  ll diff;
  diff = n[0][1] - n[0][0];
  jud &= diff == n[1][1] - n[1][0];
  jud &= diff == n[2][1] - n[2][0];
  diff = n[0][2] - n[0][1];
  jud &= diff == n[1][2] - n[1][1];
  jud &= diff == n[2][2] - n[2][1];
  diff = n[1][0] - n[0][0];
  jud &= diff == n[1][1] - n[0][1];
  jud &= diff == n[1][2] - n[0][2];
  diff = n[2][0] - n[1][0];
  jud &= diff == n[2][1] - n[1][1];
  jud &= diff == n[2][2] - n[1][2];
  if(jud) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
let () = Scanf.scanf "%d\n" @@ fun n ->
  let ls = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun l -> l in
  print_endline @@
  if
    2 * Array.fold_left max min_int ls < Array.fold_left ( + ) 0 ls
  then "Yes"
  else "No"


Measured memory_bytes: 384
def solve(n, m, PS):
    d = {}
    scores = [0, 0]
    for p, s in PS:
        if p not in d:
            d[p] = {'wa': 0, 'ac': 0}
        if d[p]['ac'] > 0:
            continue
        if s == 'AC':
            d[p]['ac'] = 1
            scores[0] += 1
            scores[1] += d[p]['wa']
        else:
            d[p]['wa'] += 1
    return scores

_n, _m = map(int, input().split())
_PS = [input().split() for _ in range(_m)]
print(*solve(_n, _m, _PS))


Measured memory_bytes: 68024