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

#define lld long long
#define pi pair<int,int>
#define pl pair<lld,lld>
#define mem0(x) memset(x,0,sizeof(x))
#define fillnum(x,n) fill(begin(x),end(x),n)
#define asort(x) sort(x.begin(),x.end())
#define dsort(x,t) sort(x.begin(),x.end(),greater<t>())

int main() {
    lld N,K;
    cin >> N >> K;
    lld cnt = 0;
    for (int i = 0; i < N; i++) {
        int h;
        cin >> h;
        if(h >= K){
            cnt++;
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 3580
h,w = map(int,input().split())
s = [list(input()) for i in range(h)]
s.insert(0,["." for i in range(w)])
s.append(["." for i in range(w)])
for i in range(h+2):
  s[i].insert(0,".")
  s[i].append(".")
ans = True
for i in range(1,h+1):
  for j in range(1,w+1):
    if "#" == s[i][j] != s[i][j-1] == s[i+1][j] == s[i][j+1] == s[i-1][j]:
      ans = False
print("Yes" if ans else "No")

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

int a, b, c, x;

int main() {
    cin >> a >> b >> c >> x;
    int count = 0;
    rep(i, a+1) rep(j, b+1) rep(k, c+1) {
        int p = 500 * i + 100 * j + 50 * k;
        if(p == x) {
            count++;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INF INT_MAX // 2147483647
#define INFLL LLONG_MAX // 9223372036854775807
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define per(i, n) for(ll i=((ll)(n))-1; i>=0; i--)
#define perf(i, n) for(ll i=((ll)(n)); i>0; i--)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
template<class T>bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
using namespace std;

int main(){
    Init();
    set<char> st;
    char c;
    c = getchar();
    st.insert(c);
    c = getchar();
    st.insert(c);
    c = getchar();
    st.insert(c);
    if(st.size() == 3) Yes();
    else No();    
}

Measured memory_bytes: 256
using System;
using System.Linq;

class Program
{
    static void Main()
    {
        int num = int.Parse(Console.ReadLine());
        string[] s_data = Console.ReadLine().Split();
        int[] data = new int[s_data.Length];

        for (int i = 0; i < data.Length; i++) data[i] = int.Parse(s_data[i]);

        int loop_num = 0;
        while (data.All(x => x % 2 == 0))
        {
            for(int i = 0; i < data.Length; i++) data[i] = data[i] / 2;
            loop_num++;
        }

        Console.WriteLine(loop_num);
    }
}

Measured memory_bytes: 13268
while True:
    y,x = [int(i) for i in input().split()]
    if x==0 and y==0:
        break
    for i in range(y):
        if i%2:
            for j in range(x):
                if j%2:
                    print('#' ,end='')
                else:
                    print('.' ,end='')
            print()
        else:
            for j in range(x):
                if j%2:
                    print('.' ,end='')
                else:
                    print('#' ,end='')
            print()
    print()

Measured memory_bytes: 9028
#include<bits/stdc++.h>
using namespace std;
#define inf 1e9
#define ll long long
#define ull unsigned long long
#define M 1000000007
#define P pair<int,int>
#define PLL pair<ll,ll>
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define RFOR(i,m,n) for(int i=m;i>=n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define PI 3.14159265

bool d[1000000];

void f(int a,int b,int c){
  int i=0;
  a-=b;
  while(i<c){
    a+=b;
    if(a<=0) continue;
    if(!d[a]) i++;
  }

  cout<<a<<endl;
}

int main(){
  d[0]=d[1]=true;

  for(int i=2;i<1000000;i++){
    if(d[i]) continue;
    for(int j=2;i*j<1000000;j++){
      d[i*j]=true;
    }
  }


  while(1){
    int a,b,c;
    cin>>a>>b>>c;
    if(a==0) break;
    f(a,b,c);
  }

  return 0;
}


Measured memory_bytes: 4024
#include <stdio.h>

#include <algorithm>

#include <string>

using namespace std;


int N; char S[6060];
int A[3030], B[3030], C[6060];


int main()
{

	scanf("%d %s", &N, S);

	A[0] = B[0] = -1;

	for (int i=0, a=0, b=0;i<N*2;i++){
		if (S[i] == 'a') A[++a] = i;
		if (S[i] == 'b') B[++b] = i;
	}

	string ans = "", best = "";
	int l = N*2+1, lm = N*2+1; bool see = false;
	for (int i=N;i>=0;i--){
		if (A[i] >= B[i]){
			if (A[i] < l) best = ans, lm = l;

			if (i){
				C[A[i]] = C[B[i]] = 1;
				string now = "";
				for (int j=B[i];j<lm;j++) if (C[j]) now += S[j];

				string mk = now + best;
				if (ans < mk)
					ans = move(mk);
			}

			l = B[i];
			see = true;
		}
		else if (!see){
			if (B[i] < l){
				ans += "ab";
				best += "ab";
				l = A[i];
			}
		}
	}

	puts(ans.c_str());
	return 0;
}


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

#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x
#define dump_1(x1) cerr << #x1 << ": " << x1 << endl
#define dump_2(x1, x2) \
  cerr << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << endl
#define dump_3(x1, x2, x3)                                                \
  cerr << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " \
       << x3 << endl
#define dump_4(x1, x2, x3, x4)                                            \
  cerr << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " \
       << x3 << ", " #x4 << ": " << x4 << endl
#define dump_5(x1, x2, x3, x4, x5)                                        \
  cerr << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " \
       << x3 << ", " #x4 << ": " << x4 << ", " #x5 << ": " << x5 << endl
#define dump(...) \
  CHOOSE((__VA_ARGS__, dump_5, dump_4, dump_3, dump_2, dump_1, ~))(__VA_ARGS__)
#define check(s) cerr << s << endl

#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 all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define unique(v) v.erase(unique(v.begin(), v.end()), v.end());
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)

using namespace std;

using ll = long long;

vector<int> dx = {0, 1, 0, -1};
vector<int> dy = {1, 0, -1, 0};

const ll LINF = 2e18;
const int INF = 1e9;

void solve(ll a, ll b, ll c, ll d) {
  ll ans1 = a * c;
  ll ans2 = a * d;
  ll ans3 = b * c;
  ll ans4 = b * d;

  ll ans = ans1;
  chmax(ans, ans2);
  chmax(ans, ans3);
  chmax(ans, ans4);
  cout << ans << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  ll a;
  scanf("%lld", &a);
  ll b;
  scanf("%lld", &b);
  ll c;
  scanf("%lld", &c);
  ll d;
  scanf("%lld", &d);
  solve(a, b, c, d);
  return 0;
}


Measured memory_bytes: 3712
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF=2147483647;
inline ll read(){
	ll x=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){
		if(ch=='-') f=-1;
		ch=getchar();
	}
	while(ch>='0'&&ch<='9'){
		x=(x<<1)+(x<<3)+(ch^48);
		ch=getchar();
	}
	return x*f;
}
const int maxn=2e5+5;
int n,a[maxn],vis[maxn];
ll k,ans,cnt;
int main(){
	n=read(),k=read();
	for(int i=1;i<=n;i++) a[i]=read();
	cnt=1;
	while(1){
		if(vis[cnt]) break;	
		vis[cnt]=1;
		cnt=a[cnt];
		++ans;		
	}
	int num=1,t=0;
	while(1){
		if(num==cnt) break;
		num=a[num];
		++t;
	}
	if(k<=t){
		int c=1;
		while(k--) c=a[c];
		printf("%d\n",c);
		return 0;
	}
	k-=t;
	ll m=k%(ans-t);
	ans=cnt;
	while(m--) ans=a[ans];
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 5280
N = int(input())
C = list(map(int, input().split()))
MOD = 10 ** 9 + 7

C.sort(reverse=True)

pow2 = [1]
for _ in range(2 * N):
    pow2.append(pow2[-1] * 2 % MOD)

ans = 0
for i in range(N):
    ans += (i + 2) * C[i]
    ans %= MOD
ans *= pow2[2 * N - 2]
ans %= MOD

print(ans)


Measured memory_bytes: 31920
/* low_link.cpp
    グラフの関節点・橋の列挙をする

    verified: AOJ GRL_3_A
        http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_3_A
    verified: AOJ GRL_3_B
        http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_3_B
*/
#include <bits/stdc++.h>
using namespace std;

struct Edge {
    int to;
};
using Graph = vector<vector<Edge>>;
using P = pair<long, long>;

/* Lowlink: グラフの関節点・橋を列挙する構造体
    作成: O(E+V)
    関節点の集合: vector<int> aps
    橋の集合: vector<P> bridges
*/
struct LowLink {
    vector<int> aps;  // articulation points
    vector<P> bridges;

    const Graph &G;
    vector<int> used, ord, low;
    LowLink(const Graph &G_) : G(G_) {
        used.assign(G.size(), 0);
        ord.assign(G.size(), 0);
        low.assign(G.size(), 0);
        int k = 0;
        for (int i = 0; i < (int)G.size(); i++) {
            if (!used[i]) k = dfs(i, k, -1);
        }
        sort(aps.begin(), aps.end());
        sort(bridges.begin(), bridges.end());
    }

    int dfs(int id, int k, int par) {
        used[id] = true;
        ord[id] = k++;
        low[id] = ord[id];
        bool is_aps = false;
        int count = 0;
        for (auto &e : G[id]) {
            if (!used[e.to]) {
                count++;
                k = dfs(e.to, k, id);
                low[id] = min(low[id], low[e.to]);
                if (par != -1 && ord[id] <= low[e.to]) is_aps = true;
                if (ord[id] < low[e.to]) bridges.emplace_back(min(id, e.to), max(id, e.to));
            } else if (e.to != par) {
                low[id] = min(low[id], ord[e.to]);
            }
        }
        if (par == -1 && count >= 2) is_aps = true;
        if (is_aps) aps.push_back(id);
        return k;
    }
};

/*
//verified: AOJ GRL_3_A
//    http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_3_A
int main() {
    long long V, E;
    cin >> V >> E;
    Graph G(V);
    for (int i = 0; i < E; i++) {
        int s, t;
        cin >> s >> t;
        G[s].push_back({t});
        G[t].push_back({s});
    }

    LowLink lowlink(G);

    for (auto i : lowlink.aps) {
        cout << i << endl;
    }
    return 0;
}
*/

/*
// verified: AOJ GRL_3_B
//    http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=GRL_3_B
*/
int main() {
    long long V, E;
    cin >> V >> E;
    Graph G(V);
    for (int i = 0; i < E; i++) {
        int s, t;
        cin >> s >> t;
        G[s].push_back({t});
        G[t].push_back({s});
    }

    LowLink lowlink(G);

    for (auto e : lowlink.bridges) {
        cout << e.first << " " << e.second << endl;
    }
    return 0;
}



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

using ll=int64_t;
#define int ll

#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(),x.end()
#ifdef MAROON_LOCAL
#define cerr (cerr<<"-- line "<<__LINE__<<" -- ")
#else
class CerrDummy{}cerrDummy;
template<class T>
CerrDummy& operator<<(CerrDummy&cd,const T&){
	return cd;
}
using charTDummy=char;
using traitsDummy=char_traits<charTDummy>;
CerrDummy& operator<<(CerrDummy&cd,basic_ostream<charTDummy,traitsDummy>&(basic_ostream<charTDummy,traitsDummy>&)){
	return cd;
}
#define cerr cerrDummy
#endif
#define REACH cerr<<"reached"<<endl
#define DMP(x) cerr<<#x<<":"<<x<<endl
#define ZERO(x) memset(x,0,sizeof(x))
#define ONE(x) memset(x,-1,sizeof(x))

using pi=pair<int,int>;
using vi=vector<int>;
using ld=long double;

template<class T,class U>
ostream& operator<<(ostream& os,const pair<T,U>& p){
	os<<"("<<p.first<<","<<p.second<<")";
	return os;
}

template<class T>
ostream& operator <<(ostream& os,const vector<T>& v){
	os<<"{";
	REP(i,(int)v.size()){
		if(i)os<<",";
		os<<v[i];
	}
	os<<"}";
	return os;
}

ll read(){
	ll i;
	scanf("%" SCNd64,&i);
	return i;
}

void printSpace(){
	printf(" ");
}

void printEoln(){
	printf("\n");
}

void print(ll x,int suc=1){
	printf("%" PRId64,x);
	if(suc==1)
		printEoln();
	if(suc==2)
		printSpace();
}

string readString(){
	static char buf[3341000];
	scanf("%s",buf);
	return string(buf);
}

char* readCharArray(){
	static char buf[3341000];
	static int bufUsed=0;
	char* ret=buf+bufUsed;
	scanf("%s",ret);
	bufUsed+=strlen(ret)+1;
	return ret;
}

template<class T,class U>
void chmax(T& a,U b){
	if(a<b)
		a=b;
}

template<class T,class U>
void chmin(T& a,U b){
	if(b<a)
		a=b;
}

template<class T>
T Sq(const T& t){
	return t*t;
}

#define CAPITAL
void Yes(bool ex=true){
	#ifdef CAPITAL
	cout<<"YES"<<endl;
	#else
	cout<<"Yes"<<endl;
	#endif
	if(ex)exit(0);
}
void No(bool ex=true){
	#ifdef CAPITAL
	cout<<"NO"<<endl;
	#else
	cout<<"No"<<endl;
	#endif
	if(ex)exit(0);
}

const ll infLL=LLONG_MAX/3;

#ifdef int
const int inf=infLL;
#else
const int inf=INT_MAX/2-100;
#endif

signed main(){
	int n=read();
	vi a(n);
	REP(i,n)a[i]=read()-i;
	sort(ALL(a));
	int m=n/2;
	int ans=0;
	REP(i,n)
		ans+=abs(a[m]-a[i]);
	print(ans);
}


Measured memory_bytes: 1792
N=int(input())
l=["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"]
Ans=[]
s=0
for i in range(11):
    s+=26**i
    S=s+26**(i+1)
    if s<=N<S:
        I=i
        break
for i in range(I+1):
    N-=26**i
while I>=0:
    for i in range(0,26):
        n=N-26**I*i
        if n<26**I:
            Ans.append(l[i])
            N=n
            I-=1
            break
print("".join(Ans))

Measured memory_bytes: 9120
/*
    Author: Nguyen Tan Bao
    Status:
    Idea:
*/
 
#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x
 
using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<II, int> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;
 
const ll MODBASE = 1000000007LL;
const int MAXN = 110;
const int MAXM = 1000;
const int MAXK = 16;
const int MAXQ = 200010;

vector<int> a = {0};

bool inRange(int u, int x) {
    int l = max(x-1, 0), r = min(9, x+1);
    return l <= u && u <= r;
}

void add() {
    a[0]++;
    int now = 0;
    while (1) {
        if (now+1 < SZ(a)) {
            if (!inRange(a[now], a[now+1])) {
                now++;
                a[now]++;
            }
            else {
                FORE(i,now-1,0) a[i] = max(0, a[i+1]-1);
                break;
            }
        }
        else {
            if (a[now] == 10) {
                a.push_back(1);
                FORE(i,now,0) a[i] = max(0, a[i+1]-1);
                break;
            }
            else {
                FORE(i,now-1,0) a[i] = max(0, a[i+1]-1);
                break;
            }
        }
    }
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    int k;
    cin >> k;
    FOR(i,1,k) add();
    FORE(i,SZ(a)-1,0) cout << a[i];
    return 0;
}


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

int main(){
  int X,A,B,C,count=0;
  cin  >> A >> B >> C >> X;
  for(int i=0; i<=A; i++){
    for(int j=0; j<=B; j++){
      for(int k=0; k<=C; k++){
        if(i*500+j*100+k*50 == X){
          count+=1;
        }
      }
    }
  }
  cout << count << endl;
}

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

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

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

int main (){
  int n;
  int pos;
  string s;

  cin >> n;
  cin.ignore();
  for (int i = 0; i < n ; ++i){
    getline(cin, s);
    while(1){
      pos = s.find("Hoshino");
      if(pos == -1) break;
      s[pos+6] = 'a';
    }
    cout << s << endl;
  }
  return 0;
}

Measured memory_bytes: 1204
#include<cstdio>
#include<cstring>
#include<iostream>
#include<stdlib.h>
#include<ctime>
#include<string>
#include<cmath>
#include<algorithm>
#include<complex>
#include<vector>
#include<set>
#include<map>
#include<queue>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define LL long long
#define FOR(i,a,b) for (int i=a;i<=b;++i)
#define FORD(i,a,b) for (int i=a;i>=b;--i)
using namespace std;
void getint(int &v){
    char ch,fu=0;
    for(ch='*'; (ch<'0'||ch>'9')&&ch!='-'; ch=getchar());
    if(ch=='-') fu=1, ch=getchar();
    for(v=0; ch>='0'&&ch<='9'; ch=getchar()) v=v*10+ch-'0';
    if(fu) v=-v;
}
int A,B,C,ans;
int main(){
	cin>>A>>B>>C;
	ans=666666;
	FOR(i,-500,500){
		int a,b,c;
		if (i<=A) a=A-i;
		else if ((i-A)%2==0) a=(i-A)/2;
		else a=(i-A+3)/2;
		if (i<=B) b=B-i;
		else if ((i-B)%2==0) b=(i-B)/2;
		else b=(i-B+3)/2;
		if (i<=C) c=C-i;
		else if ((i-C)%2==0) c=(i-C)/2;
		else c=(i-C+3)/2;
		
		ans=min(ans,a+b+c);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
import sys

def solution(numbers):
    profit = float("-inf")
    
    minv = numbers[1]
    
    for i in range(2, len(numbers)):
        n = numbers[i]
        profit = max(profit, n - minv)
        minv = min(minv, n)
        
    return profit

def main():
    first = True
    numbers = []
    for line in sys.stdin:
        if first:
            first = False
        numbers.append(int(line))

    print(solution(numbers))

if __name__ == '__main__':
    main()



Measured memory_bytes: 13612
# include <bits/stdc++.h>
# define ll long long int
# define pb push_back
# define pf push_front
# define mpi make_pair
# define pi pair<ll,ll>
# define fast ios_base::sync_with_stdio(false); cin.tie(NULL);
# define mod 1000000007
# define endl "\n"
using namespace std;
int main()
{
	fast
	ll a,b;
	cin>>a>>b;
	if((a+b)%2==0)
	{
		cout<<(a+b)/2;
	}
	else
	{
		cout<<"IMPOSSIBLE";
	}
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        int[] a = new int[n];
        for(int i=0; i<n; i++) {
            a[i] = sc.nextInt()-1;
        }
        sc.close();

        int cnt = 0;
        int tmp = 0;
        for(int i=0; i<n; i++) {
            cnt++;
            tmp = a[tmp];
            if(tmp == 1) {
                break;
            }
        }
        if(cnt == n) {
            System.out.println(-1);
        } else {
            System.out.println(cnt);
        }
    }
}


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

int main(){
  int h, w; cin >> h >> w;
  vector<vector<char>> s(h, vector<char>(w));
  vector<int> a, b;
  for(int i = 0; i < h; i++){
  for(int j = 0; j < w; j ++){
  	cin >> s[i][j];
  }
  }
  
  for(int i = 0; i < h; i++){
    int sum = 0;
  for(int j = 0; j < w; j++){
  	if(s[i][j]=='.') sum++;
  }
    if(sum==w) a.push_back(i);
  }
  for(int i = 0; i < w; i++){
    int sum = 0;
  for(int j = 0; j < h; j++){
  	if(s[j][i]=='.') sum++;
  }
  	if(sum==h) b.push_back(i);
  }
  //a.push_back(-1); b.push_back(-1);
  int x=0, y=0;
  for(int i = 0; i < h; i++){
    bool fi = true;
    for(auto k: a) if(k==i) fi = false;
  for(int j = 0; j < w; j++){
    bool fj = true;
    for(auto l: b) if(l==j) fj = false;
    if(fi&&fj) cout << s[i][j];
  }
  if(fi) cout << endl;
  }
}

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

int main(){
    int n;
    cin >> n;
    int rate = 8;
    cout << rate - ((n - 400) / 200) << endl;    
    return 0;
}


Measured memory_bytes: 3620
var input = [];
var max;
var maxIndex;
var temp;
var maxLength = 3;
process.stdin.resume();
process.stdin.setEncoding("utf8");
process.stdin.on('data', function(chunk){
    input = chunk.toString("utf8").split("\n");
});
process.stdin.on('end', function(){
    for (var m = 0; m < maxLength; m++) {
        temp = 0;
        for (var i = 0; i < input.length; i++) {
            if (i === 0) {
                temp = parseInt(input[i]);
            }else{
                if (temp < parseInt(input[i])) {
                    temp = input[i];
                    maxIndex = i;
                }
            }
        }
        input.splice(maxIndex, 1);
        console.log(temp)
    }
});

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

int partition(vector<int> &A, int p, int r) {
    int x = A.at(r - 1);
    int i = p - 1;
    for (int j = p; j < r-1; j++) {
        if (A.at(j) <= x) {
            i++;
            int tmp = A.at(j);
            A.at(j) = A.at(i);
            A.at(i) = tmp;
        }
    }
    int tmp = A.at(r-1);
    A.at(r-1) = A.at(i + 1);
    A.at(i + 1) = tmp;
    return i+1;
}

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

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

    int q = partition(A, 0, N);
    for (int i = 0; i < N; i++) {
        if (i)
            cout << " ";

        if (i == q)
        {
            cout << "[" << A.at(i) << "]";
        }
        else
        {
            cout << A.at(i);
        }
    }
    cout << endl;
}


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

int main() {
  int H, W;
  cin >> H >> W;
  vector<string>v(H);
  for(int i = 0; i < H; i++) {
    cin >> v.at(i);
  }
  for(int i = 0; i < W+2; i++) {
    cout << '#';
  }
  cout << endl;
  for(int i = 0; i < H; i++) {
    cout << '#' << v.at(i) << '#' << endl;
  }
  for(int i = 0; i < W+2; i++) {
    cout << '#';
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define All(a) a.begin(),a.end()
#define INF 1000000007
const ll MOD = 1000000007;
//accumulate(vec.begin(), vec.end(), 0)
//std::sort(v.begin(), v.end(), std::greater<Type>());
//set_intersection(x, x+7, y, y+6, back_inserter(v));
//set_union(x, x+7, y, y+6, back_inserter(v));
//set_difference(x, x+7, y, y+6, back_inserter(v));

int gcd(int x,int y){
  if(x%y==0) return y;
  else return gcd(y,x%y);
}

bool isPrime(int n){
  if(n < 2) return false;
  else if(n == 2) return true;
  else if(n%2==0) return false;

  for(int i=3;i<=sqrt(n);i++){
    if(n%i==0) return false;
  }
  return true;
}

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  for(int i=1;i<=b;i++){
    if(a*i%b==c){
      cout<< "YES" <<endl;
      return 0;
    }
  }
  cout<< "NO" <<endl;
}


Measured memory_bytes: 256
# coding:utf-8

import sys
# from collections import Counter, defaultdict

INF = float('inf')
MOD = 10 ** 9 + 7

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return input()


n = II()
ans = 0
for _ in range(n):
    x, u = LS()
    x = float(x)
    if u == 'BTC': x *= 380000
    ans += x
print(ans)

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

int main(){
  int n;
  cin >> n;
  int a;
  int amax=1;
  for(int i=2;i<n;i++){
    for(int j=2;j<n;j++){
      a=pow(i,j);
      if(a<=n){
        amax=max(amax,a);
      }else{
        break;
      }
    }
  }
    cout << amax << endl;
}

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

#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 ALL(v) v.begin(), v.end()

int main() {
  int64_t N;
  cin >> N;
  N = N%10;

  if(N == 2 || N == 4 || N == 5 || N == 7 || N == 9){
    cout << "hon" << endl;
  }else if(N == 0 || N == 1 || N == 6 || N == 8){
    cout << "pon" << endl;
  }else{
    cout << "bon" << endl;
  }
}

Measured memory_bytes: 3596
#include<iostream>
#include<map>
#include<vector>
#include<algorithm>
#include<cmath>
#include<climits>
#include<ctime>
#include<cstring>
#include<numeric>

#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)

using namespace std;

struct Point {
	int x, y;
	Point(int x_, int y_) : x(x_), y(y_) {}
};

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

int main() {
	int N;
	while(cin >> N) {
		if (N == 0) { break; }
		int n, d;	
		vector<Point> rects;
		rects.push_back(Point(0, 0));		
		rep(nth, N-1) {	
			cin >> n >> d;
			Point p = rects[n];	
			Point rect = Point(p.x+dx[d], p.y+dy[d]);
			rects.push_back(rect);
		}

		int min_x=0, max_x=0, min_y=0, max_y=0;
		rep(i, N) {
			Point p = rects[i];
			min_x = min(min_x, p.x);	
			max_x = max(max_x, p.x);	
			min_y = min(min_y, p.y);	
			max_y = max(max_y, p.y);	
		}

		cout << abs(min_x) + max_x + 1 << " ";
		cout << abs(min_y) + max_y + 1 << endl;
	}
	return 0;
}

Measured memory_bytes: 1204
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
char a[11];
void dfs(int n,int y,int z){
    if(y==n){
        cout<<a<<endl;
        return;
    }
    for(int i=0;i<=z;i++){
        a[y]='a'+i;
        if(i==z) dfs(n,y+1,z+1);
        else dfs(n,y+1,z);
    }
}
int main(void){
    int n;
    cin>>n;
    dfs(n,0,0);
}

Measured memory_bytes: 1536
h,w = map(int,input().split())
s = [input() for i in range(h)]

start = []
for i in range(h):
    for j in range(w):
        if s[i][j:j+1] == ".":
            start.append([i,j])
#print(start)

def meiro(ss,count):
    if len(ss) == 0:
  #      for i in range(h):
  #          print(jokyo[i])
  #      print()
        global ans
        ans = max(ans,count-1)
    else:
        kouho = [[0,1],[0,-1],[1,0],[-1,0]]
        next_s = []
        for hw in ss:
            for i in range(4):    
                next_w = hw[1]+kouho[i][1]
                next_h = hw[0]+kouho[i][0]
                if next_w < w and next_w >= 0:
                    if next_h < h and next_h >= 0:
                        if s[next_h][next_w:next_w+1] == "." and jokyo[next_h][next_w] == -1:
                            next_s.append([next_h,next_w])
                            jokyo[next_h][next_w] = count + 1
        meiro(next_s,count+1)

ans = 0
for i in range(len(start)):
    jokyo = [[-1 for i in range(w)] for j in range(h)]
    jokyo[start[i][0]][start[i][1]] = 0
    meiro([start[i]],0)

print(ans)

Measured memory_bytes: 62940
n,r=map(int,input().split())
while n!=0 or r!=0:
    card=[i for i in range(n,0,-1)]
    for i in range(r):
        p,c=map(int,input().split())
        for j in range(c):
            card.insert(0,card.pop(c+p-2))
    print(card[0])
    n,r=map(int,input().split())


Measured memory_bytes: 5624
#include<iostream>

using namespace std;

int main(void){
  int N;
  cin >> N;
  int ans = 0;
  for(int i = 0; i < N; i++){
    int l, r;
    cin >> l >> r;
    ans += r - l + 1;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
 
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);    
	
	int N; cin >> N;
	int data[N]; 
	F0R(i, N) cin >> data[i];
	
	int start = 0;
	
	int ans = 0;
	FOR(i, 1, N) {
		if (data[i] > data[i-1]) start = i;
		ans = max(ans, i-start);
	}
	cout << ans << endl;
	
	return 0;
}
 
// read the question correctly (ll vs int)
// template by bqi343


Measured memory_bytes: 640
Module Module088B
    Sub Main(ByVal args() As String)
        Dim N As Integer
        Dim i, j As Integer
        Dim tmp As Integer

        Dim Alice As Integer : Alice = 0
        Dim Bob As Integer : Bob = 0

        N = Console.ReadLine()
        Dim arr(N - 1) As String
        Dim arr_i(N - 1) As Integer
        arr = Split(Console.ReadLine())

        For i = 0 To N - 1
            arr_i(i) = Integer.Parse(arr(i))
        Next

        '入力をソートする
        For i = 0 To N - 1
            For j = N - 1 To i Step -1
                If arr_i(j) < arr_i(i) Then
                    tmp = arr_i(j)
                    arr_i(j) = arr_i(i)
                    arr_i(i) = tmp
                End If
            Next
        Next

        For i = 0 To N - 1
            'iが偶数の場合はAlice 
            If i Mod 2 = 0 Then
                Alice = Alice + arr_i(N - 1 - i)
            Else
                Bob = Bob + arr_i(N - 1 - i)
            End If
        Next

        Console.Write(Alice - Bob)

    End Sub
End Module


Measured memory_bytes: 13536
#include <iostream>
using namespace std;
const int INF = 1 << 29;
const int N_MAX = 41;
const int a_MAX = 11;
const int b_MAX = 11;
const int c_MAX = 100;

typedef struct{ //
  int a; // 物質aの重さ
  int b; // 物質bの重さ
  int c; // 値段
} drug;

int dp[N_MAX][a_MAX*N_MAX][b_MAX*N_MAX];
drug drugs[N_MAX];

int calcDp(int i,int ca,int cb){
  int tmp1,tmp2;
  tmp2 = INF;
  tmp1 = dp[i-1][ca][cb]; //drug iを入れない場合
  if(ca-drugs[i].a >= 0 && cb-drugs[i].b >=0){
    tmp2 = dp[i-1][ca-drugs[i].a][cb-drugs[i].b] + drugs[i].c;
  }
  if(tmp1 <= tmp2) return tmp1;
  else return tmp2;
}

int main(){
  int N,N_a,N_b;
  cin >> N >> N_a >> N_b;
  
  for(int i=0;i<N;i++){
    int a,b,c;
    cin >> a >> b >> c;
    drugs[i].a = a;
    drugs[i].b = b;
    drugs[i].c = c;
  }
  
  for(int i=0;i<N;i++)
    for(int j=0;j<a_MAX*N_MAX;j++)
      for(int k=0;k<b_MAX*N_MAX;k++) dp[i][j][k] = INF;

  dp[0][drugs[0].a][drugs[0].b] = drugs[0].c;
  for(int i=0;i<N;i++) dp[i][0][0] = 0;

  for(int i=1;i<N;i++)
    for(int ca=0;ca<a_MAX*N_MAX;ca++)
      for(int cb=0;cb<b_MAX*N_MAX;cb++)
	dp[i][ca][cb] = calcDp(i,ca,cb);

  int ans = INF;
  for(int ca=0;ca<a_MAX*N_MAX;ca++)
    for(int cb=0;cb<b_MAX*N_MAX;cb++)
      if((ca*N_b == cb*N_a) && ca != 0 && cb != 0)
	if(ans > dp[N-1][ca][cb]) ans = dp[N-1][ca][cb];

  if(ans == INF) ans = -1;

  cout << ans << endl;
  
  return 0;
}


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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
    return string(1, val);
}

int main(){
    ll X; cin >> X;

    ll res = 0;
    while(X >= 500) {
        X = X - 500;
        res += 1000;
    }

    while(X >= 5) {
        X = X - 5;
        res += 5;
    }

    cout << res << endl;
}

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

int main()
{
	ll n;
	cin >> n;
	map<char, ll> name_cnt;
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;
		switch (s[0]) {
		case 'M':
			name_cnt[s[0]]++;
			break;
		case 'A':
			name_cnt[s[0]]++;
			break;
		case 'R':
			name_cnt[s[0]]++;
			break;
		case 'C':
			name_cnt[s[0]]++;
			break;
		case 'H':
			name_cnt[s[0]]++;
			break;
		default:
			break;
		}
	}

	vector<ll> d = { name_cnt['M'],name_cnt['A'], name_cnt['R'], name_cnt['C'], name_cnt['H'] };
	vector<ll> p = { 0,0,0,0,0,0,1,1,1,2 };
	vector<ll> q = { 1,1,1,2,2,3,2,2,3,3 };
	vector<ll> r = { 2,3,4,3,4,4,3,4,4,4 };

	ll res = 0;
	for (int i = 0; i < 10; i++) res += d[p[i]] * d[q[i]] * d[r[i]];
	cout << res << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
	double x1,x2,x3,y1,y2,y3,xo,yo;
    double a,b,c;
 
    while(scanf("%lf %lf %lf %lf %lf %lf %lf %lf",&x1,&y1,&x2,&y2,&x3,&y3,&xo,&yo)!=EOF){
        a = (x2-x1)*(yo-y1)-(y2-y1)*(xo-x1);
        b = (x3-x2)*(yo-y2)-(y3-y2)*(xo-x2);
        c = (x1-x3)*(yo-y3)-(y1-y3)*(xo-x3);
        if((a>0&&b>0&&c>0) || (a<0&&b<0&&c<0)){
            printf("YES\n");
        }else{
            printf("NO\n");
        }
    }
    return 0;
}


Measured memory_bytes: 2596
#include "bits/stdc++.h"

#define rep(a,b) for(int a = 0;a < b;a++)
#define REP(i, x, n) for(int i = x; i < n; i++)
#define P(a) cout << a << endl
#define pb(a) push_back(a)
#define mp(a,b) make_pair(a,b)
#define ssort(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())
#define vP(v) for(int i = 0;i < v.size();i++){cout << v[i];if(i != v.size()-1)cout << endl;}
#define vcin(v,n) rep(i,n){int a;cin >> a;v.pb(a);}

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
int dx[] = { 1, -1 , 0 , 0 };
int dy[] = { 0,  0,  1, -1 };
ll MOD = 1000000007;

void solve(){
	int n,a;
	cin >> n >> a;
	P(n*n - a);
}

int main() {
    solve();
    return 0;
}


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

int main() {
    string s;
    cin>>s;
	for(int i = 1; i<s.length(); ++i){
        if(s[i] == s[i-1]) {
            cout<<"Bad\n";
			return 0;
        }
    }
		cout<<"Good\n";
}




Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
using namespace std;

int main()
{
    long long n;
    int m, k, d, s;
    cin >> n >> m >> k >> d >> s;
    if(n > m){
        cout << (k * d) << endl;
        return 0;
    }

    vector<bool> check(n, false);
    priority_queue<tuple<int, int, int>, vector<tuple<int, int, int> >, greater<tuple<int, int, int> > > pq;
    for(int i=0; i<m; ++i){
        int a, b, c;
        cin >> a >> b >> c;
        check[c-1] = true;
        pq.push(make_tuple(a, b, c-1));
    }
    pq.push(make_tuple(s + d, INT_MAX, -1));

    vector<int> v(n, 0);
    multiset<int> ms;
    for(int i=0; i<n; ++i)
        ms.insert(0);

    for(;;){
        int a, b, c;
        tie(a, b, c) = pq.top();
        pq.pop();

        if(c == -1){
            int x = max(a, *ms.begin());
            if(--k == 0){
                cout << (x - s) << endl;
                return 0;
            }
            pq.push(make_tuple(x + d, INT_MAX, -1));
        }
        else{
            int x = max(a + b, v[c] + b);
            ms.erase(ms.find(v[c]));
            ms.insert(x);
            v[c] = x;
        }
    }
}

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

ll mod = 1000000007;


int main() {
int x,y;cin >>x>>y;
if(x==2||y==2) {
    cout << "No" <<endl;
    return 0;
}
if((x==1||x==3||x==5||x==7||x==8||x==10||x==12)&&(y==1||y==3||y==5||y==7||y==8||y==10||y==12))
{
    cout << "Yes" <<endl;
    return 0;
}
if((x==4||x==6||x==9||x==11)&&(y==4||y==6||y==9||y==11)){
    cout <<"Yes" <<endl;
    return 0;
}
cout << "No" <<endl;
}

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

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    int res = 0;
    int aa, bb, cc;
    aa = a % 2;
    bb = b % 2;
    cc = c % 2;
    if(aa != bb || aa != cc){
        res = 1;
        if(aa == bb){a++; b++;}
        if(aa == cc){a++; c++;}
        if(cc == bb){c++; b++;}
    }

    int max3 = max(a, max(b, c));
    int ans;
    ans = (3 * max3 - a - b - c) / 2;
    cout << ans + res << endl;

}

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

int gcd(int x,int y){
	if(y==0) return x;
	else return gcd(y,x%y);
}

int lcm(int x,int y){
	return x*y/gcd(x,y);
}
 
signed main(){
	int n,ma=0;
	cin>>n;
	vector<int>vec(1000000);
	for(int i=0;i<n;i++){
		int a;
		cin>>a;
		if(a>0)vec[a-1]++;
		vec[a]++;
		vec[a+1]++;
	}
	for(int i=0;i<1000002;i++){
		ma=max(ma,vec[i]);
	}
	cout<<ma<<endl;
}

Measured memory_bytes: 4096
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    map <string,int> mp;  //map <key,value> mp
    for(int i=0;i<n;i++)
    {
        string s;
        cin>>s;
        mp[s]++;
    }
    int mx=0;
    for (auto i = mp.begin(); i != mp.end(); ++i) {
        if(i->second>mx)
        {
            mx = max(mx,i->second);
        }
    }
    for(auto i=mp.begin();i!=mp.end();i++)
    {
        if(i->second==mx)
        {
            cout<<i->first<<endl;
        }
    }
}


Measured memory_bytes: 25216
object Main {

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    // 偶数番目, 奇数番目の数が, それぞれ全て同じであればいい
    // かつ, どちらも異なる数

    val N = sc.nextInt()
    val Vm = 100000
    val OddN, EvenN = new Array[Int](Vm+1)

    (0 until N) foreach { i =>
      val v = sc.nextInt()
      if (i % 2 == 0) {
        EvenN(v) += 1
      } else  {
        OddN(v) += 1
      }
    }

    // Odd(i) // i番目に出現回数が大きい数
    // OddN(Odd(i)) // i番目に出現回数の大きい数の出現回数

    def solve(): Int = {
      val Odd = (0 to Vm).sortBy(i => OddN(i))(Ordering.Int.reverse)
      val Even = (0 to Vm).sortBy(i => EvenN(i))(Ordering.Int.reverse)

      var i = 0
      var j = 0

      val oN = OddN(Odd(i))
      val eN = EvenN(Even(j))

      if (Odd(i) != Even(j))
        N - oN - eN
      else
        N - ((OddN(Odd(i+1)) + eN) max (EvenN(Even(j+1)) + oN))
    }
    println(solve())
  }

}


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

int main() {
  int n;cin>>n;
  vector<string> s(n);
  rep(i,n)cin>>s[i];
  string t="MARCH";
  vector<ll> cnt(5);
  rep(i,n){
    rep(j,5){
      if(t[j]==s[i][0])cnt[j]++;
    }
  }
  ll ans=0;
  rep(i,5)for(int j=i+1;j<5;j++)for(int k=j+1;k<5;k++){
    ans+=cnt[i]*cnt[j]*cnt[k];
  }
  cout<<ans<<endl;
}

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


int main(){
	ll x; cin >> x;
	ll cur = 100;
	int moves = 0;
	while(cur < x){
		cur += cur/100ll;
		moves++;
	}
	cout << moves << endl;

	return 0;
}

Measured memory_bytes: 3468
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner(System.in);
		char[] a = sc.next().toCharArray();
		int b1 = 0, b2 = 0, w1 = 0, w2 = 0;
		for(int i = 0; i < a.length; i++) {
			if(i%2 != 0) {
				if(a[i] == '0') b1++;
				else w1++;
			}else {
				if(a[i] == '0')b2++;
				else w2++;
			}
		}
		int n = Math.max(b1+w2, b2+w1);
		System.out.println(a.length-n);
	}
	
	static class FastScanner {
		private BufferedReader reader = null;
	    private StringTokenizer tokenizer = null;
	    public FastScanner(InputStream in) {
	        reader = new BufferedReader(new InputStreamReader(in));
	        tokenizer = null;
	    }

	    public String next() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                tokenizer = new StringTokenizer(reader.readLine());
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }
	        return tokenizer.nextToken();
	    }

	    public String nextLine() {
	        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
	            try {
	                return reader.readLine();
	            } catch (IOException e) {
	                throw new RuntimeException(e);
	            }
	        }

	        return tokenizer.nextToken("\n");
	    }

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

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

	    public double nextDouble() {
	         return Double.parseDouble(next());
	     }

	    public int[] nextIntArray(int n) {
	        int[] a = new int[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextInt();
	        return a;
	    }

	    public long[] nextLongArray(int n) {
	        long[] a = new long[n];
	        for (int i = 0; i < n; i++)
	            a[i] = nextLong();
	        return a;
	    }
	}
}


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

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

