akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <map>
#include <time.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define pb push_back
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod (ll)(1e9+7)
#define int ll

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
  int u;
  int o[100];
  cin >>u;
  for(int i =0; i<u;i++)cin>>o[i];
  sort(o,o+u);
  cout<<o[u-1]-o[0]<<endl;
}


Measured memory_bytes: 256
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

S = input()

def solve(S):
    for op1 in range(-1, 2, 2):
        for op2 in range(-1, 2, 2):
            for op3 in range(-1, 2, 2):
                if int(S[0]) + op1 * int(S[1]) + op2 * int(S[2]) + op3 * int(S[3]) == 7:
                    return S[0] + ("+" if op1 == 1 else "-") + S[1] + ("+" if op2 == 1 else "-") + S[2] + ("+" if op3 == 1 else "-") + S[3] + "=7"

print(solve(S))

Measured memory_bytes: 3572
//#include<bits/stdc++.h>
//#pragma GCC optimize 3
//#include<ext/pb_ds/assoc_container.hpp>
//#include<ext/pb_ds/tree_policy.hpp>
#include<cmath>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<utility>
#include<set>
#include<stack>
#include<queue>
int dirx[4] = {-1,1,0,0};//four directions
int diry[4] = {0,0,-1,1};//four directions
//int dirx[8]={0,0,-1,1,1,1,-1,-1};//eight directions
//int diry[8]={1,-1,0,0,-1,1,-1,1};//eight directions
#define inf 0x3f3f3f3f
//#define inf 0x7fffffff
#define prev PrEv
#define next NeXt
#define rank RaNk
#define left LeFt
#define right RiGhT
#define debug(x) cerr << #x << "=" << x << endl
// freopen("in.txt","r",stdin);
// ios::sync_with_stdio(false);
typedef long long LL;
typedef unsigned long long ULL;
using namespace std;
int arr[200010];
int main()
{
    //freopen("in.txt","r",stdin);
    int n;
    cin >> n;
    for(int i = 1; i <= n; ++i)
        cin >> arr[i];
    LL result = 0, cur = 0;
    int l = 1, r = 1;
    while(l <= n)
    {
        while(r <= n && (cur ^ arr[r]) == cur + arr[r])
        {
            cur ^= arr[r];
            r++;
        }
        result += r - l;
        cur ^= arr[l];
        l++;
    }
    cout << result << endl;
    return 0;
}














Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <map>
#include <queue>
#include <cmath>
#include <iomanip>

#define MOD (1000000007)

using namespace std;

typedef long long ll;
typedef pair<ll, ll> tup;
const int MAX = 510000;

long long fac[MAX], finv[MAX], inv[MAX];


ll modpow(ll a, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}


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

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

template <typename T> bool next_combination(const T first, const T last, int k) {
    const T subset = first + k;
    // empty container | k = 0 | k == n 
    if (first == last || first == subset || last == subset) {
        return false;
    }
    T src = subset;
    while (first != src) {
        src--;
        if (*src < *(last - 1)) {
            T dest = subset;
            while (*src >= *dest) {
                dest++;
            }
            iter_swap(src, dest);
            rotate(src + 1, dest + 1, last);
            rotate(subset, subset + (last - dest) - 1, last);
            return true;
        }
    }
    // restore
    rotate(first, subset, last);
    return false;
}

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

    vector<ll> h(N);
    for(ll i = 0; i < N; i++) cin >> h[i];

    vector<ll> dp(N);
    dp[0] = 0;

    for(ll i = 1; i < N; i++) {
        if(i == 1) dp[1] = abs(h[0]-h[1]);
        else {
            dp[i] = min(abs(h[i-2] - h[i]) + dp[i-2], abs(h[i-1] - h[i]) + dp[i-1]);
        }
    }
    // for(ll i = 0; i < N-1; i++) {
    //     cout << dp[i] <<" " ;
    // }

    cout << dp[N-1] << endl;
    return 0;


    
}



Measured memory_bytes: 1792
# ABC109 D - Make Them Even
h,w=map(int,input().split())
a=[list(map(int,input().split())) for i in range(h)]
odd=0
for i in range(h):
    for j in range(w):
        if a[i][j]%2==1:
            odd+=1
num=0
x,y=0,0
ans=[]
for i in range(h*w):
    if a[x][y]%2==1:num+=1
    nx,ny=x,y
    if x%2==0:
        if ny==w-1:
            nx+=1
        else:
            ny+=1 
    else:
        if ny==0:
            nx+=1
        else:
            ny-=1
    
    if num%2==1:
        if num<odd:
            ans.append([x+1,y+1,nx+1,ny+1])
    x,y=nx,ny
print(len(ans))
for aa in ans:
    print(*aa)


Measured memory_bytes: 30256
#include <iostream>
#include <string>
#include <map>
#include <string.h>
using namespace std;
int main(){
  map<char,int> ch;//文字の数字辞書登録
  ch['I']=1;
  ch['V']=5;
  ch['X']=10;
  ch['L']=50;
  ch['C']=100;
  ch['D']=500;
  ch['M']=1000;
  
  int ans=0;
  int len=0;
  char s[1111];
  while(cin >> s){
    len=strlen(s);
    for(int i=0;i<len;i++){
      if(ch[s[i]]<ch[s[i+1]]){//もしも引き算をすべき場合だったら
	ans-=ch[s[i]];
      }else{
	ans+=ch[s[i]];
      }
    }
    cout << ans << endl;
    ans=0;
  }
}

