akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i,k,n) for(int i = k; i < n; i++)  
#define repp(i,k,n) for(int i = k; i <= n; i++) 
#define per(i,k,n) for(int i = k; i >= n; i--)

#define int long long
#define all(a) a.begin(),a.end()       

#define pb push_back
typedef long long ll; 
typedef pair<int, int> ii;
typedef pair<int,ii > iii; 
typedef vector<ii> vii;
typedef vector<char> vchar;
typedef vector<int> vi;
#define ff first
#define ss second

#define mem(a, b) memset(a, b, sizeof(a));
#define mem0(a) memset(a, 0, sizeof(a));

#define INF 1000000000
#define mod 998244353
//#define mod 1000000007
#define endl "\n"


   //=\/=\/=\/=\/=\/=\/=\/=\/=\/=\        Jai Hind Dosto        /=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\\
  //=\/=\/=\/=\       RETARDED     ̿̿ ̿̿ ̿̿ ̿'̿'\̵͇̿̿\з= ( ▀ ͜͞ʖ▀) =ε/̵͇̿̿/’̿’̿ ̿ ̿̿ ̿̿ ̿̿      NISHAN                 /=\/=\/=\/=\\
 //=\/=\/=\/=\         APE                                           SINGH                   /=\/=\/=\/=\\
//=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\/=\\


int modPow(int a, int b);
void solve(){


    int a;
    string b;
    cin >> a >>b;
    int c =0;
    c += 100*(b[0]-'0');
    c += 10*(b[2]-'0');
    c += 1*(b[3]-'0');
    int d = a*c;
    d/=100;
    cout << d <<endl;



}






signed main(){

    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //cout << fixed;
    //cout <<setprecision(2);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    
   // int test=1; cin >> test;
   // while(test--)
    solve();
}


int modPow(int a, int b){
    if(b==0)return 1;
    if(b%2==0){
        int x = a*a;
        x%=mod;
        return modPow(x,b/2);
    }
    return (a*modPow(a,b-1))%mod;
}


Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s;
  cin>>s;
  for(int i=2;i<s.size();i+=2){
    string sub=s.substr(0,s.size()-i);
    string f=sub.substr(0,(sub.size()/2));
    string b=sub.substr((sub.size()/2),(sub.size()/2));
    if(f==b){cout<<sub.size()<<endl;break;}
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
const int INT_INF = 1LL << 30;
#define MOD 1000000007LL

int main(){
  ll N, K;
  cin >> N >> K;
  ll ans = 0;
  for(ll b = K+1; b <= N; b++){
    //bで割ってK以上余るN以下の数
    ans += N/b * (b-K);
    if(K == 0) ans--; //0を除外
    ll ex = max(0LL, N%b - K + 1LL);
    ans += ex;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import bisect
n = int(input())
l = len(str(n))
ary = []
siti = ["3","5","7"]
def dfs (s,t):
	if len(s) == t:
		if s.count("3") > 0 and s.count("5") > 0 and s.count("7") > 0:
			ary.append(int(s))
		return
	for j in siti:
		dfs(s+j,t)
for i in range(3,l+1):
	dfs("",i)
# ary.sort()
print (bisect.bisect_right(ary,n))

Measured memory_bytes: 4084
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <queue>
#include <stack>
#include <stdlib.h>
using namespace std;
#define rep(i,n) for (int i = 0; i <n; i++) 


int main(void)
{
   int n;
   std::cin >> n;
   std::vector<int> a;
   rep(i,n){
       int t;std::cin >> t;
       a.push_back(t);
       //std::cin >> a[i];
   }
   int aa,b;
   sort(a.begin(),a.end());
   aa=0;b=0;
   rep(i,n){
       if(i%2==0)aa+=a[n-i-1];
       else b+=a[n-i-1];
   }
   std::cout << aa-b << std::endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
unsigned long long n,ain,bin,c1=0;
void compute(unsigned long long S,unsigned long long X)
{
    if((S - X)%(unsigned long long)2){
        cout<<-1;
        return;
    }
    unsigned long long A = (S - X)/(unsigned long long)2;
    unsigned long long d=0;
    unsigned long long a = 0, b = 0;
    for (long long i=0; i<8*sizeof(S); i++)
    {
        unsigned long long Xi = (X & ((unsigned long long)1 << (unsigned long long)i));
        unsigned long long Ai = (A & ((unsigned long long)1 << (unsigned long long)i));
        if (Xi == 0 && Ai == 0)
        {
        }
        else if (Xi == 0 && Ai > 0)
        {
            a = (((unsigned long long)1 << (unsigned long long)i) | a);
            b = (((unsigned long long)1 << (unsigned long long)i) | b);
        }
        else if (Xi > 0 && Ai == 0)
        {
            d = (((unsigned long long)1 << (unsigned long long)i) | d);
            /*if(ain & (1<<i)){
                a = ((1 << i) | a);
            }else{
                b = ((1 << i) | b);
            }*/
        }
        else
        {
            cout << "-1";
            return;
        }
    }
    for(long long i=8*sizeof(d)-1; i>=0; i--){
        if(((unsigned long long)1<<(unsigned long long)i) & d){
            if(a+((unsigned long long)1<<(unsigned long long)i)>ain){
                b+=((unsigned long long)1<<(unsigned long long)i);
            }else{
                a+=((unsigned long long)1<<(unsigned long long)i);
            }
            //d-=((unsigned long long)1<<(unsigned long long)i);
        }
    }
    if(a>ain){
        cout<<-1;
    }else if(a==0){
        cout<<-1;
    }else{
        cout<<(long long)ain-(long long)a;
    }
}
int main()
{
    cin>>n>>ain>>bin;
    for(long long i=2; i<n; i++){
        unsigned long long in;
        cin>>in;
        c1^=in;
    }
    compute(ain+bin,c1);
}


Measured memory_bytes: 3636
#include<stdio.h>
#include<string.h>
	int main(){
	int A,B;
	char S[15],T[15],U[15];
	
	scanf("%s %s",&S,&T);
	scanf("%d %d",&A,&B);
	getchar();
	scanf("%s",&U);
	
	if( strcmp(S,U)==0){
		A--;
		
	}
	else {
		B--;
	}		
		printf("%d %d",A,B);
		
		
		
		return 0;
	}


Measured memory_bytes: 1700
from collections import defaultdict
from collections import deque
from collections import Counter
import itertools
import math

def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()

n = readInt()
sn = [list(input()) for i in range(n)]

ans = ""
for i in range(97,123):
	m = float("inf")
	for j in sn:
		m = min(m,j.count(chr(i)))
	ans+=chr(i)*m

print(ans)

Measured memory_bytes: 9468
#!/usr/bin/env python3
import sys


def solve(N: int):
    if N < 1000:
        ret = 'ABC'
    else:
        ret = 'ABD'
    print(ret)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)

if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
#define repi(i, a, b) for(int i=a; i<(b); i++)
#define all(x) (x).begin(),(x).end()
using ll = long long;
using P = pair<int, int>;

const int mod = 1000000007;
const int MAX = 1e6+1;
//  n!  *   (k!)^-1  *  ((n-k)!)^-1
ll fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
// 計算量　O(n)
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; ++i){
        fac[i] = fac[i - 1] * i % mod;
        inv[i] = mod - inv[mod%i] * (mod / i) % mod;
        finv[i] = finv[i - 1] * inv[i] % mod;
    }
}

// 二項係数計算 nCk
// 計算量　O(1)
ll Combination(ll n, ll k){
    if (n < k){
        return 0;
    }
    if (n < 0 || k < 0){
        return 0;
    } 
    return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}

int main()
{
    ll x, y;
    cin >> x >> y;

    if((x + y) % 3 != 0){
        cout << 0 << endl;
        return 0;
    }

    ll n = (2*y - x) / 3;
    ll m = (2*x - y) / 3;
    if(n < 0 || m < 0){
        cout << 0 << endl;
        return 0;
    }
    
    COMinit();

    ll ans = Combination(n+m, n);

    cout << ans << endl;

    return 0;
}

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

typedef long long ll;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)

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