#define MAX 1005

int main() {
  int n;
  cin >> n;
  vector< vector<int> > imos(MAX+1, vector<int>(MAX+1));

  rep(i,n) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    imos[x1][y1]++;
    imos[x1][y2]--;
    imos[x2][y1]--;
    imos[x2][y2]++;
  }
  rep(i,MAX) rep(j,MAX) imos[i][j+1] += imos[i][j];
  rep(i,MAX) rep(j,MAX) imos[i+1][j] += imos[i][j];
  int ans = 0;
  rep(i,MAX) rep(j,MAX) ans = max(ans,imos[i][j]);

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 6860
import collections

n = int(input())
A = list(map(int,input().split()))
counter = collections.Counter(A)
_sum = sum(A)

q = int(input())
for i in range(q):
  b,c = map(int,input().split())
  diff  = c - b
  num = counter[b]
  if counter[c] == 0:
    counter[c] = counter[b]
    del counter[b]
  else:
    counter[c] += counter[b]
    del counter[b]
  _sum = diff*num + _sum
  print(_sum)

Measured memory_bytes: 24004
//保留所有权利。
#include<iostream>
#include<stdio.h>//printするよ
#include<vector>
#include<algorithm>//辞書順はnext_permutationだよ
#include<set>
#include<string>
#include<sstream>
#include<string.h>
#include<time.h>
#include<random>
#include<cmath>
#include<math.h>
#include<queue>
#include<time.h>
#include<iomanip>
#include<utility>//swapで数値交換するよ
//END OF LIBRARIES.
#define rt "\n"//改行を最速化させるよ
#define rep(i,n) for(int i=0;i<n;i++)
#define rop(i,n) for(int i=1;i<=n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define drop(i,n) for(int i=n;0<i;i--)
#define yes(ans) if(ans)cout<<"yes"<<rt;else cout<<"no"<<rt;
#define Yes(ans) if(ans)cout<<"Yes"<<rt;else cout<<"No"<<rt;
#define YES(ans) if(ans)cout<<"YES"<<rt;else cout<<"NO"<<rt;
#define sec(a,b,ans) if(ans)cout<<a<<rt;else cout<<b<<rt;
#define vcin(s,n) rep(i,n)cin>>s[i];//vcin(配列名),(繰り返し回数)
#define vcin(v) for (int i = 0; i < (v).size(); i++) { cin >> (v)[i]; }
#define sort(s) sort(s.begin(),s.end())
#define reve(s) reverse(s.begin(),s.end())
#define asas int ans=0
#define llcncn llint cnt=0
#define llasas llint ans=0
#define cncn int cnt=0
#define smsm int sum=0
#define str srting
#define v vector
#define please return
#define AC 0//おまじないだよ
#define Rapid cin.tie(0);ios::sync_with_stdio(false)
//END OF DEFINE.
using namespace std;
typedef vector<int> vint;
typedef vector<string> vstr;
typedef vector<char> vcha;
typedef vector<double> vdou;
typedef long long int llint;
typedef pair<int, int> pint;
typedef pair<llint, llint> pllint;
typedef vector<llint> vllint;
typedef vector<pint> vpint;
typedef vector<pair<llint, llint>> vpllint;
typedef vector<vector<int>> vvint;
typedef vector<vector<llint>> vvllint;
typedef vector<vector<string>> vvstr;
typedef vector<vector<pint>> vvpint;
typedef vector<bool> vbool;
//printf("%02d:%02d:%02d\n", h, m, s);・・・2文字は埋める・h、m、ｓ
//END OF TYPEDEF.

