akhauriyash/Code-Regression huggingface dataset:
<?php

    // AtCoder Beginner Contest 163
    // A - Circle Pond

    $r = in_int();
    out($r * 2 * pi());

    // -----------------------------------------------------
    function in() { return trim(fgets(STDIN)); }
    function in_int() { return (int)in(); }
    function in_vals() { return explode(' ', in()); }
    function in_ints() { return array_map('intval', in_vals()); }
    function out($s) { echo $s . PHP_EOL; }
    function yes() { out('Yes'); }
    function no() { out('No'); }


Measured memory_bytes: 16016
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

int matrix[2][510][510];
int ok[2][510][510];
int cnt[2];
int card[100010];
int px[2][1000010];
int py[2][1000010];
int n, u, v, m;

int Check(int iter, int sx, int sy, int dx, int dy) {
  int sum = 0;
  REP(i, n) {
    sum += ok[iter][sy + dy * i][sx + dx * i];
  }
  return sum == n;
}

int main() {
  while (scanf("%d %d %d %d", &n, &u, &v, &m) > 0) {
    MEMSET(px, -1);
    MEMSET(py, -1);
    MEMSET(cnt, 0);
    MEMSET(ok, 0);
    REP(iter, 2) {
      REP(y, n) {
        REP(x, n) {
          scanf("%d", &matrix[iter][y][x]);
          px[iter][matrix[iter][y][x]] = x;
          py[iter][matrix[iter][y][x]] = y;
        }
      }
    }
    REP(i, m) {
      scanf("%d", &card[i]);
    }
    if (n == 1) {
      REP(i, m) {
        REP(iter, 2) {
          if (matrix[iter][0][0] == card[i]) {
            cnt[iter]++;
          }
        }
        if (cnt[0] >= u || cnt[1] >= v) { goto end; }
      }
    } else {
      REP(i, m) {
        int c = card[i];
        REP(iter, 2) {
          int tx = px[iter][c];
          int ty = py[iter][c];
          if (tx == -1) { continue; }
          ok[iter][ty][tx] = 1;
          cnt[iter] += Check(iter, tx, 0, 0, 1);
          cnt[iter] += Check(iter, 0, ty, 1, 0);
          if (tx == ty) {
            cnt[iter] += Check(iter, 0, 0, 1, 1);
          }
          if (tx == n - ty - 1) {
            cnt[iter] += Check(iter, n - 1, 0, -1, 1);
          }
        }
        if (cnt[0] >= u || cnt[1] >= v) { goto end; }
      }
    }
end:
    if (cnt[0] >= u && cnt[1] >= v) {
      puts("DRAW");
    } else if (cnt[0] >= u) {
      puts("USAGI");
    } else if (cnt[1] >= v) {
      puts("NEKO");
    } else {
      puts("DRAW");
    }
  }
}

Measured memory_bytes: 19000
#include "bits/stdc++.h"
 
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(),a.end())
#define rep(i,n) for(int i = 0;i < (n) ; i++) 
#define REP(i,n) for(int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
// #define INF LLONG_MAX/2

using namespace std;

int MOD = 1000000007;
int h,w;

signed main(){

    cin >> h >> w;

    if(h%3 == 0 || w%3 == 0){
        cout << 0 << endl;
        return 0;
    }
    int ans = min(h,w);
    for(int i = 1; i <= w-1;i++){
        ans = min(ans, max({h*(w-i),i*(h/2),i*(h-h/2)}) - min({h*(w-i),i*(h/2),i*(h-h/2)}));
        // if(ans == 0){
        //     cerr << 0 << endl;
        //     cerr << i << " " << h*(w-i) << " " << i*(h/2) << " " << i*(h-h/2) << " " ;
        //     return 0;
        // }
    }
    for(int i = 1; i <= h-1;i++){
        ans = min(ans, max({w*(h-i),i*(w/2),i*(w-w/2)}) - min({w*(h-i),i*(w/2),i*(w-w/2)}));
    }
    cout << ans << endl;

    
    

    return 0;
}
// g++ -std=c++14 code1.cpp
// rm -r -f test;oj dl 

Measured memory_bytes: 256
n = int(input())
list = list(map(int, input().split()))
chk = [i+1 for i in range(n)]
#print(list)
#print(chk)
if list == chk:
    print('YES')
else:
    cnt = 0
    for i in range(0, n):
        if list[i] != chk[i]:
            cnt += 1
    if cnt==2:
        print('YES')
    else:
        print('NO')

Measured memory_bytes: 38384
//In the name of God
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;

const ll maxn = 2e5 + 100;
const ll mod = 1e9 + 7;
const ll inf = 1e18;

#define fast_io ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_io freopen("input.txt", "r+", stdin);freopen("output.txt", "w+", stdout);
#define pb push_back
#define Mp make_pair
#define F first
#define S second

ll h1, m1, h2, m2, k, a, b;

int main(){
    fast_io;

    cin >> h1 >> m1 >> h2 >> m2 >> k;
    a = h1 * 60 + m1;
    b = h2 * 60 + m2;
    a = b - a;
    if(a < 0) a += 60 * 24;
    cout << a - k;

    return 0;
}


Measured memory_bytes: 3608
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <utility>
#include <string>
#include <stack>
#include <regex>
#include <numeric>
#include <queue>
#include <set>

#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;

