akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(){
  ll N;
  cin>>N;
  
  map<ll,ll> M_even;
  map<ll,ll> M_odd;
  
  for(ll i=0;i<N;i++){
    ll v;
    cin>>v;
    if(i%2==0){
      M_even[v]++;
    }
    else{
      M_odd[v]++;
    }
  }
  vector<pair<ll,ll>>even;
  vector<pair<ll,ll>>odd;
  
  for(auto p:M_even){
    even.push_back(make_pair(p.second,p.first));
  }
  for(auto p:M_odd){
    odd.push_back(make_pair(p.second,p.first));
  }
  
  sort(even.rbegin(),even.rend());
  sort(odd.rbegin(),odd.rend());
  even.push_back(make_pair(0,0));
  odd.push_back(make_pair(0,0));
  
  ll res=0;
  if(even.at(0).second==odd.at(0).second){
    res=min(N-even.at(0).first-odd.at(1).first,N-even.at(1).first-odd.at(0).first);
  }
  else
    res=N-even.at(0).first-odd.at(0).first;
  
  cout<<res;
}




Measured memory_bytes: 8824
#include <bits/stdc++.h>
using namespace std;
#define rep0(i, n) for (long long i = 0; i < (long long)(n); i++)
#define rep1(i,n) for(long long i=1;i<=(long long)(n);i++)
#define all(v) v.begin(),v.end()
#define Sort(v) sort(all(v))
#define Reverse(v) reverse(all(v))
#define Rsort(v) sort(all(v),greater)
#define pub(v) push_back(v)
#define pob(v) pop_back(v)
typedef long long ll;
typedef vector<ll> vel;
typedef vector<vector<ll>> vel2d;
typedef string str;
typedef pair<ll,ll> pal;
typedef vector<str> ves;
typedef vector<char> vech;


int main() {
    ll X,ans=0;
    cin>>X;
    ll cnt=(double)100;
    while(cnt<X){
        cnt*=1.01;
        ans++;
    }
    cout<<ans<<endl;

}


Measured memory_bytes: 3632
import copy
N = int(input())
M = list(map(int,input().split(" ")))
M_sorted=copy.copy(M)
M_sorted.sort()
bool_list=[]
 
for i in range(N):
  if M[i]==M_sorted[i]:
    bool_list.append(False)
  else:
    bool_list.append(True)
if sum(bool_list) in [0,2]:
  print("YES")
else:
  print("NO")

Measured memory_bytes: 3444
#include<bits/stdc++.h>
 
#define rep(i,n) for(ll i = 0;i < n;++i)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
typedef pair<int,int> P;
 
const int INF = 1001001001;

 int g[15][15];

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

    int n;
    string s;
    cin >> n >> s;
    if(n % 2 == 1){
        cout << "No" << endl;
    }else {
        string a;
        a = s.substr(0,n/2);
        a += a;
        if(a == s){
            cout << "Yes" << endl;
        }else cout << "No" << endl;
    }

    cout << endl;
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(X,Y) ((X)>(Y)?X=(Y),true:false)
#define chmax(X,Y) ((X)<(Y)?X=(Y),true:false)
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

#define N 100010
vector<int> g[N];
ll v[N], dp[N], n;
bool used[N], ok = true;

void rec(int x){
	used[x] = true;
	vector<int> r;
	r.reserve(g[x].size());
	for(auto y: g[x]){
		if(used[y]) continue;
		rec(y);
		r.push_back(dp[y]);
	}
	if(r.empty()){
		dp[x] = v[x];
		return;
	}
	sort(all(r));
	ll s = 0;
	int m = r.size();
	rep(i, m) s += r[i];
	dp[x] = v[x] - (s-v[x]);
	ll t = (s-dp[x])/2;
	if(dp[x]<0||dp[x]>v[x]||t<0||t>min(s/2, s-r[m-1])||(s-dp[x])%2){
		ok = false;
	}
}

int main(){
	cin>>n;
	rep(i, n) cin>>v[i];
	rep(i, n-1){
		int x, y;
		cin>>x>>y;
		x--; y--;
		g[x].push_back(y);
		g[y].push_back(x);
	}
	if(n==2){
		cout<<(v[0]==v[1]?"YES":"NO")<<endl;
		return 0;
	}
	int u;
	rep(i, n){
		if(g[i].size()>1){
			u = i;
			break;
		}
	}
	rec(u);
	cerr<<dp[u]<<" "<<ok<<endl;
	cout<<(dp[u]==0&&ok?"YES":"NO")<<endl;
	return 0;
}


Measured memory_bytes: 18048
/**************************************************************************
Coded by: Saba Karimi(_VINTAGE)
Institution: AIT PUNE
***************************************************************************/
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back 
#define all(a) a.begin(),a.end()
#define lb lower_bound
#define ub upper_bound
#define pii pair<int,int>
#define ld long double
#define int long long int 
/**************************************************************************/
const int N = 1e5+2;
signed main()
{
    fast;
    string s;
    cin>>s;
    s = '#'+s;
    int n = s.size();
    int flag = 1;
    for(int i=1;i<n;i++)
    {
        if(i%2)
        {
            if(s[i]=='R'||s[i]=='U'||s[i]=='D')
                continue;
            cout<<"No";
            return 0;
        }
        else
        {
            if(s[i]=='L'||s[i]=='U'||s[i]=='D')
                continue;
            cout<<"No";
            return 0;
        }
    }
    cout<<"Yes";
    return 0;
}

Measured memory_bytes: 256
//problem_a.go

package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
	//"strings"
)

const (
	constMod = int(1e9) + 7
)

var (
	sc = bufio.NewScanner(os.Stdin)
	wr = bufio.NewWriter(os.Stdout)
)

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

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getIntSlice(n int) []int {
	ns := []int{}
	for i := 0; i < n; i++ {
		ns = append(ns, getInt())
	}
	return ns
}