Measured memory_bytes: 1176
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL -1
using namespace std;
const int64_t MOD = 1e9 + 7;

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

	int x, y;
	x = 800 * N;
	y = 200 * (N / 15);

	cout << x - y << endl;
}

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

int main(){
    int N; cin >> N;
    
    for(int i = 0; i <= N; i++){
        for(int j = 0; j <= N; j++){
            int sum = 4*i + 7*j;
            if(sum == N){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
S = int(input())
mod = 10**9+7
ans = [0]*(S+1)
if S<=2:
    print(0)
    exit()
if S<=5:
    print(1)
    exit()
ans[0],ans[1],ans[2] = 0,0,0
ans[3],ans[4],ans[5] = 1,1,1
for i in range(6,S+1):
    ans[i] = ans[i-1]%mod + ans[i-3]%mod
    ans[i] %= mod
print(ans[-1])

Measured memory_bytes: 9132
// #includes {{{
#ifdef MY_DEBUG
#include "header/header.hpp"
#else
#include <bits/stdc++.h>
#endif

using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define RREP(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();++i)
#define LET(x,a) __typeof(a) x(a)
//#define IFOR(i,it,c) for(__typeof((c).begin())it=(c).begin();it!=(c).end();++it,++i)
#define ALL(c) (c).begin(), (c).end()
#define MP make_pair

#define EXIST(e,s) ((s).find(e)!=(s).end())

#define RESET(a) memset((a),0,sizeof(a))
#define SET(a) memset((a),-1,sizeof(a))
#define PB push_back
#define DEC(it,command) __typeof(command) it=command

//debug

#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)

typedef long long Int;
typedef unsigned long long uInt;
typedef long double rn;

template<class T>
T inf(){
	return numeric_limits<T>::has_infinity?numeric_limits<T>::infinity():(numeric_limits<T>::max()/2);
}

typedef pair<int,int> pii;

#ifdef MY_DEBUG
#include"print.hpp"
#include"debug.hpp"
#endif
// }}}

Int N;
Int X;
vector<Int> L;

void solve(){
	int ans = 0;
	Int D = 0;
	if(D<=X)ans++;
	for(int i = 0;i < N;i++){
		D += L[i];
		if(D<=X)ans++;
	}
	cout<<ans<<endl;
}

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

	cin >> N;
    cin >> X;
    L.assign(N,Int());
    for(int i = 0 ; i < N ; i++){
        cin >> L[i];
    }
	solve();
	return 0;
}

//}}}



Measured memory_bytes: 256
def continuous(string):
    numbers = [ord(c) - 97 for c in list(string)]
    largest = max(numbers)
    flag = True
    for i in range(1, largest+1):
        if i not in numbers:
            flag = False
            break
    return flag
  
  
def solve(N):
    if N == 1:
        return "a"
    else:
        tmp = solve(N-1)
        tmp_top = ["a" + t for t in tmp]
        tmp_bottom = [t + alphabet for t in tmp for alphabet in ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"][:N]]
        tmp_bottom = [t for t in tmp_bottom if continuous(t)]
        tmp = sorted(list(set(tmp_top + tmp_bottom)))
        return tmp
      
      
N = int(input())
res = solve(N)
for s in res:
    print(s)


Measured memory_bytes: 28376
/*
    Mbak Rose Dong
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,i,j,k,x,m,curr;
    long long int a,b,c,d;
    cin >> a >> b >> c >> d;
    double rose = a*b/(double)2;
    int bit = 0;
    if(a % 2 == 0 && b % 2 == 0)
    {
        if(c == a/2 && d == b/2)
            bit = 1;
    }
    printf("%f %d\n",rose, bit);
    return 0;
}


Measured memory_bytes: 256
/**
  * @brief atcoder
  * @author yao
  */
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <utility>
#include <algorithm>
#include <functional>
#include <climits>
#include <cmath>
#include <vector>
#define ft first
#define sd second
#ifdef DBG
#   define dbg_pri(x...) fprintf(stderr,x)
#else
#   define dbg_pri(x...) 0
#   define NDEBUG
#endif //DBG
#include <cassert>

typedef unsigned int uint;
typedef long long int lli;
typedef unsigned long long int ulli;

#define N 512
#define M 32
#define K (1048576*12)
#define T (512*2)

int c[M];
int s[N][M];
int t[N];
std::vector<int> poi[M];

constexpr int n = 365, m = 26;

int count()
{
    for(int i=0;i<m;++i) poi[i] = {-1};
    int res = 0;
    for(int i=0;i<n;++i)
    {
        int l = poi[t[i]].back(), d = i-l;
        poi[t[i]].push_back(i);
        res += s[i][t[i]];
        res -= c[t[i]]*d*(d-1)/2;
    }
    for(int i=0;i<m;++i)
    {
        int l = poi[i].back(), d = n-l;
        poi[i].push_back(n);
        res -= c[i]*d*(d-1)/2;
    }
    return res;
}

int update(int x, int k)
{
    int pk = t[x];
    int res = s[x][k] - s[x][pk];
    std::vector<int>::iterator itl, it, itr;
    it = std::find(poi[pk].begin(), poi[pk].end(), x), itl = std::prev(it), itr = std::next(it);
    res -= c[pk] * (x-*itl) * (*itr-x);
    poi[pk].erase(it);
    itr = std::upper_bound(poi[k].begin(), poi[k].end(), x), itl = std::prev(itr);
    res += c[k] * (x-*itl) * (*itr-x);
    poi[k].insert(itr, x);
    t[x] = k;
    return res;
}

int main()
{
    int d;
    scanf("%d", &d);
    assert(d == n);
    for(int i=0;i<m;++i) scanf("%d", &c[i]);
    for(int i=0;i<n;++i)for(int j=0;j<m;++j) scanf("%d", &s[i][j]);
    for(int i=0;i<n;++i) t[i] = rand() % m;
    int val = count();
#ifdef DBG
    int init_val = val;
    int ca=0, cb=0;
#endif //DBG
    for(int i=0;i<K;++i)
    {
        int x = rand()%n, k = rand()%m;
        int pre_t = t[x];
        int nxt_v = val + update(x,k);
        if(nxt_v >= val || rand() <= (int)(exp((double)(nxt_v-val)/T)*((lli)RAND_MAX+1)))
        {
#ifdef DBG
            (nxt_v < val ? ca : cb) ++;
#endif //DBG
            val = nxt_v;
        }
        else update(x,pre_t);
    }
    for(int i=0;i<n;++i) printf("%d\n", t[i]+1);
    dbg_pri("poi 3: init=%d val=%d %d %d\n", init_val, val, ca, cb);
    return 0;
}


Measured memory_bytes: 3852
#include<stdio.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
 
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
 
//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 
int main(void){
	int n=0;
	int _n=0;
	cin >> n;
	int N = n;
	while (n != 0)
	{
		_n += n % 10;
		n /= 10;
	}
	if (_n == 0)
		cout << "No" << endl;
	else if (N % _n == 0){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
	return 0;
}



Measured memory_bytes: 256
#include<algorithm>
#include<cmath>
#include<complex>
#include<cstdlib>
#include<cstdio>
#include<cstring>
#include<deque>
#include<functional>
#include<iostream>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<sstream>
#include<string>
#include<vector>
#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 EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
typedef long long ll;

using namespace std;

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

	int N;
	int ac = 0, wa = 0, tle = 0, re = 0;
	string s;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> s;
		if (s == "AC")ac++;
		if (s == "WA")wa++;
		if (s == "TLE")tle++;
		if (s == "RE")re++;
	}
	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d", ac, wa, tle, re);
}

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

namespace ConsoleApp75
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] WHN = Console.ReadLine().Split(' ');
            int W = int.Parse(WHN[0]);
            int H = int.Parse(WHN[1]);
            int N = int.Parse(WHN[2]);

            int[] x = new int[N];
            int[] y = new int[N];
            int[] a = new int[N];

            int xMin = 0;
            int yMin = 0;
            int xMax = W;
            int yMax = H;

            for (int i = 0; i < N; i++)
            {
                string[] xya = Console.ReadLine().Split(' ');
                x[i] = int.Parse(xya[0]);
                y[i] = int.Parse(xya[1]);
                a[i] = int.Parse(xya[2]);
            }

            for (int i = 0; i < N; i++)
            {
                if (a[i] == 1)
                {
                    xMin = Math.Max(xMin, x[i]);
                }
                else if (a[i] == 2)
                {
                    xMax = Math.Min(xMax, x[i]);
                }else if (a[i] == 3)
                {
                    yMin = Math.Max(yMin, y[i]);
                }else if (a[i] == 4)
                {
                    yMax = Math.Min(yMax, y[i]);
                }
            }
            int resultx = xMax - xMin;
            int resulty = yMax - yMin;
            int result = resultx * resulty;
            if (result <= 0 || resultx<0 && resulty<0)
            {
                Console.WriteLine(0);
            }
            else
            {
                Console.WriteLine(result);
            }
            
        }

    }
}

