akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <utility>
#include <algorithm>
#include <string>
#include <set>
#include <random>
using namespace std;

int main() {
  int N;
  cin >> N;
  int tmp = N;
  int d   = 0;
  while (tmp > 0) {
	  d   += tmp % 10;
	  tmp /= 10;
	}
  if (N % d == 0) {
	  cout << "Yes" << endl;
	} else {
	  cout << "No" << endl;
	}
  return 0;
}


Measured memory_bytes: 256
#ifdef Rahul
# include "RAHUL.h"
#else
# include <bits/stdc++.h>
  using namespace std;
# define error(...) 42;
#endif
#define SZ(v) int((v).size())
#define ALL(vec) begin(vec), end(vec)
typedef long long i64;
template<typename T> inline bool uax(T &x, T y) {return (y > x) ? x = y, true : false;}
template<typename T> inline bool uin(T &x, T y) {return (y < x) ? x = y, true : false;}
template<typename T> void kek(T ans) {cout << ans << endl; exit(0);}
#define Lu(...) [&] (auto &&u) { return __VA_ARGS__; }
#define Luv(...) [&] (auto &&u, auto &&v) { return __VA_ARGS__; }
const int MOD = (int) 1e9 + 7;
const i64 INF = (i64) 1e18 + 42;


int main() {
  cin.tie(nullptr) -> sync_with_stdio(false);
  
  int n;
  cin >> n;
  i64 ans = 1;
  while (n--) {
    i64 x; cin >> x;
    if (x == 0) kek(0);
    if (ans == -1 or ans > INF / x) ans = -1;
    else ans *= x;
  }
  if (ans > (i64) 1e18) ans = -1;
  kek(ans);
}


Measured memory_bytes: 3656
def main():
    n = int(input())
    taro = 0
    hanako = 0
    for _ in range(0, n):
        taroCard, hanakoCard = input().split()
        if taroCard < hanakoCard:
            hanako += 3
        elif taroCard > hanakoCard:
            taro += 3
        else:
            taro += 1
            hanako += 1
    print("{0} {1}".format(taro, hanako))

if __name__ == '__main__':
    main()



Measured memory_bytes: 5600
#include <iostream>
#include <vector>
#include <string>
#include <queue>

using namespace std;

using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;

int main(int argc, char* argv[]) {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  i64 N, K;
  cin >> N >> K;
  
  if(N < K) {
    cout << 0 << endl;
    return 0;
  }
  
  priority_queue<i64> h;
  for(i64 i = 0; i < N; ++i) {
    i64 H;
    cin >> H;
    h.push(H);
  }
  for(i64 i = 0; i < K; ++i) h.pop();
  i64 ans = 0;
  for(i64 i = 0; i < N-K; ++i) {
    ans += h.top();
    h.pop();
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 2420
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
signed main(){
  ll n,l,ind=-1;
  cin >> n >> l;
  ll a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
    if(i!=0){
      if(a[i]+a[i-1]>=l){
        ind = i;
      }
    }
  }
  if(ind==-1){
    cout << "Impossible\n";
    return 0;
  }
  cout <<"Possible\n";
  for(int i=1;i<ind;i++){
    cout << i<<endl;
  }
  for(int i=n-1;i>ind;i--){
    cout << i<<endl;
  }
  cout << ind <<endl;
}


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

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

fn main() {
    input!(
    a: usize,
    b: usize,
    c: usize,
    x: usize,
    );
    let mut count = 0;
    for i in 0..a+1{
        let mut a_s = 0;
        a_s += 500 * i;
        if a_s == x {
            count += 1;
            break;
        } else if a_s > x {
            break;
        }
        for j in 0..b+1{
            let mut ab_s = a_s;
            ab_s += 100 * j;
            if ab_s == x {
                count += 1;
                break;
            } else if ab_s > x {
                break;
            }
            for k in 0..c+1{
                let mut abc_s = ab_s;
                abc_s += 50 * k;
                if abc_s == x {
                    count += 1;
                    break;
                } else if abc_s > x {
                    break;
                }
            }
        }
    }
    println!("{}", count);
}


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

using namespace std;
using ll = long long;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, K;
  cin >> N >> K;
  ll res = 0;
  for (int b = K + 1; b <= N; b++)
    res += 1LL * N / b * (b - K) + max(0, N % b - K + 1);
  if (K == 0) res -= N;
  cout << res << '\n';
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define F first
#define S second
#define PB push_back
#define REP(i,a,b) for (int i = a ; i <= b ; i++)
#define REPI(i,a,b) for (int i = a ; i >= b ; i--)
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

const int OO = 1e9+7;
const int MOD = 1e9+7;
const int N = 3e3+7;

int n;
double p[N];
double dp[N][N];


int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    //freopen("teleport.in","r",stdin);
    //freopen("teleport.out","w",stdout);

    cin >> n;
    REP(i,0,n-1) cin >> p[i];

    // dp[i][j] = prob of having j heads for prefix i
    dp[0][1] = p[0];
    dp[0][0] = 1-p[0];
    REP(i,1,n-1)
    {
        REP(j,0,i)
        {
            dp[i][j] += dp[i-1][j]*(1-p[i]);
            dp[i][j+1] += dp[i-1][j]*p[i];
            //cout << i << ' ' << j << ' ' << dp[i][j] << endl;
        }
    }
    double ans = 0;

    REP(j,(n/2)+1,n)
    {
        ans += dp[n-1][j];
    }
    cout << fixed << setprecision(9) << ans << endl;
    return 0;
}


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