int main(int argc, char const *argv[])
{
  string s;
  cin >> s;
  bool flag = false;
  char mae = s[0];
  REP(i, 3)
  {
    if (mae == s[i + 1])
      flag = true;
    mae = s[i + 1];
  }
  if (flag)
  {
    cout << "Bad" << endl;
  }
  else
  {
    cout << "Good" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
// AOJ 2926 Demon's Cedar
// 2019.4.7 bal4u

// AOJ 2672 Rescue a Postal Worker
// 2019.4.6 bal4u

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

//// 高速入力
#if 1
#define gc() getchar_unlocked()
#define pc(x) putchar_unlocked(x)
#else
#define gc() getchar()
#define pc(x) putchar(x)
#endif
int in()    // 非負整数の入力
{
	int n = 0, c = gc();
	//	while (isspace(c)) c = gc();
	do n = 10 * n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

void out(long long n)  // 非負整数の表示（出力）
{
	int i;
	char b[40];

	if (!n) pc('0');
	else {
		//		if (n < 0) pc('-'), n = -n;
		i = 0; while (n) b[i++] = n % 10 + '0', n /= 10;
		while (i--) pc(b[i]);
	}
	pc('\n');
}


//// 優先度付きキュー（ダイクストラ法用）
#define MAX 1000000
typedef struct { long long t; int n; } QUE;
QUE que[MAX]; int qsize;

#define PARENT(i) ((i)>>1)
#define LEFT(i)   ((i)<<1)
#define RIGHT(i)  (((i)<<1)+1)

void min_heapify(int i)
{
	int l, r, min;
	QUE qt;

	l = LEFT(i), r = RIGHT(i);
	if (l < qsize && que[l].t < que[i].t) min = l; else min = i;
	if (r < qsize && que[r].t < que[min].t) min = r;
	if (min != i) {
		qt = que[i]; que[i] = que[min]; que[min] = qt;
		min_heapify(min);
	}
}

void deq()
{
	que[0] = que[--qsize];
	min_heapify(0);
}

void enq(int n, long long t)
{
	int i, min;
	QUE qt;

	i = qsize++;
	que[i].t = t, que[i].n = n;
	while (i > 0 && que[min = PARENT(i)].t > que[i].t) {
		qt = que[i]; que[i] = que[min]; que[min] = qt;
		i = min;
	}
}


//// 本問題関連
#define INF 0x5f
#define MAXV 100005
int N;
int goal;
int hi[MAXV], to[MAXV][4], tm[MAXV][4];
long long dis[MAXV];

void dijkstra(int start)
{
	int i, u, v;
	long long t;

	memset(dis, INF, sizeof(long long)*N);
	enq(start, 0);
	while (qsize) {
		u = que[0].n, t = que[0].t, deq();
		if (t >= dis[u]) continue;
		dis[u] = t;
		for (i = 0; i < hi[u]; i++) {
			long long nt = t + tm[u][i];
			v = to[u][i];
			if (nt < dis[v]) enq(v, nt);
		}
	}
}

typedef struct { int id, v; } T;
T a[MAXV];

int cmp(const void *a, const void *b) { return ((T *)a)->v - ((T *)b)->v; }

void add(int u, int v, int w)
{
	int i;
	for (i = 0; i < hi[u]; i++) {
		if (to[u][i] == v) {
			if (tm[u][i] > w) tm[u][i] = w;
			return;
		}
	}
	hi[u]++, to[u][i] = v, tm[u][i] = w;
}

int main()
{
	int i, j, u, v, w;

	N = in();
	for (j = 0; j < 2; j++) {
		for (i = 0; i < N; i++) a[i].id = i, a[i].v = in();
		qsort(a, N, sizeof(T), cmp);
		for (i = 1; i < N; i++) {
			u = a[i - 1].id, v = a[i].id;
			w = a[i - 1].v - a[i].v; if (w < 0) w = -w;
			add(u, v, w), add(v, u, w);
		}
	}

	dijkstra(0);
	for (i = 0; i < N; i++) out(dis[i]);
	return 0;
}



Measured memory_bytes: 8980
#include<bits/stdc++.h>
using namespace std;
int main()
{
  map<string,int>m;
  string s;
  int n;
  cin>>n;
  while(n--)
  {
    int q,x;
    cin>>q;
    if(q==0)
    {
      cin>>s>>x;
      m[s]=x;
    }
    else if(q==1)
    {
      cin>>s;
      cout<<m[s]<<endl;
    }
    else
    {
      cin>>s;
      m.erase(s);
    }
  }
}



Measured memory_bytes: 27744
#include <stdio.h>
int main(){
  int N=0,K=0;
  char S[50]={};
  scanf("%d",&N);
  scanf("%d",&K);
  scanf("%s",&S);
  S[K-1]=S[K-1]-'A'+'a';
  for(int i=0;i<N;i++){
    printf("%c",S[i]);
  }
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
 
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pii;
typedef tuple<ll, ll, ll> ti;
ll mod=1E9+7;
 
#define REP(a,b,c) for(ll a=b;a<(c);a++)
#define PER(a,b,c) for(ll a=b;a>=(c);a--)
 
ll ii(){ ll x; cin >> x; return x; }
string is(){ string x; cin >> x; return x; }
ld id(){ ld x; cin >> x; return x; }
void oi(ll x){ cout << x; }
void od(ld x){ cout << fixed << setprecision(10) << x; }
void os(string x){ cout << x; }
void oe(){ cout << endl; }
void oie(ll x){ oi(x); oe(); }
void ode(ld x){ od(x); oe(); }
void ose(string x){ os(x); oe(); }

int main(){
    ll X=ii(), Y=ii();
    REP(a,0,100){
        REP(b,0,100){
            if(a+b==X && 2*a+4*b==Y){
                ose("Yes");
                return 0;
            }
        }
    }
    ose("No");
    return 0;
}

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

int par[10001], d[10001];
void init(int n){
	for(int i = 0;i < n;i++){
		par[i] = i;
		d[i] = 0;
	}
}

int find(int x){
	if(x == par[x])return x;
	return par[x] = find(par[x]);
}

void unite(int x, int y){
	x = find(x);
	y = find(y);
	if(x == y)return ;
	if(d[x] < d[y]){
		par[x] = y;
	}else{
		par[y] = x;
		if(d[x] == d[y])d[x]++;
	}
}

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

int main(){
	int n, q, c, x, y;
	scanf("%d%d", &n, &q);
	init(n);
	
	for(int i = 0;i < q;i++){
		scanf("%d%d%d", &c, &x, &y);
		if(!c)unite(x, y);
		else printf("%d\n", same(x, y));
	}
	return 0;
}


Measured memory_bytes: 3288
#include <stdio.h>
int main(void)
{
    int R,G,B,N;
    int r,g,b,n=0;
    int x;
    scanf("%d %d %d %d", &R, &G, &B, &N);

        for (r = 0; r <= N; r++) {
            for (g = 0; g <= N; g++) {
                x = N - (R*r + G*g);
                if(N >= R*r + G*g){
                    if(x % B == 0){
                        b = x / B;
                        n = n + 1;
                    }
                }
            }
        }
    printf("%d\n",n);

    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <queue>
#include <map>
#include <deque>
#include <algorithm>
#include <set>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <cstring>
#include <climits>
#include <iostream>


#define ll long long
#define p 1000000007
using namespace std;
//const ll MOD = (int) 10e9 + 7;

//ll dp[100001][2];
vector<vector<ll>>adj;
/*
ll dfs(ll node)
{
    if (dp[node] != -1)
        return dp[node];
    ll ans = 0;

    if (adj[node].size() == 0)
        return 2;

    for (int i = 0; i < adj[node].size(); i++) {
        ans = max(dfs(adj[node][i]) + 1, ans);

    }


    return dp[node] = ans;
}
*/
//<white, black>
pair<ll, ll> dfsColor(ll node, ll parent)
{
    ll allWh = 1;
    ll blackChild = 0;
    for (ll i = 0; i < adj[node].size(); i++)
    {
        if (adj[node][i] != parent){
            pair<ll,ll> pr = dfsColor(adj[node][i], node);
            blackChild = ((allWh * pr.second) % p + ((blackChild % p) * (pr.first + pr.second) % p) % p) % p;
            allWh = (pr.first * allWh) % p;
        }
    }
    return make_pair((allWh + blackChild) % p, allWh % p);
}

ll factorial(ll n)
{
    if (n == 1 || n == 0)
        return 1;
    return  n * factorial(n - 1);
}

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

    ll n;
    cin >> n;
    for (int i  = 0; i <= n; i++)
    {
        vector<ll>temp;
        adj.push_back(temp);
    }
    for (int i = 0; i < n - 1; i++)
    {
        ll x,y;
        cin >> x >> y;
        adj[x].push_back(y);
        adj[y].push_back(x);
    }
    pair<ll, ll> k = dfsColor(1,-1);
    cout << (k.first + k.second) % p;
    /*std::cout<<std::fixed;
    std::cout<<std::setprecision(10)<<ans;*/
             //   dp[i][i + 1 + j] = min(dp[i][i + j] + (pre[i + j + 2] - pre[i]),dp[i + 1][i + 1 + j] + (pre[i + j + 2] - pre[i]));

    return 0;
}


Measured memory_bytes: 12656
local n = io.read("n")

--nC1 * (n - 1)C1 10^(n - 2)

if n == 1 then
	print(0)
	os.exit()
end

local ten_pow, nin_pow = 1, 0
local eig_pow_t, nin_pow_t = {8}, {9}
for i = 2, n do
	eig_pow_t[i] = (eig_pow_t[i - 1] * 8) % 1000000007
	nin_pow_t[i] = (nin_pow_t[i - 1] * 9) % 1000000007
end

for i = 1, n do
	ten_pow = (ten_pow * 10) % 1000000007
end
for i = 1, n do
	local num = nin_pow + ((eig_pow_t[i - 1] or 1) * (nin_pow_t[n - i] or 1)) % 1000000007
	nin_pow = num % 1000000007
end
local out = ((nin_pow * 2) % 1000000007 + eig_pow_t[n]) % 1000000007
out = out < 0 and out + 1000000007 or out
out = ten_pow - out < 0 and ten_pow - out + 1000000007 or ten_pow - out
print(out)


Measured memory_bytes: 35292
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {
	private	static	BufferedReader	br = null;

	static {
		br = new BufferedReader(new InputStreamReader(System.in));
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		String	strNum = null;
		double	s      = calcSum();
		while((strNum = parseStdin())!= null) {
			System.out.printf("%.8f\n", s * Double.parseDouble(strNum));
		}
	}

	private static double calcSum() {
		double	s = 1.0;
		double	d = 1.0;

		for(int i = 2; i <= 10; i++) {
			d  = (i % 2 == 0) ? d * 2: d / 3.0;
			s += d;
		}

		return s;
	}

	private static String parseStdin() {
		String	strNum = null;

		try {
			String line = br.readLine();
			if (line != null) {
				if (!line.isEmpty()) {
					strNum = line;
				}
			}
		}
		catch (IOException e) {}

		return strNum;
	}
}

Measured memory_bytes: 16956
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repeq(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define rep1(i,x,n) for(int (i)=(x);(i)<(int)(n);(i)++)
#define rep1eq(i,x,n) for(int (i)=(x);(i)<=(int)(n);(i)++)
#define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--)
using namespace std;
using ll = long long;
using Int = long long;

const int MOD = 1000000007;
const ll INF = numeric_limits<ll>::max();
const int inf = 1e8;
typedef pair<int,int> P;
typedef std::priority_queue<int> IntPrioQueue;
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue;

//少数点表示
//cout << std::fixed << std::setprecision(14) << 値

int main(){
    cin.tie( 0 ); ios::sync_with_stdio( false );
    int n;
    cin >> n;
    //vector<int> a(n);
    IntReversePrioQueue que;
    bool odd = false;
    rep(i,n){
        int a;
        cin >> a;
        que.push(a);
        if(a%2 != 0) odd = true;
    }

    while(!que.empty()){
        int q = que.top();
        que.pop();
        if(que.empty()){
            que.push(q);
            break;
        }
        int r = que.top();
        que.pop();
        que.push(q);
        int s = r%q;
        if(s != 0) que.push(s);
    }

    // rep(i,que.size()){
    //     int o = que.top(); que.pop();
    //     cout << o <<" ";
    // }

    cout << que.top() << endl;
    return 0;
}

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

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

    vector<int> ac(n), wa(n), penalty(n);
    for(int i=0; i<m; i++){
        int p;
        string s;
        cin >> p >> s;

        p -= 1;
        if(s == "AC" && ac[p] == 0){
            ac[p] = 1;
            penalty[p] = wa[p];
        }
        if(s == "WA" ) wa[p] += 1;
    }

    int ans1 = 0, ans2 = 0;
    for(int i=0; i<n; i++){
        ans1 += ac[i];
        ans2 += penalty[i];
    }
    cout << ans1 << " " << ans2 << endl;
    return 0;
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
#define pi 3.14159
using namespace std;
int main()
{
    int n,m;
    vector <int> a(m);
    cin>>n>>m;
    int sum=0;
    for(int i=0;i<m;i++)
    {
        cin>>a[i];
        sum+=a[i];
    }
    if((n-sum)<0)
    {
        cout<<-1;
    }
    else
        cout<<n-sum;
}


Measured memory_bytes: 3744
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

string S;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>S;
	sort(ALL(S));
	if(S=="abc") cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


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

int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i=0; i<N; i++) cin >> a.at(i);
  bool flag = true;
  for (int i=0; i<N; i++) {
    if (a.at(i)%2 == 0) {
      if (!(a.at(i)%3 == 0 || a.at(i)%5 == 0)) flag = false;
    }
  }
  if (flag) cout << "APPROVED" << endl;
  else cout << "DENIED" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int n ;
  cin >> n ;
  int a = n /1000;
  int b = n / 100 - a * 10 ;
  int c = n / 10 - b * 10 - a * 100 ;
  int d = n - c * 10 - b * 100 - a * 1000;
  if( a == b && b == c ){
    cout << "Yes" ;
  }
  else if ( b == c && c == d ){
    cout << "Yes" ;
  }
  else{
    cout << "No";
  }
}

Measured memory_bytes: 256
package main

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

type Range struct {
	L, R int
}

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	var N, M, Q int
	scanner.Scan()
	fmt.Sscanf(scanner.Text(), "%d %d %d", &N, &M, &Q)

	dp := make(map[Range]int)
	for i := 0; i < M; i++ {
		var L, R int
		scanner.Scan()
		fmt.Sscanf(scanner.Text(), "%d %d", &L, &R)
		dp[Range{L, R}]++
	}

	for i := 1; i <= N; i++ {
		t := Range{1, i}
		for t.R <= N {
			dp[t] = dp[t] +
				dp[Range{t.L, t.R - 1}] +
				dp[Range{t.L + 1, t.R}] -
				dp[Range{t.L + 1, t.R - 1}]
			t.L++
			t.R++
		}
	}

	var buffer bytes.Buffer
	for Q > 0 {
		Q--
		var p, q int
		scanner.Scan()
		fmt.Sscanf(scanner.Text(), "%d %d", &p, &q)
		buffer.WriteString(strconv.Itoa(dp[Range{p, q}]))
		buffer.WriteString("\n")
	}
	fmt.Println(buffer.String())

}


Measured memory_bytes: 18816
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;

int main() {
  string O,E; cin >> O >> E;
  string ans = "";
  int lenO = O.length();
  int lenE = E.length();
  int i = 0;
  int j = 0;
  while(1) {
    if ( i < lenO )ans += O[i];
    if ( j < lenE )ans += E[j];
    if ( i < lenO )i++;
    if ( j < lenE) j++;
    if ( i == lenO && j == lenE ) break;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rint register int
#define deb(x) cerr<<#x<<" = "<<(x)<<'\n';
using namespace std;
typedef long long ll;
using pii = pair <int,int>;
const int maxn = 2e5 + 5;
int n, m, v, p, a[maxn];
ll pre[maxn];

bool ck(int x){
	if(x <= p) return 1;
	int rem = v - (n - x + 1) - (p - 1);
	if(rem <= 0){
		if(a[x] + m >= a[p]) return 1;
		return 0;
	}
	ll vto = 1ll * (a[x] + m) * (x - p) - (pre[x-1] - pre[p-1]);
	if(1ll * m * rem <= vto && (a[x] + m >= a[p])) return 1;
	return 0;
}

int main() {
	scanf("%d%d%d%d", &n, &m, &v, &p);
	for(int i=1; i<=n; i++) scanf("%d", a+i);
	sort(a+1, a+1+n);
	reverse(a+1, a+1+n);
	for(int i=1; i<=n; i++) pre[i] = pre[i-1] + a[i];
	int l = 1, r = n, mid;
	while(l <= r) {
		mid = l + r >> 1;
		if(ck(mid)) l = mid + 1;
		else r = mid - 1;
	}
	printf("%d\n", r);
}
/*

*/


Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin >> s;
	int len=s.length();
	int f=1;
	for(int i=0;i<len;i+=2){
		if(s[i]=='R') continue;
		else if(s[i]=='U') continue;
		else if(s[i]=='D') continue;
		else {
			f=0; break;
		}
	}
	for(int i=1;i<len;i+=2){
		if(s[i]=='L') continue;
		else if(s[i]=='U') continue;
		else if(s[i]=='D') continue;
		else {
			f=0; break;
		}
	}
	if(f==1) printf("Yes\n");
	else printf("No\n");
	return 0;
} 

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()

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

ll lucas(ll n, vector<ll> &memo) {

  if (n == 0) {
    return 2;
  } else if (n == 1) {
    return 1;
  }

  if (memo[n] != -1) {
    return memo[n];
  }

  return memo[n] = lucas(n - 1, memo) + lucas(n - 2, memo);
}

int main() {
  ll n;
  cin >> n;
  vector<ll> memo(n+1, -1);
  rep(i, n+1) {
    if (i == n ) {
        cout << lucas(i, memo) << endl;
       
    }
    lucas(i, memo);
  }

  return 0;
}

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

int main() {
	long N, P; cin >> N >> P;
	if(N>40) cout << 1 << endl;
	else if(N==1) cout << P << endl;
	else{
	    long max=1;
	    for(long i=2; pow(i, N)<=P; ++i){
	        long a=pow(i, N);
	        if(P%a==0) max=i;
	    }
	    cout << max << endl;
	}
	return 0;
}


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

#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define REP(i, n)  for(int i=0;i<(n);++i)
#define REPr(i, n) for(int i=(n)-1;i>=0; --i)
#define FORq(i, m, n) for(int i = (m);i <= (n);++i)
#define FORqr(i, m, n) for(int i = (n);i >=(m);--i)
#define PB push_back
#define MP make_pair
#define DEBUG printf("%s\n","debug")
#define fst first
#define snd second
#define SIN(x, S) (S.count(x) != 0)
#define M0(x) memset(x,0,sizeof(x))
#define FILL(x, y) memset(x,y,sizeof(x))
#define MM(x) memset(x,-1,sizeof(x))
#define ALL(x) (x).begin(),(x).end()
#define SCD(n) scanf("%d",&n)
#define SCD2(m,n) scanf("%d%d",&m,&n)
#define SCD3(m,n,k) scanf("%d%d%d",&m,&n,&k)
#define SCLLD(n) scanf("%lld",&n)
#define SCLLD2(m,n) scanf("%lld%lld",&m,&n)
#define SCLLD3(m,n,k) scanf("%lld%lld%lld",&m,&n,&k)
using namespace std;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
///////////////////////////////////////////////
const ll MOD = 1e9+7;

ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

template<class T>
inline bool chmin(T &a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}

template<class T>
inline bool chmax(T &a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
///////////////////////////////////////////////
/*(._.)*/
const long long INF = 9223372036854775000;
const int VMAX = 3000;
const int EMAX = 6000;

struct Edge{
	int from;
	int to;
	ll cost;
};

int main() { // 1 --> N minimum cost
	ll N,M,P; cin >> N >> M >> P;
	struct Edge e[EMAX];
	long long d[VMAX];
	bool negcycle[VMAX] = {};

	REP(i,M){
		ll a,b,c;
		cin >> a >> b >> c;
		e[i].from = b;
		e[i].to = a; //reverse
		e[i].cost = -c+P; // -1
	}

	REP(i,VMAX){
		d[i] = INF;
	}

	d[N] = 0;

	REP(i,N-1){ // loop V times --> NEGCYCLE

		bool update = false;
		REP(j,M){
			int u = e[j].from;
			int v = e[j].to;
			ll c = e[j].cost;

			if ((d[u] + c < d[v]) and (d[u] != INF)) { //s-->uへ現状行けないときを弾く
				d[v] = d[u] + c;
				update = true;
			}
		}
	}

	ll ans = d[1];

	REP(i,N){
		REP(j,M){
			int u = e[j].from;
			int v = e[j].to;
			ll c = e[j].cost;

			if (d[u] == INF) continue;

			if (d[v] > d[u] + c){
				d[v] = d[u] + c;
				negcycle[v] = true;
			}

			if (negcycle[u] == true){
				negcycle[v] = true;
			}
		}
	}


	if (negcycle[1]) {
		printf("-1");
		return 0;
	}

	cout << max(0LL,-ans) << endl;


	return 0;
}


Measured memory_bytes: 384
#include <iostream>

static int SeqNum;//条件値数列要素数
static int* Seq;//条件値数列

bool solve(int donum, int qnum){
	if (qnum == 0)return true;
	if (donum >= SeqNum)return false;
	bool res = solve(donum + 1, qnum) || solve(donum + 1, qnum - Seq[donum]);
	return res;
}

int main(){
	std::cin >> SeqNum;

	Seq = new int[SeqNum];//条件値数列
	for (int i = 0; i < SeqNum; ++i){//数列代入
		std::cin >> Seq[i];
	}

	int QSeqNum;//質問数列要素数
	std::cin >> QSeqNum;

	int* QSeq = new int[QSeqNum];//質問数列
	for (int i = 0; i < QSeqNum; ++i){//数列代入
		std::cin >> QSeq[i];
	}

	for (int i = 0; i < QSeqNum; ++i){
		if (solve(0, QSeq[i])){
			std::cout << "yes" << std::endl;
		} else{
			std::cout << "no" << std::endl;
		}
	}

	delete[] Seq;
	delete[] QSeq;

	return 0;
}

Measured memory_bytes: 1188
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

typedef long long ll;

#define MOD 1000000007

int main() {
  ll a, b, n;
  cin >> a >> b >> n;
  if (b == 1) {
    cout << 0 << endl;
    return 0;
  }
  if (n < b - 1) {
    cout << (a * n) / b << endl;
  } else {
    cout << (a * (b - 1)) / b << endl;
  }
  return 0;
}

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

// 約数の列挙
vector<ll> divisor(ll n) {
    vector<ll> res;
    for (ll i=1;i*i<=n;++i) {
        if (n%i == 0) {
            res.push_back(i);
            if (i != n/i) res.push_back(n/i);
        }
    }
    return res;
}
int main() {
    ll N;
    cin >> N;

    auto v = divisor(N);

    ll ans = 1e15;
    rep(i, v.size()) {
        ans = min(ans, v[i]-1 + (N/v[i]-1));
    }

    cout << ans << endl;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
//#define ll __int128
#define ll long long
#define LEFT(a) ((a)<<1)
#define RIGHT(a) (LEFT(a) + 1)
#define MID(a,b) ((a+b)>>1)
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))

/*
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/STACK: 20000000005")
*/

using namespace std;

const ll N = 200005, MOD = 1e9 + 7;

int n, Q;
ll a[N];


vector < int > g[N];


void dfs (int k, int p){
    a[k] += a[p];
    for (int to : g[k]){
        if (to == p)
            continue;
        dfs (to, k);
    }
}

main()
{
    //freopen ("in.in", "r", stdin);freopen ("out.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin >> n >> Q;
    for (int i = 1; i < n; i++){
        int u, v;
        cin >> u >> v;
        g[u].pb (v);
        g[v].pb (u);
    }
    while (Q--){
        ll x, y;
        cin >> x >> y;
        a[x] += y;
    }
    dfs (1, 0);
    for (int i = 1; i <= n; i++)
        cout << a[i] << " ";
    cout << endl;
    return 0;
}


Measured memory_bytes: 24320
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#define _USE_MATH_DEFINES
#include <math.h>
#include <iomanip>
#include <stdio.h>
#include <numeric>
#include <cmath>
#include <limits>
#include <bitset> 
#include <iterator> 
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include<deque>
#include <regex>
#include <list>
#include <unordered_set>
#define rep(i,n) for(ll i=0;i<(n); ++i)
#define per(i,n) for(ll i=n-1;i>=0; --i)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define _GLIBCXX_DEBUG
using namespace std;
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; }
const long long INF = 1LL << 60;
typedef long long ll;
const ll MOD = 1000000007;
ll getDigit(ll n) {
	ll cnt = 0;
	while (n != 0) {
		n /= 10;
		cnt++;
	}
	return cnt;
}
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
typedef pair<double, long long> pair_t;
bool PSecComp(const pair_t& a, const pair_t& b) {
	if (a.second == b.second)return  a.first > b.first;
	else {
		return a.second > b.second;
	}
}

int main() {
	ll n, m;
	cin >> n >> m;
	vector<ll>a(n),b(m),c(m),goodBc;
	rep(i, n)cin >> a[i];
	rep(i, m)cin >> b[i] >> c[i];
	
	vector<pair<ll, ll>>bc;
	rep(i, m)bc.push_back(make_pair(b[i],c[i]));
	sort(all(bc),PSecComp);
	for (ll i = 0; i < m; i++) {
		if (goodBc.size() == n)break;
		else {
			ll rest = n - goodBc.size();
			rep(p,min(bc[i].first,rest))goodBc.push_back(bc[i].second);
		}
	}
	ll sumA = accumulate(all(a),0LL);
	ll maxSum = -INF;
	sort(all(a));
	for (ll i = 0; i < goodBc.size(); i++) {
		maxSum = max(maxSum, sumA);
		sumA += (goodBc[i] - a[i]);
		maxSum = max(maxSum, sumA);
	}
	cout << maxSum << endl;
}


Measured memory_bytes: 6000
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include <climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
const ll Mod = 1000000007;
struct P {
	ll pos, cost;
	bool operator<(const P &b) const { return cost < b.cost; }
	bool operator>(const P &b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E &b) const { return cost < b.cost; }
	bool operator>(const E &b) const { return cost > b.cost; }
};
struct H {
	ll x, y;
	bool operator<(const H &b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H &b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H &b) const { return x == b.x&&y == b.y; }
	bool operator!=(const H &b) const { return (*this) != b; }
};
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j%i, i);
}
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
int n;
int a[200000];
int b[200000];
int c[200000];
signed main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	for (int i = 0; i < n; i++) {
		cin >> b[i];
	}
	for (int i = 0; i < n; i++) {
		cin >> c[i];
	}
	sort(a, a + n);
	sort(c, c + n);
	int ans = 0;
	for (int i = 0; i < n; i++) {
		int k = lower_bound(a, a + n, b[i]) - a;
		int r = upper_bound(c, c + n, b[i]) - c;
		ans += k*(n - r);
	}
	cout << ans << endl;
}

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