Measured memory_bytes: 13140
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define inf 10000000000000000
#define mod 1000000007
typedef pair<int, int> P;

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int mod_pow(int n, int p, int m) {
	if (p == 0) return 1;
	if (p % 2 == 0) {
		int t = mod_pow(n, p / 2, m);
		return (t * t) % m;
	}
	return n * mod_pow(n, p - 1, m) % m;
}
int extGCD(int a, int b, int& x, int& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}

signed main() {
	int n, ans = 0;
	cin >> n;
	map<int, int>mp;
	vector<int>vec;
	rep(i, n) {
		int x;
		cin >> x;
		mp[x]++;
	}
	for (auto i = mp.begin(); i != mp.end(); i++) {
		if (i->second != 1) {
			rep(j, i->second) {
				vec.push_back(i->first);
			}
		}
	}
	while (vec.size()>1) {
		if (vec[0] != vec[1]) {
			vec.erase(vec.begin());
		}
		else {
			ans += 2;
			vec.erase(vec.begin());
			if (vec.size() > 1) {
				vec.erase(vec.begin() + 1);
			}
		}
	}
	cout << n - ans << endl;

	return 0;
}


Measured memory_bytes: 6528
import numpy as np
N, M, C = map(int, input().split())
B = np.array(list(map(int, input().split())))
A = np.array([list(map(int, input().split())) for _ in range(N)])

ans = 0

for i in range(N):
    if sum(B * A[i]) + C > 0:
        ans += 1

