akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>

int main(){
  int H,W,x,y;
  scanf("%d %d",&H,&W);
  while(!(H==0 && W==0)){
    for(y=0;y<H;y++){
      for(x=0;x<W;x++){
        if(x%2==0 && y%2==0){
          printf("#");
        } else if(x%2==0 && y%2==1){
          printf(".");
        } else if(x%2==1 && y%2==0){
          printf(".");
        } else if(x%2==1 && y%2==1){
          printf("#");
        }
      }
      printf("\n");
    }
    printf("\n");
    scanf("%d %d",&H,&W);
  }
  return 0;
}

Measured memory_bytes: 2676
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
const double PI = acos(-1.0);
const double EPS = 1e-10;

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; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

void solve(){
    ll A, V, B, W, T;
    cin >> A >> V >> B >> W >> T;
    if(V <= W){
        cout << "NO" << endl;
        return;
    }
    ll dist = abs(A - B);
    if(dist <= T * (V - W)) cout << "YES" << endl;
    else cout << "NO" << endl;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    // int T; cin >> T; REP(t,T) solve();
}

Measured memory_bytes: 3648
import sys
input = sys.stdin.readline
from operator import itemgetter
sys.setrecursionlimit(10000000)
INF = 10**30

def main():
    n = int(input().strip())
    v = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
    print(v[n-1])

if __name__ == '__main__':
    main()


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

int n;
double dp[3003][3003],a[3003];
/*saleh rabea;*/
/*ali b ali*/
double solve(int i,int h){
    if(i==n)return h>(n/2);
    double &ans=dp[i][h];
    if(ans>-0.5)return ans;
    ans=(double)((double)(a[i]*solve(i+1,h+1))+(double)((1-a[i])*solve(i+1,h)));
    return ans;
}
int main(){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }


    for(int i=0;i<3001;i++){
        for(int j=0;j<3001;j++){
            dp[i][j]=-1;
        }
    }
    cout<<fixed<<setprecision(10)<<solve(0,0);
    return 0;
}


Measured memory_bytes: 70912
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <cctype>
#include <cmath>
#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,m,n) for(int i=m;i<n;++i)
#define RFOR(i,m,n) for(int i=m-1;i>=n;--i)
#define ALL(v) v.begin(),v.end()
#define INF 1000000001
#define MOD 1000000007

using namespace std;



int main() {
	int n,cnt=0,flag=1;
	cin >> n;
	REP(i, n) {
		int a;
		cin >> a;
		if (a == 2) {
			flag = 1;
		}
		else {
			FOR(j, 2, sqrt(a) + 1) {
				if (a%j == 0) {
					flag = 0;
					break;
				}
			}
		}
		if (flag) cnt++;
		flag = 1;
	}
	cout << cnt << endl;
	return 0;
}

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

 int main() {
 int N;
 cin >> N;
 vector<int> a(N);
 int sum = 0;

 for (int i = 0; i < N; ++i) {
 cin >> a[i];
 sum += a[i];
 }

 int mini = sum;
 int prefix_sum = 0;
 for (int i = 0; i < N; ++i) {
 cin >> a[i];
 prefix_sum += a[i];
 mini = min(mini, abs(prefix_sum - (sum - prefix_sum)));
 }

 cout << mini << endl;
 return 0;
 }

Measured memory_bytes: 3644
#include<stdio.h>
#include<math.h>


int main(){
  int n,i;
  double x[100],y[100],diff[100];
  double p1,p2,p3,pmax,p2_S,p3_S;

  scanf("%d\n", &n);
  for(i=0;i<n;i++){
    scanf("%lf",&x[i]);
  }
  for(i=0;i<n;i++){
    scanf("%lf",&y[i]);
  }

  p1 = 0.0;
  p2_S = 0.0;
  p3_S = 0.0;
  pmax = 0.0;
  for(i=0;i<n;i++){
    diff[i] = fabs(x[i]-y[i]);
    p1+=diff[i];
    p2_S+=(diff[i]*diff[i]);
    p3_S+=(diff[i]*diff[i]*diff[i]);
    if (pmax<diff[i]){
      pmax = diff[i];
    }
  }
  printf("%f\n", p1);
  p2 = sqrt(p2_S);
  printf("%f\n", p2);
  p3 = cbrt(p3_S);
  printf("%f\n", p3);
  printf("%f\n", pmax);

  return 0;
}


Measured memory_bytes: 2116
#include <bits/stdc++.h>
#define rep(i, n) for(long long int i = 0; i < n; i++)
#define _rep(i, m, n) for(long long int i = m; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int N = 1000000;
const ll mod = 1000000007;
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

ll gcd(ll A, ll B){
    if(B == 0)return A;
    return gcd(B, A % B);
}
ll lcm(ll A, ll B){
    return A * B / gcd(A, B);
}

/*------------------------------------------------------------------*/

int main(){
    vector<vector<int>> c(3, vector<int>(3));
    rep(i, 3){
        rep(j, 3){
            cin >> c[i][j];
        }
    }
    vector<int> a(3);
    vector<int> b(3);

    a[0] = 0;
    b[0] = c[0][0];
    b[1] = c[0][1];
    b[2] = c[0][2];
    a[1] = c[1][0] - b[0];
    a[2] = c[2][0] - b[0];
    bool flag = true;

    rep(i, 3){
        rep(j, 3){
            if(a[i] + b[j] != c[i][j]) flag = false;
        }
    }
    if(flag) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = m; i < (n); i++)
#define RFOR(i, m, n) for (int i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define print(ele) cout << (ele) << endl
#define print10(ele) cout << fixed << setprecision(10) << (ele) << endl

using namespace std;
typedef long long ll;
typedef vector<int> ivec;
typedef vector<string> svec;
typedef vector<ll> lvec;

const int mod = 1e9 + 7;
const ll INF = 1000000000000000000LL;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  print(a * b / 2);
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
//INSERT ABOVE HERE
signed main(){
  string s;
  cin>>s;
  auto NO=[]{cout<<"WA"<<endl;exit(0);};
  if(s[0]!='A') NO();
  Int c=0;
  for(Int i=2;i+1<(Int)s.size();i++) if(s[i]=='C') c++;
  if(c!=1) NO();
  for(Int i=1;i+1<(Int)s.size();i++){
    if(s[i]=='C') continue;
    if(!islower(s[i])) NO();
  }
  if(!islower(s[s.size()-1])) NO();
  cout<<"AC"<<endl;
  return 0;
}