ll A, B, C, D, E, F, G, H, I, J, K, L, M,
N, O, P, Q, R, S, T, U, V, W, X, Y, Z;

void aojHanafudaShuffle();
int main()
{
	aojHanafudaShuffle();
	return 0;
}

void aojHanafudaShuffle()
{
	N = R = 1;
	while (true) {
		cin >> N >> R;
		if (N == 0 and R == 0) break;

		vector<ll> cards(N);
		REP(i, N) cards[i] = i + 1;

		REP(i, R) {
			cin >> P >> C;
			vector<ll> tmp(C);
			copy(cards.begin() + (N - (C + P - 1)), cards.begin() + N - (P - 1), tmp.begin());
			copy(cards.begin() + (N - (P - 1)), cards.end(), cards.begin() + (N - (C + P - 1)));
			copy(tmp.begin(), tmp.end(), cards.begin() + (N - C));
		}

		cout << cards[cards.size() - 1] << endl;
	}
}


Measured memory_bytes: 3104
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#define INF 1e9+7
using namespace std;
typedef long long int ll;


int main() {

	int n, m, cx, cy;
	int x, y;
	int maxx, miny;
	
	cin >> n >> m >> cx >> cy;

	for (int i = 0; i < n; i++) {
		cin >> x;
		if (i == 0) { maxx = x; }
		maxx = max(maxx, x);
	}

	for (int i = 0; i < m; i++) {
		cin >> y;
		if (i == 0) { miny = y; }
		miny = min(miny, y);
	}

	maxx = max(maxx, cx);
	miny = min(miny, cy);


	if (miny-maxx>=1) {
		cout << "No War" << endl;
	}
	else {
		cout << "War" << endl;
	}

	return 0;
}


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

int main(){
	int n, m, k; cin>>n>>m>>k;
	int A[n], B[m];
	rep(i, n) cin>>A[i];
	rep(i, m) cin>>B[i];
	int64_t tot = 0; rep(i, m) tot += B[i];
	int ans = 0, j = m;
	rep(i, n+1){
		while(j>0 && tot > k) tot -= B[--j];
		if(tot > k) break;
		ans = max(ans, i+j);
		tot += A[i];
	}
	cout<< ans <<endl;
}


Measured memory_bytes: 5188
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse4")

using namespace std;

#define FOR(a,b) for(int a=0;a<b;a++)
#define F0R(a,b,c) for(int a = b; a<=c; a++)
#define f first
#define s second
#define m0(x) memset(x,0,sizeof(x))

typedef pair<int,int> pi;
typedef long long ll;
typedef vector<int> vi;
typedef vector<pi> vpi;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n; cin >> n;
    vi val(n);
    FOR(i,n) cin >> val[i];
    int nval = 0;
    FOR(i,n) nval ^= val[i];
    FOR(i,n) cout << (int)(val[i]^nval) << " ";
    cout << endl;
    return 0;
}


Measured memory_bytes: 3972
#pragma GCC optimize("O3")
//#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld  double
#define pii pair<int,int>
#define pip pair<int,pii>
#define ppi pair<pii,int> 
#define ppp pair<pii,pii>
#define pb push_back
#define ppb pop_back
#define pf push_front
#define ppf pop_front
#define ff first
#define ss second
#define warmup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
const int N = 200003, mod=1e9+7;
const ll inf=(1e9+11);