// #define ONLINE_JUDGE

#define V vector
#define P pair

using LL = long long;
#define FOR(i, x, y) \
    for (decay<decltype(y)>::type i = (x), _##i = (y); i < _##i; ++i)
#define FORD(i, x, y) \
    for (decay<decltype(x)>::type i = (x), _##i = (y); i > _##i; --i)
#ifndef ONLINE_JUDGE
#define dbg(x...)                             \
    do {                                      \
        cerr << "\033[32;1m" << #x << " -> "; \
        err(x);                               \
    } while (0)
void err() { cerr << "\033[39;0m" << endl; }
template <template <typename...> class T, typename t, typename... A>
void err(T<t> a, A... x) {
    for (auto v : a) cerr << v << ' ';
    err(x...);
}
template <typename T, typename... A>
void err(T a, A... x) {
    cerr << a << ' ';
    err(x...);
}
#else
#define dbg(...)
#endif
#define sz(x) (int)x.size()

LL bin(LL a, LL b, LL p) {
    LL res = 1;
    a = (a % p + p) % p;
    for (; b; b >>= 1, a = a * a % p)
        if (b & 1) res = res * a % p;

    return res;
}

const int N = 2e5+50;

char s[N];
int n;

void solve() {
    scanf("%d%s", &n, s);
    int l = 0, r = n;
    int ans = 0;
    while (l < r) {
        while (l < r && s[l] != 'W')
            ++l;
        while (l < r && s[r-1] != 'R')
            --r;
        if (l < r) {
            ++ans;
            swap(s[l], s[r-1]);
        }
    }
    printf("%d\n", ans);
}

int main() {

    // int t;
    // cin >> t;
    // while (t--) solve();

    solve();

    return 0;
}

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


int main() {
  double A,B,H,M;
  cin >> A >> B >> H >> M;
  double ans;

  double t = (60.0*H-11.0*M)/360.0*M_PI;
  //cout << t << endl;
  ans = pow(A*A+B*B-2.0*A*B*cos(t),0.5);

  cout << fixed << setprecision(20);
  cout << ans << endl;
}

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

using namespace std;

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,n) for(int i=1;i<=(int)(n);i++)
#define rep3(i,n) for(int i=0;i<=(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
#define repll(i,n) for(ll i=0;i<(ll)(n);i++)
#define repll2(i,n) for(ll i=1;i<=(ll)(n);i++)
#define REPLL(i,m,n) for(ll i=m;i<(ll)(n);i++)
#define INF (int)1e9  //
#define LINF (ll)4e18  //
#define MOD (int)(1e9)+7
#define MP make_pair
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define PI 3.1415926535898

//------------------------------------------------------

int main() {
    int a, b;
    cin >> a >> b;
    cout << (a + b) % 24 << endl;

    return 0;
}



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

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

int main(){
	// sengen
	LL n,m,k;
	// nyuryoku
	cin >> n >> m >> k;
	LL ans = 0;
	LL w = 998244353;
	LL add = m;
	// keisan
	for(LL i=0;i<k;i++){
		add = add*(n-1-i)%w;
	}
	for(LL i=0;i<k;i++){
		add = add*modinv(i+1,w)%w;
	}
	for(LL i=0;i<n-k-1;i++){
		add = add*(m-1)%w;
	}
	for(LL i=0;i<k+1;i++){
		ans = (ans + add)%w;
		add = add*(m-1)%w;
		add = add*(k-i)%w;
		add = add*modinv(n-k+i,w)%w;
	}
	// syutsuryoku
	cout << ans << endl;
}

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

string s, t;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> s >> t;
	int cnt = 0;
	for(int i = 0; i < (int)s.length(); i++)
		if(s[i] != t[i]) cnt++;
	cout << cnt << "\n";
	return 0;
}