typedef long long ll;
string s[100005];
ll m = 0,a = 0,r = 0, c = 0, h = 0;
int main(){
int n;
cin >> n;
for(int i = 0; i < n; i++) cin >> s[i];
for(int i = 0; i < n; i++) {
  if(s[i][0] == 'M')m++;
  if(s[i][0] == 'A')a++;
  if(s[i][0] == 'R')r++;
  if(s[i][0] == 'C')c++;
  if(s[i][0] == 'H')h++;
}
ll ans = 0;
ans += m * a * r;
ans += m * a * c;
ans += m * a * h;
ans += a * r * c;
ans += a * r * h;
ans += r * c * h;
ans += m * r * c;
ans += m * r * h;
ans += m * c * h;
ans += a * c * h;
cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6144
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <algorithm>
#include <stdint.h>
#include <queue>
#include <bitset>
#include <iomanip>
#include <set>
#include <map>

using namespace std;

#define PI (3.14159265358979323846)
#define INF (2147483647)
#define INF_LL (9223372036854775807)
#define DIV_NUM (1000000007)
typedef long long ll;

// 配列初期化テンプレ
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T& val) {
	std::fill((T*)array, (T*)(array + N), val);
}



int main() {
	int x;
	cin >> x;
	cout << x*x*x << endl;
	return 0;

}



Measured memory_bytes: 3088
S = input()

cnt1=0
start="1"
for i in range(len(S)):
    if i%2==0:
        if S[i]!=start:
            cnt1+=1
    else:
        if S[i]==start:
            cnt1+=1
cnt2=0
start="0"
for i in range(len(S)):
    if i%2==0:
        if S[i]!=start:
            cnt2+=1
    else:
        if S[i]==start:
            cnt2+=1
if cnt1 < cnt2:
    print(cnt1)
else:
    print(cnt2)


Measured memory_bytes: 3188
#include<stdio.h>
#include<ctype.h>
#include<algorithm>
using namespace std;
#define MAX(c,s) *std::max_element(c,c+s)
const int N=301;
int main()
{
	int n,m,c,v,d,l,i;
	while(scanf("%d%d",&n,&m)>0)
	{
		int V[N]={0},D[N]={0},L[N]={0};
		while(n--)
		{
			while(!isdigit(c=getchar()));
			ungetc(c,stdin);
			scanf("%d%d%d%d",&c,&v,&d,&l);
			D[c]=max(d,D[c]);
			V[c]=max(v,V[c]);
			L[c]=max(l,L[c]);
			for(i=0;i<=m-c;++i)
			{
				if(D[i])D[i+c]=max(D[i+c],D[i]+d);
				if(V[i])V[i+c]=max(V[i+c],V[i]+v);
				if(L[i])L[i+c]=max(L[i+c],L[i]+l);
			}
		}
		printf("%d\n",max(MAX(D,m+1),max(MAX(V,m+1),MAX(L,m+1))));
	}
	return 0;
}

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

namespace ConsoleApp10
{
    class Program
    {
        static void MainA(string[] args)
        {
            Console.WriteLine(Console.ReadLine().ToCharArray().Zip(Console.ReadLine().ToCharArray(), (x, y) => x == y).Count(x => x));
        }

        static void Main()
        {
            var arr=Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
      var ans =     (arr[1] - 1 + arr[0] - 2) / (arr[0] - 1);
            Console.WriteLine(ans);
        }
    }
}


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

int main() {
  std::string S;
  std::cin >> S;

  switch (S[0]) {
    case 'S':  // SUN or SAT
      switch (S[1]) {
        case 'U':  // SUN
          std::cout << '7';
          break;
        case 'A':  // SAT
          std::cout << '1';
          break;
      }
      break;
    case 'M':  // MON
      std::cout << '6';
      break;
    case 'T':  // TUE or THU
      switch (S[1]) {
        case 'U':  // TUE
          std::cout << '5';
          break;
        case 'H':  // THU
          std::cout << '3';
          break;
      }
      break;
    case 'W':  // WED
      std::cout << '4';
      break;
    case 'F':  // FRI
      std::cout << '2';
      break;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
//typedef pair<int,int> P;
//priority_queue<int> pque;
//priority_queue<int, vector<int>, greater<int>> pque;
ll INFL = 1000000000000000010;//10^18 = 2^60
int INF = 2000000000;//10^9
ll MOD  = 1000000007;

int H,W;
char mp[1010][1010];
ll dp[1010][1010];

ll solve(int H, int W){
    
    
    
    dp[0][0] = 1;
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            if( (i+j) != 0 ){
                if(mp[i][j] == '.'){
                    if(i == 0){
                        dp[i][j] = dp[i][j-1];
                    }else if(j == 0){
                        dp[i][j] = dp[i-1][j];
                    }else{
                        dp[i][j] = (dp[i-1][j] + dp[i][j-1]) % MOD;
                    }
                }
            }
        }
    }
    return dp[H-1][W-1];
}

int main(void){
    cin >> H >> W;
    for(int i = 0; i < H; i++){
        for(int j = 0; j < W; j++){
            cin >> mp[i][j];
        }
    }
    cout << solve(H, W) << endl;
}


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

int gcd(int a, int b) { return b==0 ? a : gcd(b, a%b); }
int lcm(int a, int b) { return a/gcd(a, b)*b; }

int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	int n, ans;
	cin>>n;
	int a, b;
	cin>>a>>b;
	ans=lcm(a, b); n-=2;
	while(n--) {
		int x;
		cin>>x;
		ans=lcm(ans, x);
	}
	cout<<ans<<'\n';
	return 0;
}


