akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;
 
 
#define NUM 1000005
 
int W,M;
int input[NUM];
int number[NUM];
int BIT[NUM],ans[NUM];
vector<int> V[NUM];
 
int N;
int table[6*NUM];
 
void init(int first_N){
    while(N < first_N)N *= 2;
}
 
void update(int loc,int value){
    loc += N-1;
 
    table[loc] += value;
 
    if(N == 1)return;
 
    int parent = (loc-1)/2;
 
    while(true){
        table[parent] = max(table[2*parent+1],table[2*parent+2]);
 
        if(parent == 0)break;
        else{
            parent = (parent-1)/2;
        }
    }
}
 
int query(int search_left,int search_right,int node_id,int node_left,int node_right){
 
    if(search_right < node_left || search_left > node_right)return -BIG_NUM;
 
    if(search_left <= node_left && search_right >= node_right){
        return table[node_id];
    }
 
    int left_max = query(search_left,search_right,2*node_id+1,node_left,(node_left+node_right)/2);
    int right_max = query(search_left,search_right,2*node_id+2,(node_left+node_right)/2+1,node_right);
 
    return max(left_max,right_max);
}
 
int main(){
 
    scanf("%d %d",&W,&M);
 
    if(M == 1){
 
        printf("0\n");
        return 0;
    }
 
    for(int i = 0; i < M; i++){
 
        number[i] = 0;
        ans[i] = BIG_NUM;
    }
 
    for(int i = 0; i < W; i++){
 
        scanf("%d",&input[i]);
        input[i]--;
        number[input[i]] += 1;
    }
 
    N = 1;
    init(M);
 
    int tmp;
 
    for(int start = 0; start <= 1; start++){
 
        for(int i = start; i+1 <= W-1; i += 2){
 
            V[input[i]].push_back(input[i+1]);
            V[input[i+1]].push_back(input[i]);
        }
 
        for(int i = 0; i <= 2*N-2; i++)table[i] = 0;
 
        for(int i = 0; i < M; i++){
            update(i,number[i]);
        }
 
        for(int i = 0; i < M; i++){
 
            for(int k = 0; k < V[i].size(); k++){
 
                update(V[i][k],-1);
            }
            tmp = max(query(0,i-1,0,0,N-1),query(i+1,M-1,0,0,N-1));
 
            ans[i] = min(ans[i],W-(number[i]+tmp));
 
            for(int k = 0; k < V[i].size(); k++){
 
                update(V[i][k],1);
            }
        }
 
        for(int i = 0; i < M; i++){
            V[i].clear();
        }
    }
 
    for(int i = 0; i < M; i++){
 
        printf("%d\n",ans[i]);
    }
 
    return 0;
}


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

using namespace std;

#define rep(i, x)   for (__typeof(x) i = 0; i < x; i++)
#define mp             make_pair
#define pb             push_back
#define fi             first
#define se             second
#define sz(x)          (int)((x).size())
#define all(x)         (x).begin(), (x).end()
#define sci(x)         int x;       scanf("%d", &x);
#define scii(x, y)     int x, y;    scanf("%d %d", &x, &y);
#define sciii(x, y, z) int x, y, z; scanf("%d %d %d", &x, &y, &z);
#define TC(x)          sci(x); while(x --)
#define eprintf(...)   fprintf(stderr, __VA_ARGS__)
#define debug(x)       { cerr << #x << " = " << x << endl; }
#define repi(i, x)  for (__typeof(x) i = x-1; i >= 0; i --)
#define fore(itr, x)   for (__typeof(x.begin()) itr = x.begin(); itr != x.end(); itr ++)
#define forei(itr, x)  for (__typeof(x.end()) itr = x.end() - 1; itr != x.begin() - 1; itr --)
typedef long long      ll;
typedef pair<int, int> ii;
typedef pair<ii, int>  iii;
typedef vector<int>    vi;
typedef vector<ii>     vii;
typedef vector<iii>    viii;
typedef vector<vector<int> > vvi;
typedef pair<ll, ll>   pairl;
typedef vector<ll>     vl;
typedef vector<ll>     vll;
typedef vector<vector<ll> > vvl;
const   int            infi = numeric_limits<int>::max();
const   ll             infl = numeric_limits<ll>::max();
const   double         eps = 0;
const   int            ms  = 0;



int main()
{
    ios::sync_with_stdio(false);//endl->"\n"
    cin.tie(0);
    int N;
    cin >> N;
    string s;
    cin >> s;
    int a = 1;
    for(int i = 1; i < N; i++){
        if(s[i] != s[i-1])a++;
    }
    cout << a << endl;
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <string>

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

    while(true){
        std::string x;
        std::cin >> x;
        if(x=="0") break;
        int ans = 0;
        for(const auto& c : x){
            ans += c-'0';
        }
        std::cout << ans << "\n";
    }
    return 0;
}

Measured memory_bytes: 3148
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
from functools import reduce
import sys
import math
import bisect
import random
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return list(map(float, sys.stdin.readline().split()))
def LS():return sys.stdin.readline().split()
def SR(n): return [list(sys.stdin.readline())[:-1] for i in range(n)]
def IR(n): return [int(sys.stdin.readline()) for i in range(n)]
def LIR(n): return [list(map(int, sys.stdin.readline().split())) for i in range(n)]
def LSR(n): return [list(map(list, sys.stdin.readline().split())) for i in range(n)]
_gcd = lambda x, y: _gcd(y, x%y) if (x%y) else y
_lcm = lambda x, y: x*y // _gcd(x, y)
def gcd(*numbers):
    return reduce(_gcd, numbers)
def lcm(*numbers):
    return reduce(_lcm, numbers)
sys.setrecursionlimit(1000000)
INF = float('inf')
mod = 1000000007
dire4 = [(1,0), (0,1), (-1,0), (0,-1)]
dire8 = [(1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)]

N = I()
a = LI()

ret = 0
for ai in a[1:]:
    ret ^= ai

print("Yes" if (ret==a[0]) else "No")

Measured memory_bytes: 15708
#include<iostream>
#include<vector>
using namespace std;
int main(){
  int n,k;
  cin>>n>>k;
  vector<int64_t> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  for(int i=0;i<n-k;i++){
    if(a[i]<a[k+i])
      cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
  }
}  

Measured memory_bytes: 4828
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
S = [input() for _ in range(N)]

print(len(set(S)))