Measured memory_bytes: 256
from heapq import heappop, heappush
n, m = map(int, input().split())
lst = [list(map(int, input().split())) for i in range(n)]
lst_f = [[] for i in range(m)]
#lst = sorted(lst, key=lambda x:x[0])
#lst = sorted(lst, key=lambda x:x[1], reverse=True)
cnt = 0
ans = 0
cntup = m
for a, b in lst:
  if a <= m:
    lst_f[a-1].append(b)
  #print(filter(lambda y:y<=m-i, map(lambda x:x[0], lst)))
  #lst2 = list(filter(lambda y:y[1]<=m-i, lst))
avb = [] 
for i in lst_f:
  for j in i:
    heappush(avb, -j)
  if avb != []:
    ans -= heappop(avb)
print(ans)


Measured memory_bytes: 82008
import java.io.*;
import java.io.InputStreamReader;
import java.util.*;
public class Main
{

    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());
        int n = Integer.parseInt(st.nextToken());
        int a = n % 10;
        if(a == 9 || (n / 10) == 9)System.out.print("Yes");
        else System.out.print("No");

    }

}

Measured memory_bytes: 21076
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func main() {
	sc.Scan()

	s := sc.Text()
	r, _ := strconv.ParseFloat(s, 64)

	fmt.Printf("%f %f\n", r*r*math.Pi, r*2*math.Pi)
}



Measured memory_bytes: 1116
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const long long INF=1e18,MOD=1e9+7;
int main(){
	int n;
	cin>>n;
	vector<int>v(n),c(n);
	for(int i=0;i<n;i++){
		cin>>v[i];
	}
	
	for(int i=0;i<n;i++)cin>>c[i];

	int ans=0;
	for(int i=0;i<n;i++){
		if(v[i]-c[i]>0){
			ans+=v[i]-c[i];
		}
	}
	cout<<ans<<endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string S,T;
  cin >> S;
  cin >> T;
  int i=0;
    while(i<S.size()){
  		if(S[i] != T[i])
        {
        break;
        }
      i++;
  	}
  if(i == S.size()){	
  cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  
  return 0; 
}

Measured memory_bytes: 3620
one  = 0
two = 0
three  = 0
while 1:
	try :
		i = int(raw_input())
		if one<i:
			three=two
			two=one
			one=i
		elif two<i:
			three=two
			two=i
		elif three<i:
			three=i
    	except:
	    	print"%d" % (one)
	    	print"%d" % (two)
	    	print"%d" % (three)
	    	break

Measured memory_bytes: 4208
import sys

N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))

yen = 1000
for i in range(1, N):
    if A[i-1] < A[i]:
        yen += (A[i] - A[i-1]) * (yen // A[i-1])

print(yen)

Measured memory_bytes: 9172
#include<iostream>
#include<queue>
#include<vector>
#include<algorithm>




int main() {
	int n, m;

	std::cin >> n >> m;

	std::vector<std::vector<int>> g(n);

	for (int i{}; i < m; ++i) {
		int x, y;
		std::cin >> x >> y;
		g[x - 1].emplace_back(y - 1);
	}

	std::vector<int> dist(n, -1);

	for (int i{}; i < n; ++i) {

		[&](auto f, int index) {
			return 
				f(f, index);
		}(
			[&](auto f, int index)->int {

				if (dist[index] != -1)// has NOT visited yet
					return dist[index];

//				std::cout << index << " : " << dist[index] << " ";

				std::decay_t<decltype(dist[index])> ans{ 0 };
				for ( auto e : g[index])
					ans = std::max( f(f, e) + 1, ans);
				
//				std::cout <<"Ans:"<< ans << "\n";

				return
					dist[index] = ans;
			}
			,i
		); 
		//std::cout << "\n";
		//std::cout << dist[i] << "\n";

	}//for

	std::cout << *std::max_element(std::cbegin(dist), std::cend(dist) ) << "\n";

	return 0;
}

Measured memory_bytes: 10240
import math
import collections
import bisect
from copy import copy


def main():
    ans = {"AC": 0, "WA": 0, "TLE": 0, "RE": 0}
    N = int(input())
    for i in range(N):
        S = input()
        ans[S] += 1

    for e in ans:
        print("{} x {}".format(e, ans[e]))


if __name__ == '__main__':
    main()


Measured memory_bytes: 9632
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

def main():
    N = int(input())
    ans = 0
    for n in range(1, N+1, 2):
        #if len(make_divisors(n)) == 8:
        #    print('n:{}, divisors:{}'.format(n, make_divisors(n)))
        ans += (len(make_divisors(n)) == 8)
    
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
/**
 *  author: MOOONI
 *  hackers are welcome!
**/
#include <bits/stdc++.h>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s, t;
  cin >> s >> t;
  for (int i = 0; i < 26; i++) {
    string res = s;
    res += (char) ('a' + i);
    if (res == t) {
      cout << "Yes" << '\n';
      return 0;
    }
  }
  cout << "No" << '\n';
  return 0;
}

Measured memory_bytes: 3644
//PLUS ULTRA
//one who sits atop all the clans : Lion's Sin Escanor 

#include<bits/stdc++.h>
using namespace std;
     
     
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define pb push_back 
#define forn(i,st,n) for(int i = st; i < n ; i++)
#define nfor(i,st,n) for(int i = st; i >= n ; i--)
#define ss second
#define ff first
#define ll long long 

typedef pair <int , int> pii;

const int N = 1e5 + 10 , mod =  1000000007;

void solve(){

    int n; cin >> n;
    ll arr[n]  , inp;

    map<int , int> mp;


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

    ll ans  = 0;

    ll t= n-1 - arr[n-1] , x ;
    mp[t]++;

    for(int i = n-2; i>= 0 ; i--){
    	x = arr[i] + i ;

    	if(mp.find(x) != mp.end()){
    		ans += mp[x];
    	} 

    	t = i - arr[i];
    	mp[t]++;

    }

    cout << ans << "\n";
    

 
        


}

int main(){
    SPEED;

   solve();


    return 0;
}
      
       


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

