akhauriyash/Code-Regression huggingface dataset:
//                             In The Name Of Allah
#include <bits/stdc++.h>
#define	ss second
#define ff first
#define use_fast ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define ret(n) return cout << n, 0
#define se(n) cout << setprecision(n) << fixed
#define pb push_back
#define int long long
#define ld long double
using namespace std; 
 
const int N = 100, OO = 1e14 + 100, M = 1e9 + 7, P = 6151, SQ = 120, lg = 31;
typedef pair <int, int> pii;
vector <int> v[N * N];
bool b[N][N];
int id[N][N], nxt = 1, h, w, t[N * N];

void make_edge(int i, int j, int l, int r) {
	if(r > w || j > w || l > h || i > h)
		return;
	if(b[l][r] == false || b[i][j] == false)
		return;
	if(id[i][j] == 0)
		id[i][j] = nxt++;
	if(id[l][r] == 0)
		id[l][r] = nxt++;
	v[id[i][j]].pb(id[l][r]);
}

int32_t main() {
    use_fast;
    cin >> h >> w;
    for(int i = 1; i <= h; i++) {
    	for(int j = 1; j <= w; j++) {
    		char c;
    		cin >> c;
    		if(c == '.') 
    			b[i][j] = true;
		}
	}
	for(int i = 1; i <= h; i++) {
		for(int j = 1; j <= w; j++) {
			if(b[i][j] == false)
				continue;
			make_edge(i, j, i - 1, j);
			make_edge(i, j, i + 1, j);
			make_edge(i, j, i, j - 1);
			make_edge(i, j, i, j + 1);
		}
	}
	int mx = 0;
	for(int i = 1; i < nxt; i++) {
		queue <int> q;
		memset(t, -1, sizeof(t));
		t[i] = 0;
		q.push(i);
		while(q.size()) {
			int x = q.front();
			q.pop();
			for(auto u : v[x]) {
				if(t[u] == -1) {
					t[u] = t[x] + 1;
					mx = max(mx, t[u]);
					q.push(u);
				}
			}
		}
	}
	cout << mx << endl;
	return 0;
}
/*
be carefull :
1- if not solve after 20 min, read again twice
2- after submit read the code again
3- fun with contest
4- ... 
*/	

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

int main(){
  int A,B;
  cin >> A >> B;
  if ((A-B)%2 == 0 && B>=A){
    cout << B - (B-A)/2 << endl;
  }else if((A-B)%2 == 0 && B<A){
    cout << A - (A-B)/2 << endl;
  }else{
    cout << "IMPOSSIBLE" << endl;
  }
  return 0;
}


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

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

  string s;
  cin >> s;
  int t = 0;
  for (char c : s) {
    t += (c - '0');
  }
  cout << ((t%9 == 0)?"Yes":"No") << endl;
}

Measured memory_bytes: 3736
fun main(args: Array<String>) {
    val (N, Q) = readLine()!!.split(" ").map { it.toInt() }
    val S = readLine()!!

    var sum = 0
    var flag = false
    val list = S.mapIndexed { i, s ->
        if (s == 'A') {
            flag = true
        } else {
            if (flag && s == 'C') sum++
            flag = false
        }
        sum
    }

    for (j in 1..Q) {
        val (l, r) = readLine()!!.split(" ").map { it.toInt() - 1 }
        println(list[r] - list[l])
    }
}

Measured memory_bytes: 69848
#line 1 "/mnt/c/Users/leafc/dev/compro/lib/template.hpp"


#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) (v).begin(), (v).end()
#define coutd(n) cout << fixed << setprecision(n)
#define ll long long int
#define vl vector<ll>
#define vi vector<int>
#define MM << " " <<

using namespace std;

template <class T> void say(bool val, T yes = "Yes", T no = "No") { cout << (val ? yes : no) << "\n"; }

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

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


#line 2 "tmp.cpp"

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

  int n, k;
  cin >> n >> k;
  vl a(n);
  REP(i, n) { cin >> a[i]; }
  vl cum(n + 1, 0), plus(n + 1, 0);
  REP(i, n) {
    cum[i + 1] = cum[i] + a[i];
    plus[i + 1] = plus[i] + max(a[i], 0LL);
  }
  ll ans = 0;
  FOR(i, 1, n - k + 2) {
    ll tmp = plus[i - 1] + (plus[n] - plus[i + k - 1]) + max(cum[i + k - 1] - cum[i - 1], 0LL);
    chmax(ans, tmp);
  }

  cout << ans << endl;

  return 0;
}


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

#define X first
#define Y second
#define mp make_pair
#define pb pop_back
#define eb emplace_back
#define sz(v) (int) v.size()

using namespace std;

typedef long long LL;
typedef long double LD;

const int MAX_N = 1e5 + 5;

int a[MAX_N], p[MAX_N];

void solve() {
	int n;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	for (int i = 1; i < n; ++i) {
		p[i] = (a[i] <= a[i - 1] ? p[i - 1] + 1 : 0);
	}
	cout << (*max_element(p, p + n)) << "\n";
}

signed main() {
// #define TASK ""
#if !defined(LOCAL) && defined(TASK)
	freopen(TASK".in", "r", stdin);
	freopen(TASK".out", "w", stdout);
#endif
	ios::sync_with_stdio(0); cin.tie(0);
	int tests = 1;
	// cin >> tests;
	while (tests--) {
		solve();
	}
	return 0;
}

Measured memory_bytes: 1152
N = int(input())
INF = float('inf')
dis = [INF]*N
dis[0] = 0
G = [[] for _ in range(N)]
for _ in range(N-1):
	u, v, w = map(int, input().split())
	u -= 1
	v -= 1
	G[u].append((v, w))
	G[v].append((u, w))

queue = [0]

while queue:
	u = queue.pop()
	for v, w in G[u]:
		if dis[v] > dis[u] + w:
			queue.append(v)
			dis[v] = dis[u] + w