func getIntDoubleSlice(m int, n int) [][]int {
	var nds [][]int
	for i := 0; i < m; i++ {
		ns := getIntSlice(n)
		nds = append(nds, ns)
	}

	return nds
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

func getStringSlice(n int) []string {
	ss := []string{}
	for i := 0; i < n; i++ {
		ss = append(ss, getString())
	}
	return ss
}

func getStringDoubleSlice(m int, n int) [][]string {
	sds := [][]string{}
	for i := 0; i < m; i++ {
		ss := getStringSlice(n)
		sds = append(sds, ss)
	}

	return sds

}

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

// Sort Fanction

func sortIntSlice(ns []int) []int {
	sort.Sort(sort.IntSlice(ns))
	return ns
}

func sortIntReverseSlice(ns []int) []int {
	sort.Sort(sort.Reverse(sort.IntSlice(ns)))
	return ns
}

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

// Num Fanction

//numAbs(x) = abs(s)
func numAbs(x int) int {
	if x < 0 {
		return -x
	}

	return x
}

//numModPow(a, n, m) = a^n % m
func numModPow(a int, n int, m int) int {
	result := 1

	for n > 0 {
		if n%2 == 1 {
			result = (result * a) % m
		}

		a = (a * a) % m
		n >>= 1
	}

	return result
}

// numGcd(a, b) = gcd(a, b)
func numGcd(a int, b int) int {
	if b == 0 {
		return a
	}

	return numGcd(b, a%b)
}

// numLcm(a, b) = lcm(a, b)
func numLcm(a int, b int) int {
	return a * b / numGcd(a, b)
}

// numModInv(a, p) = a^(-1) % p
func numModInv(a int, p int) int {
	if a == 1 {
		return 1
	}

	return p - numModInv(p%a, p)*(p/a)%p
}

// numModFrac(n) = n! % constMod
func numModFrac(n int) []int {
	frac := []int{1}

	for i := 1; i <= n; i++ {
		frac = append(frac, i*frac[i-1]%constMod)
	}

	return frac
}

// numModConb(n, r) = nCr % constMod
func numModConb(n int, r int) int {
	frac := numModFrac(n)

	return (frac[n] / ((frac[n-r] * frac[r]) % constMod)) % constMod
}

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

func solve() {

	x, y, z := getInt(), getInt(), getInt()
	fmt.Fprintln(wr, z, x, y)

}

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

func main() {
	maxBufSize := int(1e8)
	sc.Buffer(make([]byte, 4096), maxBufSize)
	sc.Split(bufio.ScanWords)
	solve()
	wr.Flush()
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U> using Pa = pair<T, U>;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll H,W;
    cin >> H >> W;
    if(H==1 || W==1) cout << 1 << "\n";
    else cout << (H*W+1)/2 << "\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
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; }
typedef long long ll;
const long long INF = 1LL << 60;
typedef pair<int, int> P;

ll dp[102][2][102];
int main()
{
    string N;
    cin >> N;
    int K, len = (int)N.size();
    cin >> K;

    dp[0][0][0] = 1;
    rep(i, len) {
        int D = N[i] - '0';
        rep(j, 2) {
            rep(k, 101) {
                for (int d = 0; d <= (j ? 9 : D); d++) {
                    dp[i + 1][j || (d < D)][k + (d ? 1 : 0)] += dp[i][j][k];
                }
            }
        }
    }

    cout << dp[len][0][K] + dp[len][1][K] << endl;
    return 0;
}

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

int res[1 << 16];

void init() {
	int zero = 0, one = (1 << 16) - 1;
	int a = 0, b = 0, c = 0, d = 0;
	for (int i = 0; i < 16; i++) {
		a |= (i & 1) << i;
	}
	for (int i = 0; i < 16; i++) {
		b |= ((i >> 1) & 1) << i;
	}
	for (int i = 0; i < 16; i++) {
		c |= ((i >> 2) & 1) << i;
	}
	for (int i = 0; i < 16; i++) {
		d |= ((i >> 3) & 1) << i;
	}
	vector<int> all;
	using pii = pair<int, int>;
	priority_queue<pii, vector<pii>, greater<>> pq;
	pq.emplace(1, zero);
	pq.emplace(1, one);
	pq.emplace(1, a);
	pq.emplace(1, b);
	pq.emplace(1, c);
	pq.emplace(1, d);

	while (!pq.empty()) {
		auto v = pq.top(); pq.pop();
		int val = v.second;
		if (res[val] != 0) continue;
		res[val] = v.first;
		if (res[val ^ one] == 0) pq.emplace(v.first + 1, val ^ one);
		all.push_back(val);
		for (int i = 0; i < (int)all.size(); i++) {
			if (res[val ^ all[i]] == 0 && res[val] + res[all[i]] + 3 <= 16) {
				pq.emplace(res[val] + res[all[i]] + 3, val ^ all[i]);
			}
			if (res[val & all[i]] == 0 && res[val] + res[all[i]] + 3 <= 16) {
				pq.emplace(res[val] + res[all[i]] + 3, val & all[i]);
			}
		}
	}
}

int it;
int n;
string S;
int va;

bool calc() {
	if (S[it] == '(') {
		++it;
		bool a = calc();
		assert(S[it] == '^' || S[it] == '*');
		bool c = S[it] == '*';
		++it;
		bool b = calc();
		assert(S[it] == ')');
		++it;
		return c ? a & b : a ^ b;
	}
	++it;
	if (S[it - 1] == '-') return !calc();
	if (S[it - 1] == '0') return false;
	if (S[it - 1] == '1') return true;
	return (va >> (S[it - 1] - 'a')) & 1;
}

int main()
{
	init();
	while (cin >> S, S != ".") {
		n = S.size();
		int id = 0;
		for (va = 0; va < (1 << 4); va++) {
			it = 0;
			id += calc() << va;
		}
		assert(res[id] != 0);
		cout << res[id] << endl;
	}
	return 0;
}



Measured memory_bytes: 3520
#include<iostream>
#include<iomanip>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<map>
#include<cmath>
#include<string>

#define rep(i,p) for(long long int i=0;i<p;i++)
#define reep(i,p) for(long long int i=1;i<=p;i++)
#define ll long long

using namespace std;

int main(){

ll int N;
cin >> N;
ll int sum=0;
ll int M;
M=1000000007;
vector<ll int> A(N);
rep(i,N){
	cin >> A[i];
        sum=(sum+A[i])%M;
}
ll int ans=0;
ll int syo;
rep(i,N-1){
          sum = sum-A[i]%M;
	  if (sum<0) sum+=M;
	  ans = (ans + (sum*A[i])%M)%M;
//cout << ans << endl;
}
cout << ans;

	  









	return 0;

}



Measured memory_bytes: 4856
#include <bits/stdc++.h>
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define rep(i, s, N) for(ll i{s}; i < N; i++)
#define rem(i, N, s) for(ll i{N}; i > s; i--)
using namespace std;using ll = long long int;using ld = long double;using P = pair<ll,ll>;const int MOD = (int)1e9+7;const string rt = "\n";const string sp = " ";/* 最大公約数 */template<typename T> T gcd(T a, T b){return b != 0 ? gcd(b, a % b) : a;}/* UnionFind */template<typename T> struct UnionFind{vector<T> par;UnionFind(T n) : par(n, -1){}void init(T n){par.assign(n, -1);}T root(T x){if (par[x] < 0) return x;else return par[x] = root(par[x]);}bool issame(T x, T y){return root(x) == root(y);}bool merge(T x, T y){x = root(x); y = root(y);if(x == y) return false;if(par[x] > par[y]) swap(x, y);par[x] += par[y];par[y] = x;return true;}int size(int x) {return -par[root(x)];}};/* コンビネーション */template<typename T> ll combpm(T N_, T C_) {const int NUM_=400001;static ll fact[NUM_+1],factr[NUM_+1],inv[NUM_+1];if (fact[0]==0) {inv[1]=fact[0]=factr[0]=1;for (int i=2;i<=NUM_;++i) inv[i] = inv[MOD % i] * (MOD - MOD / i) % MOD;for (int i=1;i<=NUM_;++i) fact[i]=fact[i-1]*i%MOD, factr[i]=factr[i-1]*inv[i]%MOD;}if(C_<0 || C_>N_) return 0;return factr[C_]*fact[N_]%MOD*factr[N_-C_]%MOD;}/* 多次元ベクター */template<class T>vector<T> mvec(size_t a){return vector<T>(a);}template<class T, class... Ts>auto mvec(size_t a, Ts... ts){return vector<decltype(mvec<T>(ts...))>(a, mvec<T>(ts...));}/* テスト関数 */void test(ll n){cout << "test" << n << endl;}/* 小数点以下 */void fixsp(ll n){cout << fixed << setprecision(n);}void defsp(ll n){cout << defaultfloat << setprecision(n);}/* 重み付きUnionFind */struct WUnionFind {vector<int> par;vector<int> rank;WUnionFind(int n = 1) {init(n);}void init(int n = 1) {par.resize(n); rank.resize(n);for (int i = 0; i < n; ++i) par[i] = i, rank[i] = 0;}int root(int x) {if (par[x] == x) {return x;}else {int r = root(par[x]);return par[x] = r;}}bool issame(int x, int y) {return root(x) == root(y);}bool merge(int x, int y) {x = root(x); y = root(y);if (x == y) return false;if (rank[x] < rank[y]) swap(x, y);if (rank[x] == rank[y]) ++rank[x];par[y] = x;return true;}};/* IO高速化 */void fastio(){ios::sync_with_stdio(false);cin.tie(NULL);}
/* ここからコード開始 */

int main(){
  fastio;
  ll N;
  cin >> N;
  auto exist = mvec<string>(0);
  char last{};
  rep(i, 0, N){
    string W;
    cin >> W;
    if(find(all(exist), W) != exist.end() || (last != W[0] && last != '\0')){
      cout << "No" << rt;
      return 0;
    }
    last = W[W.size()-1];
    exist.push_back(W);
  }
  cout << "Yes" << rt;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int Maxn=100005;
int n,m,mini,maxi;
int main()
{
	scanf("%d%d",&n,&m);
	maxi=n,mini=1;
	for(int i=1;i<=m;i++)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		maxi=min(maxi,y);
		mini=max(mini,x);
	}
	printf("%d",max(0,maxi-mini+1));
	return 0;
}

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

using namespace std;

typedef long long ll;

int const N = 100 * 1000 + 16;

int n;
int a[N];
int cnt[N];

int main() {
  scanf("%d", &n);
  int rep = 0;
  for(int i = 0; i < n; ++i) {
    scanf("%d",a+i);
    rep += (cnt[a[i]]++ != 0);
  }

  printf("%d\n", n-rep-(rep&1));
}

Measured memory_bytes: 1024
def examB():
    N = I()
    A = LI(); A.sort(reverse = True)
    cur = 0
    for i,j in enumerate(A):
        cur +=j*((-1)**i)
    print(cur)

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()


Measured memory_bytes: 38384
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>

using namespace std;

int main() {
	int X[10000];
	int a, b,i=0;
	char op;
	while (true) {
		cin >> a >> op >> b;
		if (op == '+') X[i] = a + b;
		if (op == '-') X[i] = a - b;
		if (op == '*') X[i] = a * b;
		if (op == '/') X[i] = a / b;
		if (op == '?') break;
		++i;
	}
	for (int j = 0; j < i; ++j) {
		cout << X[j] << endl;
	}
	return 0;
}


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


Measured memory_bytes: 640
import fractions
A, B ,C, D = list(map(int, input().split()))

lcm = C * D //fractions.gcd(C, D)
b =  B // C + B // D - B // lcm
b = B - b

A -= 1
a =  A // C + A // D - A // lcm
a = A - a

print(b - a)


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

int maxtime(int n){
  return (n+9)/10*10;
}
int last(int n){
  return maxtime(n)-n;
}
int main(){
  int a,b,c,d,e;
  cin>>a >>b >>c >>d >>e;
  int sum = maxtime(a)+maxtime(b)+maxtime(c)+maxtime(d)+maxtime(e);
  sum-=max(last(a),max(last(b),max(last(c),max(last(d),last(e)))));
  cout<<sum<<endl;
}

Measured memory_bytes: 764
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>

typedef long long ll;
using namespace std;

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define print(x) cout<<(x)<<endl
#define rep(i,n) for(int i = 0;i < ((int)(n));++i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SUM(vec) accumulate(all(vec),0LL)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define test(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

const int INF = 1e9+7;
const ll INFL = 9*1e18;

ll inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;}
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);}
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;}
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;}