//最大公約数（GCD）を求めるよ
//最小公倍数（LCM）は＜＜　A × B ÷ GCD　 ＞＞で求まるよ

long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}
long long LCM(long long a, long long b) {
	return a * b / GCD(a, b);
}

//for A以上B未満でI探索 for (int I = A; i <= B; i++)
//string s = to_string(i);
int a = 0, b = 0, c = 0, x = 0, y = 0, z = 0, n = 0, sum = 0, i = 0;
string s = ""; asas; cncn;

int main(void) {
	cin >> a >> b >> c;
	YES(b - a == c - b);
	please AC;
}

Measured memory_bytes: 256
#include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 #include<deque>
 #include<functional>
 #include<utility>
 
 using namespace std;

 int main()
 {
   int a,b,num;
   while(cin>>a>>b>>num)
   {
     int r=a%b;
     int sum=0;
     while(num--)
     {
       sum+=((r*10)/b);
       r=(r*10)%b;            
     }            
     cout<<sum<<endl;         
   }
   //while(1);
   return 0;
 }

Measured memory_bytes: 3016
const M: u64 = 1000_000_007;

fn main() {
    proconio::input! {
        n: u64,
    }

    if n <= 1 {
        println!("0");
    } else {
        let mut v = (pow(10, n) + pow(8, n)) % M;
        let no09 = pow(9, n) * 2 % M;
        if v < no09 {
            v += M;
        }
        println!("{}", v - no09);
    }
}