signed main()
{
    warmup
    
    int n;
    cin>>n;
    string s[n+1];
    int i,j,a,sz,b,f;
    for(i=1;i<=n;++i)
        cin>>s[i];
    stack<char> st;
    vector<pii> v[2];
    int c1=0, c2=0;
    for(i=1;i<=n;++i)
    {
        sz=s[i].size();
        for(j=0;j<sz;++j)
            if(s[i][j]=='(' or st.empty() or st.top()==')')
                st.push(s[i][j]);
            else 
                st.pop();
        a=0, b=0;
        if(st.empty())
            continue;
        f=(st.top()=='(');
        while(!st.empty())
        {
            if(st.top()=='(')
                ++a;
            else
                ++b;
            st.pop();
        }
        
        if(!b)
            c1+=a;
        else if(a-b>=0)
            v[0].pb({a,b});
        else
            v[1].pb({a,b});
    }      
    
    sort(v[0].begin(), v[0].end(), [&](pii a,pii b){
        if(a.ss==b.ss)
            return a.ff>b.ff;
        return a.ss<b.ss;
    });
    sort(v[1].begin(), v[1].end(), [&](pii a,pii b){
        if(a.ff==b.ff)
            return a.ss<b.ss;
        return a.ff>b.ff;
    });
    
    for(auto it:v[0])
    {
        c1-=it.ss;
        if(c1<0)
            return cout<<"No", 0;
        c1+=it.ff;
    }   
    for(auto it:v[1])
    {
        c1-=it.ss;
        if(c1<0)
            return cout<<"No", 0;
        c1+=it.ff;
    }
    cout<<(c1!=0 ? "No":"Yes");
    
    return 0;
}


Measured memory_bytes: 38560
local read = setmetatable({}, {__index = function(t, k) local a = {} for i=1,#k do table.insert(a, '*'..string.sub(k, i, i)) end local r = io.read local u = table.unpack or unpack return function() return r(u(a)) end end})
read.N = function(N) local t={} for i=1,N do t[i]=read.n() end return t end
string.totable = function(s) local t={} local u=string.sub for i=1,#s do t[i] = u(s, i, i) end return t end
string.split = function(s) local t={} for w in string.gmatch(s, "[^%s]+") do table.insert(t, w) end return (table.unpack or unpack)(t) end
local function array(dimension, default_val) local n=dimension local m={}if default_val~=nil then m[1]={__index=function()return default_val end}end for i=2,n do m[i]={__index=function(p, k)local c=setmetatable({},m[i-1])rawset(p,k,c)return c end}end return setmetatable({},m[n])end
----
local S = read.l():totable()
local a = S[1]
for i=2,3 do
    if S[i] ~= a then
        print("Yes")
        return
    end
end
print("No")

Measured memory_bytes: 1136
#include <bits/stdc++.h>
#define LL long long

const int mod = 998244353;
const int N = 3e3 + 5;

int n, m;
int a[N], f[N][N];

int main() {
    std::cin >> n >> m;
    for(int i = 1; i <= n; ++i) std::cin >> a[i];
    f[0][0] = 1;
    for(int i = 0; i <= n; ++i) {
        for(int j = 0; j <= m; ++j) {
            f[i + 1][j] += (2LL * f[i][j] % mod);
            f[i + 1][j] %= mod;
            if(j + a[i + 1] <= m) {
                f[i + 1][j + a[i + 1]] += f[i][j];
                f[i + 1][j + a[i + 1]] %= mod;
            }
        }
    }
    std::cout << f[n][m];
    return 0;
}


Measured memory_bytes: 38808
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) begin(v),end(v)
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
//---------------------------------//

template <typename T>
struct SegTree {
	T init_val;
	int n;
	vector<T> dat;
	
	SegTree() {}
	SegTree(int _n, T init_val) : init_val(init_val) {
		n = 1;
		while (n < _n) n *= 2;
		dat.resize(n * 2 - 1, init_val);
	}
	
	void update(int i, T x) {
		i += n - 1;
		dat[i] = min(dat[i], x);
		while (i > 0) {
			i = (i - 1) / 2;
			dat[i] = min(dat[i * 2 + 1], dat[i * 2 + 2]);
		}
	}
	
	void set(int i, T x) {
		dat[i + n - 1] = x;
		update(i, x);
	}
	
	// 探索範囲[a,b), 現在見ているkノード[l,r)
	T query(int a, int b, int k = 0, int l = 0, int r = -1) {
		if (r < 0) r = n;
		
		if (r <= a || b <= l) return init_val;
		if (a <= l && r <= b) return dat[k];
		return min( query(a, b, k * 2 + 1, l, (l + r) / 2), query(a, b, k * 2 + 2, (l + r) / 2, r) );
	}
};

int N, Q;
string S;

int main() {
	cin >> N >> S >> Q;
	
	SegTree<int> seg[26];
	REP(i, 26) seg[i] = SegTree<int>(N, INF);
	
	REP(i, N) seg[S[i]-'a'].set(i, 0);
	
	while (Q--) {
		int q;
		scanf("%d",&q);
		if (q == 1) {
			int i;
			char c;
			scanf("%d %c ", &i, &c);
			--i;
			seg[S[i]-'a'].set(i, INF);
			seg[c-'a'].set(i, 0);
			S[i] = c;
		}
		else {
			int l, r;
			scanf("%d %d", &l, &r);
			--l;
			int ans = 0;
			REP(i, 26) if (seg[i].query(l, r) != INF) ++ans;
			printf("%d\n", ans);
		}
	}
	return 0;
}


Measured memory_bytes: 109572
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    
    ArrayList<Float> v = new ArrayList<Float>();
    for(int i = 0; i < n; i++) {
    	float hoge = sc.nextFloat();
    	v.add(hoge);
    }
    
    for(int i = 0; i < n-1; i++) {
    	int minIndex1 = v.indexOf(Collections.min(v));
    	float mixV1 = v.get(minIndex1);
    	v.remove(minIndex1);
    	
    	int minIndex2 = v.indexOf(Collections.min(v));
    	float minV2 = v.get(minIndex2);
    	v.remove(minIndex2);
    	
    	
    	float value = (mixV1 + minV2) / 2;
    	
    	v.add(value);
    }
    
    System.out.println(v.get(0));
    sc.close();
    
  }
}

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

typedef  long long ll;
//forループ
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
//
//
#define int long long

using namespace std;