Measured memory_bytes: 3788
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <algorithm>
#include <array>
#include <complex>
#include <string>
#include <utility>
#include <map>
#include <queue>
#include <list>
int dx[4] = { -1,0,1,0 };
int dy[4] = { 0,1,0,-1 };
#define INF 1<<21
using pii = std::pair<int, int>;
#define SORT(v) std::sort(v.begin(), v.end())
int F[100][15];
int main(void) {
	std::string s,ans;
	std::cin >> s;
	for (size_t i = 0; i < s.size(); i++) {
		if (s[i] == '0') {
			ans += '0';
		}
		else if (s[i] == '1') {
			ans += '1';
		}
		else if(s[i]=='B'&&ans.size()!=0){
			ans.pop_back();
		}
	}
	std::cout << ans << std::endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;
 
public class Main{
     
    public static void main(String[] args){
         
        //テキスト入力クラス
        Scanner sc = new Scanner(System.in);
         
        //入力文字を取得
        int first = sc.nextInt();
        int second = sc.nextInt();
        int third = sc.nextInt();
         
        //配列に入れる
        int[] sort = {first,second,third};  
         
        //配列をソートする
        Arrays.sort(sort);
         
        //小さい順に並べる
        System.out.println(sort[0]+" "+sort[1]+" "+sort[2]);
    }
 
}

Measured memory_bytes: 17152
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		char[] N = sc.next().toCharArray();
		int sum = 0;
		for(char c : N)
			sum += c - '0';
		System.out.println(sum%9==0 ? "Yes" : "No");

		sc.close();
	}
}