bool isOk(ll key,ll value){
  return key >= value;
}

ll binary_search(vector<ll> a,ll key){
  ll ok = a.size()-1;
  ll ng = 0;

  while(abs(ok - ng) > 1){
    ll mid = (ok + ng) / 2;
    if(isOk(key,a[mid]))ok = mid;
    else ng = mid;
  }
  return ok;
}

bool isPrime(ll n) {
	for (int i = 2; n >= i * i; ++i) {
		if(!(n % i))return false;
	}
  return true;
}

int main() {
  cin.tie(0); ios::sync_with_stdio(0);
  string s;cin>>s;
  int a[4];rep(i,4)a[i] = s[i] - '0';
  int sum = a[0]+a[1]+a[2]+a[3];
  rep(i,8){
    bitset<3>bs(i);
    int tmp = sum;
    rep(j,3){
      tmp -= bs[j] * a[j+1] * 2;
    }
    if(tmp == 7){
      auto o = [&](int k){cout<<((bs[k])?'-':'+')<<a[k+1];};
      cout<<a[0];
      rep(j,3)o(j);
      print("=7");
      break;
    }
  }

  return 0;
}

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

struct Node{int p, l, r;};
struct Node T[100000];
int D[100000] = {NIL};

int rec(int u, int p){
  D[u] = p;
  if(T[u].r != NIL) rec(T[u].r, p);
  if(T[u].l != NIL) rec(T[u].l, p+1);
}
int main(){
  int a, b, c, n, l, r, j, k, i;
  for(cin >> n, i=0; i < n; i++) T[i].p = T[i].l = T[i].r = NIL;
  for(i = 0; i < n; i++) for(cin >> a >> b,j = 0; j < b; j++){
    cin >> c;
    if(!j) T[a].l = c;
    else T[l].r = c;
    l = c;
    T[l].p = a;
  }
  for(i = 0; i < n; i++) if(T[i].p == NIL) r = i;
  rec(r, 0);
for(i = 0;i < n; i++){
  printf("node %d: parent = %d, depth = %d, ", i, T[i].p, D[i]);
  if(T[i].p == NIL) cout << "root, [";
  else if(T[i].l == NIL) cout << "leaf, [";
  else cout << "internal node, [";
  for(j = 0, c = T[i].l; c != NIL; c=T[c].r){
    if(j++) cout << ", ";
    cout << c;
  }
  cout << "]" << endl;
}
}