Measured memory_bytes: 36564
#include <stdio.h>
int main(){
    long long a[100][100], b[100][100], c[100][100];
    int n, m, l;
    scanf("%d %d %d", &n, &m, &l);
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < m; j++)
        {
            scanf("%lld", &a[i][j]);
        }
        
    }
    for (int i = 0; i < m; i++)
    {
        for (int j = 0; j < l; j++)
        {
            scanf("%d", &b[i][j]);
        }
        
    }
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < l; j++)
        {
            c[i][j] = 0;
            for (int k = 0; k < m; k++)
            {
                c[i][j] = c[i][j] + a[i][k] * b[k][j];
            }
            
        }
        
    }
    
    for (int i = 0; i < n; i++)
    {
        for (int j = 0; j < l; j++)
        {
            if(j == 0)
                printf("%lld", c[i][j]);
            else
                printf(" %lld", c[i][j]);

        }
        printf("\n");
    }
    return 0;
}


Measured memory_bytes: 2104
#![allow(unused_imports)]
#![allow(non_snake_case)]

use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::io::*;
use std::ops::*;
use std::*;

// -----------------------------------------------
// Framework
// -----------------------------------------------

#[allow(unused)]
fn rl() -> String {
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim_right().to_owned()
}

#[allow(unused)]
fn rw<T>() -> Vec<T>
where
    T: std::str::FromStr,
    T::Err: std::fmt::Debug,
{
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.split_whitespace()
        .map(|word| T::from_str(word).unwrap())
        .collect()
}

trait IteratorExt: Iterator + Sized {
    fn vec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

impl<T: Iterator> IteratorExt for T {}

#[allow(unused)]
macro_rules! debug {
    ($($arg:expr),*) => {
        #[cfg(debug_assertions)]
        {
            let entries = &[
                $((
                    &stringify!($arg).to_string() as &fmt::Debug,
                    &($arg) as &fmt::Debug,
                )),*
            ];
            eprintln!("{:?}", DebugMap(entries));
        }
    };
}

#[allow(unused)]
struct DebugMap<'a>(&'a [(&'a fmt::Debug, &'a fmt::Debug)]);

impl<'a> std::fmt::Debug for DebugMap<'a> {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        let mut m = fmt.debug_map();
        for &(key, value) in self.0.iter() {
            m.entry(key, value);
        }
        m.finish()
    }
}

// -----------------------------------------------
// Polyfill
// -----------------------------------------------

#[derive(PartialEq, Eq, Clone, Debug)]
pub struct Rev<T>(pub T);

impl<T: PartialOrd> PartialOrd for Rev<T> {
    fn partial_cmp(&self, other: &Rev<T>) -> Option<Ordering> {
        other.0.partial_cmp(&self.0)
    }
}

impl<T: Ord> Ord for Rev<T> {
    fn cmp(&self, other: &Rev<T>) -> Ordering {
        other.0.cmp(&self.0)
    }
}

#[allow(unused)]
macro_rules! eprintln {
    ($($arg:expr),*) => { _eprintln(format_args!($($arg),*)) }
}

fn _eprintln(args: fmt::Arguments) {
    let err = std::io::stderr();
    let mut err = err.lock();
    err.write_fmt(args).unwrap();
    err.write(b"\n").unwrap();
}

// -----------------------------------------------
// Solution
// -----------------------------------------------

pub fn main() {
    let w = rw::<usize>();
    let (N, M) = (w[0], w[1]);
    let mut g = vec![vec![]; N + M];
    for v in 0..N {
        let w = rw::<usize>();
        for &w in &w[1..] {
            g[v].push(N + w - 1);
            g[N + w - 1].push(v);
        }
    }

    fn dfs(v: usize, g: &Vec<Vec<usize>>, done: &mut Vec<bool>) {
        if done[v] {
            return;
        }
        done[v] = true;
        for &w in g[v].iter() {
            dfs(w, g, done);
        }
    }
    let mut done = vec![false; N + M];
    dfs(0, &g, &mut done);

    println!("{}", if (0..N).all(|v| done[v]) { "YES" } else { "NO" });
    return;
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_ok() {
        assert_eq!(7, 1 + 2 * 3);
    }
}


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

#define ll long long
// #define endl '\n'

// void max_self(int &a, int b){a = max(a, b);}
// void min_self(int &a, int b){a = min(a, b);}

void solve(){
	int n; cin>>n;
	vector< int > v(n), idx(200005);
	for(int &i : v) cin>>i;
	for(int i = 0; i<n; i++){
		if(v[i] == 1){
			idx[v[i]]++;
			continue;
		}
		if(idx[v[i] - 1]){
			idx[v[i]]++;
		}
	}

	for(int i = 200004; i>=1; i--){
		if(idx[i]){
			cout<<n - i<<endl;
			return;
		}
	}
	cout<<-1<<endl;
}

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


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

int calc_digit(long long N) {
    int res = 0;
    while (N) {
        ++res;
        N /= 10;
    }
    return res;
}
int main() {
    int a,b;
    while(scanf("%d %d",&a,&b)!=EOF){
        int ans=calc_digit(a+b);
        cout<<ans<<endl;
    }
}


Measured memory_bytes: 3056
import java.util.Scanner;

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

		//??°?????????
		while(true){
			//?????? H???????????????
			int H = sc.nextInt();
			//?????? W???????????????
			int W = sc.nextInt();
			//W??¨H???????????????0?????´?????????
			if(H == 0 && W == 0){
				break;
			}

			//??????????????¨???
			for(int i = 1;i <= H; i++){
				System.out.print('#');
				//??????????????¨???
				for(int j = 1; j < W; j++){
					System.out.print('#');
				}
				System.out.println();
			}
			System.out.println();
		}
	}
}

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

