akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
vector<int> num ={2,5,5,4,5,6,3,7,6};
vector<bool> use(9,false);
const ll INF = ll(1e18)+5;

ll dp[int(1e4)+5];

ll dfs(ll N){
    if(N<0){
        return -INF;
    }
    if(N==0){
        // cerr <<"0" << endl;
        return 0;
    }
    if(dp[N] != -1){
        return dp[N];
    }
    ll retVal =-INF;
    for(int i=0;i<9;i++){
        if(!use[i]){
            continue;
        }
        retVal = max(retVal,dfs((N-num[i]))+1);
    }
    // cerr <<"N=" << N << "dp=" << retVal <<  endl;
    return dp[N] = retVal;
}

int main() {
    
    ll N,M;
    cin >> N>>M;
    for(int i=0;i<N+5;i++){
        dp[i] = -1;
    }
    for(int i=0;i<M;i++){
        int a;
        cin >> a;
        --a;
        use[a] = true;
    }
    ll deg = dfs(N);
    string ans ="";
    while(N>0){
        // cerr <<"N=" << N  <<"deg=" << deg<< endl;
        for(int i=8;i>=0;--i){
            if(!use[i]){
                continue;
            }
            if(dfs(N-num[i]) == deg-1){
                // cerr <<"dp[]=" << dp[N-num[i]]  <<"num[i]=" << num[i]<< endl;
                ans += char('1'+i);
                deg--;
                N -= num[i];
                break;
            }
        }
    }
    cout << ans << endl;

    return 0;
}

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

using ll = long long;

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int N; ll L; cin >> N >> L;
  deque<pair<int, double>> mp;
  mp.push_back(pair<int, double>(L, 0));
  double sum = 0;
  
  for (int i = 0; i < N; i++) {
    double t; int v; cin >> t >> v;
    int drain = v;
    while (drain > 0) {
      int amt = min(mp.back().first, drain);
      sum -= amt * mp.back().second;
      drain -= amt;
      mp.back().first -= amt;
      if (mp.back().first == 0) mp.pop_back();
    }
    sum += t * v;
    while (!mp.empty() && mp.front().second >= t) {
      t = t * v + mp.front().first * mp.front().second;
      v += mp.front().first;
      t /= v;
      mp.pop_front();
    }
    mp.push_front(pair<int, double>(v, t));
    cout << fixed << setprecision(10) << (sum/L) << '\n';
  }
}

Measured memory_bytes: 18708
N, M, X = map(int,input().split())
a=[]
b=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]

for i in range(N):
    a.append(input().split())

check=0
ans=-1
for i in range(1,pow(2,N)):
    b=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
    check=0
    for j in range(N):
        if 0x01 & (i >> j):
            for n in range(M+1):
                b[n] = b[n] + int(a[j][n])
    for k in range(1,M+1):
        if b[k] < X:
            check=1
    if check==0:
        if ans == -1 or ans > b[0]:
            ans = b[0]
print(ans)

Measured memory_bytes: 9268
#include <iostream>
#include <string>
using namespace std;
int main(void){
    // Your code here!
    int n;cin>>n;
    int A;
    int count_A;
    int output;output=10000;
    for(int i=0;i<n;i++){
        cin>>A;
        count_A=0;
        for(int j=0;j<10000;j++){
            if(A%2==0){
                A=A/2;
                count_A++; 
            }else{
                break;
            }    
            
        }
        output=min(output,count_A);
    }    
    
    cout<<output<<endl;
    return 0;
    
}

Measured memory_bytes: 256
def main():
    h,w=map(int,input().split())
    a=[]
    for _ in range(h):
        a.append(input())
    now = (0, 0)
    end = (h-1, w-1)
    visited = set([now])
    while True:
        nxt = None
        #print(now)
        if now[0]+1 < len(a) and a[now[0]+1][now[1]] == "#":
            nxt = (now[0]+1, now[1])
        if now[1]+1 < len(a[now[0]]) and a[now[0]][now[1]+1] == "#":
            if nxt is not None:
                print("Impossible")
                return
            nxt = (now[0], now[1]+1)
        #print("next", nxt)
        if now[0]-1 >= 0 and a[now[0]-1][now[1]] == "#":
            if (now[0]-1,now[1]) not in visited:
                print("Impossible")
                return
        if now[1]-1 >= 0 and a[now[0]][now[1]-1] == "#":
            if (now[0],now[1]-1) not in visited:
                print("Impossible")
                return
        
        if now == end:
            break
        if nxt is None:
            print("Impossible")
            return
        now = nxt
        visited.add(nxt)
    print("Possible")
    
if __name__ == "__main__":
    main()