Measured memory_bytes: 7892
/*
これを入れて実行
g++ code.cpp
./a.out
 */

#include <iostream>
#include <vector>
#include <string>
#include <queue>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <cmath>
#include <tuple>
#include <iomanip>

using namespace std;
typedef long long ll;
typedef long double ld;

int dy4[4] = {-1, 0, +1, 0};
int dx4[4] = {0, +1, 0, -1};
int dy8[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dx8[8] = {0, 1, 1, 1, 0, -1, -1, -1};

const long long INF = 1LL << 60;
const ll MOD = 1e9 + 7;

bool greaterSecond(const pair<int, int>& f, const pair<int, int>& s){
    return f.second > s.second;
}

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

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

ll nCr(ll n, ll r){
    if(r == 0 || r == n){
        return 1;
    } else if(r == 1){
        return n;
    }
    return (nCr(n - 1, r) + nCr(n - 1, r - 1));
}

ll nPr(ll n, ll r){
    r = n - r;
    ll ret = 1;
    for (ll i = n; i >= r + 1; i--) ret *= i;
    return ret;
}

//-----------------------ここから-----------

int main(void){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << max(a * b, c * d) << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
        int KAZU;
	int MASU[100];
	int RENZOKU = 0;
	int MAX = 0;
	
	scanf("%d",&KAZU);
	
	int a;
	
	for(a=0;a<KAZU;a++)
	{
		scanf("%d",&MASU[a]);
		
		if(MASU[a] == 1)
		{
			RENZOKU++;
		}
		else
		{
			if(MAX<RENZOKU)
			
				MAX = RENZOKU;
				RENZOKU = 0;
			
		}
	}
	if(MAX<RENZOKU)
	{
		MAX=RENZOKU;
	}
	
	printf("%d\n",MAX+1);
        return 0;
}



Measured memory_bytes: 2768
#define TEST_MODE true
 
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
 
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rrep2(i, a, b) for (int i = (a)-1; i >= (int)b; --i)
#define range(i, a, b, c) for (int i = a;		\
                               c > 0 ? i < b : i > b;	\
                               i += c)
#define chmax(a, b) (a = (a) < (b) ? (b) : (a))
#define chmin(a, b) (a = (a) > (b) ? (b) : (a))
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) a.begin(), a.end()
#define ifnot(a) if (not(a))
#define int long long
 
#if TEST_MODE == true
const bool test = true;
#define dump(x) cerr << #x << " = " << (x) << " "
#define dumpl(x) cerr << #x << " = " << (x) << " " << endl;
#else
const bool test = false;
#define dump(x) 
#define dumpl(x) 
#endif
 
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
const int INF = (int)1 << 60;
const ll INFL = (ll)1 << 60;
ll mod_n = (int)1e9 + 7;
const double eps = 1e-10;
typedef long double Real;
// return -1, 0, 1
int sgn(const Real &r) { return (r > eps) - (r < -eps); }
int sgn(const Real &a, const Real &b) { return sgn(a - b); }
 
//.....................
const int MAX = (int)2e5 + 5;
 
vector<string> split(const string &str, char sep)
{
  vector<string> v;
  stringstream ss(str);
  string buffer;
  while (getline(ss, buffer, sep))
    {
      v.push_back(buffer);
    }
  return v;
}
 
template <class InputIterator>
int sum(InputIterator begin, InputIterator end)
{
  return accumulate(begin, end, 0ll);
}
 
template<typename T>
T gcd(T a, T b)
{
  T c;
  while (a != 0) {
    c = a; a = b%a;  b = c;
  }
  return b;
}

int pow(int a, int b) {
  int res = 1;
  rep(i, b) res *= a;
  return res;
}
 
class Solver {
public:
  int A, B, C;

  void solve() {
    cin >> A >> B >> C;
    string res = (A + B >= C ? "Yes" : "No");
    cout << res << endl;
  }
};
 
signed main()
{
  srand(time(NULL));
  cout << fixed << setprecision(20);
  auto ptr = new Solver();
  ptr->solve();
  delete ptr;
  // while (true) {    
  //     auto ptr = new Solver();
  //     ptr->solve();
  //     delete ptr;
  // }
  return 0;
}
 