for i in dis:
	print(i % 2)


Measured memory_bytes: 42804
# -*- coding: utf-8 -*-
# case.rb

loop{ # 無限ループをするメッソド
  a, op, b = STDIN.gets.split(' ')
  a = a.to_i
  b = b.to_i
   
   case op
   when "+"
     puts a+b
   when "-"
     puts a-b
   when "*"
     puts a*b
   when "/"
     puts a/b
   else
    break
  end
}

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

using namespace std;

const double pi = 3.1415926535897;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  long long sum = 0;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    sum += x;
  }
  if (n - sum < 0) {
    cout << "-1\n";
  } else {
    cout << n - sum << '\n';
  }
  return 0;
}

Measured memory_bytes: 3588
#include<iostream>

using namespace std;

int main(){
	int N, K;
	int L[50];
	int sum = 0;
	cin >> N >> K;
	for(int i = 0; i < N; i++){
		cin >> L[i];
	}
	for(int i = 0; i < K; i++){
		int maxplace = 0;
		for(int j = 0; j < N; j++){
			if(L[j] > L[maxplace]){
				maxplace = j;
			}
		}
		sum += L[maxplace];
		L[maxplace] = 0;
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(ll i = n;i >= 0;--i)
#define FOR(i,m,n) for(ll i = m, i##_len=(n);i <i##_len; ++i)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const int INF = 1e9;
const ll LLINF = 1e16;
 
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}



int main(void)
{
    int n;
    cin >> n;
    vector<ll> a(n);
    REP(i,n){
        cin >> a[i];
    }

    sort(all(a));
    ll max = *max_element(all(a));
    ll harf_max = max / 2 + max%2;
    ll ans = -1;
    ll max_dif = LLINF;
    REP(i, a.size())
    {
        if(max_dif > abs(harf_max - a[i])){
            max_dif = abs(harf_max - a[i]);
            ans = a[i];
        }
    }

    cout << max << " " << ans << endl;

    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;


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

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


int main() {
    int n, m; string s;
    cin >> n >> m >> s;
    vector<pair<int, int>> dp(n+1, {INF<int>, -1});
    dp.back() = {0, 0};
    set<pair<int, int>> S;
    S.emplace(0, n);
    for (int i = n-1; i >= 0; --i) {
        if(s[i] != '1' && !S.empty()){
            auto val = *S.begin();
            dp[i] = {val.first+1, val.second};
            S.emplace(val.first+1, i);
        }
        if(n-i >= m){
            S.erase(make_pair(dp[i+m].first, i+m));
        }
    }
    if(dp.front().first == INF<int>){
        puts("-1");
    }else {
        for (int i = 0; i < n; i = dp[i].second) {
            if(i) printf(" ");
            printf("%d", dp[i].second-i);
        }
        puts("");
    }
    return 0;
}

Measured memory_bytes: 3712
#include<stdio.h>
 int main(void)
 {
     int X;
     scanf("%d",&X);
     if(X==7) printf("YES\n");
     else if(X==5) printf("YES\n");
     else if(X==3) printf("YES\n");
     else printf("NO\n");
     return 0;
 }


Measured memory_bytes: 1612
#include<iostream>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<stack>
using namespace std;


int main() {

	int n, m, X, L;

	scanf("%d", &n);
	scanf("%d", &m);

	X = 1900*m;



	X += 100 * (n-m);

	for (int i = 1; i <= m; i++) {
		X = X * 2;
	}
	
	printf("%d", X);


}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
using namespace std;
int main(){
  int n;
  cin >>n;
  int h[n];
  int flag[n];
  int count =0;
  for(int i = 0; i < n; i++){
    cin >>h[i];
    //flag[i]= 0;
  }
  if(n>1){
    for(int i = 0; i < n-1; i++){
      flag[i]=h[i+1]-h[i];
      if(flag[i]<-1){
        cout << "No";
        return 0;
      }else if(flag[i]==-1&&count==0){
        count++;
      }else if(flag[i]>0&&count==1){
        count--;
      }else if(count==1&&flag[i]==-1){
        cout << "No";
        return 0;
      }
    }
  }

  cout <<"Yes";
  /*
  if(n>1){
    if(h[0]>h[1]){
      h[0] -= 1;
      flag[0]=1;
    }
    if(h[0]>h[1]){
      cout << "No";
      return 0;
    }
    for(int i =1; i < n-1; i++){
      if(h[i]>h[i+1]){
        h[i] -= 1;
      }
      if(h[i]>h[i+1] || h[i-1]>h[i]){
        cout << "No";
        return 0;
      }
    }
    cout << "Yes";
  }else{
    cout <<"Yes";
  }*/

}


Measured memory_bytes: 1024
#include <iostream>
#define INF 10000000000LL
using namespace std;
typedef long long ll;

bool query(ll n) {
  cout << "? " << n << endl;
  string res;
  cin >> res;
  return res == "Y";
}

int main(void) {
  ll d = 1;

  while(d <= INF && query(d)) d *= 10;
  d /= 10;

  if(d == INF) {
    d = 1;
    while(!query(d * 10 - 1)) d *= 10;
    cout << "! " << d << endl;
  } else {
    ll l = d;
    ll r = d * 10;
    while(r - l > 1) {
      ll m = (r + l) / 2;
      if(query(m * 10)) r = m;
      else l = m;
    }
    cout << "! " << r << endl;
  }

  return 0;
}


Measured memory_bytes: 648
#!/usr/bin/env python3
# n,m = map(int,sys.stdin.readline().split())
# a = list(map(int,sys.stdin.readline().split()))
# a = [sys.stdin.readline() for _ in range(n)]
# s = sys.stdin.readline().rstrip()
# n = int(sys.stdin.readline())
import sys,bisect,math
sys.setrecursionlimit(15000)

N,K = map(int,sys.stdin.readline().split())
s = set(range(1,N+1))
for _ in range(K):
    d = int(sys.stdin.readline())
    a = set(map(int,sys.stdin.readline().split()))
    s = s-a
print(len(s))


Measured memory_bytes: 9192
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for i2 in range(j)] for i3 in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

N = ii()
AB = li2(N)
A = [0]*N
B = [0]*N
for i in range(N):
    A[i] = AB[i][0]
    B[i] = AB[i][1]

if N%2:
    num_a = sorted(A)[N//2]
    num_b = sorted(B)[N//2]
    print(num_b-num_a+1)
else:
    A_ = sorted(A)
    B_ = sorted(B)
    min_a = A_[N//2-1]
    max_a = A_[N//2]
    min_b = B_[N//2-1]
    max_b = B_[N//2]
    #print(max(max_b, )-min(min_a, min_b)+1)
    print(max_b+min_b-(max_a+min_a)+1)

Measured memory_bytes: 109180
#include<iostream>
#include<string.h>
#include<string>
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<bitset>
#include<math.h>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef long double db;
typedef vector<int> vi;
typedef pair<int,int> pii;
const int N=200000+100;
const db pi=acos(-1.0);
#define lowbit(x) ((x)&(-x))
#define sqr(x) (x)*(x)
#define rep(i,a,b) for (register int i=a;i<=b;i++)
#define per(i,a,b) for (register int i=a;i>=b;i--)
#define go(u,i) for (register int i=head[u],v=sq[i].to;i;i=sq[i].nxt,v=sq[i].to)
#define fir first
#define sec second
#define mkp make_pair
#define pb push_back
#define maxd 998244353
#define eps 1e-8
inline int read()
{
    int 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*10+(ch-'0');ch=getchar();}
    return x*f;
}

inline ll readll()
{
    ll x=0;int f=1;char ch=getchar();
    while ((ch<'0') || (ch>'9')) {if (ch=='-') f=-1;ch=getchar();}
    while ((ch>='0') && (ch<='9')) {x=x*10+(ch-'0');ch=getchar();}
    return x*f;
}

int n,a[N],pos[N],num[N];

int chk(int mid)
{
    if (mid==1)
    {
        rep(i,2,n) if (a[i]<=a[i-1]) return 0;
        return 1;
    }
    int tp=0;
    rep(i,2,n)
    {
        if (a[i]>a[i-1]) continue;
        while ((tp) && (pos[tp]>a[i])) tp--;
        int nowp=a[i];
        while ((tp) && (pos[tp]==nowp) && (num[tp]==mid)) {nowp--;tp--;}
        if (!nowp) return 0;
        if (pos[tp]==nowp) num[tp]++;
        else {pos[++tp]=nowp;num[tp]=2;}
    }
    return 1;
}


int main()
{
    n=read();
    rep(i,1,n) a[i]=read();
    int ans=0,l=1,r=1e9;
    while (l<=r)
    {
        int mid=(l+r)>>1;
        if (chk(mid)) {ans=mid;r=mid-1;}
        else l=mid+1;
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 4532
/*
 
Coded and Decoded by : Yash Kapoor
 
*/
#include <bits/stdc++.h>
using namespace std;
 
#define ll          long long
#define ld          long double
#define pb          push_back
#define pf          push_front
#define mp          make_pair
#define pll         pair<ll,ll>
#define vl          vector<ll>
#define sl          set<ll> 
#define vll         vector<pll>
#define ml          map<ll,ll>
#define mll         map<pll,ll>
#define all(a)      a.begin(),a.end()
#define x           first
#define y           second
#define sz(x)       (ll)x.size()
#define dl          '\n'
#define why         (ll)1000000007
//#define why         (ll)998244353
#define lp(i,a,b)   for(ll i=a;i<b;++i)
#define lpr(i,a,b)  for(ll i=a;i>=b;i--)
#define lpd(i,x)    for(auto i:x)
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
ll inf = 1e18;
ld pi = 3.141592653589;
ll mod = why;
ll fast_power(ll base,ll power,ll mod){
    ll result=1;
    while(power){
        if(power%2)
        result=(result*base)%mod;
        base=(base*base)%mod;
        power/=2;
    }
    return result;
}
 
ll inverse(ll base,ll mod){
    return fast_power(base,mod-2,mod);
}


ll solve(){
    ld n; cin>>n;
    ll i =1;
    ll ans = 100;
    while(ans < n){
        ll in = ans*(0.01);
        ans+=in;
        i++;
    }
    cout<<i-1;
    return 0;
}

int main(){
    ios
    ll t=1; 
    //cin>>t;
    while(t--){
        solve();
    }
}

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

int main(){
  int N;
  cin >> N;
  std::multiset<double> v;
  for(int i = 0; i < N; i++){
    double r;
    cin >> r;
    v.insert(r);
  }
  for(int i = 1; i < N; i++){
    double r1 = *v.begin();
    v.erase(v.begin());
    double r2 = *v.begin();
    v.erase(v.begin());
    v.insert((r1+r2)/2.0);
  }
  cout << *v.begin() << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
int n,a[101],b[101];
bool f[101];
long long ans;
bool check(long long x)
{
	for (int i=1;i<=n;i++)
	{
		memset(f,false,sizeof(f));
		f[a[i]]=true;
		for (int j=50;j>=1;j--)
		{
			if (x&(1ll<<j))
			{
				for (int k=0;k<=50;k++)
				{
					if (f[k]) f[k%j]=true;
				}
			}
		}
		if (!f[b[i]]) return false;
	}
	return true;
}
int main()
{
	ios_base::sync_with_stdio(0);cin.tie();cout.tie();
	cin>>n;
	for (int i=1;i<=n;i++) cin>>a[i];
	for (int i=1;i<=n;i++) cin>>b[i];
	ans=(1ll<<(50+1))-1;
	if (!check(ans))
	{
		cout<<"-1\n";
		return 0;
	}
	for (int i=50;i>=0;i--)
	{
		ans^=(1ll<<i);
		if (!check(ans))
		{
			ans^=(1ll<<i);
		}
	}
	cout<<ans<<endl;
	return 0;
}

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

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

    int C[600], S[600], F[600];
    for (int i = 0; i < N - 1; i++) {
        cin >> C[i] >> S[i] >> F[i];
    }

    for (int i = 0; i < N; i++) {
        if (i == N - 1) {
            cout << 0 << endl;
            continue;
        }

        int idx = i;
        int t = 0;
        while (idx != N - 1) {
            t = max(t, S[idx]);
            t = ((t + F[idx] - 1) / F[idx]) * F[idx];
            t += C[idx];
            idx++;
        }
        cout << t << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("Ofast")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

//smaller names
#define int long long
#define double long double
#define Int signed
#define vi vector<int>
#define vvi vector<vi>
#define vd vector<double>
#define vvd vector<vd>
#define pii pair<int, int>
#define vpii vector<pii>
#define vvpii vector<vpii>
#define mii map<int, int>
#define unordered_map gp_hash_table

#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, a, b) for(int i = a; i < b; i++)
#define repd2(i, a, b) for(int i = b - 1; i >= a; i--)
#define repd(i, n) for(int i = n-1; i >= 0; i--)

#define F first
#define S second

#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define all(v) v.begin(),v.end()

const int INF = 1e9;
const double EPS = 1e-9;
const double PI = acosl(-1);

//order_of_key(k) - number of elements e such that func(e, k) returns true, where func is less or less_equal
//find_by_order(k) - kth element in the set counting from 0

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

typedef tree <
    int,
    null_type,
    less_equal<int>,
    rb_tree_tag,
    tree_order_statistics_node_update
>
ordered_multiset;

const int mod = 1e9 + 7;
const int maxn = 2e5 + 5;
const int maxa = 1e6 + 5;
const int logmax = 25;

//fast exponentiation

template <typename T>
T power (T a, int n = 1, T id = 1) {
    T ans = id;
    while(n) {
        if(n & 1) ans *= a;
        a *= a;
        n >>= 1;
    }
    return ans;
}

//custom hash

struct custom_hash {
    // http://xorshift.di.unimi.it/splitmix64.c
    static uint64_t splitmix64(uint64_t x) {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }
    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

int sumdigs (int n) {
    int ans = 0;
    while (n) {
        ans += n % 10;
        n /= 10;
    }
    return ans;
}


void solve() {
    int n;
    cin >> n;
    int ans = 0;
    for(int i = 1; i <= n; i++){
        for(int j = i; j <= n; j += i) {
            ans += j;
        }
    }
    cout << ans << endl;
}

signed main(){
    fastio;
    cout << setprecision(6) << fixed;
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
}


Measured memory_bytes: 3536
#include<stdio.h>
int main()
{
  int a,b[100],i,j,n=0,m,k,mini;
  scanf("%d",&a);
  for(i=0;i<a;i++){
    scanf("%d",&b[i]);
  }
  for(i=0;i<a-1;i++){
    mini=i; 
    m=b[i];
    for(j=i;j<a;j++){
      
      if(b[j]<m){
	m=b[j];
	mini=j;
      }
    }
    if(m!=b[i]){
      k=b[i];
      b[i]=b[mini];
      b[mini]=k;
      n++;
    }
  }
  for(i=0;i<a-1;i++){
    printf("%d ",b[i]);
  }
  printf("%d\n",b[i]);
  printf("%d\n",n);
  return 0;
}

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

int main() {
  long long int S;
  cin >> S;
  long long int A, B;
  A = S / 1000000000;
  B = S % 1000000000;
  cout << 0 << " " << 0 << " ";
  cout << 1000000000 << " " << 1 << " ";
  if (S == 1000000000000000000) cout << 0 << " " << 1000000000;
  else cout << 1000000000 - B << " " << A + 1 << endl;
}

Measured memory_bytes: 3576
import sys
sys.setrecursionlimit(10**6)
from math import floor,ceil,sqrt,factorial,log
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict,deque
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
mod = 10 ** 9 + 7
 
#整数input
def ii(): return int(sys.stdin.readline().rstrip()) #int(input())
def mii(): return map(int,sys.stdin.readline().rstrip().split())
def limii(): return list(mii()) #list(map(int,input().split()))
def lin(n:int): return [ii() for _ in range(n)]
def llint(n: int): return [limii() for _ in range(n)]
#文字列input
def ss(): return sys.stdin.readline().rstrip() #input()
def mss(): return sys.stdin.readline().rstrip()
def limss(): return list(mss()) #list(input().split())
def lst(n:int): return [ss() for _ in range(n)]
def llstr(n: int): return [limss() for _ in range(n)]

#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？
#本当に貪欲法か？ DP法では？？

n=ii()
a=[]
b=[]
for _ in range(n):
    x,y=mii()
    a.append(x)
    b.append(y)
    
a.reverse()
b.reverse()

cnt=0

for i in range(n):
    ai,bi=a[i],b[i]
    if (ai+cnt)%bi!=0:    
        cnt += bi-((ai+cnt)%bi)
        

print(cnt) 



Measured memory_bytes: 76504
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
long long inf=(long long)1E17;
#define i_7 (long long)(1E9+7)
//#define i_7 998'244'353
long long mod(long long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}

//typedef long long ll;
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}

//配列のSIZEは問題ごとに定義する必要がある。
const int SIZE=200'010;
long long inv[SIZE+1];//各iの逆元を格納する配列。
long long kai[SIZE+1];//i!のmodを格納する配列。
long long invkai[SIZE+1];//各i!の逆元を格納する配列。
const int MOD=i_7;
void invinit(){//上の配列を初期化する関数。
    inv[1]=1;
    for(int i=2;i<=SIZE;i++){
        inv[i] = MOD - ((MOD/i)*inv[MOD%i])%MOD;
    }
    
    kai[0]=invkai[0]=1;
    for(int i=1;i<=SIZE;i++){
        kai[i]=(kai[i-1]*i)%MOD;
        invkai[i]=(invkai[i-1]*inv[i])%MOD;
    }
}

long long comb(long long a, long long b){
    if(b<0 || a<b){
        return 0;
    }
    return mod(kai[a]*mod(invkai[b]*invkai[a-b]));
}

int main(){
  invinit();
  using namespace std;
  long long n;
  cin>>n;
  long long c[n];
  REP(i,n){
    cin>>c[i];
  }
  sort(c, c+n);
  long long ans = 0;
  long long nowp;
  for(long long k = 0; k<n; k++){
    long long temp = po(2LL, 2*n-2);
    temp *= n-k+1;
    temp = mod(temp);
    temp *= c[k];
    temp = mod(temp);
    ans += temp;
    ans = mod(ans);
  }
  cout<<ans<<endl;  
  return 0;
}


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

 using namespace std;

 int main() {
   int N;

   cin >> N;

   if (N < 105) cout << 0 << endl;
   else if (N < 135) cout << 1 << endl;
   else if (N < 165) cout << 2 << endl;
   else if (N < 189) cout << 3 << endl;
   else if (N < 195) cout << 4 << endl;
   else cout << 5 << endl;

}


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



int main(){
    int64_t sum;
    cin >> sum;

    int a, b;
    a=sum/500;
    b=(sum%500)/5;
    cout << a*1000 + b*5 << endl;
}


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

const string YES = "Yes";
const string NO = "No";

void solve(long long N, long long M, std::vector<std::string> A, std::vector<std::string> B) {
    for (long long i = 0; i < N; i++) {
        for (long long j = 0; j < N; j++) {
            long long cnt = 0;
            for (long long k = 0; k < M; k++) {
                for (long long l = 0; l < M; l++) {
                    if (i + k >= N || j + l >= N) {
                        continue;
                    }
                    if (B[k][l] == A[i + k][j + l]) {
                        cnt++;
                    }
                }
            }
            if (cnt == M * M) {
                cout << "Yes" << endl;
                return;
            }
        }
    }
    cout << "No" << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can
// remove this line by using your custom template)
int main() {
    long long N;
    scanf("%lld", &N);
    long long M;
    scanf("%lld", &M);
    std::vector<std::string> A(N);
    for (int i = 0; i < N; i++) {
        std::cin >> A[i];
    }
    std::vector<std::string> B(M);
    for (int i = 0; i < M; i++) {
        std::cin >> B[i];
    }
    solve(N, M, std::move(A), std::move(B));
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define REP(i, n) for(int i=0; i<n; i++)
#define REPi(i, a, b) for(int i=int(a); i<int(b); i++)
#define MEMS(a,b) memset(a,b,sizeof(a))
#define mp make_pair
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; }
const ll MOD = 1e9+7;

int main(){
    ll A, B, C, K;
    cin >> A >> B >> C >> K;

    ll top, bot;
    if(A >= K)
        top = K;
    else if(A+B >= K)
        top = A;
    else 
        top = A - (K - (A+B));

    if(C >= K)
        bot = -K;
    else if(C+B >= K)
        bot = -C;
    else 
        bot = -C + (K - (C+B));

    ll ans = top;
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long A,B;
  cin >> A >> B;
  long long C = 1;
  for(long long i = 1;i <= 100000; i++){
    if(A % i == 0 && B % i == 0){
      C = i;
    }
  }
  //cout << C << endl;
  cout << A * B / C << endl;
}

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

int main(){
	int a, b;
	cin >> a >> b;

	if((a+b)%2 == 0) cout << (a+b)/2 << endl;
	else cout << "IMPOSSIBLE" << endl;

	return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main{
public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int[] t = new int[n];
    for(int i = 0; i < n; i++) {
    	t[i] = sc.nextInt();
    }
    int m = sc.nextInt();
    int[] p = new int[m];
    int[] x = new int[m];
    for(int i = 0; i < m; i++) {
    	p[i] = sc.nextInt();
    	x[i] = sc.nextInt();
    }
    int sum = 0;
    for(int i = 0; i < n; i++) {
    	sum += t[i];
    }
    for(int i = 0; i < m; i++) {
    	System.out.println(sum - t[p[i] - 1] + x[i]);
    }
}
}


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

int main() {
  vector<int> order(5);
  for (int i=0; i<5; ++i) {
    cin >> order[i];
  }
  
  int time=0;
  vector<int> var(5);
  for (int i=0; i<5; ++i) {
    time += int((order[i]+9)/10)*10;
  }
  
  vector<int> mod10(5);
  for (int i=0; i<5; ++i) {
    mod10[i] = (200-order[i])%10;
  }
  int amari = *max_element(mod10.begin(), mod10.end());
  if (amari != 0) {
    time -= amari;
  }
  cout << time << endl;
  return 0;
}







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

using namespace std;

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using Ti = tuple<int, int, int>;
using Tl = tuple<ll, ll, ll>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
#define Get(t, i) get<(i)>((t))
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, f, n) for(int i = (int)(f); i < (int)(n); i++)
#define each(a, b) for(auto& a : b)

const int inf = 1 << 25;
const ll INF = 1LL << 55;

#define MAX_M 1000001
#define MAX_W 1001

bool isprim[MAX_M];

void Eratosthenes()
{
  fill(isprim, isprim + MAX_M, true);
  isprim[0] = isprim[1] = false;
  for(int i = 2; i*i < MAX_M; i++) {
    if(isprim[i]) {
      for(int j = i+i; j < MAX_M; j += i) isprim[j] = false;
    }
  }
}

int cave[MAX_W][MAX_W];
Pi pos[MAX_M];

void make_cave()
{
  const int dx[] = {1, 0, -1, 0};
  const int dy[] = {0, -1, 0, 1};  
  typedef pair<Pi, Pi> Pii;
  queue<Pii> que;
  que.push(Pii(Pi(MAX_W/2, MAX_W/2), Pi(3, 1)));
  while(!que.empty()) {
    Pii p = que.front(); que.pop();
    int x = p.F.F, y = p.F.S, d = p.S.F, n = p.S.S;
    if(n >= MAX_M) break;
    pos[n] = p.F, cave[y][x] = n++;
    int nd = (d + 1) % 4, nx = x + dx[nd], ny = y + dy[nd];
    if(!cave[ny][nx]) que.push(Pii(Pi(nx, ny), Pi(nd, n)));
    else que.push(Pii(Pi(x + dx[d], y + dy[d]), Pi(d, n)));
  }
}

int main()
{
  Eratosthenes();
  make_cave();
  int m, n;
  while(cin >> m >> n, m) {
    int dp[MAX_W][MAX_W];
    fill(dp[0], dp[MAX_W], -1);
    dp[pos[n].S][pos[n].F] = isprim[n];
    int ans = 0, num = 0;
    for(int y = 0; y < MAX_W; y++) {    
      for(int x = 0; x < MAX_W; x++) {
	if(ans <= dp[y][x]) {
	  ans = dp[y][x];
	  if(isprim[cave[y][x]]) num = max(num, cave[y][x]);
	}
	if(y == MAX_W-1 || !cave[y][x] || m < cave[y][x] || !~dp[y][x]) continue;
	for(int a = -1; a <= 1; a++) {
	  int nx = x + a, ny = y + 1;
	  if(nx < 0 || MAX_W <= nx || !cave[ny][nx] || m < cave[ny][nx]) continue;
	  dp[ny][nx] = max(dp[ny][nx], dp[y][x] + isprim[cave[ny][nx]]);
	  if(ans <= dp[ny][nx]) {
	    ans = dp[ny][nx];
	    if(isprim[cave[ny][nx]]) num = cave[ny][nx];
	  }
	}
      }
    }
    cout << ans << " " << num << endl;
  }
  return 0;
}

Measured memory_bytes: 19788
#include <bits/stdc++.h>
using namespace std;
int n,m;

int main(){
	cin>>n>>m;
	int su;
	su=m*1900+(n-m)*100;
	for(int i=0;i<m;i++){
		su*=2;
	}
	cout<<su<<endl;
	return 0;
}

Measured memory_bytes: 256
def main():
    N = int(input())
    A = [0] + list(map(int, input().split()))

    for i in range(N//2, 0, -1):
        sum_m = sum([A[i*j] for j in range(2, N//i+1)])
        if A[i] == 0:
            if sum_m % 2 == 1:
                A[i] = 1
        else:
            if sum_m % 2 == 1:
                A[i] = 0

    sum_b = sum(A)
    print(sum_b)
    if sum_b:
        ans = [i for i, v in enumerate(A) if v == 1]
        print(*ans, sep='\n')


if __name__ == "__main__":
    main()

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

int main(){
    int n, m, k, a, i, j, c = 0;
    cin >> n >> m;
    int l[m+1] = {};
    for(i=0; i<n; i++){
        cin >> k;
        for(j=0; j<k; j++){
            cin >> a;
            l[a]++;
        }
    }
    for(i=1; i<=m; i++){
        if(l[i] == n){
            c++;
        }
    }
    cout << c;
    return 0;
}

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

#define ll long long int
const int nax = 1005;

char sl[nax][nax];



const int mod = 1e9 + 7;



void add_self(int& a, int b) {

    a += b;

    if(a >= mod) {

        a -= mod;

    }

}



int main() {

    int h, w;

    scanf("%d%d", &h, &w);

    for(int row = 0; row < h; ++row) {

        scanf("%s", sl[row]);

    }

    vector<vector<int>> dp(h, vector<int>(w));

    dp[0][0] = 1;

    for(int row = 0; row < h; ++row) {

        for(int col = 0; col < w; ++col) {

            for(int r2 : {row, row + 1}) {

                int c2 = col;

                if(r2 == row) {

                    c2 = col + 1;

                }

                if(r2 < h && c2 < w && sl[r2][c2] == '.') {

                    add_self(dp[r2][c2], dp[row][col]);

                }

            }

        }

    }

    printf("%d\n", dp[h-1][w-1]);

}


Measured memory_bytes: 5120
#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}
int dx[4]={0,1,-1,0};
int dy[4]={1,0,0,-1};
long double eps = 1e-6;
long double pi = acos(-1);


signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    ll n,m,k;
    cin>>n>>m>>k;
    ll a[n],b[m];
    for(int i=0;i<n;i++)cin>>a[i];
    for(int j=0;j<m;j++)cin>>b[j];
    ll sa[n+1]={};
    ll sb[m+1]={};
    for(int i=0;i<n;i++){
        sa[i+1] = sa[i] + a[i];
    }
    for(int i=0;i<m;i++){
        sb[i+1] = sb[i] + b[i];
    }
    ll ans = 0;
    for(int i=0;i<=n;i++){
        if(sa[i] > k)break;
        ll t = upper_bound(sb,sb+m+1,k-sa[i]) - sb - 1;
        chmax(ans,t+i);
    }
    cout << ans << endl;

}

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

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

  if(n >= 3200) cout << s << endl;
  else cout << "red" << endl;
}

Measured memory_bytes: 256
/*
  Author: @yash_31
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional>
#define ll long long int
#define eb emplace_back
#define fatafat ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MOD 1000000007
#define ft first
#define sd second
#define mkpr make_pair
#define deb(x) std::cout<<#x<<":"<<x<<endl;
#define whole(x) (x).begin(),(x).end()
#define revwhole(x) (x).rbegin(),(x).rend()
#define endl "\n"
#define fbo find_by_order
#define ook order_of_key
#define init0(x) memset(x,0,sizeof(x));

using namespace std; 
using namespace __gnu_pbds;
typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update> gharKaSet;
 
const int maxlimit=2e5+2;
const ll inf=1e18;
//TTBDC

int main()
{
  fatafat
  int n;
  cin>>n;
  vector<ll> a(n),b(n),c(n);
  for(int i=0;i<n;i++){
    cin>>a[i]>>b[i]>>c[i];
  }
  ll dp[n][3];
  dp[0][0]=a[0];dp[0][1]=b[0];dp[0][2]=c[0];
  for(int i=1;i<n;i++){
    dp[i][0]=max(dp[i-1][1],dp[i-1][2])+a[i];
    dp[i][1]=max(dp[i-1][0],dp[i-1][2])+b[i];
    dp[i][2]=max(dp[i-1][1],dp[i-1][0])+c[i];
  }
  cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
  return 0;
}

Measured memory_bytes: 7932
#include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;

map<vector<int>, int> memo;
void check(const vector<int> &v, int i, int j, queue<vector<int> > &que) {
  vector<int> nv = v;
  swap(nv[i], nv[j]);
  if (memo.count(nv) == 0) {
    memo[nv] = memo[v] + 1;
    que.push(nv);
  }
}

void init() {
  vector<int> v = {0, 1, 2, 3, 4, 5, 6, 7};
  queue<vector<int> > que;
  que.push(v);
  memo[v] = 0;
  while (!que.empty()) {
    v = que.front(); que.pop();
    int id = 0;
    while (v[id] != 0) ++id;
    if (id == 0) {
      check(v, id, id + 1, que);
      check(v, id, id + 4, que);
    }
    else if (id == 3) {
      check(v, id, id - 1, que);
      check(v, id, id + 4, que);
    }
    else if (id == 4) {
      check(v, id, id + 1, que);
      check(v, id, id - 4, que);
    }
    else if (id == 7) {
      check(v, id, id - 1, que);
      check(v, id, id - 4, que);
    }
    else {
      check(v, id, id + 1, que);
      check(v, id, id - 1, que);
      check(v, id, (id + 4) % 8, que);
    }
  }
}

int main() {
  init();
  string s;
  while (getline(cin, s)) {
    stringstream ss(s);
    string ns;
    vector<int> v;
    while(getline(ss, ns, ' ')) {
      int n = stoi(ns);
      v.push_back(n);
    }
    printf("%d\n", memo[v]);
  }
  
  return 0;
}

Measured memory_bytes: 5760
#include <iostream>
#include <stdio.h>
#include <string>
#include <list>
#include <vector>
#include <algorithm>

#define rep(i,n) for(int i = 0;i < n;i++)
#define REP(i,n,k) for(int i = n;i < k;i++)
#define P(p) cout << (p) << endl;//print
using namespace std;

int main(){
    cin.tie(0);
   	ios::sync_with_stdio(false);
    string s;
    cin >> s;
    P("ABC"+s);
}


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

using namespace std;


#define MAXN 101
int main() {
  int n;
  string w[MAXN];
  set<string> s;
  cin >> n;
  bool ans = true;
  for (int i = 0; i < n; ++i) {
    cin >> w[i];
    ans &= !s.count(w[i]) && (!i || *w[i-1].rbegin()==w[i][0]);
    s.insert(w[i]);

  }
  cout << (ans ? "Yes" : "No") << endl;
  return 0;
}


Measured memory_bytes: 256
import itertools

A = int(input())
B = int(input())
C = int(input())
D = int(input())
E = int(input())
array = [A, B, C, D, E]
min_time= float('inf')

for i in list(itertools.permutations(array)):
    tmp = i[0] + ((10 - i[0]%10) if i[0] % 10 != 0 else 0)
    tmp += i[1] + ((10 - i[1]%10)  if i[1] % 10 != 0 else 0)
    tmp += i[2] + ((10 - i[2]%10) if i[2] % 10 != 0 else 0)
    tmp += i[3] + ((10 - i[3]%10) if i[3] % 10 != 0 else 0)
    tmp += i[4]
    
    min_time = min(min_time, tmp)
    
print(min_time)

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

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

  vector<long long> dp(W + 1, 0);

  for (int i = 0; i < N; i++)
  {
    int w, v; cin >> w >> v;
    vector<long long> nextdp(dp);

    for (int j = 0; j < W + 1; j++)
    {
      if (j + w <= W) {
        nextdp[j + w] = max(dp[j + w], dp[j] + v);
      }
    }

    dp = nextdp;
  }

  long long ans = 0;
  for (int i = 0; i < W + 1; i++) ans = max(ans, dp[i]);
  cout << ans << endl;
}

Measured memory_bytes: 1804
#include<stdio.h>
int main()
{
 long long int n;
 scanf("%lld",&n);
 int i,count1=0;
 for(i=1;i<=n;i++)   
 {
     int temp;
     temp=i; 
     int count2=0;
     while(temp!=0)  
    {
      count2++;
      temp = temp/10;
    } 
    if(count2%2==1) 
       {
        count1++;
       }
 }
    
   printf("%d",count1); 
    return 0;
}

Measured memory_bytes: 1692
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [-int(x) for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()
    DD = ((1,0),(0,1),(-1,0),(0,-1))

    N = NI()
    d = {}
    for _ in range(N):
        S = input()
        if S in d:
            d[S] += 1
        else:
            d[S] = 1
    print('AC x ',d.get('AC',0))
    print('WA x ',d.get('WA',0))
    print('TLE x ',d.get('TLE',0))
    print('RE x ',d.get('RE',0))



if __name__ == '__main__':
    main()

Measured memory_bytes: 72096
#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(){

    int A,B;
    cin >> A >> B;

    if((A-2*B)<0){
        printf("%d\n",0);
        return 0;
    }
    else{
        printf("%d\n",(A-2*B));
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) { 
  return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
  return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) { 
  return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define MOD 1000000007
#define INF 1000000009
typedef long long int lli;

int main(void) {
  char s[202];
  scanf("%s", s);

  int n = strlen(s) - 1;
  for ( int i = n-1; i >= 0; i-- ) {
    if ( i % 2 == 0 ) continue;
    int ok = 1;
    int l = (i + 1) / 2;
    for ( int j = 0; j < l; j++ ) {
      if ( s[j] == s[j+l] ) continue;
      ok = 0;
      break;
    }
    if ( ok ) {
      printf("%d\n", i+1);
      return 0;
    }
  }
  return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
#include <set>

typedef long long int ll;

using namespace std;
string N;

int ho(string);

int main()
{
  int ni;

  cin >> N;

  printf("%d\n", ho(N));


  return 0;
}

int ho(string strn) {
  int ret=0;
  int n;
  int carry=0;

  for (int i=strn.size()-1; i>=0; i--) {
    n = strn[i]-'0' + carry;
    if (n>=0 && n <=4 || (n==5 && (i>=1 && strn[i-1]<='4' || i<1))) {
      carry = 0;
      ret += n;
    } else {
      carry = 1;
      ret += 10-n;
    }
  }
  ret += carry;
  return ret;
}


Measured memory_bytes: 2308
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;




int main() {
	int n;
	double d;
	vi v(6, 0);
	double a[5] = { 165.0,170.0,175.0,180.0,185.0 };
	cin >> n;
	rep(i, n) {
		cin >> d;
		for (int i = 0; i < 5; i++) {
			if (d < a[i]) {
				v[i] += 1;
				break;
			}
			if (i == 4)v[5] += 1;
		}
	}
	/*for (int i = 0; i < 6; i++) {
		cout << i << ":" << v[i] << endl;
	}*/
	for (int i = 1; i < 7; i++) {
		cout << i << ":";
		for (int j = 0; j < v[i - 1]; j++) {
			cout << "*";
		}
		cout << endl;
	}
}

Measured memory_bytes: 1232
def main():
    D, N = map(int, input().split(" "))
    answer = 100 ** D * N
    i = 1
    flag = True
    while flag:
        if not answer % 100 ** (D + i):
            answer += 100 ** D
        else:
            flag = False
    print(answer)


if __name__ == '__main__':
    main()

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <string>

using namespace std;

using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;
using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;

int main(int argc, char* argv[]) {
  i64 N;
  cin >> N;
  if(N%2 == 1) {
    cout << 0 << endl;
  } else {
    i64 ans = 0;
    i64 ten = 10;
    while(ten <= N) {
      ans += (N / ten);
      ten *= 5;
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 256
from collections import defaultdict,deque
import sys, heapq, bisect, math, itertools, string, queue, copy, time
sys.setrecursionlimit(10**8)
input = sys.stdin.readline
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp():
    '''
    一つの整数
    '''
    return int(input())
def inpl():
    '''
    一行に複数の整数
    '''
    return list(map(int, input().split()))


x = inp()
a = 100
ans=0
while a < x:
    ans+=1
    a = int(a * 1.01)
print(ans)

Measured memory_bytes: 75496
#include <iostream>
using namespace std;
int main(void){
    int a, b, N, s[100]={}, f[100]={}, i, x=0;
    cin >> a >> b >> N;
    for(i=0; i<N; i++){
        cin >> s[i] >> f[i];
        if(b > s[i] && a < f[i]){
            x=1;
            break;
        }
    }
    if(x == 1) cout << 1 << endl;
    else cout << 0 << endl;
}


Measured memory_bytes: 3104
import java.util.*;
import java.io.BufferedReader; 
import java.io.IOException; 
import java.io.InputStreamReader; 
import java.util.StringTokenizer;

public class Main {
	static class IO 
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public IO() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
        int [] readarray(int sz){
            int [] ret = new int[sz];
            for(int i = 0; i<sz; i++)ret[i] = nextInt();
            return ret;
        }
    } 
    public static void main(String[] args){
        IO fs = new IO();
        String s = fs.nextLine();
        int start = -1;int end = -1;
        for(int i = 0; i<s.length(); i++){
            if(i+1<s.length() && s.charAt(i) == s.charAt(i+1)){
                start = i+1;end = i+2;
            }
            else if(i+2<s.length() && s.charAt(i) == s.charAt(i+2)){
                start = i+1; end = i+3;
            }
        }
        System.out.println(start+" "+end);
    }
}


Measured memory_bytes: 28244
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e3 + 10;
template <class T>
inline void _read(T &x)
{
	x = 0;
	char t = getchar();
	while (!isdigit(t)) t = getchar();
	while (isdigit(t))
	{
		x = x * 10 + t - '0';
		t = getchar();
	}
}
int n, m;
char ch[MAXN];
int sum[MAXN], f[MAXN][MAXN], las[MAXN], tot;
const int mo = 1e9 + 7;
int add(int x, int y)
{
	return x + y >= mo ? x + y - mo : x + y;
}
int main()
{
	_read(n), _read(m);
	scanf("%s", ch + 1);
	for (int i = 1; i <= n + 1; ++i)
	{
		sum[i] = sum[i - 1], las[i] = i;
		if (ch[i] == '1') ++tot, ++sum[i];
	}
	for (int i = 1, x, y; i <= m; ++i) _read(x), _read(y), las[x] = max(las[x], y);
	for(int i = 1; i <= n + 1; ++i)las[i] = max(las[i], las[i - 1]);
	f[1][sum[las[1]]] = 1;
	for(int i = 1; i <= n; ++i)
		for(int j = 0; j <= tot; ++j)
			if(f[i][j])
			{
				int a = las[i], b = las[i + 1];
				if(j)f[i + 1][j + sum[b] - sum[a] - 1] = add(f[i + 1][j + sum[b] - sum[a] - 1], f[i][j]);
				if(las[i] + 1 - i - j) f[i + 1][j + sum[b] - sum[a]] = (f[i + 1][j + sum[b] - sum[a]], f[i][j]);
			}
	printf("%d\n", f[n + 1][0]);
}

Measured memory_bytes: 57984