Measured memory_bytes: 3064
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>
#include<set>
#include<climits>
#include<deque>
#include<iomanip>
#include<utility>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define all(a) a.begin(),a.end()
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define size(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
#define S 21 
llfor;
const ll mod=1000000007;
/*pi*/const double pi=acos(-1);
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll ans=1;rep(i,0,n){ans*=x;}return ans;}
/*階乗*/ll fact(ll x){ll ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)*fact(n-r)/fact(r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
/*Fibonacci数列*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
/*桁数*/ll dig(ll n){ll d=1,tmp=n;while(tmp/10>0){tmp/=10;d++;}return d;}
/*行列のコピー*/void matcpy(ll a[S][S],ll b[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)b[i][j]=a[i][j];/*(aをbに)*/i=t;}
/*行列のリセット*/void matrst(ll a[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)a[i][j]=0;i=t;}
/*行列の2乗*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
/*行列の乗算*/void matmul(ll a[S][S],ll b[S][S], ll as[S][S]){ll t=i,k;matrst(as);rep(i,0,S)rep(j,0,S)rep(k,0,S)as[i][j]+=a[i][k]*b[k][j];i=t;}
//ll ans=0;
////////////////////////////////////////////////////////////
int main(){
 ll n;cin>>n;
 string s;cin>>s;
 ll w[n+10]={0},b[n+10]={0},c1,c2;
 ll x=0,y=0;
 rep(i,0,n){
  if(i>0)b[i]=b[i-1];
  if(s[i]=='#')b[i]++;
 }
 rrp(i,n,0){
  if(i<n-1)w[i]=w[i+1];
  if(s[i]=='.')w[i]++;
 }
 ll ans=n+10,tmp;
 rep(i,0,n+1){//iの左側で切る
  tmp=0;
  if(i>0)tmp+=b[i-1];
  if(i<n)tmp+=w[i];
  ans=min(tmp,ans);
 }
 pr(ans);
return 0;}


Measured memory_bytes: 6868
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("unroll-loops") 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define int long long
#define fr(i,a,b) for(int i = a ; i <= b ; ++i)
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
#define fst first
#define snd second
using namespace __gnu_pbds;
using ordered_set =
 tree<int, null_type,less<int>,
 rb_tree_tag,tree_order_statistics_node_update>;
//find_by_order(k):returns iterator to kth element starting from 0
//order_of_key(k):returns count of elements strictly smaller than k
typedef long long ll;typedef pair<int, int> pii;
typedef vector<int> vi;typedef long double ld;
template<class T>
using min_heap = priority_queue<T,vector<T>,greater<T>>; 
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
template<class T> void re(T& x) { cin >> x; }
template<typename T> 
void remdup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)), v.end());
}
template<typename T> void re(vector<T> &v) {trav(i,v) cin >> i;}
template<class H, class... T> void re(H& h, T&... t) { re(h); re(t...); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
#ifdef np
#include "C:\Users\navodit\Desktop\mycodes\pr.h"
#else
#define trace(...)
#endif

#define MOD 1000000007  




void solve(){
	int n , r ;
	cin >> n >> r ;
	if(n<=10){
		cout << r + (100*(10-n)) << endl;
	}
	else cout << r << endl;
}

signed main() {
	unsyncIO();
	int tt =1 ;
	// cin >> tt;
	rep(i,0,tt) solve();













#ifdef np
	cout <<endl<<endl<< "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}


Measured memory_bytes: 3596
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>    
#include <cstring>
#include <array>
#include <cctype>
#include <string.h>
#include <vector>
#include <limits.h>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cassert>
#include <algorithm>
#include <functional>
#include <sstream>
#include <iomanip>
#include <cstdlib>
#include <stdio.h>
#include <bitset>
using namespace std;
#define PI 3.14159265359
#define mp make_pair
#define pb push_back
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,n) FOR(i,0,n)
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
const int INF = 1<<29;
typedef long long ll;
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

int n,m;
ll x[1001],y[1001],z[1001];

int main(){
	ios_base::sync_with_stdio(false); //Fast I/O
	cin.tie(NULL);
	//freopen("in.txt","r",stdin);
	//freopen("output.txt","w",stdout);	

	cin >> n >> m;

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

	ll dp[1001];
	ll ans=0;

	for(int i=0;i<8;i++){
		int a=(i&1)?-1:1;
		int b=(i&2)?-1:1;
		int c=(i&4)?-1:1;

		for(int i=0;i<n;i++){
			dp[i]=a*x[i]+b*y[i]+c*z[i];
		}
		sort(dp,dp+n);
		reverse(dp,dp+n);
		ll cc=0;

		for(int i=0;i<m;i++)
			cc+=dp[i];
		ans=max(ans,cc);
	}

	cout << ans << endl;

	return 0;
}


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

#define REP(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) REP(i,0,n)
#define INF (1<<30)
#define INFLL (1LL<<62LL)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);
  int N;
  vector<int> A;

  cin >> N;
  A.resize(3 * N);

  rep(i, 3 * N) cin >> A[i];
  sort(A.begin(), A.end(), greater<int>());

  ll ans = 0;
  REP(i, 0, 2 * N) {
    if (i % 2) ans += A[i];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    string s;
    getline(cin,s);
    ll len=s.size();
    ll i,flag=0;
    for(i=0; i<len; i++)
    {
        if(s[i]=='?')
        {
            s[i]='D';
        }
    }

    cout<<s<<endl;

    return 0;
}


Measured memory_bytes: 3692
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a) for(int i = 0; i < (a); i++)
#define ALL(a) (a).begin(),(a).end()
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e9;
const int MOD = 1e9 + 7;