// class Mycin {
// 	bool flag = true;
// public:
// 	Mycin& operator >> (int& a) {flag = scanf("%lld", &a) != EOF; return *this;}
// 	Mycin& operator >> (char& a) {flag = scanf("%c", &a) != EOF; return *this;}
// 	Mycin& operator >> (string& s) {flag = (bool)(cin >> s); return *this;}
// 	operator bool() {return flag;}
// } mycin;
 
// class Mycout {
// public:
// 	Mycout& operator << (const int& a) {printf("%lld", a); return *this;}
// 	Mycout& operator << (const char c) {printf("%c", c); return *this;}
// 	Mycout& operator << (const string& s) {printf("%s", s.c_str()); return *this;}
// } mycout;
 
// #define cin mycin
// #define cout mycout
// #define endl '\n'


Measured memory_bytes: 256
#include<iostream>
     
    int main(void){
      char b;
      
      std::cin >> b;
      
      if(b == 'A'){
        std::cout << "T" << std::endl;
      }else if(b == 'T'){
        std::cout << "A" << std::endl;
      }else if(b == 'G'){
        std::cout << "C" << std::endl;
      }else if(b == 'C'){
        std::cout << "G" << std::endl;
      }
      
    }

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

int main()
{
    int n;
    int num[3];

    cin >> n;
    
    if (n == 2){
        cin >> num[0] >> num[1];
        sort(num, num + 1);
        for (int i = 1; i < num[0]; i++){
            if (num[0] % i == 0 && num[1] % i == 0){
                cout << i << endl;
            }
        }
    }

    else if (n == 3){
        cin >> num[0] >> num[1] >> num[2];
        sort(num, num + 3);
        for (int i = 1; i < num[0]; i++){
            if (num[0] % i == 0 && num[1] % i == 0 && num[2] % i == 0){
                cout << i << endl;
            }
        }
    }
    return (0);
}



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