Measured memory_bytes: 31512
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

template<class T> inline bool chmin(T& a,T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a,T b) {if (a < b) {a = b; return true;} return false;}

const ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

int main(){
  string S; cin >> S;
  string T; cin >> T;

  int N_S = S.size();
  int N_T = T.size();
  vector<vector<int>> dp(N_S + 10, vector<int>(N_T + 10, 0));
  dp[0][0] = dp[0][1] = dp[1][0] = 0;
  for (int i = 0; i < N_S; ++i){
    for (int j = 0; j < N_T; ++j){
      if (S[i] == T[j]) chmax(dp[i + 1][j + 1], dp[i][j] + 1);
      //else chmax(dp[i + 1][j + 1], dp[i][j]);
      chmax(dp[i + 1][j + 1], dp[i + 1][j]);
      chmax(dp[i + 1][j + 1], dp[i][j + 1]);
    }
  }
  string ans = "";
  int i = (int)S.size(), j = (int)T.size();
  while (i > 0 && j >> 0){
    // (i, j + 1) -> (i + 1, j + 1)
    if (dp[i][j] == dp[i - 1][j]) --i;
    // (i + 1, j) -> (i + 1, j + 1)
    else if (dp[i][j] == dp[i][j - 1]) --j;
    // (i, j) -> (i + 1, j + 1)
    else {
      ans = S[i - 1] + ans;
      --i, --j;
    }
  }
  //cout << dp[N_S][N_T] << endl;
  cout << ans << endl;
}