signed main(){
    int n,t;
    cin >> n >> t;
    ll a;
    ll mn = INF, mx = 0;
    int ans = 0;
    REP(i,n){
        cin >> a;
        mn = min(mn, a);
        if(a - mn > mx){
            ans = 1;
            mx = a - mn;
        }else if(a - mn == mx){
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <ctime>
#include <sstream>
#define weewoo ios::sync_with_stdio(false);cin.tie(0)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ld long double
#define ll long long
#define se second
#define fi first
#define ctoi(x) (x-'0')
#define pi (acos(-1))
#define llputin(a,n) for(int i=0;i<n;i++){ll x;cin >> x;a.push_back(x);}
#define iputin(a,n) for(int i=0;i<n;i++){int x;cin >> x;a.push_back(x);}

#define MOD ((ll) 1e9 + (ll) 7)
using namespace std;

ll pw(ll x,ll a){
    if(a==0)
        return 1;
    ll t = pw(x,a/2);
    if(a%2==0)
        return (t*t);
    else
        return (t*t*x);
}

bool prime(int x)
{
    if(x < 2) return false;
        for(int i=2; i<= sqrt(x); i++) {
            if ((x%i) == 0) return false;
        }
    return true;
}


ll lcm(ll x,ll y){
    return x*y/__gcd(x,y);
}

int main()
{
    weewoo;
    ll a,b;
    cin >> a >> b;
    cout << min(a*b,lcm(a,b)) << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int inf=999999999;
int n,k;
int a[1000001];
int las[1000001];
int dp[1000001];
deque<pair<int,int> >q;
signed main()
{
	scanf("%d%d",&n,&k);
	for(int i=0;i<=n;i++)
		scanf("%1d",&a[i]);
	if(a[0])
	{
		printf("-1");
		return 0;
	}
	q.push_front(make_pair(0,0));
	for(int i=1;i<=n;i++)
	{
		while(!q.empty()&&q.front().second<i-k)
			q.pop_front();
		dp[i]=q.front().first+1;
		las[i]=q.front().second;
		if(a[i]) dp[i]=inf;
		while(!q.empty()&&q.back().first>dp[i])
			q.pop_back();
		q.push_back(make_pair(dp[i],i));
	}
	if(dp[n]>=inf)
	{
		printf("-1");
		return 0;
	}
	vector<int>ans;
	int x=n;
	while(x)
		ans.push_back(x-las[x]),x=las[x];
	for(int i=ans.size()-1;i>0;i--)
		printf("%d ",ans[i]);
	printf("%d",ans[0]);
	return 0;
}


Measured memory_bytes: 9592
#include <iostream>  
#include <stdio.h>  
#include <string.h>  
using namespace std;  
typedef long long LL;  
char s[15];  
int pos[15];  
LL num(int l,int r)  
{  
    LL ans=0;
    for(int i=l;i<=r;i++)  
        ans=ans*10+s[i]-'0';  
    return ans;  
}  
LL solve(int n)  
{  
    int l=-1,r=0;  
    LL ans=0;  
    pos[n]=1;  
    for(int i=0;i<=n;i++)  
    {  
        if(pos[i]==0) r++;  
        else {ans+=num(l+1,i); l=i;}  
    }  
    return ans;  
}  
int main()  
{  
     while(cin>>s)  
     {  
        int n=strlen(s);  
        long long ans=0;
        int m = (1<<(n-1))-1 ; 
        for(int i=0;i<=m;i++)  
        {  
            memset(pos,0,sizeof(pos));  
            int tt=0;  
            int temp=i;  
            while(temp)  
            {  
                pos[tt++]=temp%2;  
                temp=temp/2;  
            }  
            ans+=solve(n-1);  
        }  
        printf("%lld\n",ans);  
     }  
    return 0;  
}  

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

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

    int maxnum = 0;

    maxnum = max(a+b,a-b);
    maxnum = max(maxnum,a*b);

    cout << maxnum << endl;
    return 0;
}

Measured memory_bytes: 256
//#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector,fast-math")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,abm,mmx,popcnt,avx,avx2,tune=native")
           
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
           
//#define int long long
  
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ld, ld> pld;

template<typename T>
using kawaii_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
  
void FAST_IO() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout.setf(ios::fixed);
    //cout.precision(20);
    #ifndef _offline
    //freopen("mincost.in", "r", stdin);
    //freopen("mincost.out", "w", stdout);
    #endif
}

const int MAXN = 6010;
int rev[MAXN];
int dp[MAXN][MAXN * 2];

int binpow(int a, int n, int mod) {
    int res = 1;
    while (n) {
        if (n & 1) {
            res = (res * 1LL * a) % mod;
        }
        a = (a * 1LL * a) % mod;
        n >>= 1;
    }
    return res;
}

signed main() {
    FAST_IO();
    int n, mod;
    cin >> n >> mod;
    for (int s = 1; s <= 3 * n; ++s) {
        rev[s] = binpow(s, mod - 2, mod);
    }
    int f = 1;
    for (int i = 1; i <= 3 * n; ++i) {
        f = (f * 1LL * i) % mod;
    }
    dp[0][MAXN + 0] = f;
    for (int s = 1; s <= 3 * n; ++s) {
        for (int ps = s - 1; ps >= max(0, s - 3); --ps) {
            for (int val = -3 * n; val <= 3 * n; ++val) {
                int nval = (s - ps == 1 ? val + 1 : s - ps == 2 ? val - 1 : val);
                dp[s][MAXN + nval] = (dp[s][MAXN + nval] + dp[ps][MAXN + val] * 1LL * rev[s]) % mod;
            }
        }
    }
    int ans = 0;
    for (int val = 0; val <= 3 * n; ++val) {
        ans += dp[3 * n][MAXN + val];
        if (ans >= mod) {
            ans -= mod;
        }
    }
    cout << ans << '\n';
}  

Measured memory_bytes: 281984
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007

int kouyaku(int a,int b){
    int x=max(a,b);
    int y=min(a,b);
    int z;
    if(y==0) return x;
    while(x%y!=0){
        z=x;
        x=y;
        y=z%x;
    }
    return y;
}

int main(){
    int n, A[100005],ans=1,a,b,L[100005],R[100005];
    cin>>n;
    REP(i,n) cin>>A[i];
    a=b=0;
    for(int i=0;i<n;i++){
        L[i]=kouyaku(a,A[i]);
        a=L[i];
    }
    for(int i=n-1;i>=0;i--){
        R[i]=kouyaku(b,A[i]);
        b=R[i];
    }
    REP(i,n){
        if(i==0) ans=max(ans,kouyaku(0,R[1]));
        else if(i==n-1) ans=max(ans,kouyaku(L[n-2],0));
        else ans=max(ans,kouyaku(L[i-1],R[i+1]));
        
    }


    cout<<ans<<endl;
}

Measured memory_bytes: 1408
#include <iostream>
#include <vector>
#include <algorithm>

int main(int argc,char* argv[]){
  int n;
  std::cin >> n;
  
  std::vector<int> array(n);

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

  int count = 0;
  for(int i = 0; i < n; i++){
    int min = i;

    for(int j = i; j < n; j++){
      if(array[j] < array[min]){
	min = j;
      }
    }
    
    if(i != min){
      std::swap(array[i], array[min]);
      count++;
    }
  }

  bool first = true;
  for(int i = 0; i < n; i++){
    if(!first){
      std::cout << " ";
    }else{
      first = false;
    }

    std::cout << array[i];
  }

  std::cout << std::endl;

  std::cout << count << std::endl;

  return 0;
  
}

Measured memory_bytes: 1196
s = input()
s12 = int(s[0:2])
s34 = int(s[2:])

if (0 < s12 < 13) and(0 < s34 < 13):
  print("AMBIGUOUS")
elif 0 < s12 < 13:
  print("MMYY")
elif 0 < s34 < 13:
  print("YYMM")
else:
  print("NA")

Measured memory_bytes: 3060
#include<stdio.h>

#define LIM 500000
#define SENTINEL 1000000001
int cnt = 0;

void merge(int A[], int left, int mid, int right) {
  int l = mid - left;
  int r = right - mid;
  int L[l], R[r];

  for ( int i = 0; i < l; i++ ) L[i] = A[left + i];
  for ( int i = 0; i < r; i++ ) R[i] = A[mid + i];
  L[l] = R[r] = SENTINEL;

  l = r = 0;
  for ( int i = left; i < right; i++ ) {
    if (L[l] <= R[r]) {
      A[i] = L[l];
      l++;
    } else {
      A[i] = R[r];
      r++;
    }
    cnt++;
  }
}

void mergeSort(int A[], int left, int right) {
  if ( left + 1 < right ) {
    int mid = (left + right) / 2;
    mergeSort(A, left, mid);
    mergeSort(A, mid, right);
    merge(A, left, mid, right);
  }
}

int main() {
  int n, A[LIM];

  scanf("%d", &n);
  for ( int i = 0; i < n; i++ ) scanf("%d", &A[i]);

  mergeSort(A, 0, n);

  for ( int i = 0; i < n; i++ ) {
    if (i) printf(" ");
    printf("%d", A[i]);
  }

  printf("\n");

  printf("%d\n", cnt);

  return 0;
}



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

int main()
{
    ios::sync_with_stdio(false);
    int n = 0;
    cin >> n;
    unordered_set<int> S;
    for (int i = 0; i!= n; ++i){
        int s = 0;
        cin >> s;
        S.insert(s);
    }
    int q = 0;
    cin >> q;
    int counts = 0;
    for (int i = 0; i != q; ++i){
        int t = 0;
        cin >> t;
        counts += S.count(t);
    }
    cout << counts << endl;
    return 0;
}

Measured memory_bytes: 4628
N,K = map(int,input().split())

S = [0 for i in range(N)]

for i in range(K):
  d = int(input())
  A = list(map(int,input().split()))
  for j in range(d):
    S[A[j]-1]+=1
    
ans = 0
for i in range(N):
  if S[i]==0:
    ans+=1
    
print(ans)

Measured memory_bytes: 67524
#include <stdio.h>
int main (){
	
	int n,r,z;
	scanf ("%d %d", &n, &r);
	z = 100 * (10 - n);
	if (n < 10){
		printf ("%d\n", r + z);
	}
	else if (n >= 10){
		printf ("%d\n", r);
	}

	
	return 0;
}

Measured memory_bytes: 1732
l = "1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51"
li = [int(x.strip()) for x in l.split(',')]
print(li[int(input())-1])

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

int main() {
	ios::sync_with_stdio(0);cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n);
	for(int i=0; i<n; i++) {
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	long long ans = 0;
	for(int i=0; i<n; i++) {
		for(int j=i+1; j<n; j++) {
			int x = lower_bound(a.begin(), a.end(), a[j]-a[i]+1) - a.begin(), y = lower_bound(a.begin(), a.end(), a[j]+a[i]) - a.begin();
			int add = y-x;
			if(x <= i && i <= y)
				add--;
			if(x <= j && j <= y)
				add--;
			ans += add;
		}
	}
	cout << ans/3;
}

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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    int n; cin >> n;
    cout << n/2*(n-n/2) << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 7692
#include <stdio.h>


int main(){
    int a,b,c,d;
    scanf("%d %d %d %d",&a,&b,&c,&d);
    int train=0,bus=0;
    if(a<=b){
        train=a;
    }
    else{
        train=b;
    }
    if(c<=d){
        bus=c;
    }
    else{
        bus=d;
    }
    printf("%d",train + bus);
}


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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    ll n,k; cin >> n >> k;
    ll res = n % k;
    res = min(res,abs(res-k));
    cout << res << endl;
}


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

int main() {
  int n, m;
  cin >> n >> m;
  vector<string> a(n), b(m);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }

  bool flag = true;
  for (int i = 0; i < n - m + 1; i++) {
    for (int j = 0; j < n - m + 1; j++) {
      flag = true;
      for (int k = 0; k < m; k++) {
        for (int l = 0; l < m; l++) {
          if (a[k+i][l+j] != b[k][l]) {
            flag = false;
          }
        }
      }
      if (flag) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;

int H, W, N;
queue<int> que;
vector<vector<int>> ans(101, vector<int>(101, 0));

int main(void){
	
	scanf("%d %d %d", &H, &W, &N);
	vector<vector<int>> ans(H, vector<int>(W, 0));
	for(int i = 0; i < N; ++i){
	    int temp; scanf("%d", &temp);
	    for(int j = 0; j < temp; ++j) que.push(i + 1);
	}
	
	for(int i = 0; i < H; ++i){
	    if(i % 2 == 0){
	        for(int j = 0; j < W; ++j){ ans[i][j] = que.front(); que.pop(); }
	    }
	    else{
	        for(int j = W - 1; j >= 0; --j){ ans[i][j] = que.front(); que.pop(); }
	    }
	}
	
	for(int i = 0; i < H; ++i){
	    for(int j = 0; j < W; ++j){
	        if(j) printf(" ");
	        printf("%d", ans[i][j]);
	    }
	    printf("\n");
	}
	
    return 0;
}

Measured memory_bytes: 384
def main():
    N,L = map(int,input().split())
    aji_all = 0

    for i in range(1,N+1):
        aji_all += L + i - 1

    for i in range(1,N+1):
        aji_i = aji_all - (L + i - 1)
        if i == 1:
            best_score =  abs(aji_all - aji_i)
            best_num = i
            ans = aji_i
            
        if best_score > abs(aji_all - aji_i):
            best_score = abs(aji_all - aji_i)
            ans = aji_i
            best_num = i

    print(ans)

if __name__ == '__main__' :
    main()


Measured memory_bytes: 3060
#include <iostream>

using namespace std;

bool anti(int n,int k){
    return k <= (n+1)/2;


}
int main(){
    int n,k;
    cin >> n >> k;
    if (anti(n,k)){
        cout << "YES";
    }else{
        cout << "NO";
    }
    return 0;


}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string.h>
#include<math.h>
#include<cstring>
using namespace std;


int main(){
	while(1){
		int n,p[101][101],l,i,j,k,me[101],m,a,flg=0;
		cin>>n;
		if(n==0)break;
		for(i=0;i<101;i++){
			for(j=0;j<101;j++){
				if(j!=0){
					p[i][j]=0;//初期化
				}else{
					p[i][j]=1;
				}
			}
		}
		for(i=1;i<=n;i++){
			cin>>m;
			for(j=0;j<m;j++){
				cin>>a;
				p[i][a]=1;
			}
		}
		cin>>k;
		for(i=0;i<k;i++){
			cin>>me[i];
		}
		for(i=1;i<=n;i++){
			for(j=0;j<k;j++){
				if(p[i][me[j]]==0){
					p[i][0]=0;
				}
			}
		}
		flg=0;a=-1;
		for(i=1;i<=n;i++){
			if(p[i][0]==1){
				if(flg==0){
					flg=1;a=i;
				}else{
					a=-1;flg=2;
					break;
				}
			}
		}
		cout<<a<<endl;
	}
    return 0;
}

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

/* #pragma */
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")


/*alias*/
#define F first
#define S second

#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev
#define itn int

/*template*/
template<class T>inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }

/* func */
int32_t GCD(int32_t a, int32_t b){return b ? GCD(b, a%b) : a;}
int64_t GCD(int64_t a, int64_t b){return b ? GCD(b, a%b) : a;}
int32_t LCM(int32_t a, int32_t b){return a * b / GCD(a, b);}
int64_t LCM(int64_t a, int64_t b){return a * b / GCD(a, b);}

/*struct*/
struct aaa {
	aaa() {
		cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20);
	};
}aaaaaaa;

/* const */
constexpr int32_t INF = 1001001001;
constexpr int64_t LINF = 1001001001001001001ll;
constexpr int32_t MOD = 1e9 + 7; //10^9
constexpr int64_t EPS = 1e-9;
constexpr int32_t dx[] = { 1, 1, 0, -1, -1, -1, 0, 1 }, dy[] = { 0, 1, 1, 1, 0, -1, -1, -1 };
//constexpr int32_t dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
//Counterclockwise from the 6o'clock direction
//Take the x-axis downward and the y-axis right


//g++ -std=c++14 -Wall --pedantic-errors -o template template.cpp
//g++ -std=c++14 -Wall --pedantic-errors template.cpp
//chcp 65001

/*global*/



//for dfs, I prepare container(tree) at global
vector<int> to[200005];
vector<int> ans;
void dfs(int v, int p = -1){
	for(int u: to[v]){
		if(u == p) continue;
		ans[u] += ans[v];
		dfs(u, v);
	}
}

//#define int int64_t
signed main()
{
	int n, q; cin >> n >> q;
	for(int i = 0, i_len = (int)n-1; i < i_len; ++i){
		int a, b;
		cin >> a >> b;
		--a;--b;
		to[a].emplace_back(b);
		to[b].emplace_back(a);		
	}
	ans.resize(n);
	for(int i = 0, i_len = (int)q; i < i_len; ++i){
		int p, x;
		cin >> p >> x;
		--p;
		ans[p] += x;
	}
	dfs(0);

	for(int i = 0, i_len = (int)n; i < i_len; ++i){
		cout << ans[i] << " ";
	}

}

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

#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define fastt ios_base::sync_with_stdio(false); cin.tie(NULL)
#define debug1(x) cout<<#x<<" : "<<x<<endl
#define debug2(x,y) cout<<#x<<" : "<<x<<" "<<#y<<" : "<<y<<endl
#define debug3(x,y,z) cout<<#x<<" : "<<x<<" "<<#y<<" : "<<y<<" "<<#z<<" : "<<z<<endl

typedef long long ll;
typedef pair<ll,ll> pii;
const ll modd=1e9+7;

ll poww(ll a,ll b){
  ll ans=1;
  while(b>0){
    if(b%2==1) ans=(ans*a);
    a=(a*a);
    b=b/2;
  }
  return ans;
}

/*-----------------------------------------------------------------------*/

ll n;
vector <ll> adj[100001];
ll dp[100001][2];

void dfs(ll node,ll par){
	for(auto i: adj[node]){
		if(i==par)
			continue;
		dfs(i,node);
	}
	ll part1=1,part2=1;
	for(auto i: adj[node]){
		if(i==par)
			continue;
		part1=(part1*(dp[i][0]+dp[i][1]))%modd;
		part2=(part2*dp[i][1])%modd;
	}
	dp[node][0]=part2;
	dp[node][1]=part1;
}

int main(){
   fastt;

   cin>>n;

   for(ll i=1;i<=n-1;i++){
   	  ll x,y;
   	  cin>>x>>y;
   	  adj[x].pb(y);
   	  adj[y].pb(x);
   }

   dfs(1,-1);

   ll ans=(dp[1][0]+dp[1][1])%modd;

   cout<<ans<<endl;

   return 0;
}


Measured memory_bytes: 12800
N, x = map(int, input().split())
a = list(map(int, input().split()))

tmp = 0
for i in range(N-1):
    s = a[i] + a[i+1]
    if s > x :
        last = a[i+1]
        a[i+1] = max(0, x-a[i])
        tmp += last - a[i+1]
    if a[i] > x:
        last = a[i]
        a[i] = x
        tmp += last - a[i]

ans = tmp
print(tmp)
             


Measured memory_bytes: 14052
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>

auto& in = std::cin;
auto& out = std::cout;

int32_t N;
int64_t W[100];
int64_t V[100];
std::unordered_map<int64_t, int64_t> dp[100];
int64_t func(int i, int64_t W_MAX)
{
	if (W_MAX < 0) {
		return -100000000000000;
	}
	if (i >= N) {
		return 0;
	}
	if (dp[i].count(W_MAX)) {
		return dp[i][W_MAX];
	}
	auto& memo = dp[i][W_MAX];
	return memo = std::max(
		func(i + 1, W_MAX),
		func(i + 1, W_MAX - W[i]) + V[i]
	);
}
int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);

	int64_t W_MAX;
	in >> N>>W_MAX;
	for (int32_t i = 0; i < N; ++i)
	{
		in >> W[i] >> V[i];
	}
	std::cout << func(0, W_MAX) << std::endl;

	return 0;
}
#endif