int main(){
	int n,m;
	cin >> n >> m;
	int r[m][2];
	for(int i=0;i<m;++i) cin >> r[i][0] >> r[i][1];
	
	for(int i=1;i<=n;++i){
		auto cnt=0;
		for(int j=0;j<m;++j){
			if(r[j][0]==i) cnt++;
			if(r[j][1]==i) cnt++;
		}
		cout << cnt << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <utility>

using namespace std;

typedef pair<int, int> P_ii;
typedef pair<string, int> P_si;

int main() {
    int K, X;
    cin >> K >> X;

    for (int i = min(X-K+1, X+K-1); i <=max(X-K+1, X+K-1) ; ++i) {
        cout << i << ' ';
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define ld long double
#define ull unsigned long long
#define ff first
#define ss second
#define Mod 1000000007
//#define Mod 998244353
#define nl "\n" 
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define f(i, a, b) for (ll i = a; i < b; ++i)
#define rf(i, a, b) for (ll i = a; i >= b; --i)
#define vll vector<ll>
#define pll pair<ll, ll>
#define mem(a, b) memset(a, b, sizeof(a))
#define printv(v) for(int i=0;i<v.size();i++) { cout<<v[i]<<" "; } cout<<nl;
using namespace std;
inline bool kthbit(ll n, int k) { return (n >> k) & 1; }
ll pw(ll a, ll b){ll c = 1, m = a;while (b){if (b & 1) c = (c * m);m = (m * m);b /= 2;}return c;}
//------------------------------------------------------------------------------------------------

int main()
{
    fast;
    ll T=1;
    //cin>>T; //comment for single test

    while(T--)
    {
        //code...
        ll N;
        cin>>N;
        string str;
        cin>>str;
        ll nw=0;
        f(i,0,N)
            if(str[i]=='W')nw++;
        ll nr=N-nw,w=0;
        f(i,0,nr)
        {
            if(str[i]=='W')w++;
        }
        cout<<w<<nl;
    }
    return 0;  
}

Measured memory_bytes: 3776
#include<stdio.h>
int main()
{
  int m,n,j,t,x,a=0;
  scanf("%d%d",&m,&n);
  for(;m--;a=a<x?x:a)
    for(x=j=0;j++<n;x+=t)
      scanf("%d",&t);
  printf("%d\n",a);
  return 0;
}

Measured memory_bytes: 0
// Problem : C - Peaks
// Contest : AtCoder - AtCoder Beginner Contest 166
// URL : https://atcoder.jp/contests/abc166/tasks/abc166_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
ordered_set;	

#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
#define FORD(i,a,b) for(int i = (a); i >= (b); --i)
#define RI(i,n) FOR(i,1,(n))
#define REP(i,n) FOR(i,0,(n)-1)
#define mini(a,b) a=min(a,b)
#define maxi(a,b) a=max(a,b)
#define pb push_back
#define st first
#define nd second
#define sz(w) (int) w.size()
typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<pii, int> para;
const ll inf = 1e18 + 7;
const ll maxN = 1e6 + 5;
const ll MOD = 1e9 + 7;

vi neigh[maxN];
int h[maxN];

// sprawdz MODULO!
int main() {
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int n, m;
	cin >> n >> m;
	RI(i, n) cin >> h[i];
	REP(i, m) {
		int a, b;
		cin >> a >> b;
		neigh[a].pb(b);
		neigh[b].pb(a);
	}
	int ans = 0;
	RI(i, n) {
		bool ok = true;
		for (auto x: neigh[i]) {
			if (h[x] >= h[i]) {
				ok = false;
				break;
			}
		}
		//cout << i << " " << ok << endl;
		ans += ok;
	}
	cout << ans;
	return 0;
}
 


Measured memory_bytes: 30232
/*
 ▓█████▄  ▄████▄  ▓██   ██▓ ██▓███   ██░ ██ ▓█████  ██▀███
▒██▀ ██▌▒██▀ ▀█   ▒██  ██▒▓██░  ██▒▓██░ ██▒▓█   ▀ ▓██ ▒ ██▒
 ░██   █▌▒▓█    ▄   ▒██ ██░▓██░ ██▓▒▒██▀▀██░▒███   ▓██ ░▄█ ▒
 ░▓█▄   ▌▒▓▓▄ ▄██▒  ░ ▐██▓░▒██▄█▓▒ ▒░▓█ ░██ ▒▓█  ▄ ▒██▀▀█▄
 ░▒████▓ ▒ ▓███▀ ░  ░ ██▒▓░▒██▒ ░  ░░▓█▒░██▓░▒████▒░██▓ ▒██▒
  ▒▒▓  ▒ ░ ░▒ ▒  ░   ██▒▒▒ ▒▓▒░ ░  ░ ▒ ░░▒░▒░░ ▒░ ░░ ▒▓ ░▒▓░
  ░ ▒  ▒   ░  ▒    ▓██ ░▒░ ░▒ ░      ▒ ░▒░ ░ ░ ░  ░  ░▒ ░ ▒░
  ░ ░  ░ ░         ▒ ▒ ░░  ░░        ░  ░░ ░   ░     ░░   ░
    ░    ░ ░       ░ ░               ░  ░  ░   ░  ░   ░
  ░      ░         ░ ░
*/
//focus less on how much problem you should solve within a fixed time and focus more on getting the problem solved and
//learning something from it
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define per(i,a,b) for(ll i=a; i>=b; i--)
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vii vector <pair<ll,ll> >
#define sedes set <ll, greater <ll> >
#define seasc set <ll>
#define pb push_back
#define mkp make_pair
#define ff first
#define ss second
#define MOD 1000000007
#define prec(n) fixed<<setprecision(n)
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int> >
#define umap unordered_map<ll, ll>
#define map map<ll, ll>
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define mems(a, i) memset(a, i, sizeof(a))
#define endl '\n'
#define all(v) v.begin(),v.end()
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define printx(x) printf("%lld\n",x);
#define printxy(x,y) cout << x << y <<endl;
#define printxyz(x,y,z) cout << x << y << z <<endl;
#define deba(a) cout << #a << a << endl;
#define debab(a,b) cout << #a << a << #b << b << endl;
int main()
{
	fast;
	string a, b;
	cin >> a;
	cin >> b;
	ll n = a.length(), cn = 0;
	rep(i, 0, n)
	{
		if (a[i] != b[i])
			cn++;
	}
	cout << cn << endl;
	return 0;
}

Measured memory_bytes: 3792
import math
N,D = map(int,(input().split()))
C = [list(map(int,input().split())) for _ in range(N)]

ans = 0
temp = 0

def is_integer_num(n):
    if isinstance(n, int):
        return True
    if isinstance(n, float):
        return n.is_integer()
    return False


for i in range(1,N):
    for j in range(i):
        temp = 0
        for k in range(D):
            temp += (C[i][k] - C[j][k])**2
        dis = math.sqrt(temp)
        if is_integer_num(dis):
            ans += 1 

print(ans)

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

int main(){
    //入力
    int N;

    cin >> N;

    vector<int> a(N);

    for(int i=0;i<N;i++){
        cin >> a.at(i);
    }

    int a_min=a.at(0);
    int a_max=a.at(0);
    for(int i=1;i<N;i++){
        a_min=min(a_min,a.at(i));
        a_max=max(a_max,a.at(i));
    }

    //出力
    cout << a_max - a_min << endl;
}

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

int main() {
  int n;
  cin >> n;
  ll d[n+1],ans=0;
  d[0]=0;
  map<ll,ll> m;
  m[0]=0;
  for(ll i=1,x; i<=n; i++) {
    cin >> x;
    d[i]=x+d[i-1];
    if(m.count(d[i])) ans=max(ans,i-m[d[i]]);
    else m[d[i]]=i;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 17068
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <set>
using namespace std;
typedef long long ll;

int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int n,m;cin>>n>>m;
    vector<ll> v(n);
    for(ll &i:v)cin>>i;
    vector<vector<int> > adj(n);
    for(int i=0;i<m;i++){
        int a,b;cin>>a>>b;
        a--;b--;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    int ans=0;
    vector<bool> vv(n,1);
    for(int i=0;i<n;i++){
        if(vv[i]==1){
            for(int u:adj[i]){
                if(v[i]<=v[u]){vv[i]=0;break;}
            }
        }
    }
    for(int i=0;i<n;i++)ans+=(vv[i]==1);
    cout<<ans;
}

Measured memory_bytes: 9268
#include <bits/stdc++.h> 
using namespace std; 
int main() { 
		int n,res=1; 
			cin>>n; 	
			int a[n+1]; 	
			for(int i=0;i<n;i++) 	cin>>a[i]; 	
			int min=a[0];
				for(int i=1;i<n;i++) 	
				if(min>=a[i]){
					min=a[i];
				res+=1;} 
					cout<<res<<endl; 
						return 0;
	 } 



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

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1e6 + 5;

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
  cout << fixed << setprecision(12);
  string s; cin>>s;
  if (s=="SUN") out(7);
  if (s=="SAT") out(1);
  if (s=="FRI") out(2);
  if (s=="THU") out(3);
  if (s=="WED") out(4);
  if (s=="TUE") out(5);
  if (s=="MON") out(6);
  

  return 0;
}


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

#define MP make_pair
#define PB push_back
#define ALL(x)      (x).begin(),(x).end()
#define REP(i,n)    for(int i=0;i<(n);i++)
#define REP1(i,n)   for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n)   for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;

const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

int main(){
    string s;
    int k;
    cin >> s >> k;

    REP(i, s.length()){
        if(i+1 == k || s[i] != '1'){
            cout << s[i] << endl;
            break;
        }
    }
}

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

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

  bool isStrong = true;
  int N = S.length();
  for (int i = 0; i < N/2; i++) {
    if (S[i] != S[N-1-i]) isStrong = false;
  }

  string partial = S.substr(0, (N-1)/2);
  int N_par = partial.length();
  for (int i = 0; i < N_par/2; i++) {
    if (partial[i] != partial[N_par-1-i]) isStrong = false;
  }

  string partial2 = S.substr((N+3)/2-1, N);
  int N_par2 = partial2.length();
  for (int i = 0; i < N_par2; i++) {
    if (partial2[i] != partial2[N_par2-1-i]) isStrong = false;
  }

  if (isStrong) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	int a,b,c,d;cin>>a>>b>>c>>d;
	while(1){
		c -= b;
		if (c <= 0){
			cout << "Yes" << endl;
			return 0;
		}
		a -= d;
		if (a <= 0){
			cout << "No" << endl;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 3636
import itertools

h,w,k = map(int,input().split())
c = [input() for i in range(h)]

yoko = [i for i in range(w)]
tate = [i for i in range(h)]
ans = 0

for i in range(w+1):
    for u in itertools.combinations(yoko, i):
        #print(u)

        for j in range(h+1):
            for v in itertools.combinations(tate, j):
                #print(v)
                #print('yoko'+ str(u) + 'tate' + str(v))

                #kazoeru
                poi = 0
                #print(10)
                for ii in range(w):
                    if not ii in u:
                        #print(76)
                        for jj in range(h):
                            if not jj in v:
                                #print(91)
                                if c[jj][ii]=='#':
                                    poi += 1
                if poi == k:
                    ans += 1
                #print('yoko'+ str(u) + 'tate' + str(v) + 'poi' + str(poi))
print(ans)

Measured memory_bytes: 9208
#include <iostream>
#include <map>
#include <algorithm>
#include <string>
#include <vector> 
#include <numeric>
#include <cmath>
#include <queue>
#include <iomanip>
#include <functional>


#define CHMAX(a,b) a = std::max(a,b)
#define CHMIN(a,b) a = std::min(a,b)
#define MAXMIN(a,b,c) std::max(a,min(b,c))
#define CHABS(a) a = std::abs(a) 
#define COUT(a) std::cout << a << std::endl
#define CERR(a) std::cerr << a << std::endl
#define FOR(n) for(lli i = 0; i < n; i++)

using namespace std;
using lli = long long int;
using pll = pair<lli, lli>;
using tlll = tuple<lli, lli, lli>;
using vll = vector<lli>;

constexpr lli inf = 10000 * 10000;

lli mod197 = 1000000007LL;
lli INF = 10000000000000;

// ax + by = gcd(a,b) 最大公約数
template< typename T >
T extgcd(T a, T b, T& x, T& y) {
	T d = a;
	if (b != 0) {
		d = extgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
	else {
		x = 1;
		y = 0;
	}
	return d;
}

int main(void) {


	lli x;
	cin >> x;

	lli money = 100;
	int c = 0;
	while (true) {
		if (x <= money)
			break;
		c++;
		money *= 1.01;
	}

	cout << c << endl;

	return 0;
}


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

int main(void)
{
	char abacus[8][11] = {
		"*****     ",
		"     *****",
		"==========",
		" **** ****",
		"* **** ***",
		"** **** **",
		"*** **** *",
		"**** **** ",
	};
	
	int n;
	bool flag = false;
	while (scanf("%d", &n) != EOF){
		int num[5];
		char a[8][5];
		for (int i = 0; i < 5; i++){
			num[4 - i] = n % 10;
			n /= 10;
		}
		for (int i = 0; i < 8; i++){
			for (int j = 0; j < 5; j++){
				a[i][j] = abacus[i][num[j]];
			}
		}
		
		if (flag){
			cout << endl;
		}
		
		for (int i = 0; i < 8; i++){
			for (int j = 0; j < 5; j++){
				cout << a[i][j];
			}
			cout << endl;
		}
		flag = true;
	}
	
	return (0);
}

Measured memory_bytes: 1200
import sys

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001


table = [0]*26

letters = "abcdefghijklmnopqrstuvwxyz"
input_str = sys.stdin.read()

for A in input_str:
    index = 0
    for B in letters:
        if A == B or A == B.upper():
            table[index] += 1
            break
        index += 1

for i in range(len(letters)):
    print("%s : %d"%(letters[i],table[i]))


Measured memory_bytes: 5572
n = int(input())
xlist = []
for i in range(n):
    order = list(map(int, input().split()))
    o = order[0] 
    if (o == 0):
        xlist.append(order[1])
    elif (o == 1):
        print(xlist[order[1]])
    elif (o == 2):
        del xlist[-1]
    


Measured memory_bytes: 13368
n=int(input())
t=list(map(int,input().split()))
m=int(input())
for i in range(m):
    p,x=map(int,input().split())
    s=0
    for j in range(len(t)):
        if j==p-1:
            s+=x
        else:
            s+=t[j]
    print(s)  
        
    



Measured memory_bytes: 3060
n=input()
s = int(n)

if len(n) <= 1:
    print(n)
if 2 <= len(n) <3:
    print(9)
if 3<= len(n) <4:
    print(s-99 + 9)
if 4 <= len(n) < 5:
    print(999-99+9)
if 5 <= len(n) < 6:
    print(s -9999 + 999 - 99 + 9)
if len(n) == 6:
    print(99999-9999 + 999 -99 +9)

Measured memory_bytes: 9120
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cassert>
#include<vector>
#include<fstream>
#include<string>
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<queue>
#include<map>
#include<set>
#include<bitset>
#include<cmath>
#include<typeinfo>

using namespace std;
#define rep(i,m,n) for(int i=m;i<n;++i)
#define llrep(i,m,n) for(ll i=m;i<n;++i)
#define inf 1000000000
#define llinf 1000000000000000000
#define MOD 1000000007
#define ll long long
#define mp make_pair
#define all(v) v.begin(),v.end()

vector<int>vr, dist;
vector<vector<pair<int,int>>>edge;
int ansdist[10][10];
int n;

int dijkstra(int start, int goal) {
	dist.assign(n + 1, inf);
	dist[start] = 0;
	queue<int>q;
	q.push(start);
	while (!q.empty()) {
		int hoge = q.front(); q.pop();
		rep(i, 0, edge[hoge].size()) {
			pair<int, int>tmp = edge[hoge][i];
			if (dist[tmp.first] > dist[hoge] + tmp.second) {
				q.push(tmp.first);
				dist[tmp.first] = dist[hoge] + tmp.second;
			}
		}
	}
	return dist[goal];
}

int main() {
	int m, r;
	cin >> n >> m >> r;
	rep(i, 0, r) {
		int tmp;
		cin >> tmp;
		vr.push_back(tmp);
	}
	edge.assign(n + 1, vector<pair<int,int>>(0, mp(0, 0)));
	rep(i, 0, m) {
		int a, b, c;
		cin >> a >> b >> c;
		edge[a].push_back(mp(b, c));
		edge[b].push_back(mp(a, c));
	}
	rep(i, 0, r) {
		ansdist[i][i] = -1;
	}
	rep(i, 0, r) {
		rep(j, i + 1, r) {
			ansdist[i][j] = dijkstra(vr[i], vr[j]);
			ansdist[j][i] = ansdist[i][j];
		}
	}
	int ans = inf;
	vector<int>v;
	rep(i, 0, r) {
		v.push_back(i);
	}
	do {
		int vane = 0;
		rep(i, 1, r) {
			vane += ansdist[v[i - 1]][v[i]];
		}
		ans = min(ans, vane);
	} while (next_permutation(all(v)));
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 640
/* package codechef; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
public class Main
{
	public static void main (String[] args) throws java.lang.Exception
	{
		Scanner scn = new Scanner(System.in);
		int n = scn.nextInt();
		int maxWeight = scn.nextInt();
		int[][] itemvaw = new int[n+1][2];
		
		for(int i=1;i<=n;i++){
		    itemvaw[i][0] = scn.nextInt();
		    itemvaw[i][1] = scn.nextInt();
		}
		System.out.println(knapsack_dp(itemvaw,maxWeight));
	}
	
	public static long knapsack_dp(int[][] itemvaw, int capacity) {
		int n = itemvaw.length - 1;
		long[][] memo = new long[n + 1][capacity + 1];
		for (int cii = n; cii > 0; cii--) {
			for (int capacityLeft = capacity; capacityLeft > 0; capacityLeft--) {
				if (cii == n) {
					memo[cii][capacityLeft] = capacityLeft >= itemvaw[cii][0] ? itemvaw[cii][1] : 0;
					continue;
				}
				long o1 = capacityLeft - itemvaw[cii][0] >= 0 ?
				          itemvaw[cii][1] + memo[cii + 1][capacityLeft - itemvaw[cii][0]] : Integer.MIN_VALUE;
				// knapsack_memoized(cii + 1, itemvaw, capacityLeft - itemvaw[cii][0], memo)
				long o2 = memo[cii + 1][capacityLeft];
				// knapsack_memoized(cii + 1, itemvaw, capacityLeft, memo);
				memo[cii][capacityLeft] = Math.max(o1, o2);
			}
		}
		return memo[1][capacity];
	}
}


Measured memory_bytes: 140580
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

int main() {
	int a, b, k; scanf("%d%d%d", &a, &b, &k);
	std::vector<int> vec;
	for(int i = 1; i <= std::min(a, b); i++) {
		if(a % i or b % i) continue;
		vec.push_back(i);
	}
	reverse(begin(vec), end(vec));
	
	printf("%d\n", vec[k - 1]);
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int search(int A[],int n,int key){
    int i=0;
    A[n]=key;
    while(A[i]!=key) i++;
    return i!=n;
}

int main(void){
    
    int i,n,A[10000+1],q,key,sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++) scanf("%d",&A[i]);
    scanf("%d",&q);
    for(i=0;i<q;i++){
        scanf("%d",&key);
        if(search(A,n,key)) sum++;
        
    }
    printf("%d\n",sum);
    return 0;
}



Measured memory_bytes: 2144
#include <bits/stdc++.h>
#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++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main()
{
  string S, T, U;
  int A, B;
  cin >> S >> T >> A >> B >> U;
  
  if (S == U)
    A--;
  else
    B--;

  cout << A << " " << B << endl;
  return 0;
}


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

int main(){
  int ans = 0, R, G, B, N;
  vector<int> RGB(3);
  cin >> RGB[0] >> RGB[1] >> RGB[2] >> N;
  std::sort(RGB.begin(),RGB.end());
  int Min0 = N / RGB[0];
  int Min1 = N / RGB[1];
  int Min2 = N / RGB[2];
  //cout << RGB[0] << RGB[1] << RGB[2] << endl;
  for(int r = 0; r <= Min2; r++){
    if(r * RGB[2] > N)break;
    for(int g = 0; g <= Min1; g++){
      if(r * RGB[2] + g * RGB[1] > N)break;
      if((N - r*RGB[2] - g*RGB[1])%RGB[0] == 0)ans++;
    }
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		int c = Integer.parseInt(sc.next());
		int d = Integer.parseInt(sc.next());
		
		while(a > 0 || c > 0) {
			c -= b;
			if(c <= 0) {
				System.out.println("Yes");
				break;
			}
			a -= d;
			if(a <= 0) {
				System.out.println("No");
				break;
			}
			
		}
	}

}


Measured memory_bytes: 35660
import sys
def input(): return sys.stdin.readline().rstrip()


def main():
    n, m = map(int, input().split())
    price = [0]*m
    typesnum = [0]*m
    keybit=[0]*m
    for i in range(m):
        price[i], typesnum[i] = map(int, input().split())
        keybit[i] = sum(map(lambda x: 2**(int(x)-1), input().split()))
    dp = [10**9]*(1 << n)
    dp[0]=0
    for bit in range(1 << n):
        for i in range(m):
            dp[bit | keybit[i]] = min(dp[bit | keybit[i]], dp[bit]+price[i])
    if dp[-1] == 10**9:
        dp[-1] = -1
    print(dp[-1])


if __name__ == '__main__':
    main()

Measured memory_bytes: 9312
class BinaryTree
  attr_accessor :key, :left, :right, :parent

  def initialize(key=nil, left=nil, right=nil, parent=nil)
    @key = key
    @left = left
    @right = right
    @parent = parent
  end

  def root
    if parent
      parent.root
    else
      self
    end
  end

  def insert(z)
    y = nil # x の親
    x = root
    while x
      y = x # 親を設定
      if z.key < x.key
        x = x.left # 左の子へ移動
      else
        x = x.right # 右の子へ移動
      end
    end
    z.parent = y

    if y.nil? # t が空の場合
      key = z.key
      left = z.left
      right = z.right
    elsif z.key < y.key
      y.left = z # z を y の左の子にする
    else
      y.right = z # z を y の右の子にする
    end
  end

  def in_order
    ret = []
    ret << left.in_order if left
    ret << key
    ret << right.in_order if right
    ret.flatten.compact
  end

  def pre_order
    ret = []
    ret << key
    ret << left.pre_order if left
    ret << right.pre_order if right
    ret.flatten.compact
  end
end

n = gets.chomp.to_i

bt = nil
n.times do
  op, x = gets.chomp.split

  if op == 'insert'
    if bt.nil?
      bt = BinaryTree.new(x.to_i, nil, nil, nil)
    else
      bt.insert(BinaryTree.new(x.to_i, nil, nil, nil))
    end
  else
    puts " #{bt.in_order.map(&:to_s).join(' ')}"
    puts " #{bt.pre_order.map(&:to_s).join(' ')}"
  end
end


Measured memory_bytes: 150060