print(ans)


Measured memory_bytes: 12496
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var row = input.split('\n');
var result = [];
for(var i=0;i<row.length;i++){
    var x = row[i].split('').map(Number);
    if(x[0] === 0){
        break;
    }
    var total = x.reduce(function(a,b){return a+b;});
    result.push(total);
}
console.log(result.join('\n'));


Measured memory_bytes: 16428
template<class T> inline void chmin(T & a, const T b) { if (a > b) a = b; }

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

int main(void) {
	int n; cin >> n;
	vector<int> P(n);
	rep(i, n) scanf("%d", &P[i]);

	int ans = 1;
	int minv = P[0];
	for (int i = 1; i < n; i++) {
		chmin(minv, P[i]);
		if (minv == P[i]) ans++;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0;i < (n);i++)
#define rrep(i,n) for (int i = (n - 1);i >= 0;i--)
#define all(v) v.begin(),v.end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h,w,a,b;
    cin >> h >> w >> a >> b;
    rep(i,h){
        rep(j,w){
            if((i<b)^(j<a))
                cout<<1;
            else 
                cout<<0;
        }
        cout<<endl;
    }
}

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

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

    int n, k;
    cin >> n >> k;
    int _;
    rep(i, n) cin >> _;

    int res = 0;
    int area = 1;

    while(area < n){
        area += k-1;
        ++res;
    }
    cout << res << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
#define LONGMAX 1e18
#define MOD 1000000007
#define mp make_pair
#define endl "\n"
#define test() ull t;cin>>t;while(t--)
#define pb push_back
#define fr(a,n) for(int i=a;i<n;i++)

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

	int n;
	cin>>n;

	int k;
	cin>>k;

	vector<int> h(n,0);

	for(int i=0;i<n;i++)
	{
		cin>>h[i];
	}

	int dp[n];
	dp[0]=0;
	dp[1]=abs(h[1]-h[0]);
	for(int i=2;i<n;i++)
	{
		int min=INT_MAX;
		for( int j=1;j<=k and i-j >=0 ;j++)
		{
			int t=dp[i-j] + abs(h[i] - h[i-j]);
			min=min<t?min:t;
		}
		dp[i]=min;
	}

	cout<<dp[n-1]<<endl;

}


Measured memory_bytes: 1024
#include "bits/stdc++.h"
typedef long long ll;
using namespace std;