int main(){
  int n;
  ll k;
  cin>>n>>k;
  ll vec[n];
  ll sum=0;
  for(int i=0;i<n;i++){
    cin>>vec[i];
    sum+=vec[i];
  }
  if(sum<=k){
    cout<<1<<endl;
    return 0;
  }
  ll ng=1,ok=1e10,check;
  for(int q=0;q<40;q++){
    if(ok-ng==1){
      break;
    }
    ll count=0;
    check=(ng+ok)/2;
    for(int i=0;i<n;i++){
      count+=(vec[i]-1)/check;
      if(count>k){
        break;
      }
    }
    if(count<=k){
      ok=check;
    }
    else{
      ng=check;
    }
  }
  cout<<ok<<endl;
}

Measured memory_bytes: 5168
#include<bits/stdc++.h>
#define fo(i,a,b) for((i)=(a);i<=(b);i++)
#define rfo(i,a,b) for((i)=(a);i>=(b);i--)
#define inrange(x,y,z) (((x)>=(y))&&((x)<=(z)))
#define ALL(vec) (vec).begin(),(vec).end()
#define SOR(vec) sort(ALL(vec))
#define UNI(vec) (vec).erase(unique(ALL(vec)),(vec).end())
using namespace std;
int n,l[120],rt;
int main(){
	#ifdef FILIN
		#ifndef DavidDesktop
			freopen(FILIN,"r",stdin);
			freopen(FILOUT,"w",stdout);
		#endif
	#endif
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>n;
	for(int i=1;i<=n;i++) cin>>l[i];
	sort(l+1,l+n+1);
	for(int i=1;i<=n;i++) for(int j=i+1;j<=n;j++)
		for(int k=j+1;k<=n;k++){
			if(l[i]!=l[j]&&l[i]!=l[k]&&l[j]!=l[k]){
				if(l[i]+l[j]>l[k]){
					rt++;
				}
			}
		}
	cout<<rt<<endl;
	return 0;
}


Measured memory_bytes: 3656
#include<iostream>
#include<string>
#include<vector>
using namespace std;