Measured memory_bytes: 5888
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


#define NUM 200005

int N,K;
int table[NUM];

int main(){

	scanf("%d %d",&N,&K);

	for(int i = 0; i <= 200000; i++){

		table[i] = 0;
	}

	int tmp;

	for(int i = 0; i < N; i++){

		scanf("%d",&tmp);
		table[tmp] += 1;
	}

	priority_queue<int> Q;

	for(int i = 1; i <= 200000; i++){
		if(table[i] == 0)continue;

		Q.push(table[i]);
	}

	if((int)Q.size() <= K){

		printf("0\n");
		return 0;
	}

	int minus = 0;

	//大きい順に残せば良さそう
	while(Q.empty() == false && K > 0){

		minus += Q.top();
		Q.pop();
		K -= 1;
	}

	printf("%d\n",N-minus);

	return 0;
}


Measured memory_bytes: 2168
#include<cstdio>
#include<cmath>
#include<queue>
using namespace std;

struct qnode{
	int v1,v2;
	double w;
	bool operator <(const qnode &b)const{
		return w<b.w;
	}
};
priority_queue<qnode> q;

int x[10001],y[10001],set[100001];

int find(int x)
{
	if(x==set[x])
		return x;
	else
		return set[x]=find(set[x]);
}

inline double dist(double x1,double x2,double y1,double y2)
{
	return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

int main()
{
	int n,m,v1,v2,i;
	qnode z;
	double s=0;

	scanf("%d%d",&n,&m);
	for(i=1;i<=n;i++)
	{
		scanf("%d%d",&x[i],&y[i]);
		set[i]=i;
	}
	for(i=1;i<=m;i++)
	{
		scanf("%d%d",&v1,&v2);
		z.v1=v1;
		z.v2=v2;
		z.w=dist(x[v1],x[v2],y[v1],y[v2]);
		s+=z.w;
		q.push(z);
	}

	while(!q.empty())
	{
		z=q.top();
		q.pop();
		v1=z.v1;
		v2=z.v2;
		if((v1=find(v1))!=(v2=find(v2)))
		{
			set[v2]=v1;
			s-=z.w;
		}
	}
	printf("%.10f\n",s<0?0:s);

	return 0;
}

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

using namespace std;

int cntDig(long long n) {
    int res = 0;
    while (n) {
        n /= 10;
        res++;
    }
    return res;
}

int main() {
    ios_base::sync_with_stdio(0);
    long long N;
    cin >> N;
    int res = 1000;
    for (long long i = 1; i * i <= N; i++) {
        if (N % i == 0) {
            res = min(res, max(cntDig(i), cntDig(N / i)));
        }
    }
    cout << res << "\n";
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>

int main(){
  int t;
  int h, m ,s;
  
  std::cin >> t;
  h = floor((double)t / 3600.0);
  t -= h * 3600;
  
  m = floor((double)t / 60.0);
  t -= m * 60;
  
  s = t;
  
  std::cout << h << ":" << m << ":" << s << std::endl;
  return 0;
}

Measured memory_bytes: 3056
import sys

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


N = ii()
A = il()
B = il()
S = 0
diff = []
num_i = 0
for a, b in zip(A, B):
    if a < b:
        S += b - a
        num_i += 1
    else:
        diff.append(a - b)
diff.sort(reverse=True)
if num_i == 0:
    print(0)
    exit()
c = 0
for i in range(len(diff)):
    S -= diff[i]
    c += 1
    if S < 0:
        break
else:
    print(-1)
    exit()
print(num_i + c)


Measured memory_bytes: 19188
#include<stdio.h>
#include<stdlib.h>
int main(){
  int count=0, i, j, N, min, x, *A;
  scanf("%d",&N);
  A = (int *)malloc(sizeof(int) * N);
  for(i=0; i<N; i++)
    scanf("%d",&A[i]);
  for(i=0; i<N-1; i++){
    min = i;
    for(j=i+1; j<N; j++){
      if(A[min] > A[j])
	min = j;
    }
    if(i != min){
      x = A[i];
      A[i] = A[min];
      A[min] = x;
      count++;
    }
  }
  for(i=0; i<N; i++){
    printf("%d",A[i]);
    i < N-1 ? printf(" "):printf("\n");
  }
  printf("%d\n",count);
  free(A);
  return 0;
}

Measured memory_bytes: 604
#include <bits/stdc++.h>
#define all(a) (a).begin(),(a).end()
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);

	int n;
	cin >> n;

	vector<vector<int>>dp(3,vector<int>(n+1,0));
	for(int i=0;i<n;i++){
		int a,b,c;
		cin >> a >> b >> c;

		dp[0][i+1] = max(dp[1][i],dp[2][i]) + a;
		dp[1][i+1] = max(dp[0][i],dp[2][i]) + b;
		dp[2][i+1] = max(dp[1][i],dp[0][i]) + c;
	}

	cout << max( { dp[0][n], dp[1][n] , dp[2][n] } ) << endl ;

	return 0;
}