int main(){
    int N, K;
    cin >> N >> K;
    vector<int> have(N, 0);

    for (int i=0; i<K; i++){
        int d;
        cin >> d;
        for (int j=0; j<d; j++){
            int a;
            cin >> a;
            a--;
            have[a] = 1;
        }
    }
    int ans = 0;
    for (int i=0; i<N; i++){
        if (have[i] == 0){
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


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



int main() {
	int sm = 101;
	int n, l; cin >>n >> l;
	vector<int> vec;
	int k = 0, tot = 0;
	for(int i = 0; i < n; i++) {
		int lezzet = l+i;
		tot += lezzet;
		if(abs(lezzet) < sm) {
			sm = abs(lezzet);
			k = lezzet;
		}
	}

	cout << tot - k << endl;
}


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

typedef long long ll;


int N = 26;
int D;

vector<int> c(N+1);
vector<vector<int>> s;
vector<int> t;

ll now_score = 0;

ll greedy(){
    vector<int> last(N+1, 0);
    ll greedy_score=0;
    for(int d = 1; d <= D; d++){
        ll max_score = -1e9;
        vector<int> max_last;
        for(int n = 1; n <= N; n++){
            ll tmp_score = 0;
            vector<int> tmp_last(N+1);
            tmp_last = last;
            
            tmp_score +=  s[d][n];
            tmp_last[n] = d;
     
            int penalty = 0;
            for(int i = 1; i <= N; i++){
                penalty += c[i]*(d-tmp_last[i]);    
                
            }
            
            tmp_score -= penalty;

            if(max_score < tmp_score){
                max_score = tmp_score;
                max_last = tmp_last;
                t[d] = n;
            }                    
            
        }
        
        last = max_last;
        greedy_score += max_score;
    }

    return greedy_score;
}


ll scoring(){
    vector<int> last(N+1, 0);
    ll score = 0;
    for(int d = 1; d <= D; d++){

        score += s[d][t[d]];
        last[t[d]] = d;

        int penalty = 0;
        for(int i = 1; i <= N; i++){
            penalty += c[i]*(d-last[i]);    
        }
        
        score -= penalty;            
    }
    return score;
}


void exchange(int d, int x){
    swap(t[d], t[d+x]);

    ll swap_score = scoring();
    
    if(now_score >= swap_score){
        swap(t[d], t[d+x]);
    }else{
        now_score = swap_score;
    }

}

void pachinko(){
    srand((unsigned) time(NULL)); /* Use Mersenne Twister */
    for(int i=1; i<=D; i++){
        int pre = t[i];
        t[i] = rand()%26+1;

        ll pachi_score = scoring();
        if(now_score >= pachi_score){
            t[i] = pre;
        }else{
            now_score = pachi_score;
        }        
    }

}

int main(){
    cin>> D;

    s.resize(D+1);
    for(int i=0; i<=D; i++){
        s[i].resize(N+1);
    }
    t.resize(D+1);

    for(int i=1; i<=N; i++){
        cin>>c[i];
    }
 
    for(int i=1; i<=D; i++){
        for(int j=1; j<=N; j++){
            cin>>s[i][j];
        }
    }
    for(int i=1; i<=D; i++){
        cin>>t[i];
    }

    now_score = greedy();

    //乱数パチンコ
    pachinko();
    //解交換
    for(int x=1; x<D; x++){
        for(int d=1; d<=D-x; d++){
            exchange(d, x);
        }
    }
    
    
    for(int i=1; i<=D; i++){           
        cout<<t[i]<<endl;
    }
    return 0;
}

Measured memory_bytes: 3692
#include<stdio.h>

int main(void){
	int a, b, c, d, e, f, g, h, i, j, x;

	//printf("?±±????????????");
	scanf("%d", &a);
	//printf("?±±?????????2 ");
	scanf("%d", &b);
	//printf("?±±?????????3 ");
	scanf("%d", &c);
	//printf("?±±?????????4 ");
	scanf("%d", &d);
	//printf("?±±?????????5 ");
	scanf("%d", &e);
	//printf("?±±?????????6 ");
	scanf("%d", &f);
	//printf("?±±?????????7 ");
	scanf("%d", &g);
	//printf("?±±?????????8 ");
	scanf("%d", &h);
	//printf("?±±?????????9 ");
	scanf("%d", &i);
	//printf("?±±?????????10 ");
	scanf("%d", &j);

	
	if (a<b){
		x = a;
		a = b;
		b = x;

	}
	if (a < c){
		x = a;
		a = c;
		c = x;
	}
	if (a < d){
		x = a;
		a = d;
		d = x;
	}
	if (a < e){
		x = a;
		a = e;
		e = x;
	}
	if (a < f){
		x = a;
		a = f;
		f = x;
	}
	if (a < g){
		x = a;
		a = g;
		g = x;
	}
	if (a < h){
		x = a;
		a = h;
		h = x;
	}
	if (a < i){
		x = a;
		a = i;
		i = x;
	}
	if (a < j){
		x = a;
		a = j;
		j = x;
	}

	
		
		if (b < c){
			x = b;
			b = c;
			c = x;
		}
		if (b < d){
			x = b;
			b = d;
			d = x;
		}
		if (b < e){
			x = b;
			b = e;
			e = x;
		}
		if (b < f){
			x = b;
			b = f;
			f = x;
		}
		if (b < g){
			x = b;
			b = g;
			g = x;
		}
		if (b < h){
			x = b;
			b = h;
			h = x;
		}
		if (b < i){
			x = b;
			b = i;
			i = x;
		}
		if (b < j){
			x = b;
			b = j;
			j = x;
		}


		
		if (c < d){
			x = c;
			c = d;
			d = x;
		}
		if (c < e){
			x = c;
			c = e;
			e = x;
		}
		if (c < f){
			x = c;
			c = f;
			f = x;
		}
		if (c < g){
			x = c;
			c = g;
			g = x;
		}
		if (c < h){
			x = c;
			c = h;
			g = x;
		}
		if (c < i){
			x = c;
			c = i;
			i = x;
		}
		if (c < j){
			x = c;
			c = j;
			j = x;
		}

		printf("%d\n",a);
		printf("%d\n",b);
		printf("%d\n",c);

		return 0;
}

Measured memory_bytes: 600
#include <cstdio>
#include <numeric>
#include <vector>
#include <algorithm>
#include <climits>

using namespace std;

int main()
{
  int n;
  scanf("%d", &n);
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  sort(a.begin(), a.end());
  int last = 0;
  int startsymbol = 0;
  int ans;
  for (int i = 0; i < n; i++) {
    if (a[i] == last) {
      startsymbol ^= 1;
    }
    else {
      startsymbol = 1;
    }
    last = a[i];
    int h = n - 1 - i;
    if (h == a[i] && startsymbol == 1) {
      ans = (startsymbol ^ 1);
      break;
    }
    if (h < a[i]) {
      if ((a[i] - (h+1)) % 2 == 0) {
        ans = startsymbol;
      }
      else {
        ans = startsymbol ^ 1;
      }
      break;
    }
  }
  if (ans)
    printf("Second\n");
  else
    printf("First\n");
  return 0;
}

Measured memory_bytes: 640
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <bitset>
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef tuple<ll, ll, ll> tl3;



const int BIG_NUM = 1e9;
const ll INF = 1000000000000000000;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;



int main() {
	int a, b;
	cin >> a >> b;
	if (a > 9 || b > 9) {
		cout << -1 << endl;
	}
	else {
		cout << a * b << endl;
	}

}


Measured memory_bytes: 3676
//Nihal Mittal - nihal_47
//Strike First , Strike Hard , No Mercy !!

/**⠀⠀⠀⠀⠀⠀⣀⣤⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣰⣿⣿⣿⣿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣧⢀⠀⠀⠀⠀
⠀⠀⠀⣿⣿⣿⠋⠀⠀⠀⠀⠀⠙⠀⠙⣿⣿⣿⣷⢳⢀⠀⠀⠀
⠀⠀⣠⣿⣿⣿⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⢀
⠀⠀⣸⣿⣿⣿⠸⠀⠀⠀⠒⠒⠒⠐⠀⠀⢿⣿⣿⣿⣿⣿⠀⠀
⠀⣴⣿⣿⣿⡿⠀⠒⣋⣙⡒⢰⠀⠤⣖⠒⢾⣿⣿⣿⣿⣧⠀⠀
⢺⣿⣿⣿⣿⢀⠀⠀⠉⠉⠉⠸⠀⡇⠉⠉⠀⢿⣿⣿⣿⣄⠀⠀
⠀⠙⣿⣿⣧⢻⠀⠀⠀⠀⠀⠠⠀⠰⠀⠀⠀⣸⠸⣿⣿⠿⠰⠀
⠀⠀⠀⠹⣿⣿⣿⣷⠀⡠⠙⣲⣔⣅⢡⣰⣷⣿⣿⣿⣧⠀⠀⠀
⠀⠀⠀⣼⣿⣿⣿⣿⠀⡿⠭⠭⠭⠭⢿⠀⣿⢻⣿⣿⠃⠀⠀⠀
⠀⠀⠀⠙⠛⣿⢻⠹⣿⠐⠙⠛⠟⠉⢀⣴⡟⢿⣿⡏⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⡟⠀⠀⠻⣦⣤⣶⠾⠋⠀⠀⠁⡦⢄⢀⠀⠀⠀
⠀⠀⠀⠀⡠⠁⡇⠑⢄⠀⠀⠀⠀⠀⠀⠔⠀⠀⠁⠀⠀⠀⠉⠁
⠀⠔⠊⠁⠀⠀⣇⠀⠀⠀⠑⡤⠤⢎⠁⠀⠀⡘⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢢⠠⠀⡠⢆⠀⠀⡠⠙⢄⠀⡸⠀
**/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define mk make_pair
#define pb push_back
#define in insert
#define se second
#define fi first
#define mod 1000000007
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define all(v) (v).begin(),(v).end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define pii pair<ll,ll>
#define K 3000
#define vi(x) vector<x>
#define maxn 100005
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
using namespace std;
using namespace __gnu_pbds;
ll n,m,s;
ll c[110] , d[110] , dp[70][K+8];
struct datas
{
	ll node;
	ll cost;
	ll tim;
};

vector<datas> v[100];
void djiktra()
{
	priority_queue<pair<ll,pii>,vector<pair<ll,pii>>,greater<pair<ll,pii>>> pq;
	pq.push({0,{s,1}});
	dp[1][s] = 0;
	while(!pq.empty())
	{
		pair<ll,pii> st = pq.top();
		ll pcity = st.se.se;
		ll kane = st.se.fi;
		ll ti = st.fi;
		pq.pop();

		for(auto u: v[pcity])
		{
			if(kane >= u.cost and dp[u.node][kane - u.cost] > ti + u.tim)
			{
				dp[u.node][kane - u.cost] = ti + u.tim;
				pq.push({ti+u.tim,{kane-u.cost,u.node}});
			}
		}
		if(kane + c[pcity] < K and dp[pcity][kane+c[pcity]] > ti + d[pcity])
		{
			dp[pcity][kane+c[pcity]] = ti + d[pcity];
			pq.push({ti + d[pcity] , {kane+c[pcity] , pcity}});
		}
	}
}
signed main()
{
    fast;
   
    ll i,j;
    cin>>n>>m>>s;
    s = min(s,K-1LL);
    for(i=0;i<m;i++)
    {
    	ll x,y,a,b;
    	cin>>x>>y>>a>>b;
    	v[x].pb({y,a,b});
    	v[y].pb({x,a,b});
    }
    for(i=1;i<=n;i++)
    {
    	cin>>c[i]>>d[i];
    	for(j=0;j<K;j++) dp[i][j] = 1e18;
    }
    djiktra();
    for(i=2;i<=n;i++)
    {
    	cout<<*min_element(dp[i] , dp[i]+K)<<"\n";
    }

}

Measured memory_bytes: 7556
# coding: utf-8
# Your code here!
n,k=map(int,input().split(" "))
ans1=0
for i in range(1,n+1):
    c=0
    while(i<k):
        i*=2
        c+=1
    ans1+=0.5**c
   # print(c)
print(ans1*(1/n))


Measured memory_bytes: 2940
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#include <random>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <random>
#include <time.h>
#include <chrono>
#include <sstream>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define sort(s) sort(s.begin(), s.end());
#define reverse(s) reverse(s.begin(), s.end());
#define P pair<int,int>
#define valid(x,y,h,w) (0<=x&&x<h&&0<=y&&y<w)
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }


int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	cout << (a -c)*(b-d) << endl;
	return 0;
}



Measured memory_bytes: 256
#include<stdio.h>
    int main()
    { int n,md,a,min,ri=0,re=0;
        scanf("%d %d\n",&n,&md);
        int mati[n];
        for (int i=0;i!=n;i++)
        scanf("%d ",&mati[i]);
min=mati[0];
        for (int i=0;i!=n;i++)
        { if (mati[i]-min==ri)
            re++;
            if (mati[i]-min>ri)
        {
            ri=mati[i]-min;
            re=1;
        }  
        if (min>mati[i])
        min=mati[i];
        }
        printf("%d",re);
       return 0;
    }

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

typedef long long ll;
const int N = 2e5+7;
int a[N];
int main(){
    int n;
    while(~scanf("%d", &n)){
        for(int i=1;i<=n;i++) scanf("%d", &a[i]);
        int ans=0,cnt=1;
        for(int i=1;i<=n;i++){
            if(a[i]==cnt){
                cnt++;
                ans++;
            }
        }
        if(cnt==1) ans=n+1;
        printf("%d\n", n-ans);
    }
    return 0;
}

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

int main()
{
    // 入力
    // a,b,cの入力
    int k;
    cin >> k;


    // 初めの三文字を出力
    string s ;
    cin >> s;
    if(s.size() <= k)cout << s << endl;
    else{
        string ans = s.substr(0, k);
        cout << ans << "..." <<endl;
    }

    return 0;
}


Measured memory_bytes: 3568
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //GCC5.4.1で配列の範囲外アクセスをエラーにする

//cmdで g++ test.cpp とするとコンパイルできる
//制限1秒なら10^6は余裕 10^7は多分間に合う 10^8はよほど単純でないと厳しい

#define ALL(x) x.begin(),x.end()
#define get_tp(t,i) get<i>(t)
typedef long long ll; //long long
typedef pair<int,int> pii; //pair<int,int>
typedef pair<long long,long long> pllll; //pair<ll,ll>
typedef vector<int> vi; //vector<int>
typedef vector<vector<int>> vvi; //vector<vector<int>>
typedef vector<ll> vll; //vector<long long>
typedef vector<vector<ll>> vvll; //vector<vector<long long>>
typedef priority_queue<int, vector<int>, greater<int> > gpq; //逆順priority_queue
typedef priority_queue<int> pq;

//const int MOD=998244353;
const int MOD=1000000007; //10^9+7
const long double PI=3.1415926535897932;

int main(){
    int N;
    cin>>N;
    vector<tuple<int,int,int>> d(N);
    for(int i=0;i<N;i++){
        int x,y,h;
        cin>>x>>y>>h;
        d[i]=make_tuple(h,x,y);
    }
    sort(ALL(d));
    reverse(ALL(d));
    
    for(int cx=0;cx<=100;cx++){
        for(int cy=0;cy<=100;cy++){
            int height=get_tp(d[0],0)+abs(get_tp(d[0],1)-cx)+abs(get_tp(d[0],2)-cy);
            bool ok=true;
            for(int i=1;i<N;i++){
                if(get_tp(d[i],0)!=max(0,height-abs(get_tp(d[i],1)-cx)-abs(get_tp(d[i],2)-cy))){
                    ok=false;break;
                }
            }
            if(ok){
                cout<<cx<<" "<<cy<<" "<<height<<endl;return 0;
            }
        }
    }
    
    
}

Measured memory_bytes: 3616
#include <iostream>
using namespace std;
 
int main(){
  int k,a,b;
  cin>>k;
  cin>>a>>b;
  int i,check=0;
  bool bl = true;
  while(bl){
    if (i*k>=a&&i*k<=b){
      check=1;
      break;
    }else if(i*k>b){
      bl=false;
    }
  	i+=1;
  }
  if (check==1) cout<<"OK"<<endl;
  else cout << "NG" << endl;
  return 0;
}

Measured memory_bytes: 3632
N = int(input())
A = list(map(int, input().split()))

S = [0] * (N + 1)
S[0] = abs(A[0])
for i, a in enumerate(A[1:]):
    S[i + 1] += abs(a - A[i])
S[-1] = abs(A[-1])

s = sum(S)

print(abs(A[1]) + s - S[0] - S[1])
for i in range(1, N - 1):
    print(s - S[i] - S[i + 1] + abs(A[i - 1] - A[i + 1]))
print(s - S[-2] - S[-1] + abs(A[-2] - 0))


Measured memory_bytes: 14048
n,x=map(int, input().split())
a=list(map(int, input().split()))
count=0
for i in a:
    if i>x:count+=i-x
a=[min(x,i) for i in a]
a2=[a[0]]
for i in range(1,n):
    if a2[-1]+a[i]-x>0:
        count+=a2[-1]+a[i]-x
        a2.append(x-a2[-1])
    else:a2.append(a[i])
print(count)

Measured memory_bytes: 14252
b = [0.5,0.25,0.125,0.0625]
list = []
(1..4).each do |i|
  b.combination(i) do |arr|
    list << arr.inject{|sum,x| sum+x}
  end
end
num = ["1000","0100","0010","0001","1100","1010","1001","0110","0101","0011","1110","1101","1011","0111","1111"]

hash=Hash.new
list.each_index do |i|
  hash[list[i]]=num[i]
end
hash[0]="0000"
loop do
  n=gets.chomp
  next if n==""
  n = n.to_f
  break if n <0
  a = n.floor
  b = n-a
  a=a.to_i.to_s(2)
  if a.size >8
    puts "NA"
    next
  end
  a = "%08d" % a.to_i

  b=0if b>-0.0000000000001 && b<0.0000000000001
  unless hash[b]
    puts "NA"
    next
  end
  puts a+"."+hash[b]
end

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

using namespace std;

#define REP(i, a, b) for (int i = (a), i##_end_ = (b); i < i##_end_; ++i)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define mp make_pair
#define x first
#define y second
#define pb push_back
#define SZ(x) (int((x).size()))
#define ALL(x) (x).begin(), (x).end()

#ifdef __WIN32
#define LLFORMAT "I64"
#define Rand() ((rand() << 15) | rand())
#else
#define LLFORMAT "ll"
#define Rand() (rand())
#endif

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

typedef long long LL;

const int oo = 0x3f3f3f3f;

const int Mod = 1e9 + 7;

LL n, m;

int Min_step;

pair<pair<LL, LL>, pair<LL, LL> > coe[100];

int ans;

void dfs(LL x, LL y, int res)
{
	if (!res)
	{
		(ans += ((m - y) / x + 1) % Mod) %= Mod;
		if (y <= n && x != y) (++ans) %= Mod;
		return;
	}
	swap(y, x);
	--res;
	while (1)
	{
		y += x;
		if (y > m) break;
		if (y >= 2 * x && y > n) break;
		if (x * coe[res].x.x + y * coe[res].x.y > n) break;
		if (x * coe[res].y.x + y * coe[res].y.y > m) break;
		dfs(x, y, res);
	}
}

int main()
{
#ifdef matthew99
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	coe[0] = mp(mp(1LL, 0LL), mp(0LL, 1LL));
	REP(i, 1, 100)
	{
		coe[i] = coe[i - 1];
		swap(coe[i].x, coe[i].y);
		coe[i].y.x += coe[i].x.x;
		coe[i].y.y += coe[i].x.y;
	}
	int case_cnt;
	scanf("%d", &case_cnt);
	for (int case_id = 1; case_id <= case_cnt; ++case_id)
	{
		scanf("%" LLFORMAT "d%" LLFORMAT "d", &n, &m);
		if (n > m) swap(n, m);
		ans = 0;
		Min_step = 1;
		while (coe[Min_step + 1].x.x + coe[Min_step + 1].x.y <= n && coe[Min_step + 1].y.x + coe[Min_step + 1].y.y <= m) ++Min_step;
		if (Min_step == 1) ans = (LL)(n % Mod) * (m % Mod) % Mod;
		else dfs(1, 1, Min_step);
		(ans += Mod) %= Mod;
		printf("%d %d\n", Min_step, ans);
	}
	return 0;
}


Measured memory_bytes: 3968
#include<bits/stdc++.h>
#define $$ long long int
#define pb push_back
#define db pop_back
#define q2(n) (n%2)==0
#define vp vector<pair <$$,$$> >
#define vctr vector<$$>
#define in(a) scanf("%lld",&a)
#define out(a) printf("%lld ",a)
#define loop(i,m,p) for ($$ i = m; i < p; i++)
#define loopn(i,m,p) for ($$ i = p-1; i >=m; --i)

using namespace std;


int main()
{
    $$ n,k;
    cin>>n>>k;
    $$ ar[n];
    loop(i,0,n) cin>>ar[i];
    $$ cn=1;
    n-=k;
    cn+=(ceil((double)n/(k-1)));
    cout<<cn<<endl;





return 0;
}


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

int main(void){
    int A,B;
    cin >> A >> B;
    if(A < B){
        int temp = A;
        A = B;
        B = temp;
    }
    if(2 <= A-B){
        cout << 2*A-1 << endl;
    }else{
        cout << A+B << endl;
    }
    return 0;
}

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


int main() {
  int a, b, m;
  int numa, numb, numc;
  int c = 0;
  cin >> a >> b >> m;
  int A[a], B[b];
  priority_queue<int, vector<int>, greater<int>> aque;
  priority_queue<int, vector<int>, greater<int>> bque;
  rep(i, a){
    cin >> A[i];
    aque.push(A[i]);
  }
  rep(i ,b) {
    cin >> B[i];
    bque.push(B[i]);
  }
  ll ans = (ll)aque.top() + bque.top();
  rep(i ,m) {
    cin >> numa >> numb >> numc;
    numa--;
    numb--;
    ans = min(ans, (ll)A[numa] + B[numb] - numc);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 2040
#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> v(n);
  int up = 0, down = 0;
  for(int i = 0; i < n; i++){
    int a;
    cin >> a;
    up += a;
    v[i] = up;
  }
  vector<int> b(n);
  for(int i = 0; i < n; i++) cin >> b[i];
  for(int i = n-1; i >= 0; i--){
    down += b[i];
    v[i] += down;
  }
  int ans = *max_element(v.begin(), v.end());
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl '\n'
#define uset unordered_set
#define umap unordered_map
#define all(var) var.begin(), var.end()
#define input freopen("input", "r", stdin)
#define output freopen("output", "w", stdout)
#define Fast ios_base::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL)
typedef long long ll;
using namespace std;

int dr[] = {0, 0, -1, +1, -1, -1, +1, +1};
int dc[] = {-1, +1, 0, 0, -1, +1, -1, +1};

int const M = 2e5+5;
vector<int> adj[M];
bool visited[M] = {};
int cnt = 0;

void dfs(int node){
    visited[node] = 1;
    cnt++;
    for(int child: adj[node]){
        if(!visited[child])
            dfs(child);
    }
}

int main(){
    int n, e;
    cin >> n >> e;
    while(e--){
        int u, v;
        cin >> u >> v;
        adj[u-1].push_back(v-1);
        adj[v-1].push_back(u-1);
    }
    int ans = 0;
    for(int i = 0; i < n; i++){
        if(!visited[i]){
            cnt = 0;
            dfs(i);
            ans = max(ans, cnt);
        }
    }
    cout << ans << endl;
}



Measured memory_bytes: 20956
open Printf
open Scanf

let (++) = Int64.add
let (--) = Int64.sub
let ( ** ) = Int64.mul
let (//) = Int64.div
let (%%) = Int64.rem
let landl = Int64.logand
let lorl = Int64.logor
let lnotl = Int64.lognot
let lxorl = Int64.logxor
let lsll = Int64.shift_left
let lsrl = Int64.shift_right_logical
let long = Int64.of_int
let succl = Int64.succ
let predl = Int64.pred

let read_int _ = scanf " %d " (fun x -> x)
let read_long _ = scanf " %Ld " (fun x -> x)
let read_str _ = scanf " %s " (fun x -> x)
let read_double _ = scanf " %f " (fun x -> x)

let m = 1_000_000_007L

let rec gcd a b = if b = 0L then a else gcd b (a %% b)

let rec mod_pow a = function
  | 0L -> 1L
  | b -> (if b %% 2L = 0L then 1L else a) ** mod_pow (a ** a %% m) (b//2L) %% m

let explode s =
  let rec exp i l =
    if i < 0 then l else exp (i - 1) (s.[i] :: l) in
  exp (String.length s - 1) []

let rec max_len m accum = function
  | [] -> max m accum
  | c :: rest when c = 'A' || c = 'C' || c = 'G' || c = 'T' ->
    max_len m (accum+1) rest
  | _ :: rest -> max_len (max m accum) 0 rest

let () =
  let s = read_str () in
  printf "%d\n" (max_len 0 0 @@ explode s)


Measured memory_bytes: 4480
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
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 ll INF = 1LL << 60;
//const int INF = 1001001001;

int main(void){
    int n,k;
    cin >> n >> k;
    vector<int> a(3);
    REP(i,3) cin >> a[i];
    string s;
    cin >> s;
    vector<int> ctoi(256);
    ctoi['r']=2;
    ctoi['c']=0;
    ctoi['p']=1;
    int ans=0;
    REP(i,k){
        vector<int> x;
        for(int j=i;j<n;j+=k){
            x.push_back(ctoi[s[j]]);
        }
        vector<int> dp(2);
        int pre=-1;
        for(int nx :x){
            vector<int> p(2);
            swap(dp,p);
            dp[0]=max(p[0],p[1]);
            if(pre==nx){
                dp[1]=p[0]+a[nx];
            }else{
                dp[1]=max(p[0],p[1])+a[nx];
            }
            pre=nx;
        }
        ans+=max(dp[0],dp[1]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3992
N,M = map(int,input().split())
 
A = [[] for i in range(N)]
 
for i in range(N):
    A[i] = list(map(int,input().split()))
 
B = [[0]*1 for i in range(M)]
 
for i in range(M):
    B[i] = int(input())
 
 
for row in range(N):
    tmp = 0
    for col in range(M):
        tmp += A[row][col]*B[col]
    print("%d"%(tmp))


Measured memory_bytes: 6020
#include <iostream>
#include <vector>

template <class Cost = int>
struct Edge {
    int src, dst;
    Cost cost;
    Edge(int src = -1, int dst = -1, Cost cost = 1)
        : src(src), dst(dst), cost(cost){};

    bool operator<(const Edge<Cost>& e) const { return this->cost < e.cost; }
    bool operator>(const Edge<Cost>& e) const { return this->cost > e.cost; }
};

template <class Cost = int>
struct Graph {
    std::vector<std::vector<Edge<Cost>>> graph;

    Graph(int n = 0) : graph(n) {}

    void span(bool direct, int src, int dst, Cost cost = 1) {
        graph[src].emplace_back(src, dst, cost);
        if (!direct) graph[dst].emplace_back(dst, src, cost);
    }

    std::vector<Edge<Cost>>& operator[](int v) { return graph[v]; }
    std::vector<Edge<Cost>> operator[](int v) const { return graph[v]; }

    int size() const { return graph.size(); }
};

using lint = long long;
constexpr lint INF = 1LL << 60;

std::vector<lint> xs;
Graph<> graph;
std::vector<std::vector<bool>> posdp;
std::vector<std::vector<lint>> negdp;

void dfs(int v, int p) {
    auto& pdp = posdp[v];
    auto& ndp = negdp[v];

    pdp.resize(1, xs[v] > 0);
    ndp.resize(1, xs[v]);
    int sz = 0;

    for (auto e : graph[v]) {
        int u = e.dst;
        if (u == p) continue;

        dfs(u, v);

        const auto& cpdp = posdp[u];
        const auto& cndp = negdp[u];
        int csz = (int)cpdp.size() - 1;

        auto opdp = pdp;
        auto ondp = ndp;

        pdp.assign(sz + csz + 2, false);
        ndp.assign(sz + csz + 2, INF);

        for (int i = 0; i <= sz; ++i) {
            for (int j = 0; j <= csz; ++j) {
                // don't cut
                if (opdp[i] && cpdp[j]) pdp[i + j] = true;
                ndp[i + j] = std::min(ndp[i + j], ondp[i] + cndp[j]);

                // cut
                if (!cpdp[j] && cndp[j] >= 0) continue;
                if (opdp[i]) pdp[i + j + 1] = true;
                ndp[i + j + 1] = std::min(ndp[i + j + 1], ondp[i]);
            }
        }

        sz += csz + 1;
    }
}

void solve() {
    int n;
    std::cin >> n;

    xs.resize(n);
    for (auto& x : xs) std::cin >> x;

    graph = Graph<>(n);
    for (int i = 0; i < n - 1; ++i) {
        int u, v;
        std::cin >> u >> v;
        graph.span(false, --u, --v);
    }

    posdp.resize(n);
    negdp.resize(n);

    dfs(0, -1);

    int ans = n;
    for (int i = 0; i < (int)posdp[0].size(); ++i) {
        if (posdp[0][i] || negdp[0][i] < 0) ans = std::min(ans, i);
    }

    std::cout << ans << std::endl;
}

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

    solve();

    return 0;
}


Measured memory_bytes: 84736
/* Author: Rennan Rocha
 * Time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
**/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define F first
#define S second
#define PB push_back
#define MP make_pair

#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define pi pair<int,int>
#define pll pair<ll, ll>
#define vpi vector<pi>
#define vpll vector<pll>

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
//*find_by_order(); order_of_key();

int main() {
    ios_base::sync_with_stdio(false);

    int n;
    cin >> n;
    string s, t;
    cin >> s >> t;

    string a = "";
    for(int i = 0; i < n; i++) {
        a += s[i];
        a += t[i];
    }
    cout << a << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int inf = 0x3f3f3f3f,oo = inf;
#define rd() read()
#define mem(x,v) memset(x,v,sizeof(x))
#define IL inline
#define RG register
#define rep(i,a,b) for(RG int i=(a);i<(b);++i)
#define Rep(i,a,b) for(RG int i=(a);i<=(b);++i)
#define Dep(i,a,b) for(RG int i=(a);i>=(b);--i)
#define pc putchar
#define gc getchar
IL ll read(){
	RG ll x=0;char f=0;RG char c=gc();
	for(;!isdigit(c);c=gc())f|=(c=='-');
	for(;isdigit(c);c=gc())x=(x<<1)+(x<<3)+(c^48);
	return f?-x:x;
}
#define lowbit(x) ((x & -x))
IL void write(ll x){if(x<0)x=-x,pc('-');if(x>=10)write(x/10);pc(x%10+'0');}
IL void writeln(ll x){write(x);puts("");}
const int Mod = 1e9+7;
int n,m,bin[205],g[20][40005],f[40005],q[40005];
int main(){
//	freopen("gemo.in","r",stdin);
//	freopen("gemo.out","w",stdout);
	n = rd(),m = rd();
	int ans = 0;
	Rep(i,1,m){
		int x = rd()-1,y = rd()-1;
		g[x][(1<<y)] = true;
	}
	rep(i,0,n){
		rep(j,1,(1<<n)){
			g[i][j] = g[i][j-lowbit(j)] + g[i][lowbit(j)];
		}
	}
	for(int S=0;S<(1<<n);++S){
		if((S&1) != (S>>1&1)) continue;
		f[S] = 1;
		for(int T=S;T;T=(T-1)&S){
			//s1 : T,s2 : S-T
			if((T&1) != (T>>1&1)) continue;
			int w = f[T];
			rep(j,0,n){
				//是sg为1的点 
				if(T>>j&1) w = 1ll * w * ((1 << g[j][S-T]) - 1) % Mod;
				else if((S-T)>>j&1)  w = 1ll * w * ((1 << g[j][T])) % Mod;
			}
			f[S] = (f[S] + w) % Mod;
		}
	}
	ll anss = 1;
	for(int i=1;i<=m;i++) anss = 1ll * anss * 2 % Mod;
	writeln((anss - f[(1<<n)-1] + Mod)%Mod);
	return 0;
}

Measured memory_bytes: 2304
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> P;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)
/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
vector<char>NUM(10);
	NUM = { '0','1','2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' };
*/



int main() {
	vector<int>di(8);
	vector<int>dj(8);
	di = { 0,1,1,1,0,-1,-1,-1 };
	dj = { 1,1,0,-1,-1,-1,0,1 };
	int H, W;
	cin >> H >> W;
	vector<string>S(H);
	rep(i, H) {
		cin >> S[i];
	}
	int cnt = 0;
	rep(i, H) {
		rep(j, W) {
			if (S[i][j] == '#') {
				cout << '#';
			}
			else {
				rep(k, 8) {
					if (0 <= i + di[k] && i + di[k] < H &&
						0 <= j + dj[k] && j + dj[k] < W &&
						S[i + di[k]][j + dj[k]] == '#') {
						cnt++;
					}
				}
				cout << cnt;
				cnt = 0;
			}
		}
		cout << endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll mod=1e9+7;
ll const maxn=4e5+5;
ll const inf=1e18;
ll add(ll a,ll b){
    return ((a%mod)+(b%mod))%mod;
}
ll mul(ll a,ll b){
    return ((a%mod)*(b%mod))%mod;
}
ll powm(ll x,ll n,ll M)
{
    ll result=1;
    while(n>0)
    {
        if(n % 2 ==1)
            result=(result * x)%M;
        x=(x*x)%M;
        n=n/2;
    }
    return result;
}
int main(){
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt","r",stdin);
    // freopen("output.txt","w",stdout);
    // #endif
    ios_base::sync_with_stdio(false);
   cin.tie(NULL);
   ll n;
   cin>>n;
   ll ans=ceil((n*1.0)/2);
   long double x=(ans*1.0)/n;
   cout<<fixed<<setprecision(10)<<x<<"\n";
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define repr(e,x) for(auto& e:x)
using namespace std;
typedef long long ll;

int N,M;
int x[100000], y[100000];
bool red[100001];
int cnt[100001];

int main(){
    cin>>N>>M;
    rep(i,M) cin>>x[i]>>y[i];

    red[1]=true;
    fill(cnt,cnt+N+1,1);
    rep(i,M){
        cnt[x[i]]--;
        cnt[y[i]]++;
        if(red[x[i]]){
            red[y[i]]=true;
            if(cnt[x[i]]<=0) red[x[i]]=false;
        }
    }

    int ans=0;
    repn(i,N){
        if(red[i]) ans++;
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 1536
fn main() {
    // loop{ //For test
        solve();
    // }
}

#[allow(dead_code)]
fn solve(){
    let mut st: Vec<String> = read_vec();
    let mut ab: Vec<i32> = read_vec();
    let mut a = ab[0];
    let mut b = ab[1];
    let mut u: String = read();

    if st[0]== u  {
        a = a -1;
    } else{
        b = b -1;
    }
    println!("{} {}", a, b);
}

fn is_even(arr: &Vec<i32>) -> bool {
    return arr.iter().all(|x| x%2==0);
}

/// 標準入力から一行を読み取り、指定の型に変換する関数
#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    let _ = std::io::stdin().read_line(&mut s);
    s.trim().parse().ok().unwrap()
}

/// 標準入力から一行を読み取り、空白文字で分割し、各要素を指定の型に変換する関数
#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

/// 標準入力からn行を読み取り、各行を空白文字で分割し、各要素を指定の型に変換する関数
#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>				//Written by ThiDaiLoc
using namespace std;				//Team Three Wolves
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> pll;
#define fu(i,a,b)   for(ll i=a;i<b;i++)
#define fd(i,b,a)   for(ll i=b;i>=a;i--)
#define ms(a,x)     memset(a, x, sizeof a)
#define prec(n)     fixed<<setprecision(n)
#define pb(i)       push_back(i)
#define popb()      pop_back()
#define sc(a)       cin>>a
#define sc2(a,b)    cin>>a>>b
#define pr(a)       cout<<a<<" "
#define pr2(a,b)    cout<<a<<" "<<b<<" "
#define lowb(a,n,x) lower_bound(a,a+n,x) -a
#define lowb2(a,x)  lower_bound(a.begin(),a.end(),x) -a.begin()
#define all(x)      (x).begin(), (x).end()
#define sz(a)       (ll)a.size()
#define le(s)       (ll)s.length()						
#define re          return 	
#define	mp(a,b)     make_pair(a,b)
#define se          second
#define fi          first 
#define debug(x)    cerr << #x << " = " << x << endl
#define INPUT       freopen("locin.txt", "r", stdin)
#define OUTPUT      freopen("locout.txt", "w", stdout)
void inline minize(ll& a,ll b){a=(a>b?b:a);};
void inline maxize(ll& a,ll b){a=(a<b?b:a);};
double const eps = 1e-6;
ll const Base=1e9+7,oo=1e17,MAXN=1e7;
ll arr[3][1000];

ll Solves(){
	//INPUT;
	ll n,p,x;
	
	arr[0][0]=arr[1][0]=0;
	
	sc2(n,p);
	
	fu(i,1,n+1){
		sc(x);
		if(x%2){
			arr[0][i]=arr[0][i-1]+arr[1][i-1];
			arr[1][i]=arr[1][i-1]+arr[0][i-1]+1;
		}
		else{
			arr[0][i]=2*arr[0][i-1]+1;
			arr[1][i]=2*arr[1][i-1];
		}
	}
	arr[0][n]++;
	pr(arr[p][n]);
	// Hack it if you can :)
}
int main(){
	
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	Solves();
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define PI 3.14159265
#define ll long long
#define vi vector<int>
#define pb push_back
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 100000000
#define inf 1000000000000000001;
#define all(c) c.begin(),c.end()
#define mk(x,y) make_pair(x,y)
#define mem(a,val) memset(a,val,sizeof(a))
#define eb emplace_back
#define ff first
#define ss second
#define re return
// #define endl "\n"
#define max2(x,y)              (x>y)?x:y
#define min2(x,y)              (x<y)?x:y
#define mid(s,e)               (s+(e-s)/2)
#define mini                   INT_MIN
#define maxo                   INT_MAX
#define rep(i,a,b) for(int i=a;i<(int)(b);++i)
#define read(a,n) for(int i=0;i<n;i++)cin>>a[i]
#define show(a,n) for(int i=0;i<n;i++)cout<<a[i]<<' ';cout<<endl
#define en cout<<"\n";

int main()
{
    // #ifndef ONLINE_JUDGE
    //  freopen("input.txt","r",stdin);
    //  freopen("output.txt","w",stdout);
    // #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    ll a[n];
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
    }
    ll res[n] = {};
    vector <int> v;
    for(ll i=n-1;i>=0;i--)
    {
        ll j = 2*(i+1);
        ll ans = 0;
        while(j<=n)
        {
            j--;
            if(res[j] == 1)
                ans++;
            j=j+(i+1)+1;
        }
        if(ans%2==a[i])
        {
            res[i] = 0;
        }
        else
        {
            res[i] = 1;
        }
    }
    ll r = 0;
    for(ll i=0;i<n;i++)
    {
        if(res[i]==1)
            r++;
    }
    cout<<r<<endl;
    for(ll i=0;i<n;i++)
    {
        if(res[i]==1)
            cout<<i+1<<" ";
    }
    cout<<endl;
}

Measured memory_bytes: 3968