int ctoi(char c) {
 switch (c) {
 case '0': return 0;
 case '1': return 1;
 case '2': return 2;
 case '3': return 3;
 case '4': return 4;
 case '5': return 5;
 case '6': return 6;
 case '7': return 7;
 case '8': return 8;
 case '9': return 9;
 default: return 0;
 }
}


 ll a,b,c,s,t,x,y,z;
 ll A,B,C,S,T,X,Y,Z;

 ll count;

 long double pi=3.14159265358979323846;

 string N,M;

unsigned long long D;

signed main(){

	cin>>a>>b;

	int f[b];

		REP(i,b){
		cin>>f[i];
		a=a-f[i];
		if(a<0){
	cout<<-1;
	return 0;
}
	}

	cout<<a;

	return 0;

}


Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    bool a=0;
    cin>>s;
    for (int i=0;i<s.length();i++)
    {
    	if (s[i]=='C') a=1;
    	if (s[i]=='F'&&a==1) {
    		cout<<"Yes";return 0;
		}
	}
	cout<<"No";
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll mod=1e9+7;
const ll lmt=1010;
ll ans[lmt][lmt];
ll n,m;
char c[lmt][lmt];
int main()
{
    cin>>n>>m;
    for(ll i=1;i<=n;i++)
    {
        for(ll j=1;j<=m;j++)
        {
            cin>>c[i][j];
        }
    }
    ans[1][1]=1;
    for(ll i=1;i<=n;i++)
    {
        for(ll j=1;j<=m;j++)
        {
            ans[i][j]=((ans[i][j])%mod+(ans[i-1][j])%mod+(ans[i][j-1])%mod)%mod;
            if(c[i][j]=='#')
            {
                ans[i][j]=0;
            }
        }
    }
    cout<<ans[n][m]<<endl;
    return 0;
}


Measured memory_bytes: 9088
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int N, score;
string city;
vector<pair<string, pair<int,int>>> v;
int main() 
{
  cin >> N;
  for (int i = 1; i <= N; ++i) {
    cin >> city >> score;
    v.push_back({ city,{score, i} });
  }

  sort(v.begin(), v.end(), [](auto A, auto B) {
    if (A.first < B.first) return true;
    else if (A.first == B.first) {
      if (A.second.first > B.second.first)
        return true;
    }
    return false;
    });

  for (auto & i : v) {
    cout << i.second.second << '\n';
  }
}

Measured memory_bytes: 256
#!/usr/bin/env python3
import sys

YES = "Yes"  # type: str
NO = "No"  # type: str

def solve(s: str):
    sl = [i for i in list(s) if i =='C' or i == 'F']
    if(''.join(sl).count('CF') > 0):
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    s = next(tokens)  # type: str
    solve(s)

if __name__ == '__main__':
    main()


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

int main(){
  int n, k;
  map<char, ll> score;
  string t;
  cin >> n >> k >> score['s'] >> score['p'] >> score['r'] >> t;
  vector<char> memory(k, 'a');

  ll ans;

  for (int i=0; i<n; i++){
    if (t[i] == memory[i%k]){
      memory[i%k] = 'a';
    }
    else{
      memory[i%k] = t[i];
      ans += score[t[i]];
    }
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <deque>
#include <thread>

using namespace std;

int main()
{
    int n;
    int x, y;
    int dist[300010] = {};

    cin >> n >> x >> y;

    for (int i = 1; i <= n; i++) {
        for (int j = i+1; j <= n; j++) {
            int dist1 = j-i;
            int dist2 = abs(x-i) + abs(y-j) + 1;
            dist[min(dist1, dist2)]++;
        }
    }

    for (int i = 1; i < n; i++) {
        cout << dist[i] << endl;
    }
}


Measured memory_bytes: 1408
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#define ll   long long
#define ull unsigned long long
#define mp make_pair
#define pii pair<int,int>
#define piii pair<int, pii >
#define pll pair <ll,ll>
#define pb push_back
#define PB pop_back
#define p push
#define P pop
#define INF 2147483647
#define ull unsigned long long
#define vi vector < int >
#define vpii vector < pii >
#define pq priority_queue
#define rep(i,n) for (int (i)=0;(i)<n;(i)++)
#define End return 0
#define mi multiset <int>
#define si set <int>
#define sll set<ll>
#define mll multiset<ll>
#define vll vector <ll>
#define Rep(i,a,b) for (int (i)=(a);(i)<=(b);(i)++)
#define maxn 100005
using namespace std;
ll a[55];
ll k;
int main()
{
    scanf("%lld",&k);
    memset(a,0,sizeof(a));
    for(int i=1;i<=50;i++)
    {
        a[i]=k/50+i-1;
    }
    k=k%50;
    for(int i=1;i<=k;i++)
    {
        for(int j=1;j<=50;j++)
       {
        a[j]--;
       }
       a[i]+=51;
    }
    printf("50\n");
    for(int i=1;i<=50;i++)
    {
        if(i!=1) printf("");
        printf("%lld ",a[i]);
    }
    printf("\n");
    return 0;
}




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

class Main {
    static Scanner scanner = new Scanner();
    static long mod = 1000000007;

    public static void main(String[]$) {
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int[] cost = new int[m];
        int[] c = new int[m];
        for (int i = 0; i < m; i++) {
            int a = scanner.nextInt();
            int b = scanner.nextInt();
            cost[i] = a;
            for (int j = 0; j < b; j++) {
                c[i] += 1 << (scanner.nextInt() - 1);
            }
        }
        int[][] dp = new int[m + 1][1 << n];
        Arrays.fill(dp[0], 0x7fffff);
        dp[0][0] = 0;
        for (int i = 1; i <= m; i++) {
            Arrays.fill(dp[i], 0x7fffff);
            for (int j = 0; j < 1 << n; j++) {
                dp[i][j] = Math.min(dp[i][j], dp[i - 1][j]);
                dp[i][j | c[i - 1]] = Math.min(dp[i][j | c[i - 1]], dp[i - 1][j] + cost[i - 1]);
            }
        }
        System.out.println(dp[m][(1 << n) - 1] == 0x7fffff ? -1 : dp[m][(1 << n) - 1]);
    }

    static class Scanner {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 1 << 15);
        StringTokenizer tokenizer;

        String next() {
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                    tokenizer = new StringTokenizer(reader.readLine());
                }
            } catch (IOException ignored) {
            }
            return tokenizer.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }
}