Measured memory_bytes: 4788
a = int(input())
if a < 600:
    print("8")
elif a < 800:
    print("7")
elif a < 1000:
    print("6")
elif a < 1200:
    print("5")
elif a < 1400:
    print("4")
elif a < 1600:
    print("3")
elif a < 1800:
    print("2")
elif a < 2000:
    print("1")

Measured memory_bytes: 61652
#include<iostream>
using namespace std;
int main()
{
  int k, x;
  cin >> k >> x;
  string res;
  
  if(k * 500 >= x)
  {
    res = "Yes";
  }
  else 
  {
    res = "No";
  }
  cout << res << endl;
  
  return 0;
}

Measured memory_bytes: 256
//
//  main.cpp
//

#include <algorithm>
#include <array>
#include <assert.h>
#include <iomanip>
#include <iostream>
#include <limits>
#include <math.h>
#include <memory>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = int64_t;
using ull = uint64_t;

template<typename T>
vector<T> make_vec_nd(T init, size_t size) {
    return vector<T>(size, init);
}
template<typename T, typename... Args>
auto make_vec_nd(T init, size_t size, Args... rest) {
    auto inner = make_vec_nd(init, rest...);
    return vector<decltype(inner)>(size, inner);
}

struct Mod {
    static ll BASE;
    ll value = 0;
    static ll residue(ll value) { return (value % BASE + BASE) % BASE; }
    Mod(ll value)
    : value(residue(value)) {}
    Mod operator+(const Mod& rhs) const { return Mod(value + rhs.value); }
    void operator+=(const Mod& rhs) { *this = *this + rhs; }
    Mod operator-(const Mod& rhs) const { return Mod(value - rhs.value); }
    void operator-=(const Mod& rhs) { *this = *this - rhs; }
    Mod operator*(const Mod& rhs) const { return Mod(value * rhs.value); }
    void operator*=(const Mod& rhs) { *this = *this * rhs; }
};
ll Mod::BASE = 1000000007;