Measured memory_bytes: 35712
#include <iostream>
#include <vector>
#include <string>
#include <string.h>
#include <algorithm>
#include <math.h>
using namespace std;

int main()
{
	int N;
	cin >> N;
	for (int i = 0;; i += 1000) {
		if (i <= N&&N <= i + 1000) {
			cout << (i + 1000 - N);
			break;
		}
	}
}

Measured memory_bytes: 3632
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int p = sc.nextInt();
    int t = 0;
    for(int i = 0; i < n; i++) {
      int a = sc.nextInt();
      if((a % 2) == 1) t++;
    }
    long ans = (long)Math.pow(2, n - 1);
    if(t == 0) {
      if(p == 0) {
        ans = (long)Math.pow(2, n);
      } else {
        ans = 0;
      }
    } 
    System.out.println(ans);
  }
}

Measured memory_bytes: 23764
#include <iostream>

using namespace std;
int cnt[3] = {};
int main(){
	int i,n,a,b;
	cin >> n >> a >> b;
	for(i=0;i<n;i++){
		int x;
		cin >> x;
		if(x<=a) cnt[0]++;
		else if(x<=b) cnt[1]++;
		else cnt[2]++;
	}
	int ans = 1000;
	for(i=0;i<3;i++){
		ans =  min(ans,cnt[i]);
	}
	cout << ans << endl;
}
		

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
char c[5][5],d[5][5];
int main() {
	for (int i=1;i<=2;++i) scanf("%s",c[i]+1);
	for (int i=1;i<3;++i)
		for (int j=1;j<4;++j)
			d[3-i][4-j]=c[i][j];
	for (int i=1;i<3;++i)
		for (int j=1;j<4;++j)
			if (d[i][j]^c[i][j]) {
				puts("NO");
				return 0;
			}
	puts("YES");
	return 0;
}