fn pow(mut a: u64, mut n: u64) -> u64 {
    let mut r = 1;
    while n > 0 {
        if n & 1 > 0 {
            r = r * a % M;
        }
        a = a * a % M;
        n >>= 1;
    }
    r
}


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

signed main(void)
{
	int n;
	vector<long long> a, b;
	long long sum;

	cin >> n;
	a.resize(n);
	b.resize(n);
	sum = 0;
	rep(i, n)
	{
		cin >> a[i] >> b[i];
		a[i] += b[i];
		sum += b[i];
	}
	sum *= -1;
	sort(a.rbegin(), a.rend());
	for(int i = 0; i < n; i+=2)
		sum += a[i];
	cout << sum << endl;
	return 0;
}


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

ll INF = 1e+18;
int iINF = 1e9;

int 
main()
{
  int N, M, X; cin >> N >> M >> X;
  vector<int> cost(N);
  vector<vector<int>> skill(N);
  rep(i, 0, N){
    cin >> cost[i];
    rep(k, 0, M){
      int tmp; cin >> tmp;
      skill[i].push_back(tmp);
    }
  }
  
  int ans = iINF;
  for(int bit = 0; bit < (1 << N); ++bit){
    int comp = 0;
    vector<int> acum(M);
    rep(i, 0, N){
      if(bit & (1 << i)){
        rep(k, 0, M) acum[k] += skill[i][k];
        comp += cost[i];
      }
    }
    bool check = true;
    rep(i, 0, M){
      if(acum[i] < X) check = false;
    } 
    if(check && ans > comp) ans = comp;
  }

  if(ans == iINF) cout << -1 << endl;
  else cout << ans << endl;

}


Measured memory_bytes: 3616