int main() {
    ll H, W;
    cin >> H >> W;
    auto grid = make_vec_nd('$', W, H);
    for (ll i = 0; i < H; i++) {
        for (ll j = 0; j < W; j++) {
            cin >> grid[j][i];
        }
    }
    auto dp = make_vec_nd((Mod)0, W, H);
    dp[0][0] = 1;
    for (ll i = 0; i < W; i++) {
        for (ll j = 0; j < H; j++) {
            if (grid[i][j] == '#') {
                continue;
            }
            bool from_left = (i > 0 && grid[i-1][j] == '.');
            bool from_up = (j > 0 && grid[i][j-1] == '.');
            if (from_left && from_up) {
                dp[i][j] = dp[i-1][j] + dp[i][j-1];
            } else if (from_left) {
                dp[i][j] = dp[i-1][j];
            } else if (from_up) {
                dp[i][j] = dp[i][j-1];
            }
        }
    }
    cout << dp[W-1][H-1].value << endl;
}



Measured memory_bytes: 9088
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <random>
#include <chrono>
 
using namespace std;
using namespace __gnu_pbds;
 
#define endl '\n'
 
typedef long long ll;
typedef pair<ll, ll> pii;
typedef tree<int, null_type,less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
template<typename T>
static T randint(T lo, T hi){
	return uniform_int_distribution<T>(lo, hi)(rng);
}