Measured memory_bytes: 256
import CoreFoundation
let arr=readLine()!.characters.split{$0==" "}.map{Int(String($0))!}

let n = arr[0]

var move = 0
var min = n 
for i in 1...Int(sqrt(Double(n))) {
  if( ( n % i ) == 0 ) {
    if( ( n / i ) + i - 2 < min ) {
      min = ( n / i ) + i - 2
    }
  }
}

print( min )

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


using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define fore(i,a) for(auto &i:a)

typedef pair <int, int> P;
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
const int  INF = 1 << 30;
const ll INFL = 1LL << 60;
const ll mod = 1000000007;




int main() {
	
	int n;
	cin >> n;
	cout << n * n*n << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>    //std::min/max_elementの使用に必要
#include <numeric>  //std::accumurateの使用に必要
using namespace std;

int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    for (int i=0; i<N; i++) {cin >> a[i];}
    int min = *min_element(a.begin(), a.end()); //そのままではイテレータを返すので*をつける
    int max = *max_element(a.begin(), a.end());
    long long sum = accumulate(a.begin(), a.end(),0LL); //第3引数は初期値で最後に足す（今回は桁数の問題で long long を使用 => 初期値を0LLと指定 ）
    cout << min << " " << max << " " << sum << endl;
    return 0;
}