Measured memory_bytes: 3220
#include <bits/stdc++.h>
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define rep(i, a, b) for(i = a; i < b; i++)
#define per(i, a, b) for(i = a; i >= b; i--)
#define all(x) x.begin(), x.end()
#define trav(x, it) for(auto it = x.begin(); it != x.end(); it++)
#define pr(x) cout << #x << " = " << x << endl
#define fill(x,y) memset(x,y,sizeof(x))
#define endl "\n"
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector< pii > vpii;
typedef vector< pll > vpll;
double eps = 1e-7;
ll mod = 1000000007;
ll N = 998244353;

ll binpow(ll b, ll p){ ll ans = 1; while(p > 0){if(p & 1) ans = (ans * b) % mod; b = (b * b) % mod; p >>= 1;}return ans;}
ll modinv(ll x){return binpow(x, mod - 2);}

void solve()
{
	ll n, i, a;
	cin >> n;
	ll arr[n];
	ll ans = 1;
	int f = 0;
	rep(i, 0, n)
	{
		cin >> arr[i];
		if(arr[i] == 0)
			f = 1;
		
	}
	if(f)
	{
		cout << 0 << endl;
		return;
	}
	rep(i, 0, n)
	{
		if(arr[i] <= ((ll)1e18 / ans))
			ans *= arr[i];
		else
		{
			cout << -1 << endl;
			return;
		}
	}
	cout << ans << endl;
}

signed main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

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

Measured memory_bytes: 4432
#include <iostream>
#include <sstream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <bitset>
#include <assert.h>
#include <deque>
using namespace std;

typedef unsigned long long UL;
typedef long long LL;
#define LP(i, a, b) for (int i = int(a); i < int(b); i++)
#define LPE(i, a, b) for (int i = int(a); i <= int(b); i++)
typedef pair<int, int> PII;
typedef vector<vector<PII> > WAL;
typedef vector<vector<int> > SAL;
#define Ep 1e-7

#define INF 1e16

/*
 */

int const MaxSize = 200 + 10;
set<PII> done;

int go(int a, int b, int c) {
	if(a > b)
		swap(a, b);
	if(a > c)
		swap(a, c);
	if(b > c)
		swap(b, c);

	PII step = PII(a, b);

	if (done.count(step))
		return -1;
	else
		done.insert(step);

	if (a % 2 || b % 2 || c % 2)
		return 0;
	else {
		int nextA = b / 2 + c / 2;
		int nextB = a / 2 + c / 2;
		int nextC = a / 2 + b / 2;

		int nextRes = go(nextA, nextB, nextC);

		if (nextRes < 0)
			return -1;
		else
			return 1 + nextRes;
	}
}