int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
 
	// freopen("settling.in", "r", stdin);
	// freopen("settling.out", "w", stdout);

	ll n;
	cin >> n;

	ll x = (n + 999) / 1000;
	cout << -n + x * 1000 << endl;

	return 0;
}


Measured memory_bytes: 3620
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include<stdbool.h>
typedef long long ll;
typedef long double ld;
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define rrep(i,l,r)for(ll i=(l);i>=(r);i--)
#define INF (1LL<<60)
#define MOD1 1000000007
#define MOD2 998244353
#define MAX_N (1 << 17)
#define YES printf("Yes\n")
#define NO printf("No\n")
#define PN printf("\n")

void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a=c;}
ll max2(ll a,ll b){return a>=b?a:b;}
ll min2(ll a,ll b){return a>=b?b:a;}
ll min3(ll a, ll b, ll c){return (a<=b && a<=c) ? a : b<=c ? b : c;}
ll max3(ll a, ll b, ll c){return (a>=b && a>=c) ? a : b>=c ? b : c;}
ll minn(ll n, ll a[n]){ll b=INF;rep(i,0,n) b=min2(b,a[i]);return b;}
ll maxn(ll n, ll a[n]){ll b=-INF;rep(i,0,n) b=max2(b,a[i]);return b;}
ll ABS(ll a){return a>=0?a:(-a);}
ll POW(ll a, ll b){ll c=1;rep(i,0,b) c*=a;return c;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
ll mod(ll n){return n%=MOD1;}
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}