Measured memory_bytes: 3156
import java.util.*;

public class Main {

  public static void main (String[] args) {

    Scanner sc = new Scanner(System.in);

    String S = sc.next();
    long K = sc.nextLong();

    sc.close();

    String[] s = S.split("");
    
    TreeMap<Integer, Integer> map = new TreeMap<>();

    int count = 0;
    map.put(count, 1);
    for (int i = 1; i < s.length; i++) {
      if (s[i - 1].equals(s[i])) {
        int v_ = map.get(count);
        map.put(count, v_ + 1);
      } else {
        count++;
        map.put(count, 1);
      }
    }

    if (map.size() == 1) {
    
      System.out.println(s.length * K / 2);
    
    } else {

      int result = 0;
      int size = map.size();
      
      if (!s[0].equals(s[s.length-1])){
      
        for (int i = 0; i < size; i++) {
          int v_ = map.get(i);
          result += v_ / 2;
        }

        System.out.println(result * K);
      
      } else {

        for (int i = 0; i < size; i++) {
          int v_ = map.get(i);
          result += v_ / 2;
        }
        
        int a1 = map.get(0) / 2 + map.get(size - 1) / 2;
        int a2 = (map.get(0) + map.get(size - 1)) / 2;

        System.out.println(result * K + (a2 - a1) * (K - 1));
        
      }

    }

  }

}

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


using namespace std;

using ll   = long long;
using ii   = pair   < int , int >;
using i3   = pair   < int , ii  >;
using li   = pair   < ll  , int >;
using lii  = pair   < ll  , ii  >;
using pll  = pair   < ll  , ll  >;
using vi   = vector < int       >;
using vl   = vector < ll        >;
using vii  = vector < ii        >;
using vli  = vector < li        >;
using vpll = vector < pll       >;
using vi3  = vector < i3        >;
using vlii = vector < lii       >;


const int N = 2e5 + 5;
const ll INF = 1e17 + 7;
const double eps = 1e-9 , PI = acos(-1);



int n;
map < int , int > freq;

void solve(int testCase){

    scanf("%d" , &n);

    ll ans = 0;
    for(int i = 1 ; i <= n ; i ++) {
            int x; scanf("%d" , &x);

            int curr = i - x;
            ans += 1ll * freq[curr];

            freq[i + x] ++;
    }
    printf("%lld\n" , ans);

}

main(){

    int t = 1;
    // scanf("%d" , &t);

    for(int testCase = 1 ; testCase <= t ; testCase ++){
            solve(testCase);
    }

    return 0;
}


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

int main(){
	
	int flg[4][14]={};
	int p[256];
	p['S']=0;
	p['H']=1;
	p['C']=2;
	p['D']=3;
	char e[5]="SHCD";
	int n;
	cin>>n;
	while(n--){
		char c;
		int r;
		cin>>c>>r;
		flg[p[c]][r]=1;
	}
	for(int i=0;i<4;i++){
		for(int j=1;j<=13;j++){
			if(flg[i][j]==0){
				cout<<e[i]<<" "<<j<<endl;
			}
		}
	}
	
	return 0;
}


Measured memory_bytes: 1160
#[allow(unused_imports)]
use proconio::{input, marker::*};

#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

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

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

fn fact(n: usize) -> Vec<usize> {
    let mut res = Vec::new();
    for i in 1.. {
        if i * i > n {
            break;
        }
        if i * i == n {
            res.push(i);
        } else if n % i == 0 {
            res.push(i);
            res.push(n / i);
        }
    }
    res
}

fn main() {
    input! {
        n: usize,
        mut a: [usize; n],
    }

    let mut map = BTreeMap::new();
    for &e in &a {
        *map.entry(e).or_insert(0) += 1;
    }
    let mut sum = 0usize;
    for &e in &a {
        let val = map.get(&e).cloned().unwrap();
        if val > 1 {
            continue;
        }

        let mut flag = false;
        for b in fact(e) {
            if e == b {
                continue;
            }
            if map.contains_key(&b) {
                flag = true;
            }
        }
        if !flag {
            sum += 1;
        }
    }
    println!("{}", sum);
}


Measured memory_bytes: 9612