Measured memory_bytes: 50004
import java.io.*;
import java.util.StringTokenizer;


public class Main {

    public static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner(String s) {
            try {
                br = new BufferedReader(new FileReader(s));
            } catch (FileNotFoundException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();
            }
        }

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

        String nextToken() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(nextToken());
        }

        long nextLong() {
            return Long.parseLong(nextToken());
        }

        double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }

    public static void main(String[] args) {
        FastScanner fs = new FastScanner();

        long X = fs.nextLong();
        long initial = 100;

        int years = 0;
        while (true) {
            initial = initial + (long) (((double) initial) * 0.01);
            years++;
            if (initial >= X) {
                break;
            }
        }

        System.out.println(years);

    }


}


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

float avg( float a, float b){
    return (a+b)/2;
}

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

    vector <float> v;
    while (n--){
        float no;
        cin >> no;
        v.push_back(no);
    }

    sort (v.begin(), v.end());
    for (int i=0; i<v.size()-1; i++){
        v[i+1] = avg(v[i], v[i+1]);
        v[i] =0;
    }


    sort (v.begin(), v.end());
    cout << v[v.size() -1 ] << endl;
}


Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main(void){
    int a, b, c;
    cin >> a >> b >> c;
    if (a<c && c <b) cout <<"Yes"<<endl;
    else if (b<c && c <a) cout <<"Yes"<<endl;
    else cout <<"No"<<endl;
    return 0;
}

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

class UnionFind {
private:
	std::vector<int> parent;
	std::vector<int> height;
	std::vector<int> m_size;
 
public:
	UnionFind(int size_) : parent(size_), height(size_, 0), m_size(size_, 1) {
		for (int i = 0; i < size_; ++i) parent[i] = i;
	}
	void init(int size_) {
		parent.resize(size_);
		height.resize(size_, 0);
		m_size.resize(size_, 1);
		for (int i = 0; i < size_; ++i) parent[i] = i;
	}
	int find(int x) {
		if (parent[x] == x) return x;
		return parent[x] = find(parent[x]);
	}
	void unite(int x, int y) {
		x = find(x);
		y = find(y);
		if (x == y) return;
		int t = size(x) + size(y);
		m_size[x] = m_size[y] = t;
		if (height[x] < height[y]) parent[x] = y;
		else parent[y] = x;
       		if (height[x] == height[y]) ++height[x];
	}
	bool same(int x, int y) {
		return find(x) == find(y);
	}
	int size(int x) {
		if (parent[x] == x) return m_size[x];
		return size(parent[x] = find(parent[x]));
	}
};