int main(){
    int n,m;
    cin >> n >> m;
    bool a[10];
    for(int i=0;i<10;i++){
        a[i] = false;
    }
    for(int i=0;i<m;i++){
        int tmp;
        cin >> tmp;
        a[tmp] = true;
    }
    int b[10] = {1000,2,5,5,4,5,6,3,7,6};
    int dp[n+1];
    for(int i=0;i<n+1;i++){
        dp[i] = -(int)1e9;
    }
    dp[0] = 0;
    for(int i=1;i<n+1;i++){
        for(int j=1;j<=9;j++){
            if(a[j]){
                if(i-b[j] >= 0){
                    dp[i] = max(dp[i-b[j]] + 1,dp[i]);
                }
            }
        }
        //cout <<i << " " <<  dp[i] << endl;
    }
    int max_digit = dp[n];
    string ans = "";
    int now_digit = max_digit;
    int last = n;
    //cout << max_digit << endl;
    while(now_digit > 0){
        for(int i = 9;i >=1;i--){
            if(last - b[i] >= 0){    
                if(a[i] && dp[last-b[i]] == now_digit-1){
                    now_digit --;
                    ans += to_string(i);
                    last -= b[i];
                    break;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main(void)
{
   char s[200], p[200], sroop[400];
    scanf("%s",s);
    strcpy(sroop,s);
    strcat(sroop,s);
    scanf("%s",p);
   if(strstr(sroop,p)){
     printf("Yes\n");
  }
   else{
     printf("No\n");
  }
 
    return 0;
}

Measured memory_bytes: 540
n = int(input())
a = list(map(int, input().split()))
bai4 = []
bai2 = []
bai_ = []
for ai in a:
    if ai % 4 == 0:
        bai4.append(ai)
    elif ai % 2 == 0:
        bai2.append(ai)
    else:
        bai_.append(ai)

len_bai_ = len(bai_)
len_bai2 = len(bai2)
len_bai4 = len(bai4)


if len_bai_ > len_bai4:
    if len_bai_ == len_bai4 + 1 and n == len_bai_ + len_bai4:
        print("Yes")
    else:
        print("No")
else:
    print("Yes")

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

signed main(){
  int n,count=0; cin>>n;
  for(int i=1;i<n;i++){
    if(n%i==0)
      count+=n/i-1;
    else
      count+=n/i;
  }
  cout<<count<<endl;
}

Measured memory_bytes: 3588
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include <functional>
#include<time.h>
#include <stack>
#include<iomanip>
using namespace std;
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define llint long long int
#define reverse(v)  reverse(v.begin(), v.end());
#define Yes(ans) if(ans)cout<<"Yes"<<endl; else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl; else cout<<"NO"<<endl;
#define hei(a) vector<a>
#define whei(a) vector<vector<a>>
#define UF  UnionFind 
#define Pint pair<int,int>
#define keta(a)  fixed << setprecision(a)
constexpr auto INF = 100000000000;
constexpr auto mod = 1000000007;
//辞書順はnext_permutation( begin( v ), end( v ) );やで！
struct edge { int to, cost; };


int main() {
	ll n,m;
	cin >> n >> m;
	if (n == 1 || m == 1) {
		cout << 1 << endl;
		return 0;
	}
	ll ans = n * (m / 2);
	if (m % 2 == 1)ans += (n + 1) / 2;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define N 100005
#define M 1000000007
#define pii pair<ll,ll>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
main()
{
    int n;
    cin>>n;
    double pi=acos(-1.0);
    cout<<setprecision(10)<< 2*pi*n;

}



Measured memory_bytes: 3800
#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 n;
  int ans = 0;
  cin >> n;
  vector<int> a(n);
  vector<int> b(n);
  vector<int> c(n - 1);
  rep(i, n) cin >> a[i], a[i]--;
  rep(i, n) cin >> b[i];
  rep(i, n - 1) cin >> c[i];
  rep(i, n) {
    ans += b[a[i]];
    if(i > 0) {
      if(a[i] - 1 == a[i - 1]){
        ans += c[a[i - 1]];
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#define buf 1000
using namespace std;
int Search_A(int z);
int Search_B(int z);
int n,cnt,A[50];
int main(void){
  int m,z,i;
  char str[buf],*line;

  for( ;fgets(str,sizeof(str),stdin)!=NULL; ){
      sscanf(str,"%d",&n);
      if(n==0) break;
      fgets(str,sizeof(str),stdin);
      line=strtok(str," ");
      sscanf(line,"%d",&m); A[0]=m;
      for(i=1;i<n;i++){
        line=strtok(NULL," ");
        sscanf(line,"%d",&m);
        A[i]=m;
      }
      z=32; cnt=0;
      while(z!=0){
        z=Search_A(z);
        z=Search_B(z);
      }
  }
  return 0;
}

int Search_A(int z){
  z=z-(z-1)%5;
  if(z<0) z=0;
  printf("%d\n",z);
  return z;
}
int Search_B(int z){
  z=z-A[cnt%n];
  if(z<0) z=0;
  printf("%d\n",z);
  cnt+=1;
  return z;
}

Measured memory_bytes: 2568
#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <functional>
using namespace std;
#define int long long
#define All(v) (v).begin(),(v).end()
int dy[8] = {-1,0,1,0,-1,1,1,-1};
int dx[8] = {0,1,0,-1,1,1,-1,-1};
const int mod = 1000000007;
const int inf = mod*mod;
const int d5 = 100100;
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    string s,t;
    cin>>n>>s>>t;
    string res="";
    for(int i=0;i<n;i++){
        res+=s[i];
        res+=t[i];
    }
    cout<<res<<endl;
}

Measured memory_bytes: 256
def main():
    N, L = map(int, input().split())
    D = input().split()
    ans = N
    while 1:
        s = str(ans)
        f = 1
        for i in D:
            if i in s : f = 0
        if f : break
        ans += 1
    print(ans)
if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define del(a,i) memset(a,i,sizeof(a))
#define ll long long
#define inl inline
#define il inl void
#define it inl int
#define ill inl ll
#define re register
#define ri re int
#define rl re ll
#define INF 0x3f3f3f3f
#define lowbit(x) (x&(-x))
#define mid ((l+r)>>1)
using namespace std;
template<class T>il read(T &x){
	x=0;int f=1;char k=getchar();
	for(;k>'9'||k<'0';k=getchar()) if(k=='-') f=-1;
	for(;k>='0'&&k<='9';k=getchar()) x=x*10+k-'0';
	x*=f;
}
template<class T>il _print(T x){
	if(x>9) _print(x/10);
	putchar(x%10+'0');
}
template<class T>il print(T x){
	if(x<0) putchar('-'),x=-x;
	_print(x);
}
it qpow(int x,int k,int mod){
	int res=1,bas=x;
	while(k){
		if(k&1) res=1ll*res*bas%mod;
		bas=1ll*bas*bas%mod,k>>=1;
	}
	return res;
}
const int N = 2e5+5,mod = 1e9+7;
int n,a,b;
it mul(int x,int y){return 1ll*x*y%mod;}
it add(int x,int y){return x+y>=mod?x+y-mod:x+y;}
il inc(int &x,int y){x=add(x,y);}
it C(int n,int m){
	int res=1;
	for(ri i=n-m+1;i<=n;++i) res=mul(res,i);
	for(ri i=2;i<=m;++i) res=mul(res,qpow(i,mod-2,mod));
	return res;
}
int main(){
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	read(n),read(a),read(b);
	int ans=qpow(2,n,mod);
	inc(ans,mod-1),inc(ans,mod-C(n,a));
	inc(ans,mod-C(n,b)),print(ans);
	return 0;
}

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

int main() {
  string word;
  priority_queue<int> Q; // int を格納する優先度つきキュー
  while (cin >> word) { // 入力がある限り読み込む
    if (word == "insert") {
      int n;
      cin >> n;
      Q.push(n);
    }
    else if (word == "extract") {
      int n = Q.top();
      cout << Q.top() << endl;
      Q.pop();
    }
    else if (word == "end") {
      break;
    }
  }
}


Measured memory_bytes: 6928
import java.util.Scanner;

public class Main {
    public static void main(String[]args){
        int a,b,sub1,sub2;
        Scanner in= new Scanner(System.in);
        a=in.nextInt(); b=in.nextInt();
        sub1=a+b;
        if(sub1%2==0)
            System.out.println(""+(sub1/2));
        else
            System.out.println("IMPOSSIBLE");
    }
}


Measured memory_bytes: 21460
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A[][] = new int[3][3];
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j  < 3; j++) {
				A[i][j] = sc.nextInt();
			}
		}

		int N = sc.nextInt();

		int b[] = new int[N];

		for (int k = 0; k < N; k++) {
			int tmp = sc.nextInt();
			for (int i = 0; i < 3; i++) {
				for (int j = 0; j  < 3; j++) {
					if (A[i][j] == tmp) A[i][j] = 0;
				}
			}
		}

		boolean possible = false;
		for (int i = 0; i < 3; i++) {
			int sum = 0;
			for (int j = 0; j  < 3; j++) {
				sum += A[i][j];
			}
			if (sum == 0) possible = true;
		}

		for (int i = 0; i < 3; i++) {
			int sum = 0;
			for (int j = 0; j  < 3; j++) {
				sum += A[j][i];
			}
			if (sum == 0) possible = true;
		}

		if (A[0][0] + A[1][1] + A[2][2] == 0) possible = true;
		if (A[0][2] + A[1][1] + A[2][0] == 0) possible = true;


		if (possible) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
}

Measured memory_bytes: 21972
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef vector<ll> vi;
typedef long double td;
typedef vector<td> vd;
typedef pair<ll,ll> ii;
typedef vector<ii> vii; typedef vector<bool> vb;
#define FIN ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define forr(i, a, b) for(ll i = ll(a); i < (ll)(b); i++)
#define forn(i, n) forr(i, 0, n)
#define pb push_back
#define mp make_pair
#define all(c) (c).begin(),(c).end()
#define DBG(x) cerr << #x << " = " << (x) << endl
#define show(v,n) cerr << #v << " = "; forn(i,n) cerr << v[i] << " "; cerr << endl;
#define esta(x,c) ((c).find(x) != (c).end())
#define RAYA cerr << "===============================" << endl
int MAXN = 500005;
int INF = (int)(1e9+7);

ll mod = (ll)(1e9+7);

typedef vector<vector<ll> > Matrix;

Matrix ones(int n) {
	Matrix r(n,vector<ll>(n));
	forn(i,n)r[i][i]=1;
	return r;
}
Matrix operator*(Matrix &a, Matrix &b) {
	int n=a.size(),m=b[0].size(),z=a[0].size();
	Matrix r(n,vector<ll>(m));
	forn(i,n)forn(j,m)forn(k,z)
		r[i][j]+=a[i][k]*b[k][j],r[i][j]%=mod;
	return r;
}
Matrix be(Matrix b, ll e) {
	Matrix r=ones(b.size());
	while(e){if(e&1LL)r=r*b;b=b*b;e/=2;}
	return r;
}

 
int main()
{ 	
	FIN;
	#ifdef input
		freopen("T2.txt", "r", stdin);
	#endif
	
	int n;
	ll k;
	cin >> n >> k;
	Matrix v(n,vector<ll>(n));
	forn(i,n) forn(j,n) cin >> v[i][j];
	v = be(v,k);
	ll ans = 0;
	forn(i,n)
	{
		forn(j,n)
		{
			ans+=v[i][j];
			ans%=mod;
		}
	}
	cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 3712
import fractions

N, X = map(int, input().split())
cities = list(map(int, input().split()))
cities.append(X)
cities.sort()
distances = list(map(lambda x: cities[x + 1] - cities[x], range(len(cities) - 1)))
ans = distances[0]
for distance in distances:
    ans = fractions.gcd(ans, distance)
print(ans)

Measured memory_bytes: 16280
const MOD: usize = 998244353;
fn main() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let n: usize = sc.read();
    let s = sc.chars();

    let mut rgb = vec![vec![]; 3];
    for (i, &c) in s.iter().enumerate() {
        let c = match c {
            'R' => 0,
            'G' => 1,
            'B' => 2,
            _ => unreachable!(),
        };
        rgb[c].push(i);
    }

    let mut min = vec![];
    let mut center = vec![];
    let mut max = vec![];
    for i in 0..n {
        let mut x = [rgb[0][i], rgb[1][i], rgb[2][i]];
        x.sort();

        min.push(x[0]);
        center.push(x[1]);
        max.push(x[2]);
    }

    let mut head = 0;
    let mut from_min = 1;
    for i in 0..n {
        let c = center[i];
        while head < n && min[head] < c {
            head += 1;
        }
        from_min = (from_min * (head - i)) % MOD;
    }

    let mut head = 0;;
    let mut to_min = 1;
    for i in (0..n).rev() {
        let c = center[i];
        while head < n && max[n - 1 - head] > c {
            head += 1;
        }
        to_min = (to_min * (head - (n - 1 - i))) % MOD;
    }

    let mut ans = (from_min * to_min) % MOD;
    for i in 0..n {
        ans = (ans * (i + 1)) % MOD;
    }
    println!("{}", ans);
}

pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n')
            .take_while(|&b| b != b' ' && b != b'\n')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 16636
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        string[] input = Console.ReadLine().Split();
        long N = long.Parse(input[0]);
        long K = long.Parse(input[1]);
        long mod = 1000000007;
        long[,] ncr = new long[N+1, K+1];
        for (long i = 0; i < N+1; i++)
        {
            for (long j = 0; j < K+1; j++)
            {
                if (j == 0) ncr[i, j] = 1;
                else if (i == 0) ncr[i, j] = 0;
                else ncr[i, j] = (ncr[i - 1, j]+ncr[i-1,j-1])%mod;
            }
        }
        for (var i = 1; i <= K; i++)
        {
            long a = ncr[N-K+1,i];
            long b = ncr[K - 1, i - 1];
            Console.WriteLine(a * b % mod);
        }
    }
    public static long ncr(long n,long r,long m)
    {
        long ans = 1;
        for(long i = n; i >= n - r + 1; i--)
        {
            ans = ans * i;
        }
        for(int i = 1; i <= r; i++)
        {
            ans = ans / i;
        }
        return ans;
    }
}


Measured memory_bytes: 41696
#include<stdio.h>

typedef struct {
    int up;     // 1
    int front;  // 2 
    int right;  // 3
    int left;   // 4
    int back;   // 5
    int down;   // 6
}dice;

dice rollN(dice data);
dice rollE(dice data);
dice rollS(dice data);
dice rollW(dice data);

int main (void){
    dice dice1;
    char ope[100]={0};
    scanf("%d %d %d %d %d %d",&dice1.up,&dice1.front,&dice1.right,&dice1.left,&dice1.back,&dice1.down);
    scanf("%s",ope);
    for (int i = 0; ope[i]!=0; i++)
    {
        switch (ope[i])
        {
        case 'N':
            dice1=rollN(dice1);
            break;
        case 'E':
            dice1=rollE(dice1);
            break;
        case 'S':
            dice1=rollS(dice1);
            break;
        case 'W':
            dice1=rollW(dice1);
            break;
        
        }
    }
    printf("%d\n",dice1.up);
    
    return 0;
}

dice rollN(dice data){
    dice rolleddice;
    rolleddice.up=data.front;
    rolleddice.front=data.down;
    rolleddice.right=data.right;
    rolleddice.left=data.left;
    rolleddice.back=data.up;
    rolleddice.down=data.back;
    return rolleddice;
}

dice rollE(dice data){
    dice rolleddice;
    rolleddice.up=data.left;
    rolleddice.front=data.front;
    rolleddice.right=data.up;
    rolleddice.left=data.down;
    rolleddice.back=data.back;
    rolleddice.down=data.right;
    return rolleddice;
}

dice rollS(dice data){
    dice rolleddice;
    rolleddice.up=data.back;
    rolleddice.front=data.up;
    rolleddice.right=data.right;
    rolleddice.left=data.left;
    rolleddice.back=data.down;
    rolleddice.down=data.front;
    return rolleddice;
}

dice rollW(dice data){
    dice rolleddice;
    rolleddice.up=data.right;
    rolleddice.front=data.front;
    rolleddice.right=data.down;
    rolleddice.left=data.up;
    rolleddice.back=data.back;
    rolleddice.down=data.left;
    return rolleddice;
}


Measured memory_bytes: 2100
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>

bool f;

using namespace std;
int main() {
  string s; cin >> s;
  sort(s.begin(),s.end());
  char ans;

  
  for ( char c = 'a'; c <= 'z'; c++ ) {
    f = false;
    for ( int i = 0; i < s.length(); i++ ) {
      if ( c == s[i] ) {
	f = true;
      }
     
    }
    if ( f == false ) {
     cout << c << endl;
      return 0;
    }
  }
    cout << "None" << endl;


  return 0;
}


Measured memory_bytes: 512
// #pragma GCC target("avx2")  // CPU 処理並列化
// #pragma GCC optimize("O3")  // CPU 処理並列化
// #pragma GCC optimize("unroll-loops")  // 条件処理の呼び出しを減らす
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
#include<numeric>
#include<unordered_set>
#include<complex>
using namespace std;
const long long mod=998244353;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-10;
const double INF=1e+10;
const double PI=acos(-1.0);
const int C_SIZE = 3121000;
namespace{
	long long fact[C_SIZE];
	long long finv[C_SIZE];
	long long inv[C_SIZE];
	long long Comb(int a,int b){
	 	if(a<b||b<0)return 0;
	 	return fact[a]*finv[b]%mod*finv[a-b]%mod;
	}
	void init_C(int n){
		fact[0]=finv[0]=inv[1]=1;
		for(int i=2;i<n;i++){
			inv[i]=(mod-(mod/i)*inv[mod%i]%mod)%mod;
		}
		for(int i=1;i<n;i++){
			fact[i]=fact[i-1]*i%mod;
			finv[i]=finv[i-1]*inv[i]%mod;
		}
	}
	long long pw(long long a,long long b){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%mod;
			a=a*a%mod;
			b/=2;
		}
		return ret;
	}
	long long pw_mod(long long a,long long b,long long M){
		if(a<0LL)return 0;
		if(b<0LL)return 0;
		long long ret=1;
		while(b){
			if(b%2)ret=ret*a%M;
			a=a*a%M;
			b/=2;
		}
		return ret;
	}
	int pw_mod_int(int a,int b,int M){
		if(a<0)return 0;
		if(b<0)return 0;
		int ret=1;
		while(b){
			if(b%2)ret=(long long)ret*a%M;
			a=(long long)a*a%M;
			b/=2;
		}
		return ret;
	}
	int ABS(int a){return max(a,-a);}
	long long ABS(long long a){return max(a,-a);}
	double ABS(double a){return max(a,-a);}
	int sig(double r) { return (r < -EPS) ? -1 : (r > +EPS) ? +1 : 0; }
}
// ここから編集しろ
char in[110000];
int main(){
	int a;scanf("%d",&a);
	scanf("%s",in);
	int ret=1;
	for(int i=1;i<a;i++){
		if(in[i]!=in[i-1])ret++;
	}
	printf("%d\n",ret);
}

Measured memory_bytes: 256
a,b,c = map(int,input().split())
Min = min(a,b,c)
if Min==a:
    Mid = min(b,c)
    Max = max(b,c)
elif Min==b:
    Mid = min(a,c)
    Max = max(a,c)
else:
    Mid = min(a, b)
    Max = max(a, b)
print(Min,Mid,Max)


Measured memory_bytes: 5588
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
using namespace std;

int main(void) {

	// TODO: submit前にprintf-debugの削除確認！
	string n;
	cin >> n;

	string ans = "";
	for(int i=0; i<n.size(); i++) {
		if(n[i] == '1') ans += '9';
		else ans += '1';
	}

	cout << ans;
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int day=0,win=0,lose=0;
  string s;
  cin>>s;
  for(int i=0; i<s.size(); i++){
    if(s[i]=='o'){
      win++;
    }else{
      lose++;
    }
    day++;
  }
  if(15-day+win>=8){
    cout<<"YES"<<'\n';
  }else{
    cout<<"NO"<<'\n';
  }
  return 0;
}


Measured memory_bytes: 256
from queue import Queue
INF = 10 ** 6 + 1
H, W, K = map(int,input().split())
x1, y1, x2, y2 = map(int,input().split())
MAP = []
for _ in range(H):
    MAP.append(list(input()))
D = [[INF for i in range(W)] for j in range(H)]
D[x1-1][y1-1] = 0
tx = [1,0,-1,0]
ty = [0,1,0,-1]

q = Queue()
q.put([x1-1,y1-1,0])

while not q.empty():
    x, y, k = q.get()
    if x == x2 - 1 and y == y2 - 1:
        break
    for i in range(4):
        nx = x
        ny = y
        for _ in range(K):
            nx += tx[i]
            ny += ty[i]
            if (not (0 <= nx <= H-1 and 0 <= ny <= W-1)) or MAP[nx][ny] == '@' or D[nx][ny] < k + 1:
                break
            if D[nx][ny] == k + 1:
                continue
            D[nx][ny] = k + 1
            q.put([nx, ny, k+1])

if D[x2-1][y2-1] == INF:
    print(-1)
else:
    print(D[x2-1][y2-1])

Measured memory_bytes: 170280
n,m = map(int, input().split())
if m == 1 and n == 1:
    print(0)
elif m < 2:
    print(n*(n-1)//2)
elif n < 2:
    print(m*(m-1)//2)
else:
    print(n*(n-1)//2 + m*(m-1)//2)

Measured memory_bytes: 2940
#include<bits/stdc++.h>
#include<vector>
#include<list>
#include<stack>
#include<queue>
#include<algorithm>
using namespace std;

//typedef int kz;
//typedef long kz;
typedef long long kz;

kz gcd(kz a,kz b) { if(b==0) return a; else gcd(b,a%b); }
kz lcm(kz a,kz b) { return a*b/gcd(a,b); }

/**
 * vector<int>ar(3);
 * for(auto&e:ar){
 *     scanf("%d",&e);
 * }
 * sort(ar.begin(),ar.end())
 * int sum=accumulate(ar.begin(),ar.end(),0);
 **/


int main(){
    int mod=1000000007;
    int a,b;
    while ((scanf("%d %d",&a,&b))!=EOF) {
        printf("%d %d\n",gcd(max(a,b),min(a,b)),lcm(max(a,b),min(a,b)));
    }
    return 0;
}

Measured memory_bytes: 3164
import java.util.Scanner;

public class Main {

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

		while (sc.hasNext()) {
			int d = sc.nextInt();
			System.out.println(integ(d));
		}
	}

	public static long integ(int d) {
		int x = d;
		long ans = 0;
		while (x != 600) {
			ans += x*x * d;
			x = x + d;
		}
		return ans;
	}
}

Measured memory_bytes: 26156
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
		String s;
		while ((s = stdIn.readLine()) != null) {
			String[] ss = s.split(" ");
			int vn = Integer.valueOf(ss[0]);
			int vm = Integer.valueOf(ss[1]);

			Vect vect1 = new Vect();
			for (int i = 0; i < vn; i++)
				vect1.addRow(stdIn.readLine());

			Vect vect2 = new Vect();
			for (int i = 0; i < vm; i++)
				vect2.addRow(stdIn.readLine());

			Vect vect3 = new Vect();
			vect3.multi(vect1, vect2);
		}
		System.exit(0);
	}
}

class Vect {
	List<Vrow> rows = new ArrayList<Vrow>();

	public void addRow(String row) {
		Vrow r = new Vrow(row);
		rows.add(r);
	}

	public void multi(Vect vect1, Vect vect2) {
		for (int r = 0; r < vect1.getRcount(); r++) {
			for (int c = 0; c < vect2.getCcount(); c++) {
				int e = 0;
				for (int i = 0; i < vect2.getRcount(); i++)
					e += (vect1.getElem(r, i) * vect2.getElem(i, c));
				if (c > 0)
					System.out.print(" ");
				System.out.print(e);
			}
			System.out.println("");
		}
	}

	private int getRcount() {
		return rows.size();
	}

	private int getCcount() {
		return rows.get(0).getCcount();
	}

	public int getElem(int r, int c) {
		return rows.get(r).get(c);

	}
}

class Vrow {
	List<Integer> elem = new ArrayList<Integer>();

	public Vrow(String row) {
		String[] rows = row.split(" ");
		for (int i = 0; i < rows.length; i++)
			elem.add(Integer.valueOf(rows[i]));
	}

	public int getCcount() {
		return elem.size();
	}

	public int get(int c) {
		return elem.get(c);
	}
}

Measured memory_bytes: 28168
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll dp[105][5][2];
int main() {
	string s;
	int k;
	cin >> s >> k;
	int n = s.size();
	dp[0][0][1] = 1;
	for(int i = 0; i < n; ++i) {
		for(int j = 0; j < 4; ++j) {
			int b = s[i] - '0';
			if(b) {
				dp[i + 1][j][0] += dp[i][j][1];
				dp[i + 1][j][0] += dp[i][j][0];
				dp[i + 1][j + 1][0] += dp[i][j][1] * (b - 1);
				dp[i + 1][j + 1][0] += dp[i][j][0] * 9;
				dp[i + 1][j + 1][1] += dp[i][j][1];
			} else {
				dp[i + 1][j][1] += dp[i][j][1];
				dp[i + 1][j][0] += dp[i][j][0];
				dp[i + 1][j + 1][0] += dp[i][j][0] * 9;
			}
		}
	}
	cout << dp[n][k][0] + dp[n][k][1] << '\n';
	return 0;
}


Measured memory_bytes: 256
from collections import defaultdict
def main(n, m):
    b = [int('0b' + input(), 0) for i in range(n)]
    ans = 0
    d = defaultdict(int)
    d[0] = 0
    for i in b:
        nd = defaultdict(int)
        for k, v in d.items():
            nd[k] = v
        for key, value in d.items():
            nd[key ^ i] = max(nd[key ^ i], value + 1)
        d = nd
    print(d[0])
    

if __name__ == "__main__":
    while 1:
        n,m = map(int, input().split())
        if n == 0: break
        main(n,m)


Measured memory_bytes: 161632
import { readFileSync } from "fs";

const [cin, nCin, biCin] = (() => {
  const inputs = readFileSync("/dev/stdin", "utf-8").split(/[\n|\s]/);
  let count = 0;
  const getInput = () => inputs[count++];
  return [() => getInput(), () => Number(getInput()), () => BigInt(getInput())];
})() as [() => string, () => number, () => bigint];

const range = (n: number | bigint) => [...Array(Number(n))].map((_, i) => i);

/**
 * Program
 */
const getName = (n: bigint): string => {
  const alphabets = range(26).map((i) => String.fromCharCode("a".charCodeAt(0) + i));
  const getName = (n: bigint, l: bigint): string => {
    const m = 26n ** l;
    return n <= m
      ? range(l).reduce(
          ({ num, str }, _) => ({
            num: num / 26n,
            str: alphabets[Number(num % 26n)] + str,
          }),
          { num: n - 1n, str: "" }
        ).str
      : getName(n - m, l + 1n);
  };
  return getName(n, 1n);
};

{
  const N = biCin();
  console.log(getName(N));
}


Measured memory_bytes: 29604
#include <iostream>

using namespace std;

int main(void) {
  uint64_t N;
  cin >> N;

  uint64_t fN = 0;
  auto temp = N;
  while(temp > 0){
      fN += temp % 10;
      temp /= 10;
  }
  cout << ((N % fN) == 0 ? "Yes" : "No") << endl;

  return 0;
}

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

int main()
{
    vector<int> n(5);
    rep (i, 5)
        cin >> n[i];

    rep (i, 5)
        if (n[i] == 0)
            cout << i + 1 << endl;

    return 0;
}

Measured memory_bytes: 3512
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
using namespace std;

int main()
{
    int N;
    cin >> N;
    vector<int> d;

    for (int i = 0; i < N; i++)
    {
        int z;
        cin >> z;
        d.push_back(z);
    }

    sort(d.begin(), d.end());

    int count = 0;
    int max = 0;

    for (int i = 0; i < N; i++)
    {
        if (d[i] > max)
        {
            count++;
            max = d.at(i);
        }
    }

    cout << count << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
map<int,int>m;
vector<int>vec;
int main(){
	int n,t;
	scanf("%d",&n);
	for(int i = 0;i<n;i++){
		scanf("%d",&t);
		m[t]++;
	}
	for(auto it= m.begin();it!=m.end();it++){
		if((*it).second > 1) vec.push_back((*it).first);
	}
	ll ans = 0;
	int sz = vec.size();
	if(sz > 0 && m[vec[sz-1]] >= 4){
		ans = 1LL *  vec[sz-1]*vec[sz-1]; 
	}
	sort(vec.begin(),vec.end());
	if(sz > 1){
		ans = max(ans,1LL * vec[sz-1] * vec[sz-2]);
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 4992
#include<stdio.h>

int main()
{
	int n, m;
	int ans = 1;
	scanf("%d %d", &n, &m);
	
	for(int i = 0; i < n; i++){
		if(ans <= m){
			ans *= 2;
		}else{
			ans += m;
		}
	}
	printf("%d\n", ans);
}

Measured memory_bytes: 1728
#include <stdio.h>
int main(){
  int n,i,k,max,min,j,sum,summ;
  while(1){scanf("%d",&n);
  max=0;
  min=500;
  if(n==0){
    return 0;
  }
  for(j=0;j<n;j++){
    sum=0;
    summ=0;
     for(i=0;i<5;i++){
       scanf("%d",&k);
       sum+=k;
       summ+=k;
}
     if(sum>max){
       max=sum;
     }
     if(summ<min){
       min=summ;
     }
  }
  printf("%d %d\n",max,min);
  }
return 0;
}

Measured memory_bytes: 600
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) std::cout << x << '\n'
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define sz(x) ((int)(x).size())
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; }
const int dx[4] = { 1, 0, -1,  0 };
const int dy[4] = { 0, 1,  0, -1 };
const int INF = INT_MAX / 2;
const ll  inf = LLONG_MAX / 2;
const int mod = 1000000007;
const int MAX_N = 101010;
const double PI = acos(-1);

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(10);
	/*------------------------------*/

	int k;
	string s;
	cin >> k >> s;

	if (sz(s) > k) {
		s = s.substr(0, k);
		s += "...";
	}

	out(s);

	return 0;
}

Measured memory_bytes: 3660
def run_length_encoding(s):
    '''連長圧縮を行う
    s ... iterable object e.g. list, str
    return
    ----------
    s_composed,s_num,s_idx
    それぞれ、圧縮後の文字列、その文字数、その文字が始まるidx'''
    from itertools import groupby
    s_composed, s_sum = [], []
    s_idx = [0]
    for k, v in groupby(s):
        s_composed.append(k)
        n = len(list(v))
        s_sum.append(n)
        s_idx.append(s_idx[-1] + n)

    # assert len(s_sum) == len(s_composed)
    return s_composed, s_sum, s_idx


S_composed, _, _ = run_length_encoding(input())
print(len(S_composed) - 1)


Measured memory_bytes: 14444
#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long
#define maxn 100000
using namespace std;

ll ar[2*maxn+5],pr[2*maxn+5];
int n;
ll tree[maxn*8+2];
void update(int node,int b,int e,int i,ll val)
{
    if(i>e || b>i) return;
    if(b>=i && e<=i) {
        tree[node]+= val;
        return;
    }
    int left = node*2;
    int right = node*2+1;
    int mid = (b+e)/2;
    update(left,b,mid,i,val);
    update(right,mid+1,e,i,val);
    tree[node] = max(tree[left],tree[right]);
}

ll query(int node,int b,int e,int i,int j)
{
    if(i>e || b>j) return 0;
    if(b>=i && e<=j) return tree[node];
    int left = node*2;
    int right = node*2 + 1;
    int mid= (b+e)/2;
    ll q1 = query(left,b,mid,i,j);
    ll q2 = query(right,mid+1,e,i,j);
    return max(q1,q2);
}


int main()
{
    int n;
    cin>>n;
    for(int i=1;i<=n;i++) cin>>ar[i];
    for(int i=1;i<=n;i++) cin>>pr[i];
    ll mx = 0;
    for(int i=1;i<=n;i++) {
        update(1,1,n,ar[i],pr[i]);
        ll maxVal = query(1,1,n,1,ar[i]-1);
        update(1,1,n,ar[i],maxVal);
        mx = max(mx,maxVal+pr[i]);
    }
    cout<<mx<<endl;
}


Measured memory_bytes: 9600
#include <cstdio>
int map[4][4];
int sum;
int main ()
{
	scanf ("%d%d%d",&map[1][1],&map[1][2],&map[2][2]);
	for (int i=1;i<=101;i++)
	{
		map[3][3]=i;
		sum=map[1][1]+map[2][2]+i;
		map[1][3]=sum-map[1][1]-map[1][2];
		map[3][1]=sum-map[1][3]-map[2][2];
		map[2][1]=sum-map[1][1]-map[3][1];
		if (map[1][3]+map[3][3]==map[2][2]+map[2][1])
		{
			map[2][3]=sum-map[1][3]-map[3][3];
			if (map[1][2]+map[2][2]==map[3][1]+map[3][3])
			{
				map[3][2]=sum-map[1][2]-map[2][2];
				for (int j=1;j<=3;j++)
					printf ("%d %d %d\n",map[j][1],map[j][2],map[j][3]);
				return 0;	
			}
		}
	}
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
 
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1000000;
 
signed main()
{
    int n; cin >> n;
    int dp[101]{0};
    rep(i,9) rep(j,9) {
        dp[(i+1) * (j+1)] = 1;
    }
    
    string ans;
    if (dp[n] == 1) {
        ans = "Yes";
    } else {
        ans = "No";
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define rv(s) reverse(s.begin(),s.end());
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
 
int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
 
int main()
{
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  
  string s;cin>>s;
  int n=s.size();
  
  int ans=0;
  rep(i,n){
    if(s[i]=='0')ans++;
  }
  chmin(ans,n-ans);
  cout(ans*2);
}

Measured memory_bytes: 512
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<list>
#include<stack>
//#include<unordered_map>
using namespace std;
#define ll long long
#define dd cout<<endl
#define lll __int128
const int mod=1e9+7;
const int inf=1e9+7;

//const int maxn=

int main()
{
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    
    int n,h;
    
    cin>>n>>h;
    int cnt=0;
    
    int x;
    
    for(int i=0;i<n;i++)
    {
    	cin>>x;
    	if(x>=h)
    		cnt++;
	}
	
	cout<<cnt<<endl;

    return 0;
}

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

int main() {
	int n, m;							//調査時間n、トンネル内の台数mを定義
	cin >> n >> m;

	int x = m;							//トンネル内の最大台数xを定義
	int y = 0;							//トンネル内の0以下台数yを定義

	for (int i = 0; i < n; i++) {
		int in, out;					//入口in、出口outを定義
		cin >> in >> out;
		m = m + in - out;				//[トンネル内の台数]＝[トンネル内の台数]＋[入って来た台数]ー[出て行く台数]
		x = max(x, m);
		y = min(y, m);
	}

	if (y < 0) cout << 0 << endl;
	else cout << x << endl;

	return 0;
}



Measured memory_bytes: 3100