//0 if c, 1 if j
int main() {

	ios_base::sync_with_stdio(false);
	//freopen("/Users/george/A_1.in", "r", stdin);

	int A, B, C;
	cin >> A >> B >> C;

	cout << go(A, B, C) << endl;

	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <cmath>
#include <algorithm>

int main(){
	int n,tmp,count = 0,limit;
	scanf("%d",&n);

	for(int i = 0; i < n; i++)
	{
		scanf("%d",&tmp);
		limit = sqrt(tmp);
		for(int j = 2; j <= limit; j++){
			if(tmp%j==0){
				count++;
				break;
			}
		}
	}
	printf("%d\n",n-count);
}


Measured memory_bytes: 2756
Q = int(input())

L = []
R = []
for i in range(Q):
    l, r = map(int, input().split())
    L.append(l)
    R.append(r)


def primes(max_r):
    is_prime = [True] * (max_r + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(max_r**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, max_r + 1, i):
            is_prime[j] = False
    return [i for i in range(max_r + 1) if is_prime[i] and is_prime[(i+1)//2]]


max_r = max(R)
ps = primes(max_r)

S = [0]
for i in range(1, max_r+1):
    if i in ps:
        S.append(S[i-1]+1)
    else:
        S.append(S[i-1])


for i in range(Q):
    print(S[R[i]] - S[L[i]-1])


Measured memory_bytes: 18000
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll x,y,z;
    cin>>x>>y>>z;
    ll sum=x+y+z;
    if(sum>=22) cout<<"bust"<<endl;
    else cout<<"win"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
static const int MAX=1000;
static const int VAMX=10000;

int n,A[MAX],s;
int B[MAX],T[VAMX+1];


int solve(){
    int ans=0;
    bool V[MAX];
    for(int i=0;i<n;i++){
        B[i]=A[i];
        V[i]=false;
    }
    sort(B,B+n);//sort(排序数组头,排序数组尾)
    for(int i=0;i<n;i++) T[B[i]] = i;
    for(int i=0; i<n; i++){
        if(V[i]) continue;
        int cur=i;
        int S=0;
        int m=VAMX;
        int an = 0;
        while(1){
            V[cur] = true;
            an++;
            int v = A[cur];
            m = min(m,v);
            S+=v;
            cur = T[v];
            if(V[cur]) break;
        }
        ans +=min(S + (an - 2)*m,m + S+(an+1)*s);
    }

    return ans;
}


int main(){
    cin >> n;
    s  = VAMX;
    for(int i=0; i<n; i++){
        cin>>A[i];
        s=min(s,A[i]);
    }
    int ans =solve();
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3184
#include<stdio.h>
 
int main(){
	long long int x,y;
	scanf("%lld%lld",&x,&y);
	long long int z=y/x,s=1,s1=0;
	while(s<=z){
		s*=2,++s1;
	}
	printf("%lld\n",s1);
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
#define int long long
#define mod 1000000007
#define for0(i, n) for(int i = 0; i < (n); i++)
#define for1(i, n) for(int i = 1; i <= (n);i++)
#define mp make_pair
#define all(x) x.begin(),x.end()
using namespace std;
int input() {
	int r;
	cin >> r;
	//scanf("%lld", &r);
	return r;
}
int l, n, rm, lm;
signed main() {
	cin >> l >> n;
	while (n--) {
		int x, w; cin >> x >> w;
		if (x < 0)lm += -x * w;
		if (x > 0)rm += x * w;
	}
	if (lm > rm) {
		cout << (lm - rm + 49999) / 50000 << endl;
		while (rm + 50000 <= lm) {
			cout << "1 50000\n";
			rm += 50000;
		}
		cout << "1 " << lm - rm << endl;
	}
	else if (lm < rm) {
		swap(lm, rm);
		cout << (lm - rm + 49999) / 50000 << endl;
		while (rm + 50000 <= lm) {
			cout << "-1 50000\n";
			rm += 50000;
		}
		cout << "-1 " << lm - rm << endl;
	}
	else printf("0\n");
}


Measured memory_bytes: 3132
import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException{

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();
    long count = 1;

        while(true){
            int x = Integer.parseInt(br.readLine());
            if(x == 0) break;
                sb.append("Case "+ count +": "+ x + "\n");
                count++;
        }
        System.out.print(sb);
    }
}

Measured memory_bytes: 31480
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define mod 1000000007
#define INF 1000000000
#define LLINF 2000000000000000000LL

#define SIZE 100000

int main(){
    int n,a,b;
    int m,x[10],y[10],z[10],k;
    
    scanf("%d%d%d%d",&n,&a,&b,&m);
    
    for(int i=0;i<m;i++){
        scanf("%d%d%d",&x[i],&y[i],&z[i]);
    }
    
    scanf("%d",&k);
    
    for(int i=m-1;i>=0;i--){
        if(x[i]==0){
            if(y[i]==k){
                k=z[i];
            }else if(z[i]==k){
                k=y[i];
            }
        }else{
            if(y[i]==k){
                k=z[i];
            }
        }
    }
    
    printf("%lld\n",a+(ll)b*(k-1));
    
    return 0;
}

Measured memory_bytes: 1192
while True:

    h = input()
    if h == '-':
        break
    n = int(input())
    shuffle_times = [int(input()) for _ in range(n)]
        
    for shuffle_time in shuffle_times:
            if shuffle_time == 1:
                h = h[shuffle_time:] + h[0]
            else:
                h = h[shuffle_time:] + h[:shuffle_time]
    print(h)


Measured memory_bytes: 5600
package main

import (
	"fmt"
)

func main() {
  var n string
  fmt.Scanf("%s", &n)
  
  ans := "Yes"
  for i := 0; i < len(n) / 2; i++{
    if n[i] != n[len(n)-1-i] {
      ans = "No"
    }
  }
  fmt.Printf("%s\n", ans)
}

Measured memory_bytes: 1832
#include <bits/stdc++.h>
using namespace std;
int n,i,j,l,lg,lgmaxi;
char sir[11];
int main()
{
    cin>>sir;
    l=strlen(sir);
    for(i=0;i<l;i++)
        if(sir[i]=='A' || sir[i]=='C' || sir[i]=='G' || sir[i]=='T')
        {
            lg=0;
            j=i;
            while(sir[i]=='A' || sir[i]=='C' || sir[i]=='G' || sir[i]=='T')
                i++ , lg++;
            i--;
            if(lg>lgmaxi)
                lgmaxi=lg;
        }
    cout<<lgmaxi;
    return 0;
}


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

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a, b;
    string s;
    cin >> a >> b;

    cout << a * (a - 1) / 2 + b * (b - 1) / 2 << 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 < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

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


	int N;
	cin >> N;
	int L[2000];
	rep(i, N) cin >> L[i];
	sort(L, L + N);

	ll kotae = 0;
	rep(i, N) rep(j, i) {
		int a = L[i];
		int b = L[j];
		if (a > b) swap(a, b);

		int wa = a + b;
		int sa = b - a;
		int k = lower_bound(L, L + N, wa) - upper_bound(L, L + N, sa);
		if (a + a > b) k--;
		k--;

		kotae += k;

	}
	co(kotae / 3);

	Would you please return 0;
}

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

#define ll long long int
vector<int> ad[29];

int main()
{
    int  a,p,q,i,j,k,n,m,x,y;

    string str,test;
    cin>>str>>test;
    int len=str.length();
    int lent=test.length();

    for(int i=0;i<len;i++){
        ad[(str[i]-'a')].push_back(i);
    }

    ll ct=0;
    int last=-1;
    bool bl=true;
    for(i=0;i<lent;){
        int id=test[i]-'a';
        if(ad[id].size()==0){
            bl=false;
            break;
        }

        vector<int> :: iterator it=upper_bound(ad[id].begin(),ad[id].end(),last);
        if(it==ad[id].end()){
            last=-1;
            ++ct;
        }
        else{
            last=ad[id][it-ad[id].begin()];
            ++i;
        }
    }

    if(!bl) cout<<"-1\n";
    else{
        ll ans=ct*len;
        ans+=(last+1);
        cout<<ans<<'\n';
    }
}


Measured memory_bytes: 4252
n = int(input())
s = set()
s.add(n)
ret = 1
while True:
    ret += 1
    if n % 2 == 0:
        n = n // 2
    else:
        n = 3 * n + 1
    if n in s:
        break
    s.add(n)
print(ret)       

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
//One-stroke Path

int cnt = 0;
vector<bool> use;

void calc(vector<vector<int> > &G, int n, vector<int> &E){
    if(E.size() == G.size()){
        bool is_unique = true;
        for(auto e : E){
            if(use[e] != false){
                is_unique = false;
            }
            use[e] = true;
        }
        if(is_unique){
            // for(int i  = 0; i < E.size();++i) cout << E[i] + 1 << " ";
            // cout << endl;   
            cnt++;
        }
        for(int i  = 0; i < use.size();++i)use[i] = false;
        return;
    }

    for(auto e : G[n]){
        bool is_exist = false;
        for(int i = 0; i < E.size(); ++i){
            if(e == E[i])is_exist = true;
        }
        if(is_exist)continue;
        E.push_back(e);
        calc(G, e, E);
        E.pop_back();
    }
    return;
}

int main(){
    int N, M;
    cin >> N >> M;
    vector<vector<int> > G(N);
    for(int i = 0; i < M; ++i){
        int a, b;
        cin >> a >> b;
        G[a - 1].push_back(b - 1);
        G[b - 1].push_back(a - 1);
    }
    
    use.assign(N, false);
    vector<int> E;
    E.push_back(0);
    calc(G, 0, E);
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll inf=1e9+7;
const ll mod=998244353;
int main(){
    ll n;cin>>n;
    vector<ll>a(n+1);
    ll ma=0;
    rep(i,n){
        ll b;cin>>b;
        a[i+1]=a[i]+b;
        ma+=b;
    }
    REP(i,3,n){
        ll x,y,w,z;
        ll r=i-1,l=0;
        while(r-l>1){
            ll k=(r+l)/2;
            if(a[k]<=a[i-1]-a[k])l=k;
            else r=k;
        }
        if(a[r]-(a[i-1]-a[r])<a[i-1]-a[l]-a[l]){
            x=a[r];
            y=(a[i-1]-a[r]);
        }else{
            x=a[i-1]-a[l];
            y=a[l];
        }
        r=n,l=i-1;
        while(r-l>1){
            ll k=(r+l)/2;
            if(a[k]-a[i-1]<a[n]-a[k])l=k;
            else r=k;
        }
        if(a[r]-a[i-1]-(a[n]-a[r])<a[n]-a[l]-(a[l]-a[i-1])){
            w=a[r]-a[i-1];
            z=(a[n]-a[r]);
        }else{
            w=a[n]-a[l];
            z=a[l]-a[i-1];
        }
        ma=min(ma,max(x,w)-min(y,z));
    }
    cout<<ma<<endl;
}

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

int main()
{
    vector <int> v;
    int n,i,l;
    cin >> n;
    for(i=0;i<n;i++) { cin >> l; v.push_back(l); }

    int x=n-1;

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

    long long int area=0;

    if(x>2)
    {
        while (v[x]!=v[x-1]&&x>0) { x--; }
        if(x!=0) area=v[x];
        x-=2;
        while (v[x]!=v[x-1]&&x>0) { x--; }
        if(x>=0) area*=v[x];
        cout << area;
    }
    else
    { cout << "0"; }
}


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

public class Main {
	
	public static void main(String[] args) throws Exception{
		FastReader in = new FastReader();
		//BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt(), k = in.nextInt();
		int[] prices = new int[n];
		for(int i = 0; i<n; i++)
			prices[i] = in.nextInt();
		Arrays.sort(prices);
		int sum = 0;
		for(int i = 0; i<k; i++)
			sum+=prices[i];
		out.println(sum);
        
		
		
		
		
		out.close();
	}
	
	static class FastReader 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastReader() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    } 
		
}


Measured memory_bytes: 33204
import std.stdio, std.string, std.conv, std.array;

string inv( string v ) {
  return to!string(2 - to!int(v));
}

string mult( string x, string y ) {
  if ( x == "0" || y == "0" ) return "0";
  else if ( x == "1" || y == "1" ) return "1";
  else return "2";
}

string add( string x, string y ) {
  if ( x == "2" || y == "2" ) return "2";
  else if ( x == "1" || y == "1" ) return "1";
  else return "0";
}

void main()
{
  while ( true ) {
	string input = strip( readln );
	if ( input == "." ) break;
	int count = 0;
	foreach ( p; [ "0", "1", "2" ] ) {
	  foreach ( q; [ "0", "1", "2" ] ) {
		foreach ( r; [ "0", "1", "2" ] ) {
		  auto exp =  replace( replace( replace( input, "P", p ), "Q", q ), "R", r );
		  Tokenizer tk = new Tokenizer( exp );
		  // stderr.writeln( exp );
		  if ( apply( tk ) == "2" ) {
			count++;
		  }
		}
	  }
	}
	writeln( count );
  }
}

class Tokenizer {
  string str;
  int index;
  this( string str ) {
	this.str = str;
	this.index = 0;
  }
  string nextToken() {
	auto ans = str[ index..index+1 ];
	index++;
	return ans;
  }
  bool eof() {
	return index == str.length;
  }
}

string apply( Tokenizer tk ) {
  if ( !tk.eof ) {
	auto nt = tk.nextToken;
	switch( nt ) {
	case "0":
	case "1":
	case "2":
	  return nt;
	case "-":
	  auto token = apply( tk );
	  return inv( token );
	case "(":
	  auto token1 = apply( tk );
	  auto op = tk.nextToken();
	  auto token2 = apply( tk );
	  tk.nextToken(); // )
	  if ( op == "+" ) {
		return add( token1, token2 );
	  } else if ( op == "*" ) {
		return mult( token1, token2 );
	  } else {
		return "";
	  }
	default:
	  return "";
	}
  } else {
	return "";
  }
}

Measured memory_bytes: 2032
using System;
using System.Collections;
using System.Collections.Generic;


public class Pair:IComparable<Pair>
{
	public long P { get; private set; }
	public int X { get; private set; }
	public int Y { get; private set; }
	public int Z { get; private set; }
	
	public Pair(long p, int x, int y, int z)
	{
		P = p;
		X = x;
		Y = y;
		Z = z;		
	}
	
	public int CompareTo(Pair a)
	{
		return P.CompareTo(a.P);	
	}
}


public class D
{	
	public static void Main()
	{
		string[] args;
		
		args = Console.ReadLine().Split(' ');
		int X = Int32.Parse(args[0]);
		int Y = Int32.Parse(args[1]);
		int Z = Int32.Parse(args[2]);
		int K = Int32.Parse(args[3]);

		List<long> A = new List<long>(X);
		args = Console.ReadLine().Split(' ');
		for(int i = 0; i < X; i++)
			A.Add(Int64.Parse(args[i]));
		
		List<long> B = new List<long>(Y);
		args = Console.ReadLine().Split(' ');
		for(int i = 0; i < Y; i++)
			B.Add(Int64.Parse(args[i]));
		
		List<long> C = new List<long>(Z);
		args = Console.ReadLine().Split(' ');
		for(int i = 0; i < Z; i++)
			C.Add(Int64.Parse(args[i]));
		
		A.Sort();
		A.Reverse();
		B.Sort();
		B.Reverse();
		C.Sort();
		C.Reverse();
		
		List<long> result = new List<long>(K);
		
		bool[,,] used = new bool[X,Y,Z];
		PriorityQueue<Pair> pqueue = new PriorityQueue<Pair>(8192,1);
		pqueue.Push(new Pair(A[0] + B[0] + C[0], 0, 0, 0));
		used[0,0,0] = true;		
		for(int i = 0; i < K; i++)
		{
			Pair max = pqueue.Pop();
			int x = max.X;
			int y = max.Y;
			int z = max.Z;
			result.Add(max.P);
			
			if((x < X-1) && !used[x+1,y,z])
			{
				pqueue.Push(new Pair(A[x+1] + B[y] + C[z], x+1, y ,z));
				used[x+1,y,z] = true;
			}
			if((y < Y-1) && !used[x,y+1,z])
			{
				pqueue.Push(new Pair(A[x] + B[y+1] + C[z], x, y+1 ,z));
				used[x,y+1,z] = true;
			}
			if((z < Z-1) && !used[x,y,z+1])
			{
				pqueue.Push(new Pair(A[x] + B[y] + C[z+1], x, y ,z+1));
				used[x,y,z+1] = true;
			}			
		}
		
		for(int i = 0; i < K; i++)
			Console.WriteLine(result[i]);		
	}	
}


public class PriorityQueue<T> where T:IComparable<T>
{
	public long Size { get; private set; } = 0;
	public long MaxSize { get; private set; } = 0;
	private T[] m_heap;
	public int Type { get; private set; } = 0;
	
	public PriorityQueue(long maxSize, int type)
	{
		if(maxSize <= 0)
			throw new Exception();
		MaxSize = maxSize;
		m_heap = new T[maxSize];
		
		Type = type;
	}
	
	private int Compare(T x, T y)
	{
		return (Type == 0) ? x.CompareTo(y) : y.CompareTo(x);
	}
	
	public void Push(T x)
	{
		if(Size == MaxSize)
			throw new Exception("Queue is full.");
		
		long i = Size++;
		while(i > 0)
		{
			long p = (i - 1)/2;
			if(Compare(m_heap[p],x) <= 0)
				break;
			m_heap[i] = m_heap[p];
			i = p;			
		}
		m_heap[i] = x;		
	}
	
	public T Pop()
	{
		if(Size == 0)
			throw new Exception("Queue is empty.");
		
		T result = m_heap[0];
		T x = m_heap[--Size];
		long i = 0;
		while(i * 2 + 1 < Size)
		{
			long c1 = i * 2 + 1, c2 = i * 2 + 2;
			if(c2 < Size && Compare(m_heap[c2], m_heap[c1]) < 0)
				c1 = c2;
			if(Compare(m_heap[c1], x) >= 0)
				break;
			m_heap[i] = m_heap[c1];
			i = c1;
		}
		m_heap[i] = x;
		
		return result;		
	}	
}





Measured memory_bytes: 986456
import sys
input=sys.stdin.readline
h,w=map(int,input().split())
s=[]
for i in range(h):
	s.append(input().rstrip())
num=[[0]*w for _ in range(h)]
for i in range(h):
	p=0
	for j in range(w):
		if s[i][j]==".":
			p+=1
			num[i][j]+=p
		else:
			p=0
for i in range(h):
	p=0
	for j in range(w-1,-1,-1):
		if s[i][j]==".":
			p+=1
			num[i][j]+=p
		else:
			p=0
for i in range(w):
	p=0
	for j in range(h):
		if s[j][i]==".":
			p+=1
			num[j][i]+=p
		else:
			p=0
for i in range(w):
	p=0
	for j in range(h-1,-1,-1):
		if s[j][i]==".":
			p+=1
			num[j][i]+=p
		else:
			p=0
ans=0
for i in range(h):
	ans=max(ans,max(num[i])-3)
print(ans)

Measured memory_bytes: 92380
#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>

#include<queue>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
 
#define INF (1e9)
typedef long long unsigned int ll;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
 

template<typename T>
int vector_finder(std::vector<T> vec, T number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

int gcd(int a,int b){
	if(b>0){
		return gcd(b, a % b);
	}else{
		return a;
	}
}

int N;

int main()
{
	cin >> N;
	int x, y, t;

	int prex=0;
	int prey = 0;
	int pret = 0;
	REP(i, N)
	{
		cin >> t>>x >> y;
		int tt = t - pret;
		int d = abs(x - prex) + abs(y - prey);
		
		if (tt<d||tt%2!=d%2)
		{
			cout << "No" << endl;
			return 0;
		}
		prex = x;
		prey = y;
		pret = t;
	}

	cout << "Yes" << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int n;
  cin >>n;
  while(n--){
    double a[2],b[2],c[2],d[2];
    cin >>a[0]>>a[1]>>b[0]>>b[1]>>c[0]>>c[1]>>d[0]>>d[1];
    b[0]-=a[0];
    b[1]-=a[1];
    d[0]-=c[0];
    d[1]-=c[1];
    if(b[0]*d[1] == b[1]*d[0]){cout <<"YES"<<endl;}
    else{cout <<"NO"<<endl;}
  }
  return 0;
}
 

Measured memory_bytes: 1224
#include <iostream>

void checkTringle(int a,int b,int c){
    if(a * a == b * b + c * c){
        std::cout << "YES" << std::endl;
    }else{
        std::cout << "NO" << std::endl;
    }
}

int main(int argc, char *argv[])
{
    int dataSize;
    std::cin >> dataSize;

    int side[3];

    for(int i=0; i<dataSize; i++){
        for(int a=0; a<3;a++){
            std::cin >> side[a];
        }

        for(int b = 0; b< 3; b++){
            for(int j=b+1; j<3;j++){
                if(side[b] > side[j]){
                    int tmp = side[b];
                    side[b] = side[j];
                    side[j] = tmp;
                }
            }
        }

        
        checkTringle(side[2],side[1],side[0]);
    }
}

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

int main() {
 int N;
 cin >> N;
 double n = sqrt(N);
 bool a = true;
for (int i = 1; i <= n; i++)
{
  if (N % i == 0 && N/i < 10)
  {
        cout << "Yes" <<endl;
    a = false;
    break;
  }
}
  if (a)
  {
    cout <<  "No" << endl;
  }
  


}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;cin>>n;
  vector<int >nos(n,0);
  for(int i=0,a;i<n;i++){cin>>a;nos[i]=a-1;}
  int tot=0;
  for(int i=0;i<n;i++){
  	if(nos[nos[i]]==i)tot++;
  }
  cout<<tot/2;
}

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

int main() {
  int N, K;
  cin >> N >> K;
  
  int val = 1;
  
  for(int i=0; i<N; i++)
  {
    int n1 = val * 2;
    int n2 = val + K;
    
    if(n1 < n2)
    {
      val = n1;
    }else
    {
      val = n2;
    }
  }
  
  cout << val << endl;
  
}


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

int main(){
    string S;
    cin >> S;
    if (S.at(2) == S.at(3) && S.at(4) == S.at(5)) cout << "Yes" << endl;
    else cout <<"No" << endl;
}

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

struct record
{
    char t;
    int w, l;
};

void sort( record* a, int n )
{
    for( int i = 0; i < n; i++ )
        for( int j = n - 1; j >= i + 1; j-- )
            if( a[j].w > a[j-1].w )
            {
                record temp = a[j];
                a[j] = a[j-1];
                a[j-1] = temp;
            }
    for( int i = 0; i < n; i++ )
        for( int j = n - 1; j >= i + 1; j-- )
            if( a[j].w == a[j-1].w && a[j].l < a[j-1].l )
            {
                record temp = a[j];
                a[j] = a[j-1];
                a[j-1] = temp;
            }
}

int main()
{
    int n;
    char d;
    record team[10];

    while( cin >> n )
    {
        if( n == 0 )
            break;

        
        for( int i = 0; i < n; i++ )
        {
            cin >> d;
            team[i].t = d;

            int a = 0, b = 0;
            for( int j = 0; j < n - 1; j++ )
            {
                cin >> d;
                if( d == '0' )
                    a++;
                else if( d == '1' )
                    b++;
                else if( d == '2' );
                else;
            }
            team[i].w = a;
            team[i].l = b;
        }

        sort( team, n );

        for( int i = 0; i < n; i++ )
            cout << team[i].t << endl;
    }

    return 0;
}



Measured memory_bytes: 3004
#include <iostream>

int main() {
  int payment_amount, one_yen_coin_num;
  std::cin >> payment_amount >> one_yen_coin_num;
  
  std::string can_pay =  one_yen_coin_num >= payment_amount % 500 ? "Yes" : "No";
  std::cout << can_pay << std::endl;
}


Measured memory_bytes: 256
import itertools

A = list(itertools.chain.from_iterable([list(map(int,input().split())) for i in range(3)]))
N = int(input())
for i in range(N):
    b = int(input())
    if b in A:
        A[A.index(b)] = 0

if A[0] == 0 and A[1] == 0 and A[2] == 0:
    print("Yes")
    exit()

if A[3] == 0 and A[4] == 0 and A[5] == 0:
    print("Yes")
    exit()
if A[6] == 0 and A[7] == 0 and A[8] == 0:
    print("Yes")
    exit()
if A[0] == 0 and A[3] == 0 and A[6] == 0:
    print("Yes")
    exit()
if A[1] == 0 and A[4] == 0 and A[7] == 0:
    print("Yes")
    exit()
if A[2] == 0 and A[5] == 0 and A[8] == 0:
    print("Yes")
    exit()
if A[0] == 0 and A[4] == 0 and A[8] == 0:
    print("Yes")
    exit()
if A[6] == 0 and A[4] == 0 and A[2] == 0:
    print("Yes")
    exit()
print('No')

Measured memory_bytes: 3064
import java.util.*;

public class Main {
	
	private void doit() {
		Scanner sc = new Scanner(System.in);
		
		while(true){
			int n = sc.nextInt();
			int m = sc.nextInt();
			if(n == 0 && m == 0){
				break;
			}
			int sum1 = 0;
			int sum2 = 0;
			int [] data1 = new int[n];
			int [] data2 = new int[m];
			for(int i =0; i < n; i++){
				data1[i] = sc.nextInt();
				sum1 += data1[i];
			}
			for(int i =0; i < m; i ++){
				data2[i] = sc.nextInt();
				sum2 += data2[i];
			}
			int ans= Integer.MAX_VALUE, a1=0, a2= 0;
			for(int i = 0; i < n; i++){
				for(int j = 0; j < m; j++){
					if(sum1 - data1[i] + data2[j] == sum2 - data2[j] + data1[i]){
						if(ans > data1[i] + data2[j]){
							ans = data1[i] + data2[j];
							a1 = i;
							a2 = j;
						}
					}
				}
			}
			if(ans == Integer.MAX_VALUE){
				System.out.println(-1);
			}
			else{
				System.out.println(data1[a1] + " " + data2[a2]);
			}
		}
	}

	public static void main(String[] args) {
		Main obj = new Main();
		obj.doit();
	}
}

Measured memory_bytes: 12000
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:https://atcoder.jp/contests/abc163/tasks/abc163_c>
 問題文============================================================
 C - management
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    int N; cin >> N;
    vector<int> A(N);
    for(int i = 1; i < N; i++) cin >> A[i];
    vector<int> cnt(N);

    for(int i = N-1; i > 0; i--){
        cnt[A[i]-1]++;
    }
    
    for(int i = 0; i < N;i++){
        cout << cnt[i] << endl;
    }
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    solve(0);
    // cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


Measured memory_bytes: 4796
#include <iostream>
#include <set>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

typedef long long int lli;
#define rep(i,s,N) for(int i=s;i<N;i++)
using namespace std;

int main(void)
{
	lli X, Y; cin >> X >> Y;
	lli ans = 0;

	while (X <= Y){
		ans++;
		X *= 2;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
using pii = pair<int, int>;

string f(ll n) {
  if (n == 0) return "";
  n--;
  return f(n / 26) + string(1, 'a' + n % 26);
}
int main() {
  ll n;
  cin >> n;
  cout << f(n) << endl;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e18
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; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;


signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int a, v;
    int b, w;
    int t;
    cin >> a >> v >> b >> w >> t;

    int x = abs(a - b);
    if(v<=w){
        cout << "NO" << endl;
    }
    else{
        if((v-w) *t  >= x){
            cout << "YES" << endl;
        }
        else{
            cout << "NO" << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int,int> pii;
typedef vector< pii > vii;

#define ll          long long
#define ff          first
#define ss          second
#define pb          push_back
#define mkp         make_pair
#define sz          size()

#define forf(a,b,c)    for(int i=a;i<=b;i+=c)
#define forr(a,b,c)    for(int i=a;i>=b;i-=c)
#define all(a)      a.begin(),a.end()
#define mem(a,b)    memset(a,b,sizeof(a))
#define pi          2*acos(0.0)
#define End         return 0;

#define scan1(a)    scanf("%d",&a)
#define scan2(a,b)  scanf("%d %d",&a,&b)
#define scan3(a,b,c)  scanf("%d %d %d",&a,&b,&c)
#define scanl(a)    scanf("%lld",&a)
#define scanll(a,b) scanf("%lld %lld",&a,&b)
#define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)

#define print1(a)    printf("%d",a)
#define print2(a,b)  printf("%d %d",a,b)
#define print3(a,b,c)  printf("%d %d %d",a,b,c)
#define printl(a)    printf("%lld",a)
#define printll(a,b) printf("%lld %lld",a,b)
#define printlll(a,b,c) printf("%lld %lld %lld",a,b,c)

#define MAXN        100000007
#define INF 0x3f3f3f3f
//int dx[]={+1,-1,+0,+0};///Four Directions
//int dy[]={+0,+0,+1,-1};///Four directions
//int dx [] = {+1,-1,+0,+0,-1,-1,+1,+1};///Eight Directions
//int dy [] = {+0,+0,+1,-1,+1,-1,-1,+1};///Eight Directions

//int mark[10007];vi prime;void seive(){for(int i=2;i<10000;i++){if(mark[i]==0){prime.pb(i);for(int j=i+i;j<=10000;j+=i)mark[j]=1;}}}

//freopen("input.txt", "r", stdin);

int main()
{
   ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
   string s; cin>>s;
   if(s[2]==s[3]&&s[4]==s[5]) cout<<"Yes"<<endl;
   else cout<<"No"<<endl;
   End;
}


Measured memory_bytes: 256
#include<string.h>
#include<stdio.h>
const int N=100;
char a[N];
 
int main()
{
      while(gets(a))
      {
            int n=strlen(a);
 
 
  printf("%c",a[0]);
  printf("%d",n-2);
  printf("%c\n",a[n-1]);
 
      }
 
}

Measured memory_bytes: 128
using System;


namespace _007_DebtHell
{
	class Program
	{
		static void Main ( string[] args )
		{
			int weekCount = int.Parse (Console.ReadLine ());

			int debt = 100000;

			for (int lp = 0; lp < weekCount; lp++)
			{
				int adddebt = (int) (debt * 0.05);
				int rest = adddebt % 1000;

				if (rest != 0)
					adddebt = adddebt - rest + 1000;

				debt += adddebt;
			}

			Console.WriteLine (debt);
		}
	}
}

Measured memory_bytes: 9176
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
const int maxn = 1e9 + 5;
#define INF 100000000000
const int MOD = 1e9+7;
const double PI = 3.14159265358979323846264338;
const int MAXN = 201+5;



int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	fastio
	int n;
	cin >> n;
	string s,t;
	cin >> s >> t;
	string ans;
	for(int i=0; i<n; i++){
		ans+=s[i];
		ans+=t[i];
	}
	cout << ans << endl;
    return 0;
}




Measured memory_bytes: 3624