typedef struct{ ll a , b;}fr;
int cmp1( const void *p, const void *q ) { return ((fr*)p) ->a - ((fr*)q)->a;}
int cmp2( const void *p, const void *q ) { return ((fr*)q) ->a - ((fr*)p)->a;}
void strsortup(fr*a,int n){qsort(a,n,sizeof(fr),cmp1);}
void strsortdown(fr*a,int n){qsort(a,n,sizeof(fr),cmp2);}

int main(void){
    // char ;
    ll n,k,ans=INF;
    scanf("%lld%lld",&n,&k);
    ll x[n];
    rep(i,0,n){
        scanf("%lld",&x[i]);
    }
    rep(i,0,n-k+1){
        if(x[i]*x[i+k-1]>=0){
            if(x[i]>0) ans=min2(ans,x[i+k-1]);
            else ans=min2(ans,ABS(x[i]));
        }else{
            ans=min2(ans, x[i+k-1]-x[i]+ min2(ABS(x[i]),x[i+k-1]) );
        }
    }

    
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
#include <vector> 
# include <cstdint>
#define FOR(i,l,r) for(int i=(l);i<(r);++i)
#define RFOR(i,l,r) for(int i=(l);i>=(int)(r);i--)
#define rep(i,n)  FOR(i,0,n)
#define rrep(i,n)  RFOR(i,n-1,0)

using namespace std;
#define int long long
using ll = long long;
const int MX = 1e6;
const ll inf = 1e13;
const int mod = 1e9+7;

signed main() {
    int n,m;
    cin >> n >> m;
    vector<vector<int>> a(m);
    vector<int> p(m);
    rep(i,m) {
        int k;
        cin>> k;
        rep(j,k) {
            int x;
            cin >> x;
            x--;
            a[i].push_back(x);
        }
    }
    rep(i,m) {
        
        cin >> p[i];
    }
    int ans = 0;
    rep(i,1<<n) {
        int cnt = 0;
        rep(j,m) {
            int tm = 0;
            for(auto s: a[j]) {
                int sw = (i>>s)&1;
                tm+=sw;
            }
            if(tm%2==p[j])cnt++;
        }
        if(cnt==m)ans++;
    }
    cout << ans << endl;



    return 0;
}



Measured memory_bytes: 3624
#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 N, K;
    cin >> N >> K;

    ll ans = 0;
    ll left = 0;
    ll right = N;
    REPi(i,1,N+2){
        if(K <= i){
            ll num = right - left + 1;
            //printf("%lld %lld\n", left, right);
            ans += num;
            ans %= MOD;
        }
        left += i;
        right += N-i;
    }

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


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

#define REP(i, s, n) for (int i = s; i < n; ++i)
#define rep(i, n) REP(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define IINF INT_MAX
#define LLINF LLONG_MAX
#define DEBUG false

#define MAX_V 100
#define INF INT_MAX

int main()
{
    int n;
    cin >> n;
    vector<int> v(n);
    rep(i, n)
    {
        cin >> v[i];
    }
    int count = 1;
    int now = v[0];
    while (true)
    {
        if (now == 2)
        {
            break;
        }
        now = v[now - 1];
        count++;

        if (n < count)
        {
            count = -1;
            break;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 768
#include<set>
#include<map>
#include<cmath>
#include<queue>
#include<stack>
#include<vector>
#include<cstdio>
#include<string>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;

long long n,k,ans,ans1;

int main()
{
//    cout<< (1&1);
//    cout<<(1&0);
//    cout<<(0&0);
//    cout<<(2&1);
//    cout<<(-1&1);
	cin>>n>>k;
	if(k&1)
	{
		ans=n/k;
		printf("%lld\n",ans*ans*ans);
	}
	else
	{
		ans1=(n+k/2)/k;
		ans=n/k;
		printf("%lld\n",ans*ans*ans+ans1*ans1*ans1);
	}
}



Measured memory_bytes: 256
/*
 * wafuIroha.cpp
 *
 *  Created on: 2020/02/23
 *      Author: black
 */
#include <iostream>
#include <string>
using namespace std;

int main(){
	int n, m;
	cin >> n >> m;

	string *a = new string[n];
	string *b = new string[m];

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

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

	int count = 0;

	for(int i = 0; i < n-m+1; ++i){
		count = 0;
		for (int j = 0; j < n; ++j){
			if (a[j].substr(i, m) == b[count]){
				count++;
				if (count == m){
					cout << "Yes" << endl;
					return 0;
				}
			}
			else{
				count = 0;
			}
		}

	}

	cout << "No" << endl;

	return 0;
}


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

int main() {
 int N;
 cin >> N;
 vector<string>S(N);
  
 for(int i=0;i<N;i++){
  cin >> S.at(i);
 }
  
 int countAC = 0,countWA = 0,countTLE = 0,countRE = 0;
  
  for(int i=0;i<N;i++){
   if(S.at(i) == "AC"){
    countAC++;
   }
   else if(S.at(i) == "WA"){
    countWA++;
   }
   else if(S.at(i) == "TLE"){
    countTLE++;
   }
   else if(S.at(i) == "RE"){
    countRE++;
   }
  }
  cout << "AC" << " x " << countAC << endl;
  cout << "WA" << " x " << countWA << endl;
  cout << "TLE" << " x " << countTLE << endl;
  cout << "RE" << " x " << countRE << endl;
}
  

Measured memory_bytes: 6404