int main(){
  long long int n,m;cin>>n>>m;
  long long int a[m],b[m];
  long long int now=n*(n-1)/2;
  UnionFind uf(n);
  vector<long long int> ans;
  for(int i=m-1;i>=0;i--){
    cin>>a[i]>>b[i];
  }
  for(int i=0;i<m;i++){
    long long int x=a[i],y=b[i];
    --x;--y;
    ans.push_back(now);

    if(uf.same(x,y)){continue;}
    now-=uf.size(x)*uf.size(y);
    uf.unite(x,y);
  }

  reverse(ans.begin(),ans.end());

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


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

using namespace std;

int main() {
	string data[10];
	data[0] = " ";
	data[1] = "',.!?";
	data[2] = "abcABC";
	data[3] = "defDEF";
	data[4] = "ghiGHI";
	data[5] = "jklJKL";
	data[6] = "mnoMNO";
	data[7] = "pqrsPQRS";
	data[8] = "tuvTUV";
	data[9] = "wxyzWXYZ";
	string b;
	while (getline(cin, b)) {
		int counter = 0;
		while (counter < b.size()) {
			int counter2 = 0;
			char a = b[counter];
			for (int i = counter+1; i < b.size(); i++) {
				if (b[i] == a) {
					counter++;
					counter2++;
				} else {
					break;
				}
			}
			if (a == '0') {
				if (counter2 == 0) {
				} else {
					for (int i = 0; i < counter2; i++) {
						cout << ' ';
					}
				}
			} else {
				counter2 %= data[a-'0'].size();
				cout << data[a-'0'][counter2];
			}
			counter++;
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1176
{-# LANGUAGE FlexibleContexts, OverloadedStrings #-}
import Control.Applicative
import Control.Monad
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)
import Text.Printf
import Debug.Trace

main = do
  s1 <- getLine
  s2 <- getLine
  putStrLn $ if reverse s1 == s2 then "YES" else "NO"

-- util
getInts :: IO [Int]
getInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine

substr :: Int -> Int -> B.ByteString -> B.ByteString
substr b l s = B.take l $ B.drop b s


Measured memory_bytes: 380
import math
n = int(input())
xy = [list(map(int, input().split())) for i in range(n)]
ans = 0
for i in range(n-1):
    for j in range(i+1,n):
        d = 0
        for k in range(2):
            d+= (xy[i][k]-xy[j][k])**2
        ans += math.sqrt(d)
print(ans*2/n)


Measured memory_bytes: 3064
// dfmt off
T lread(T=long)(){return readln.chomp.to!T;}T[] lreads(T=long)(long n){return iota(n).map!((_)=>lread!T).array;}
T[] aryread(T=long)(){return readln.split.to!(T[]);}void arywrite(T)(T a){a.map!text.join(' ').writeln;}
void scan(L...)(ref L A){auto l=readln.split;foreach(i,T;L){A[i]=l[i].to!T;}}alias sread=()=>readln.chomp();
void dprint(L...)(lazy L A){debug{auto l=new string[](L.length);static foreach(i,a;A)l[i]=a.text;arywrite(l);}}
static immutable MOD=10^^9+7;alias PQueue(T,alias l="b<a")=BinaryHeap!(Array!T,l);import std, core.bitop;
// dfmt on

void main()
{
    long N, K;
    scan(N, K);
    long R, S, P;
    scan(R, S, P);
    auto T = sread();

    auto dp = new long[][](N + 1, 3);
    foreach (i; 0 .. N)
    {
        if (i < K)
        {
            switch (T[i])
            {
            case 'r':
                dp[i + 1][2] = P;
                break;
            case 's':
                dp[i + 1][0] = R;
                break;
            case 'p':
                dp[i + 1][1] = S;
                break;
            default:
                assert(0);
            }
        }
        else
        {
            // dprint(i - K);
            foreach (j; 0 .. 3)
                dp[i + 1][j] = dp[i + 1 - K].reduce!max;
            switch (T[i])
            {
            case 'r':
                dp[i + 1][2] = max(dp[i + 1 - K][0], dp[i + 1 - K][1]) + P;
                break;
            case 's':
                dp[i + 1][0] = max(dp[i + 1 - K][1], dp[i + 1 - K][2]) + R;
                break;
            case 'p':
                dp[i + 1][1] = max(dp[i + 1 - K][0], dp[i + 1 - K][2]) + S;
                break;
            default:
                assert(0);
            }
        }
    }
    dp[$ - K .. $].map!(reduce!max).sum().writeln();
}


Measured memory_bytes: 8800
package main

import (
	"fmt"
	"math"
)

func main() {
	var N, A, B int
	fmt.Scan(&N, &A, &B)
	div := N / (A + B)
	rem := N % (A + B)
	// ans := div*A + min(rem, A)
	// fmt.Println(ans)
	// A==0の場合は結果的に場合分けしなくて良い
	// divが、N個のボールのうち高橋くんが実行する回数（余りを含まない）
	// remがdiv回の操作が行われた余り。
	// remがAより小さかったらそれはすべて青いボール
	// remがAより大きかったらA個のボールが含まれる
	// if A == 0 {
	// 	fmt.Println(0)
	// } else
	if rem < A {
		fmt.Println(div*A + rem)
	} else {
		fmt.Println(div*A + A)
	}
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}


Measured memory_bytes: 512
let permutation ( * ) n =
  Array.fold_left ( * ) 1 @@ Array.init n @@ fun i -> i + 1

let modulo = 1000000007

let ( *^ ) m n = ((m mod modulo) * (n mod modulo)) mod modulo

(* If N = M :
  DMDM
  MDMD
  If N = M + 1 :
  DMDMD
  if N = M - 1 :
  MDMDM
  otherwise :
  impossible *)
let () = Printf.printf "%d\n" @@ Scanf.scanf "%d %d" (fun n m ->
  if n = m then
    let perm = permutation ( *^ ) n in
    2 *^ perm *^ perm
  else if n = m + 1 then
    let perm = permutation ( *^ ) m in
    n *^ perm *^ perm
  else if n = m - 1 then
    let perm = permutation ( *^ ) n in
    m *^ perm *^ perm
  else 0)

Measured memory_bytes: 2944
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SORT(x) sort(all(x));
#define RSORT(x) sort(rall(x));
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const int inf = 1<<29;
const ll mod = 1000000007;
const double eps = 1e-9;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//cout << fixed << setprecision(10);

int main () {
  string S; cin >> S;
  int N = S.size();

  vi ans(N);
  rep(ri,2) {
    // solve R
    int cnt = 0;
    rep(i,N) {
      if (S[i] == 'R') {
        cnt++;
      }
      else {
        ans[i] += cnt/2;
        ans[i-1] += (cnt+1)/2;
        cnt = 0;
      }
    }

    reverse(all(ans));
    reverse(all(S));
    rep(i,N) {
      if (S[i] == 'L') {
        S[i] = 'R';
      }
      else {
        S[i] = 'L';
      }
    }
  }

  rep(i,N) {
    printf("%d\n", ans[i]);
  }
  return 0;
}

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

#define int long long 
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

typedef long long ll;
typedef long double ld;

signed main() {
    IOS;
    int n,m;
    cin>>n>>m;
    if(n==m) {
        cout<<"Yes"<<endl;
    }
    else {
        cout<<"No"<<endl;
    }

return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl

using namespace std;

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

const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll LINF = 1e18;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const int ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

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

int lcm(int a, int b) { return a * b * gcd(a, b); }

bool compareP(pair<int, int> a, pair<int, int> b) {
    if (a.second != b.second) {
        return a.second < b.second;
    } else {
        return a.first < b.first;
    }
}

int main() {
    int n;
    cin >> n;
    double tmp;
    if (n % 2 == 0) {
        tmp = n / 2;
    } else {
        tmp = n / 2 + 1.0;
    }
    cout << tmp / n << endl;
}

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

//{ START
using namespace std;
#define int int64_t
#define rep(i, a, n) for (int i = (a); i < (n); ++i)
#define reps(i, a, n) for (int i = (n - 1); i > (a - 1); --i)
#define arep(i, x) for (auto &&i : (x))
#define irep(i, x) for (auto i = (x).begin(); i != (x).end(); ++i)
#define rirep(i, x) for (auto i = (x).rbegin(); i != (x).rend(); ++i)
//降順はgreater<T>()
#define all(x) (x).begin(), (x).end()
#define rv(s) reverse((s).begin(), (s).end())
// gcd lcmはそのままok
#define gcd(a, b) __gcd(a, b)
#define bits(n) (1LL << (n))
#define pcnt(x) __builtin_popcountll(x)
//配列内等要素削除
#define Unique(x) (x).erase(unique((x).begin(), (x).end()), (x).end())
#define Fixed(n) fixed << setprecision(n)
//総和
#define sowa(n) (((n) * ((n) + 1)) / 2)
#define updiv(a, b) ((a + b - 1) / b)
#define cauto const auto &
using P = pair<int, int>;
using Graph = vector<vector<P>>;
template <class T>  //昇順
using min_heap = priority_queue<T, vector<T>, greater<T>>;
template <class T>  //降順
using max_heap = priority_queue<T>;
template <class A, class B>
using umap = unordered_map<A, B>;
template <class A>
using uset = unordered_set<A>;
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val) {  //多次元初期化
  std::fill((T *)array, (T *)(array + N), val);
}
template <class A, class B>
bool chmax(A &a, const B &b) {  //最大値更新 返り値はbool
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class A, class B>
bool chmin(A &a, const B &b) {  //最小値更新 返り値はbool
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, 1, 1, -1, -1};
constexpr int INF = 0x3f3f3f3f;
constexpr int LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod1 = 1e9 + 7;
constexpr int mod2 = 998244353;
//} END

signed main(void) {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);

  int n, k;
  cin >> n >> k;
  int a = n / k;
  int b = (n * 2 + k) / (k * 2);
  a = a * a * a;
  b = b * b * b;
  cout << (k % 2 == 0 ? a + b : a) << '\n';
  return 0;
}

Measured memory_bytes: 3584
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.stream.Stream;

public class Main {
    private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    private static PrintWriter pw = new PrintWriter(System.out);
    public static void main(String[] args) throws IOException {
        func();
        pw.flush();
        return;
    }

    static void func() throws IOException {
        int[] input = arrayOfInt();
        int n = input[0];
        int m = input[1];

        // 1.N個の数が最大公約数Dを持つということから、
        // 　その合計値のMの約数にもDを含んでいることがわかる。
        // 2.MがDを約数としているとき、D×NがMを超えると成立しなくなるので、
        //   取りうるDの最大値はM/Nとなる
        // ex.) ・N = 3 M = 14のとき、Mの約数は 1 2 7となる
        //      ・最大公約数が7のとき、数列は全て7以上となるため、
        //      　最低値の7×3でも21となり成立しない。
        //      ・最大公約数が2のとき、数列は全て2以上となるため、
        //      　最低値の2×3は6となり、取りうる最大公約数となる。

//        // (一回目のAC解 テストケースによっては10^9ループ回ってTLEになるので想定解ではなさそう)
//        // 最大値を求める問題なので、取りうる最大値からマイナスして成立するものを探すほうが早い
//        int MAX = Math.floorDiv(m, n);
//        long ans = 1;
//        for(int i = MAX;1 < i;i--){
//            if (m%i == 0){
//                ans = i;
//                break;
//            }
//        }

        // 想定解っぽいやつ
        // Mの平方根までの約数と、その約数で割った値で全ての約数が求められるため
        // それらの値が条件に一致するかどうかをチェックして最大値を入れる
        int MAX = Math.floorDiv(m, n);
        long ans = 1;
        for (int i = 1; i*i <= m; i++) {
            if (m % i != 0) continue;
            if(i <= MAX) ans = Math.max(ans,i);
            if (m / i <= MAX) ans = Math.max(ans,m/i);
        }
        println(ans);
    }
    // 入力受け取り
    static String next() throws IOException {return br.readLine();}
    static int nextInt() throws IOException{return getInt(br.readLine());}
    static long nextLong() throws IOException{return getLong(br.readLine());}
    static String[] arrayOfString() throws IOException{return br.readLine().split(" ");}
    static int[] arrayOfInt() throws IOException{return toIntArray(arrayOfString());}
    // 変換
    static long getLong(String val) {return Long.parseLong(val);}
    static int getInt(String val) {return Integer.parseInt(val);}
    static int[] toIntArray(String[] array) {return Stream.of(array.clone()).mapToInt(Integer::parseInt).toArray();}
    static String joinToString(String[] array) {
        StringBuilder sb = new StringBuilder();
        for(int i = 0;i < array.length;i++) sb.append(array[i]);
        return sb.toString();
    }

    // 出力
    static void println(Object val){pw.println(val);}
}

Measured memory_bytes: 30036
#include <iostream>
using namespace std;
int main(void){
  long long n;
  cin >> n;
  
  long long p = 100;
  int ans = 0;
  
  while(p < n){
    p *= 1.01;
    ans ++;
  }
  
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;

#define repr(i, n) for(int i = n; i >= 0; i--)
#define reprl(i, n) for(ll i = n; i >= 0; i--)
#define all(v) v.begin(), v.end()

const ll mod=1000000007;

int countBits(int in){
  int res=0;
  for(int i=0;i<10;i++){
    int msk=1<<i;
    if((in&msk)!=0){
      res++;
    }
  }
  return res;
}

template<typename T>
void show2dVector(vector<vector<T>>& v){
  for(int i=0;i<v.size();i++){
    int m=v[i].size();
    cout<<i<<" : ";
    for(int j=0;i<m;i++){
      cout<<v[i][j]<<" ";
    }
    cout<<endl;
  }
}

void bfs(const vector<vector<int>>&g, int v, vector<bool>& seen){
  seen[v]=true;
  cout<<v<<" ";
  for(auto next: g[v]){
    if(seen[next]){
      continue;
    }
    bfs(g,next,seen);
  }
}

bool dfs(vector<vector<int>> &g,int start,vector<ll> &v,int goal,vector<bool>&seen){
  bool res=false;
  seen[start]=true;
  v[start]+=goal;
  for(auto next: g[start]){
    if(seen[next]){
      continue;
    }
    res=dfs(g,next,v,v[start],seen);
  }
  return res;
}

ll gcd(ll a,ll b) {
  return b? gcd(b,a%b): a;  
}
ll lcm(ll a,ll b) {
  return a*b/gcd(a,b);
}
bool isLowerCase(char c){
  return (c>='a'&&c<='z');
}
const string outputYesNo(bool ans){
  return (ans?"Yes":"No");
}
int main() {
  int n,q;cin>>n>>q;
  vector<vector<int>> g(n+1);
  for(int i=0;i<n-1;i++){
    int a,b;cin>>a>>b;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  vector<ll> val(n+1,0);
  for(int i=0;i<q;i++){
    int p,x;cin>>p>>x;
    val[p]+=x;
  }
  vector<bool> seen(n+1,false);
  dfs(g,1,val,0,seen);
  for(int i=1;i<n+1;i++){
    cout<<val[i]<<" ";
  }
  cout<<endl;
  return 0;
}


Measured memory_bytes: 30592
N, X = map(int, input().split())

L = [1]
P = [1]

for i in range(N):
    tmp = 2*L[i]+3
    L.append(tmp)
    tmp = 2*P[i]+1
    P.append(tmp)

def Heap(now_L, Goal):
    if now_L == 0:
        if Goal <= 0:
            return 0
        else:
            return 1
    elif Goal < L[now_L-1] + 2:
        return Heap(now_L-1, Goal-1)
    else:
        return P[now_L-1] + 1 + Heap(now_L-1, Goal-L[now_L-1]-2)
    
print(Heap(N, X))

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

int main() {
  string b;
  cin >> b;
  if(b=="A"){
      cout << "T" << endl;
  }else if(b=="T"){
      cout << "A" << endl;
  }else if(b=="C"){
      cout << "G" << endl;
  }else if(b=="G"){
      cout << "C" << endl;
  }
}

Measured memory_bytes: 256
N, K = map(int, input().split())
if N == K:
    print(0)
    exit()

tmp1 = 0
if N > K:
    tmp, m = divmod(N, K)
    tmp1 = m
    tmp1 = min(tmp1, abs(m - K))
else:
    tmp = abs(N - K)
    tmp1 = min(N % K, tmp)

print(tmp1)

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

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 100000000

using namespace std;
#define MAXH 11
#define MAXW 1001

int choco[MAXH][MAXW];
int cut_choco[MAXH][MAXW];
int dp[MAXH][MAXW];
int h,w,k;

void cut(int bit){
  rep(x, MAXW)rep(y, MAXH)cut_choco[y][x]=0;
  
  rep(x, w){
    int bitc=0;
    rep(y, h){
      cut_choco[bitc][x]+=choco[y][x];
      // bit による切断判定があればbitcを増加
      if(bit&(1<<y))bitc++;
    }
  }
}

int main(){
  cin>>h>>w>>k;
  rep(i, h){
    string s;cin>>s;
    rep(j, w) choco[i][j]=(int)(s[j]-'0');
  }

  int result = INF;
  rep(cut_pattern, (2<<(h-1))){
    // dp配列を準備
    cut(cut_pattern);
    int bitc = (int)__builtin_popcount(cut_pattern);
//cout<<cut_pattern<<endl;
//rep(y, bitc+1){rep(x, w)cout<<cut_choco[y][x]<<' ';cout<<endl;}cout<<endl;

    int tmp=bitc;
    vector<int>counter(bitc+1);
    rep(x,w){
      rep(y, bitc+1)if(cut_choco[y][x]>k)tmp=INF;
      bool f=true;
      rep(y, bitc+1) counter[y]+=cut_choco[y][x];

      rep(y, bitc+1) if(counter[y]>k)f=false;
      if(!f){
        rep(y, bitc+1)counter[y]=cut_choco[y][x];
        tmp++;
      }
    }
//cout<<cut_pattern<<' '<<result<<' '<<tmp<<endl;cout<<"---"<<endl;
    result = min(result, tmp);
  }

  cout<<result<<endl;

  return 0;

  rep(x, w)rep(y, h){
    dp[y][x]=choco[y][x]+(x>0 ? dp[y][x-1] : 0);
  }
  rep(y, h){rep(x, w)cout<<dp[y][x]<<' ';cout<<endl;}

}

Measured memory_bytes: 384
#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>

using namespace std;

#define N_MAX 100000
#define MOD 1000000007

void solv()
{
	int N; scanf("%d", &N);
	char S[N_MAX], T[N_MAX];
	scanf("%s%s", S, T);

	char ret[N_MAX];
	for (int i = 0; i < N; i++){
		ret[i * 2] = S[i];
		ret[i * 2 + 1] = T[i];
	}
	ret[N * 2] = '\0';
	printf("%s", ret);

	return;
}

int main()
{
	FILE *fin = NULL, *fout = NULL;
	//fin = freopen("input.txt", "r", stdin);
	//fout = freopen("output.txt", "w", stdout);

	solv();

	//finalize
	if (NULL != fin) fclose(fin);
	if (NULL != fout) fclose(fout);

	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define TARUNNO ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long long ll;
   #define INF 99999
   #define MAX 100000
   #define pb push_back
   #define pf push_front
   #define pob pop_back
   #define pof pop_front
   #define ins insert
   #define mp make_pair
   #define F first
   #define S second
   #define Endl endl
   #define PII pair<ll,ll>
   #define pii pair<int, int>
   #define PIPII pair<ll , pair<ll, ll> >
#define testing() {cout<<"OK"<<endl;}
#define array(a,n) for(int i=0;i<int(n);i++){cout<<a[i];}
#define vector(v) for(int i=0;i<v.size();i++){cout<<v[i]<<" ";}cout<<endl;
using namespace std;
template<typename T>
string to_string(T str){stringstream stream;stream << str;return stream.str();}

vector <ll> pr;
void SieveOfEratosthenes(ll n){
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (ll p=2; p*p<=n; p++){
        if (prime[p] == true){
            for (ll i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }

    for (ll p=2; p<=n; p++)
       if (prime[p])
          pr.pb(p);
}

int main(){
    TARUNNO;
    ll n; cin>>n;
    SieveOfEratosthenes(1000000);
    for(ll i=0; i<=1000000; i++){
        if(pr[i]==n or pr[i] > n){
            cout<<pr[i]<<endl;
            break;
        }
    }
    return 0;
}



                             //   C O M F O R T A B L Y   N U M B   //


Measured memory_bytes: 2424