ll gcd(ll a, ll b) {
    if (a < b) swap(a, b);
    ll r = a % b;
    while (r) {
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}

int main() {
    int n;
    cin >> n;
    vector<int> monster(n);
    for (int i = 0; i < n; ++i) {
        cin >> monster[i];
    }

    int g = monster[0];
    for (int i = 1; i < n; ++i) {
        g = gcd(g, monster[i]);
    }

    cout << g;

    return 0;
}


Measured memory_bytes: 640
#include<iostream>

using namespace std;

int main()
{
	int n,t[110],m,p[110],x[110],ans = 0;
	cin >> n;
	for(int i=1; i<=n; i++){
		cin >> t[i];
		ans += t[i];
	}
	cin >> m;
	for(int i=0; i<m; i++){
		cin >> p[i] >> x[i];
		cout << ans - t[p[i]] + x[i] << endl;
	}
	
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define fi first
#define se second

template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i];if(i<len-1) s<<" ";
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){
	int len=d.size();
	rep(i,len){
		s<<d[i]<<endl;
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){
	s<<"{ ";
	for(auto itr=v.begin();itr!=v.end();++itr) {
		if (itr!=v.begin()) {s<< ", ";}
		s<<(*itr);
	}
	s<<" }";
	return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){
	s<<"{"<<endl;
	for(auto itr=m.begin();itr!=m.end();++itr){
		s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;
	}
	s<<"}"<<endl;
	return s;
}

const ll mod=1e9+7;
const ll inf=1e15;
const int INF=1e9;

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	string s;
	cin>>n>>s;
	int ans=0;
	rep(i,n-2){
		string t=s.substr(i,3);
		if(t=="ABC"){
			ans++;
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
#ABC82 C

from collections import Counter

n = int(input())
a = list(map(int,input().split()))

b = Counter(a)
b = list(b.items())
ans = 0
for i,j in b:
    if j >= i:
        ans += j - i
    else:
        ans += j
print(ans)


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

static const int INF = 1<<21;
int n, m, a, b, c, d, s, g, v, p;
int mat[21][21];

void floyd(){
    for(int k = 1; k <= n; k++){
        for(int i = 1; i <= n; i++){
            for(int j = 1; j <= n; j++){
                mat[i][j] = min(mat[i][j], mat[i][k]+mat[k][j]);
            }
        }
    }
}

int main(){
    scanf("%d", &n);
    scanf("%d", &m);

    for(int i = 0; i < 21; i++){
        for(int j = 0; j < 21; j++){
            mat[i][j] = INF;
        }
    }

    for(int i = 0; i < m; i++){
        scanf("%d,%d,%d,%d", &a, &b, &c, &d);
        mat[a][b] = c;
        mat[b][a] = d;
    }
    
    scanf("%d,%d,%d,%d", &s, &g, &v, &p);

    floyd();

    printf("%d\n", v-(mat[s][g]+mat[g][s]+p));

    return 0;
}


Measured memory_bytes: 3148
#include <bits/stdc++.h>
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector<P> a(n);
    rep(i, n)cin >> a[i].first >> a[i].second;
    sort(all(a));
    priority_queue<int> que;
    ll ans = 0, j = 0;
    REP(i, m){
        while(a[j].first <= i){
            que.push(a[j].second);
            j++;
        }
        if(!que.empty()){
            ans += que.top();
            que.pop();
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1660
#include <iostream>
#include <cstring>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <queue>
#include <list>
#include <numeric>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <math.h>
#include <stack>
#include <climits>
#include <bitset>

using namespace std;
typedef long long ll;

//最小公倍数
ll gcd(ll x, ll y) {
  ll tmp = 0;
  if (x < y){
    tmp=x;
    x=y;
    y=tmp;
  }
  while (y > 0) {
    ll r = x % y;
    x = y;
    y = r;
  }
  return x;
}

//最大公倍数
ll lcm(ll x,ll y){
  return x/gcd(x,y)*y;
}


//for(int i = ; i < ; i++){}

int main(){
  int a[3];
  cin>>a[0]>>a[1]>>a[2];
  sort(a,a+3);
  cout<<a[0]+a[1]<<endl;

  return 0;
}
  



Measured memory_bytes: 256
package main
import (
    "fmt"
    "sort"
)
func main(){
    remainder := []int{}
    ans :=  0
    for i, num:=0, 0;i<5;i++{
        fmt.Scan(&num)
        remainder = append(remainder, num % 10)
        ans += num / 10 * 10
    }
    sort.Ints(remainder)
    index := 0
    for remainder[index] % 10 == 0 && index < 4 {
        index ++
    }
    fmt.Println(ans + remainder[index] + 10 * (4-index))
}


Measured memory_bytes: 512
n,t=map(int,input().split())
l=[list(map(int,input().split())) for i in range(n)]
l.sort()
dp=[[0]*(t) for i in range(n+1)]
for i in range(1,n+1):
    for j in range(t):
        if j-l[i-1][0]>=0:
            dp[i][j]=max(dp[i-1][j-l[i-1][0]]+l[i-1][1],dp[i-1][j])
        else:
            dp[i][j]=dp[i-1][j]
ans=[]
for i in range(n):
    ans.append(dp[i][-1]+l[i][1])
#print(dp)
print(max(ans))

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

using namespace std;

int32_t main() {
    ios::sync_with_stdio(false);

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

    int n;
    cin >> n;
    cout << 1000 - (n%1000?n%1000:1000);

    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define PI (acos(-1))
#define ct cout<<
#define cn cin>>
#define spc <<" "<<
#define nl puts("")
#define _fl(x) puts("FLAG " #x);
#define  _(x)  cout<< #x <<" is "<< x <<endl;
#define fs first
#define sc second
#define pb push_back
#define all(v)  (v).begin(), (v).end()
#define _109 (1000000000)
#define _0(arr) memset(arr,0,sizeof ( arr ) )
#define _1(arr) memset(arr,-1,sizeof ( arr ) )
#define _ninp(n,arr) for(int i=0; i<n;i++)cin>>arr[i];
#define _nout(n,arr) for(int i=0; i<n;i++)cout<<arr[i]<<" \n"[i==n-1];
double _eps=1e-6;
long long gcd(long long a, long long b) {
    if (b == 0)
        return a;
    return gcd(b, a % b);
}

int main() {

    int n, m, l;
    
    cn n>>m>>l;

    if(n+m+l<22)ct "win";
    else ct "bust";
    nl;







    return 0;
}


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

#define ll long long

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);

	ll a, p;
	scanf("%lld %lld", &a, &p);
	p += a * 3;
	a = p / 2;
	printf("%lld\n", a);
	return 0;
}

Measured memory_bytes: 3744
#include <stdio.h>
#include <string.h>
#define LEN 100005

typedef struct pp{
  char name[100];
  int t;
}P;

P Q[LEN];
int head, tail, n;

void enqueue(P x){
  Q[tail]=x;
  tail=(tail +1) % LEN;
}

P dequeue(){
  P a;
  a=Q[head];
  head=(head + 1) % LEN;
  return a;
}

int MIN(int x,int y){
  return x < y ? x : y;
}

int main(){
  int elaps = 0, c;
  int i, q;
  P u;
  scanf("%d %d", &n, &q);

  for ( i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }
  tail = n + 1;
  head = 1;
  while(head != tail){
     u=dequeue();
    c=MIN(q,u.t);
    u.t -= c;
    elaps+=c;
    if(u.t>0){
      enqueue(u);
    }else{
      printf("%s %d\n",u.name,elaps);
    }
  }
  
  return 0;
}
  



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

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader f = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(f.readLine());
		Map<Integer, Integer> ncount = new HashMap<>();
		StringTokenizer st = new StringTokenizer(f.readLine());
		for(int i = 0; i < n; i++) {
			int next = Integer.parseInt(st.nextToken());
			if(!ncount.containsKey(next)) {
				ncount.put(next, 1);
			} else {
				ncount.put(next, ncount.get(next) + 1);
			}
		}
		int m = Integer.parseInt(f.readLine());
		Map<Integer, Integer> mcount = new HashMap<>();
		st = new StringTokenizer(f.readLine());
		for(int i = 0; i < m; i++) {
			int next = Integer.parseInt(st.nextToken());
			if(!mcount.containsKey(next)) {
				mcount.put(next, 1);
			} else {
				mcount.put(next, mcount.get(next) + 1);
			}
		}
		boolean good = true;
		for(int mkey : mcount.keySet()) {
			if(!ncount.containsKey(mkey)) {
				good = false;
				break;
			}
			if(mcount.get(mkey) > ncount.get(mkey)) {
				good = false;
				break;
			}
		}
		if(good) {
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}
}


Measured memory_bytes: 102928
//============================================================================
// Name        : AOJ.cpp
// Author      : Akari Fujii
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cctype>
#include <string>
#include<algorithm>

using namespace std;
typedef long long ll;
int main(){

	ll k,s,t=0;

	cin>>k>>s;

	for(int i=0; i<k+1; ++i){
		for(int j=0; j<k+1; ++j){
			if(s-(i+j)<=k){
				if(s-(i+j)>=0){
					t++;
				}
			}

		}
	}

	cout<<t<<endl;
	return 0;



}


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

int main(){
    int n,a,b,c; cin >> n >> a >> b >> c;
    vector<string> s(n);
    rep(i,n) cin >> s[i];
    vector<string> ans;
    if(1){
        rep(i,n){
            if(s[i] == "AB" && a == 1 && b == 1 && c == 0 && i != n-1 && s[i+1] == "AC") {
                ans.push_back("A");
                a++;b--;
            }else if(s[i] == "AB" && a == 1 && b == 1 && c == 0 && i != n-1 && s[i+1] == "BC"){
                ans.push_back("B");
                b++;a--;
            }else if(s[i] == "AC" && a == 1 && c == 1 && b == 0 && i != n-1 && s[i+1] == "AB"){
                ans.push_back("A");
                a++;c--;
            }else if(s[i] == "AC" && a == 1 && c == 1 && b == 0 && i != n-1 && s[i+1] == "BC"){
                ans.push_back("C");
                a--;c++;
            }else if(s[i] == "BC" && b == 1 && c == 1 && a == 0 && i != n-1 && s[i+1] == "AB"){
                ans.push_back("B");
                b++;c--;
            }else if(s[i] == "BC" && b == 1 && c == 1 && a == 0 && i != n-1 && s[i+1] == "AC"){
                ans.push_back("C");
                c++;b--;
            }else{
                if(s[i] == "AB"){
                    if(a <= b) {ans.push_back("A"); a++;b--;}
                    else {ans.push_back("B"); b++;a--;}
                }else if(s[i] == "AC"){
                    if(a <= c) {ans.push_back("A"); a++;c--;}
                    else {ans.push_back("C"); c++;a--;}
                }else {
                    if(b <= c){ans.push_back("B"); b++;c--;}
                    else {ans.push_back("C"); c++;b--;}
                }
            }
            if(a < 0 || b < 0 || c < 0) {
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    rep(i,n) cout << ans[i] << endl;
}

Measured memory_bytes: 10576
N = int(input())
H = list(map(int,input().split()))

dp = [float("inf")]*N
dp[0] = 0

for i in range(1,N):
    if i == 1:
        dp[i] = min(dp[i],dp[i-1] + abs(H[i]-H[i-1]))
    else:
        dp[i] = min(dp[i],dp[i-1]+abs(H[i]-H[i-1]),dp[i-2]+abs(H[i]-H[i-2]))

print(dp[N-1])


Measured memory_bytes: 13980
fun main(args: Array<String>){
    val n = readLine()!!.toInt()
    val g = Array(n+1){ mutableListOf<Int>()}
    val ab = Array(n-1){ readLine()!!.split(" ").map { it.toInt() }.let { Pair(it[0], it[1]) }}
    val ans = mutableMapOf<Pair<Int, Int>, Int>()
    ab.forEach {
        g[it.first].add(it.second)
        g[it.second].add(it.first)
    }

    fun dfsWithPaint(e: Int, prevE: Int, prevColor:Int){
        var i = 1
        ans.put(Pair(e, prevE), prevColor)
        ans.put(Pair(prevE, e), prevColor)
        g[e].forEach {
            if(it != prevE){
                if(i == prevColor) i++
                dfsWithPaint(it, e, i)
                i++
            }
        }
    }
    dfsWithPaint(1, 0, 0)
    ab.map { ans.get(it)!! }.let { 
        println(it.max()!!)
        it.forEach { println(it) }
    }
}

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

int main() {
  string S; cin >> S;
  string acgt = "ACGT";
  int length = 0;
  int ans = 0;
  for (char c: S) {
    bool isacgt = false;
    for(int i = 0; i < 4; i++) {
      if (c == acgt.at(i)) {
        isacgt = true;
      }
    }
    if (isacgt) {
      length++;
    }
    else {
      length = 0;
    }
    ans = max(ans, length);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int a, b, c, even = 0, mx = 0, ans = 0;
int main(){
  cin >> a >> b >> c;
  vector<int> N{a, b, c};
  for(int i=0; i<3; ++i) if(N[i]%2 == 0) ++even;
  if(even == 2){
    for(int i=0; i<3; ++i) if(N[i]%2 == 0) ++N[i];
    ++ans;
  }else if(even == 1){
    for(int i=0; i<3; ++i) if(N[i]%2 != 0) ++N[i];
    ++ans;
  }
  for(int i=0; i<3; ++i) mx = max(mx, N[i]);
  for(int i=0; i<3; ++i) if(N[i] < mx) ans += (mx-N[i])/2;
  cout << ans << endl;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using vi = vector<int64_t>;
using vvi = vector<vi>;
using ll = int64_t;
using P = pair<ll,ll>;
ll INF = 1000000007;
// ll INF = 9223372036854775807;
// ll INF = 998244353;

int main() {
    // fasten cin
    cin.tie(0);
    ios::sync_with_stdio(false);
    // implement
    ll x,n;
    cin >> x >> n;
    vi p(n);
    rep(i,n) cin >> p.at(i);
    vi exist(102); // 0~101
    rep(i,n) exist.at(p.at(i)) = 1;
    ll mindiff = INF;
    rep(i,102){
        if(exist.at(i)==1) continue;
        mindiff = min(mindiff, abs(x - i));
    }
    vi ress;
    rep(i,102){
        if(exist.at(i)==1) continue;
        if(mindiff == abs(x - i)) ress.push_back(i);
    }
    sort(ress.begin(), ress.end());
    cout << ress.at(0) << endl;
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
int dp[3001][3001];
int findLCS(string &s,string &t,int sp=0,int tp=0) {
  if (sp >= s.size() || tp >= t.size()) return 0;
  auto &res = dp[sp][tp];
  if (res!=-1) return res;
  if (s[sp] == t[tp]) res = 1 + findLCS(s,t,sp+1,tp+1);
  else res = max(findLCS(s,t,sp+1,tp),findLCS(s,t,sp,tp+1));
  return res;
}
void printLCS(string &s,string &t) {
  int sp=0,tp=0;
  while(sp < s.size() and tp < t.size()) {
    if (s[sp] == t[tp]) {
      cout << s[sp];
      sp++;
      tp++;
    } else {
      if (dp[sp][tp] == dp[sp][tp+1]) {
        tp++;
      } else {
        sp++;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
  memset(dp,-1,sizeof dp[0][0] * 3001 * 3001);
  string s,t;
  cin >> s >> t;
  findLCS(s,t);
  printLCS(s,t);
  return 0;
}

Measured memory_bytes: 35968
#include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <stack>
#include <map>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cctype>
#define INF 1000000000
using namespace std;
bool debug=false;

int main(){
  int n,k;
  long long ans=1;
  cin>>n>>k;
  if(n==1){
    ans=k;
  }else{
    for(int i=1;i<n;i++){
      ans*=k-1;
    }
    ans*=k;
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define Would
#define you
#define please


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

	//これは解説みないと全くわからんかったぁ

	int N, Z, W;
	int a[2000];

	cin >> N >> Z >> W;
	rep(i, N) cin >> a[i];

	if (N == 1) co(abs(W - a[N - 1]));
	else co(max(abs(W - a[N - 1]), abs(a[N - 1] - a[N - 2])));
	Would you please return 0;
}

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

using namespace std;

int main(void) {
  int N;
  cin >> N;
  int s[N];
  int sum = 0;
  for(int i = 0; i < N; i++) {
    cin >> s[i];
    sum += s[i];
  }

  if(sum % 10 != 0) {
    cout << sum << endl;
    return 0;
  }

  sort(s, s + N);
  for(int i = 0; i < N; i++) {
    if(s[i] % 10 != 0) {
      sum -= s[i];
      cout << sum << endl;
      return 0;
    }
  }
  cout << "0" << endl;
}

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

int main(){
  
  int N;
  cin >> N;
  
  int tmp = N;
  int sum = 0;
 
  while(N > 0){
    sum +=  N % 10;
    N /= 10;
     
  }
  
   for(int i = 1 ;i <= 5 ; i++){
    int x = pow(10,i);
    if(x==tmp) sum = 10;
   }
  
 cout << sum << endl;
  
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long 
using namespace std;
int main()
{
ll sum = 0 ;     ll n,k;
 cin>>n;
vector<int> v(n);
unordered_map<int,int> u;
for(int i = 0 ; i<n ; i++) cin>>v[i],u[v[i]]++; 
for(int i = 0 ;i<n ;i++) sum+=v[i];
cin>>k;
while(k--)
{
int a,b;
cin>>a>>b;
int cnt = u[a];
u[a]=0;
u[b]+=cnt;
sum+=(-cnt*a+b*cnt);
cout<<sum<<endl;
}
}

Measured memory_bytes: 7356
function Main(input) {
  input = input.trim()
  input = input.split(" ").map(Number);
var a = input[0]+input[1];
  if(a>=10){
    console.log("error")
  }else{
console.log(a)
  }
}Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

using namespace std;

#define debug(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d)for(auto blockTime = make_pair(chrono::high_resolution_clock::now(), true); blockTime.second;debug("%s: %.5lf s\n", d, chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - blockTime.first).count()/1000.0), blockTime.second = false)

template <typename T>std::string NumberToString ( T Number ){std::ostringstream ss; ss << Number;return ss.str(); } // Usages NumberToString(3)
template <typename T>T StringToNumber ( const string &Text ){istringstream ss(Text);T result;return ss >> result ? result : 0;} // StringToNumber<int>("3")

string StrCpy(string str, long long int start, long long int end){string temp = "";for(long long int i=start; i<=end; i++){temp += str[i];}return temp;}

#define ull unsigned long long int
#define ll long long int 
#define gcd(a, b)  __gcd(a, b)
#define lcm(a, b)  ((a*b)/gcd(a, b))




int solve(){

    ll deposit_exc;

    cin >> deposit_exc;

    ll deposit = 100;

    for(int i=1; ; i++){
        deposit += deposit / 100;
        if(deposit >= deposit_exc){
            cout << i << endl;
            break;
        } 
    }
    
    return 0;
}

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

    time__("programm time"){
        solve();
	}
    return 0;

}

Measured memory_bytes: 3812
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int a,b,c,d;
	cin>>a>>b>>c>>d;

	if(abs(a-c)<=d) cout<<"Yes"<<endl;
	else if(abs(a-b)<=d && abs(b-c)<=d) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
int N;
  cin >>N;
  if(N%2==0){
    cout<<1.0/2<<endl;
  }
  else{
    cout<<(double)(N - N / 2) / (double)N<<endl;
  }
 
 
}


Measured memory_bytes: 256
#!/usr/bin/env python
from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


def main():
    n = int(input())
    r = []
    for i in range(n):
        x, l = map(int, input().split())
        r.append((x - l, x + l))

    # print(r)
    cnt, end = 0, float("-inf")
    r.sort(key=lambda x: x[1])
    for x, y in r:
        if x >= end:
            end = y
        else:
            cnt += 1

    print(n - cnt)


# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()


Measured memory_bytes: 56532
/* Author : Aaryan Srivastava ^__^ */ 
#include <bits/stdc++.h>
#include <random>
#include <chrono>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define pb push_back
#define popb pop_back
#define mt make_tuple 
#define eb emplace_back
#define mp make_pair
#define ff first
#define ss second 
#define ull unsigned long long  
#define pii pair<int, int>
#define piii pair<int,pii>
#define beg begin
#define rep(i,n) for(int (i) = 0 ; i < (n) ; i++)
#define repA(i,x,y) for(int i = (x) ; i <= (y) ; i++)
#define repD(i,x,y) for(int i = (x) ; i >= (y) ; i--)
#define all(c) (c).begin(),(c).end()
#define fill(a,val) memset(a,val,sizeof(a))
#define Randomize mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define int ll
using ll = long long;
const int N = 3*1e5 +5 ;
const int mod = 1e9 + 7 ;
const int inf = 1e18 ;
const int SZ = 101 ;
const double eps = 1e-9 ;
using namespace __gnu_pbds;
using namespace std;
using ordered_set =  tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ;

#ifdef AaryanS
#define mycout cout
#define mycerr cerr 
#endif

#ifndef AaryanS
#define mycout if(false) cout
#define mycerr if(false) cerr
#endif

double dp[3000][3000]; 
void solve()
{
	// dp[i][j] , i => coins encoutered, j => number of heads till now
	int n ;
	cin >> n ;
	repA(i,1,n){
		double x;
		cin >> x; 
		if(i > 1)
			for(int j = 0 ; j < i ; ++j){
				dp[i][j+1] += x*dp[i-1][j] ;
				dp[i][j] += (1-x)*dp[i-1][j]; 
			}
		else dp[i][0] = (1-x) , dp[i][1] = x; 
	}
	double ans = 0 ;
	for(int i = 0 ; i <= n; ++i)
		if(i > n - i)
			ans += dp[n][i] ;
	cout << std::fixed << setprecision(10) ;
	cout << ans ;
}   

     
int32_t main(int32_t argc, char *argv[])
{
    double t1 = clock() ;
    ios::sync_with_stdio(0);    
    cin.tie(0); cout.tie(0);
    int TC = 1, t = 0;
    //cin >> TC ;
    while(t++ < TC)
    {
        //cout << "Case #" << t << ": " ;
        solve();
        //cout << endl ;
    }
    mycerr << "Time : " << 1000 *(clock() - t1)/CLOCKS_PER_SEC << " ms\n" ;
    return 0;
}

Measured memory_bytes: 68864
#include <bits/stdc++.h>
	using namespace std;
	int main(){
      int r,c,cnt=0;cin>>r>>c;
      for (int i=0;i<r;i++){
        string s;cin>>s;
        for (int j=0;j<c;j++){
          if (s[j]=='#') cnt++;
        }
      }
      if (cnt==r+c-1) cout << "Possible" << endl;
      else cout << "Impossible" << endl;
    }

Measured memory_bytes: 3592
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

using namespace std;

#define rep(i, a, b) for (int i = a; i < b; i++)
#define rrep(i, a, b) for (int i = a; i <= b; i++)
#define revrep(i, s) for (int i = s-1; i > 0; i--)
#define revrrep(i, s) for (int i = s-1; i >= 0; i--)
#define all(a)  begin((a)),end((a))
#define uniq(c) (c).erase(unique(all((c))), end((c)))

int main()
{
    long long A, B; cin >> A >> B;

    if (A%2 != B%2) cout << "IMPOSSIBLE" << endl;
    else cout << (A+B) / 2 << endl;
}

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

int main() {
  ll a, b, c;
  cin >> a >> b >> c;
  if(a%2!=0&&b%2!=0&&c%2!=0) {
    if(a>b) swap(a, b);
    if(a>c) swap(a, c);
    if(b>c) swap(b, c);
    cout << a*b << endl;
  } else {
    cout << 0 << endl;
  }
  return 0;
}

Measured memory_bytes: 256