akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef long double D;
//typedef complex<D> P;
#define F first
#define S second
const ll MOD=1000000007;
//const ll MOD=998244353;

template<typename T,typename U>istream & operator >> (istream &i,pair<T,U> &A){i>>A.F>>A.S; return i;}
template<typename T>istream & operator >> (istream &i,vector<T> &A){for(auto &I:A){i>>I;} return i;}
template<typename T,typename U>ostream & operator << (ostream &o,const pair<T,U> &A){o<<A.F<<" "<<A.S; return o;}
template<typename T>ostream & operator << (ostream &o,const vector<T> &A){int i=A.size(); for(auto &I:A){o<<I<<(--i?" ":"");} return o;}


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;
  cin>>N;
  vector<ll> A(N);
  cin>>A;
  ll ans=1;
  ll cnt=0;
  for(ll i=0;i<N;i++){
    (ans*=cnt+1)%=MOD;
    if(A[i]>=cnt*2+1){
      cnt++;
    }
  }
  cout<<ans<<endl;
  
  return 0;
}


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

int main(){

    int A, B, C, D;
    cin >> A >> B >> C >> D;
    int ans = 0;
    for(int i = 0 ; i <= 100; i++){
        if(A <= i && i < B && C <= i && i < D)ans++;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    vector<int> v;
    for(int i = 0;i < n;i++)
    {
        int x;
        cin >> x;
        v.push_back(x);
    }
    int count = 0;
    for(int i = 0;count < 3 && i < n;i++)
    {
        if(v.at(i) != i + 1)
        {
            count++;
        }
    }
    if(count == 3)
    {
        cout << "NO";
    }
    else
    {
        cout << "YES";
    }
        
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

#define N 101

#define A 0
#define B 1
#define C 2

void Depth_First_Search(void);
void visit(int);
int next(int);
void push(int);
void pop(void);

int ori[N][N];
int judgement[N],fir[N],sec[N],tc,numord[N];
int n,S[N],top=-1;

int main()
{
  int i,j,a,b,c;

  for(i=1;i<= N;i++){
    for(j=1;j<=N;j++){
      ori[i][j]=0;
    }
  }

  scanf("%d",&n);

  for(i = 1; i <= n; i++){
    scanf("%d %d",&a,&b);
    for(j = 1; j <= b; j++){
      scanf("%d",&c);
      ori[a][c] = 1;
    }
  }

  Depth_First_Search();

  return 0;
}

void Depth_First_Search()
{
  int i;
  for(i=1;i<=n;i++){
    judgement[i] = A;
  }

  for(i=1;i<=n;i++){
    if(judgement[i]==A) visit(i);
  }

  for(i=1;i<=n;i++){
    printf("%d %d %d\n",i,fir[i],sec[i]);
  }
}

void visit(int i)
{
  int numtop,x;

  push(i);
  judgement[i]=B;
  tc++;
  fir[i]=tc;

  while(top!=-1){
    numtop=S[top];
    x=next(numtop);

    if(x!=-1){
      if(judgement[x]==A){
	       judgement[x]=B;
         tc++;
	       fir[x]=tc;
	        push(x);
        }
      }

    else {
      pop();
      judgement[numtop]=C;
      tc++;
      sec[numtop]=tc;
    }
  }
}

int next(int t)
{
  int i;

  for(i=numord[t]+1;i<=n;i++){
    numord[t]=i;
    if(ori[t][i]) return i;
  }
  return -1;
}

void push(int x)
{
  top++;
  S[top]=x;
}

void pop()
{
  top--;
}



Measured memory_bytes: 2112
#if defined(_WIN32)
#include "stdc++.h"
#else
#include <bits/stdc++.h>
#endif

using ulong = unsigned long;
using ll = long long;
using ull = unsigned long long;

using namespace std;
using P = pair<int, int>;
using LP = pair<ll, ll>;
using PP = pair<int, P>;
using LPP = pair<ll, LP>;

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

	int a, b, c, d;
	cin >> a >> b >> c >> d;

	if(a + b > c + d)
	{
		cout << "Left" << endl;
	}
	else if (a + b == c + d)
	{
		cout << "Balanced " << endl;
	}
	else if (a + b < c + d)
	{
		cout << "Right" << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std; 
inline int read(){
	register int x=0;
	register bool f=0;
	register char c=getchar();
	while(c<'0'||c>'9'){
		if(c=='-') f=1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=(x<<3)+(x<<1)+c-48;
		c=getchar();
	}
	return f?-x:x;
}
char cr[200],str[200];int tt;
inline void print(int x,char k='\n') {
    if(!x) putchar('0');
    if(x < 0) putchar('-'),x=-x;
    while(x) cr[++tt]=x%10+'0',x/=10;
    while(tt) putchar(cr[tt--]);
    putchar(k);
}
const int inf=1000000007 ;
const int maxn=50000;
struct Edge{
    int nxt,to,val;
}e[2000200];
int num=1,h[maxn],s,t,sum;
queue <int> q;
void add(int from,int to,int dis){
    e[++num].nxt=h[from];
    e[num].to=to;
    e[num].val=dis;
    h[from]=num;
    e[++num].nxt=h[to];
    e[num].to=from;
    e[num].val=0;
    h[to]=num;
}
int n,m,maxflow,dep[maxn];
bool mp[350][350];
int x[8]={1,1,-1,-1,2,2,-2,-2},y[8]={2,-2,2,-2,1,-1,1,-1}; 
bool bfs(int s,int t){
	memset(dep,0x3f,sizeof(dep));
	while(!q.empty()) q.pop();
    dep[s]=0;
    q.push(s);
    while(!q.empty()){
        int u=q.front();q.pop();
        for (int i=h[u];i;i=e[i].nxt){
        	int v=e[i].to;
            if(dep[v]>inf&&e[i].val){
                dep[v]=dep[u]+1;
                q.push(e[i].to);
            }
        }
    }
    if (dep[t]<inf) return true;
    return 0;
}
int dfs(int u,int t,int lim){
    if (!lim||u==t)return lim;
    int flow=0,f;
    for (int i=h[u];i;i=e[i].nxt){
        int v=e[i].to;
        int &w=e[i].val;
        if(dep[v]==dep[u]+1&&(f=dfs(v,t,min(lim,w)))){
            flow+=f;
            lim-=f;
            w-=f;
            e[i^1].val+=f;
            if(!lim) break;
        }
    }
    if(!flow) dep[u]=inf;
    return flow;
}
void dinic(int s,int t){
    while(bfs(s,t)){
		maxflow+=dfs(s,t,inf);
	}
}
int b[550][550],ans[550][550],a[550][550];
int f[550];
vector<int> c[205][205];
int col(int x){
	return (x-1)/m+1;
}
void pop(int x, int i,int j){
	b[i][j]=c[i][x].back(),c[i][x].pop_back();
}
void work(int id) {
	for(int i=1;i<=n;i++)add(s,i,1),add(i+n,t,1);
        dinic(s,t);
    for(int i=n+1;i<=n+n;i++)
        for(int j=h[i];j;j=e[j].nxt)
            if(e[j].val)e[j].val=0,pop(i-n,e[j].to,id);
}
void ins(int i,int x){
	c[i][col(x)].push_back(x);
	add(i,n+col(x),1);
}
int main(){
	s=23333;t=22333;
	n=read(),m=read();
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++){
        	a[i][j]=read();ins(i,a[i][j]);
		}
    for(int i=1;i<=m;i++) work(i);
    for(int i=1;i<=n;i++){
    	for (int j=1;j<m;j++)
            print(a[col(b[i][j])][j]=b[i][j],' ');
        print(a[col(b[i][m])][m]=b[i][m]);
	}
    for(int i=1;i<=n;i++){
    	for (int j=1;j<m;j++) 
			print(a[i][j],' ');
		print(a[i][m]);
	}  
	return 0;
}

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

int main()
{
  int N, K;
  int x[110];
  int res=0;
  cin >> N>>K;
  rep(i,N) cin >> x[i];

  rep(i,N){
    if(x[i]<K-x[i]) res+= x[i];
    else res+=(K-x[i]);
  }

  cout << res*2 << endl;
}

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

int main(){
    ll n;
    cin >> n;
    ll nmax = n;
    int sum = 0;
    int msn;
    int degit = 1;
    while(true){
      if(10 > n){
        msn = n;
        sum += n;
        break;
      }
      degit++;
      sum += n % 10;
      n = n / 10;
    }
    if(sum == 0)sum = n;

    int subsum = 9 * (degit-1) + (msn-1);
    cout << max(sum,subsum) << endl;
    return 0;
}

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

//define
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define SUB(a, b) a = (a+mod-b)%mod
#define MUL(a, b) a = (a * b) % mod
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define dmp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define fi first
#define se second

//template
template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p){
  os << p.first << " " << p.second;return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &v){
  for (auto it = v.begin();it != v.end();++it){
    if (it != v.begin())os << " ";os << *it;
  }return os;
}
template<typename T, int SIZE>
int array_length(const T (&)[SIZE]){return SIZE;}
template<typename T, int N>
void print(const T (&a)[N], int s = N, int t = -1, bool f = true){
	if(t == -1){rep(i,s){if(i)cout << " ";cout << a[i];}}
	else repi(i,s,t){if(i!=s)cout << " ";cout << a[i];}
	if(f)cout << "\n";
}
template<typename T, int N1, int N2>
void print(const T (&a)[N1][N2], int h = N1, int w = N2){
	rep(i,h){rep(j,w){cout << a[i][j] << " \n"[j==w-1];}}
}

//typedef
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef pair<P, int> Pi;
typedef vector<int> vi;
typedef deque<int> dq;
const int inf = 1e9+7;
const int INF = 1e18+7;

struct st{int win, lose;char c;};
bool comp(const st& a, const st& b){
	if(a.win == b.win)return a.lose < b.lose;
	return a.win > b.win;
}

st a[30];
signed main(){
	while(1){
		int n;
		scanf("%lld", &n);
		if(n == 0)break;
		rep(i,n)a[i].win = a[i].lose = 0;
		char c;int tmp;
		rep(i,n){
			scanf(" %c", &c);
			a[i].c = c;
			rep(j,n-1){
				scanf("%lld", &tmp);
				if(tmp == 0)a[i].win++;
				if(tmp == 1)a[i].lose++;
			}
		}
		sort(a, a+n, comp);
		rep(i,n)printf("%c\n", a[i].c);
	}
	return 0;
}







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

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	int ab, ac, bc;
	ab = a + b;
	ac = a + c;
	bc = b + c;

	if (a == bc || b == ac || c == ab) {
		cout << "Yes" << endl;
		return 0;
	}
	cout << "No" << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
long long modpow(long long a, long long b){
	a %= MOD;
	long long res = 1;
	while (b > 0){
		if (b % 2 == 1) res = res * a % MOD;
		a = a * a % MOD;
		b = b / 2;
	}
	return res;
}
int main(){
  int N, M;
  cin >> N >> M;
  if (M < N){
    cout << 0 << endl;
  } else {
    vector<vector<vector<long long>>> dp(N + 1, vector<vector<long long>>(N + 1, vector<long long>(2, 0)));
    //dp[j][k][0]: i日経過時点で町1と双方向で繋がる町がj個、一方向で繋がる町がk個で、前者にいる
    //dp[j][k][1]: i日経過時点で町1と双方向で繋がる町がj個、一方向で繋がる町がk個で、後者にいる
    //A: 双方向 B: 一方向 C: なし
    dp[1][0][0] = 1;
    for (int i = 0; i < M; i++){
      //配列使いまわし
      vector<vector<vector<long long>>> dp2(N + 1, vector<vector<long long>>(N + 1, vector<long long>(2, 0)));
      for (int j = 0; j <= N; j++){
        for (int k = 0; k <= N; k++){
          int r = N - j - k;
          if (r < 0){
            continue;
          }
          //A->A
          dp2[j][k][0] = (dp2[j][k][0] + dp[j][k][0] * j) % MOD;
          //A->B
          dp2[j][k][1] = (dp2[j][k][1] + dp[j][k][0] * k) % MOD;
          //A->C
          if (k < N) dp2[j][k + 1][1] = (dp2[j][k + 1][1] + dp[j][k][0] * r) % MOD;
          //B->A
          dp2[j + k][0][0] = (dp2[j + k][0][0] + dp[j][k][1] * j) % MOD;
          //B->B
          dp2[j][k][1] = (dp2[j][k][1] + dp[j][k][1] * k) % MOD;
          //B->C
          if (k < N) dp2[j][k + 1][1] = (dp2[j][k + 1][1] + dp[j][k][1] * r) % MOD;
        }
      }
      dp = dp2;
    }
    cout << (dp[N][0][0] + dp[N][0][1]) % MOD;
  }
}

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

using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<lint> vl;
typedef pair<lint,lint> pll;
#define mpr make_pair

template <typename T>
struct SetSum {
  std::set<T> st;
  T sum;

  void insert(T t){
    st.insert(t);
    sum += t;
  }

  void erase(T t){
    st.erase(st.find(t));
    sum -= t;
  }

  void erase(typename set<T>::iterator it){
    sum -= *it;
    st.erase(it);
  }

  typename set<T>::iterator begin(){
    return st.begin();
  }

  typename set<T>::reverse_iterator rbegin(){
    return st.rbegin();
  }

  lint size(){
    return st.size();
  }

  bool empty(){
    return st.empty();
  }

  lint count(T t){
    return st.count(t);
  }

};

template <typename T>
struct SetPartSum {
  SetSum<T> low, high;
  function<bool(T, T)> less = [](T t1, T t2){
    return t1 < t2;
  };

  void add(T t){
    if (less(t, *high.begin())){
      low.insert(t);
    } else {
      high.insert(t);
      low.insert(*high.begin());
      high.erase(high.begin());
    }
  }

  bool needShink = false;
  void remove(T t){
    if (low.count(t)){
      low.erase(t);
    } else {
      high.erase(t);
      if (low.empty()){
        needShink = true;
      } else {
        high.insert(*low.rbegin());
        low.erase(*low.rbegin());
      }
    }
  }

  void expand(){
    assert(low.size());
    high.insert(*low.rbegin());
    low.erase(*low.rbegin());
  }

  void shink(){
    if (needShink){
      needShink = false;
      return;
    }
    assert(high.size());
    low.insert(*high.begin());
    high.erase(high.begin());
  }
};



set<lint> tp0, tp1;
//SetSum<lint> sdb, ssin;
SetPartSum<lint> sp;

lint getdb(){
  if (sp.high.empty()) return 0;
  if (tp0.size()){
    if ( *tp0.rbegin() >= *sp.high.begin())
      return sp.high.sum;
   else
    return sp.high.sum - *sp.high.begin() + *tp0.rbegin();
  } else {
    return sp.high.sum - *sp.high.begin();
  }
}

void add(lint d, lint tp){
  if (tp == 0) tp0.insert(d);
  else tp1.insert(d);

  sp.add(d);

  if (tp == 1){
    sp.expand();
  }
}

void rm(lint d, lint tp){
  if (tp == 0) tp0.erase(d);
  else tp1.erase(d);

  sp.remove(d);

  if (tp == 1){
    sp.shink();
  }
}

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

    int r, c, k; cin>>r>>c>>k;

    vector<vl> mp(r, vl(c, 0));
    while(k--){
      lint r, c, v;
      cin>>r>>c>>v;
      r--, c--;
      mp[r][c] = v;
    }

    vector<vector<vl>> dp(r, vector<vl>(c, vl(4, -1)));

    function<lint(int, int, int)> res = [&](int row, int col, int c)->lint{
      lint &ans = dp[row][col][c];
      if (ans != -1) return ans;
      ans = 0;
      if (row == 0 && col == 0){
        if (c == 0) return ans = 0;
        else return ans = mp[0][0];
      }

      if (col > 0){
        ans = max(ans, res(row, col-1, c));
        if (c > 0) ans = max(ans, res(row, col-1, c-1) + mp[row][col]);
      }
      if (row > 0){
        ans = max(ans, res(row-1, col, 3));
        if (c > 0) ans = max(ans, res(row-1, col, 3) + mp[row][col]);
      }
      return ans;
    };

    cout<<res(r-1, c-1, 3);
}


Measured memory_bytes: 707508
#import decimal
#decimal.getcontext().prec==500 Floatの桁数を500まで増やす
#Decimal(c).sqrt() それで平方根を求める
#Decimal(1) / Decimal(7) 1/7
from collections import *
from itertools import *
from bisect import *
from heapq import *
import copy
import math
from fractions import gcd
import sys
#input = sys.stdin.readline


#N=int(input())

N,K=map(int,input().split())
A=list(map(int,input().split()))
A.sort(reverse=True)

M=sum(A)
maxi=round(M**.5)+2
lst=[]
i=2

for i in range(1,maxi):
    if M%i==0:
        lst.append(i)
        lst.append(M//i)


lst.sort(reverse=True)
for l in lst:
    B=deque(sorted([i%l for i in A if i%l!=0]))
    _K=K
    #print(B,l)
    while len(B)>=2 and _K:

        n=min(B[0],l-B[-1],_K)
        B[0]-=n
        B[-1]+=n
        _K-=n
        if not B[0]%l:
            B.popleft()
        if not B[-1]%l:
            B.pop()

    if not B:
        print(l)
        exit()


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

#define FILE
#define fr first
#define se second

using namespace std;

const long long N = 2e5 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;

int used[N][4];
int f(char c){
    return (c == 'R' ? 0 : c == 'G' ? 1 : 2);
}
int main()
{
    ios_base::sync_with_stdio(false);

    int n;
    string s;
    cin >> n >> s;
    vector<int> g[4];
    s = '#' + s;
    for(int i = 1; i <= n; i ++){
        g[f(s[i])].push_back(i);
        used[i][f(s[i])] = 1;
    }
    long long cnt = 0;
    for(int i = 1; i <= n; i ++){
        for(int j = i + 1; j <= n; j ++){
            if(s[i] == s[j]){
                continue;
            }
            set<char> c = {'R', 'G', 'B'};
            c.erase(s[i]);
            c.erase(s[j]);
            int x = f(*c.begin());
            int sz = (int)g[x].size();
            int pos = lower_bound(g[x].begin(), g[x].end(), j + 1) - g[x].begin();
            if(pos == sz){
                continue;
            }
            int dist = j - i;
            int canNot = j + dist;
            cnt += sz - pos - used[canNot][x];
        }
    }
    cout << cnt << "\n";
}



Measured memory_bytes: 3756
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#define REP(i, m, n) for(int i=int(m);i<int(n);i++)
#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s, e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

//#define LOCAL 1
#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR
#endif

//改造
typedef long long int ll;
using namespace std;

//ここから編集する

int main() {
    vector<int> v;
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        int tmp;
        scanf("%d", &tmp);
        v.push_back(tmp);
    }

    int x = 0;
    int y = 0;
    int z = 0;

    for (int i = 0; i < n; i++) {
        if (v[i] % 4 == 0) {
            y++;
        } else {
            if (v[i] % 2 == 0) {
                x++;
            } else {
                z++;
            }
        }
    }
/*

    if (x == 1) {
        z++;
        if (z <= y + 1 && y != 0 || z == 0) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    } else {
        if (z <= y && y != 0 || z == 0) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }

*/

    if (x == 0) {
        if (z <= y + 1) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    } else {
        z++;
        if (z <= y + 1) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }

    return 0;
}

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

#define rep(i, a, b) for(int i = (a); i < (b); ++i)
#define per(i, a, b) for(int i = (b)-1; i >= (a); --i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fst first
#define snd second

template<class T> bool ckmin(T& a, const T& b) { return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pii> vii;

int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);

  int n, k;
  cin >> n >> k;

  vi ans(n+1);
  rep(i,0,k) {
    int d;
    cin >> d;

    rep(j,0,d) {
      int l;
      cin >> l;
      ++ans[l];
    }
  }

  int out=0;
  rep(i,1,n+1) if (ans[i] == 0) ++out;
  cout << out << '\n';
}


Measured memory_bytes: 3652
#include <iostream>
#include <algorithm>
#include <numeric>
#include <map>
#include <vector>
#include <climits>
#include <cmath>

long long int func(int start_polarity, std::vector<long long int>& a, int n) {
  long long int count = 0;
  signed long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i];
    if ((start_polarity == +1 && (i % 2 == 1)) ||
        (start_polarity == -1 && (i % 2 == 0))) {
      //std::cout << "-" << sum << std::endl;
      if(sum >= 0) {
        count += sum + 1;
        sum = -1;
      }
    } else if ((start_polarity == +1 && (i % 2 == 0)) ||
               (start_polarity == -1 && (i % 2 == 1))) {
      //std::cout << ":" << sum << std::endl;
      if(sum <= 0) {
        count += -sum + 1;
        sum = 1;
      }
    }
  }
  return count;
}

int main(void) {
  int n;
  std::cin >> n;

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

  long long int count = std::min(func(-1, a, n), func(+1, a, n));

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

  return 0;
}


Measured memory_bytes: 1024
N, M = map(int, input().split())
num = [-1 for i in range(N)]
for m in range(M):
    s, c = map(int, input().split())
    if s == 1 and c == 0 and N != 1:
        print(-1)
        import sys
        sys.exit(0)
    elif num[s-1] == -1:
        num[s-1] = c
    elif num[s-1] != c:
        print(-1)
        import sys
        sys.exit(0)
for n in range(N):
    if n == 0 and num[n] == -1:
        if N == 1:
            num[0] = 0
        else:
            num[0] = 1
    elif num[n] == -1:
        num[n] = 0
print("".join(map(str, num)))


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int a[101];
string s;
int main(){
	int n;
	bool f=false;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
		if(a[i]%2==0){
			if(a[i]%3!=0&&a[i]%5!=0){
				f=true; 
				s+="DENIED"; 
				break;
			}
		}
	}
	if(!f) s+="APPROVED";
	cout<<s;
	return 0;
} 

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>

using namespace std;
int main()
{
  int n;
  cin>>n;

  int ans=0;

  if(n<135 && n>=105) ans=1;
  else if(n<165 && n>=105) ans=2;
  else if(n<189 && n>=105) ans=3;
  else if(n<195 && n>=105) ans=4;
  else if(n<=200 && n>=105) ans=5;
  else ans=0;

  cout<<ans<<endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
C - Minimization
https://beta.atcoder.jp/contests/abc101/tasks/arc099_a

"""
import sys
from sys import stdin
input = stdin.readline


def solve(N, K, arr):
    ans = 1
    while N > K:
        N -= (K - 1)
        ans += 1
    return ans


def main(args):
    N, K = map(int, input().split())
    arr = [int(a) for a in input().split()]
    ans = solve(N, K, arr)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])


Measured memory_bytes: 13304
import numpy as p
n,M=map(int,input().split())
l=n*3+1
r=p.roll
d=p.zeros((l,n*5),p.int64)
d[0][0]=1
for i in range(1,l):j,k=i-1,i-2;d[i]=(d[i-3]*k*j+r(d[k],-1)*j+r(d[j],1))%M
print(d[-1][:l].sum()%M)


Measured memory_bytes: 481492
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n;
    cin >> n;
    int p[n];
    int x[n];
    rep(i, 0, n) {
        cin >> p[i];
        x[i] = p[i];
    }
    sort(x, x + n);
    int cnt = 0;
    rep(i, 0, n) {
        if (p[i] != x[i]) cnt++;
    }
    if (cnt <= 2) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}


Measured memory_bytes: 256
import itertools
n=int(input())
seq=list(map(int,input().split()))
ans=0
for li in list(itertools.combinations(seq,3)):
  if(li[0]+li[1]>li[2] and li[1]+li[2]>li[0] and li[0]+li[2]>li[1]):
    if(li[0]!=li[1] and li[1]!=li[2] and li[0]!=li[2]):
      ans+=1

print(ans)

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

int main(int argc, char const *argv[])
{
	char ch;
	cin>>ch;

	if(ch >= 65 && ch <=90)
		cout<<"A"<<endl;
	else if(ch >= 97 && ch <=122)
		cout<<"a"<<endl;
	return 0;
}

Measured memory_bytes: 3568
#include<bits/stdc++.h>
using namespace std;
const int N=100010;
int n;
struct data{
    int x,y;
}p[N];
int f[N<<1];
int find(int x){
    return f[x]==x?x:f[x]=find(f[x]);
}
vector<int>X[N<<2],Y[N<<2];
int main(){
//	freopen("1.in","r",stdin);
    cin>>n;
    for(int i=1;i<=n;++i){
        scanf("%d%d",&p[i].x,&p[i].y);
	}
	for(int i=1;i<(N<<1);++i)f[i]=i;
	for(int i=1;i<=n;++i){
	    int x=find(p[i].x),y=find(p[i].y+N);
	    if(x==y)continue;
	    f[y]=x;
	}
	for(int i=1;i<N;++i){
	    int t=find(i);
	    X[t].push_back(i);
	    t=find(i+N);
	    Y[t].push_back(i);
	}
	long long ans=0;
	for(int i=1;i<(N<<1);++i){
		if(!X[i].size())continue;
	    sort(X[i].begin(),X[i].end());
	    X[i].erase(unique(X[i].begin(),X[i].end()),X[i].end());
	    sort(Y[i].begin(),Y[i].end());
	    Y[i].erase(unique(Y[i].begin(),Y[i].end()),Y[i].end());
//	    for(vector<int>::iterator it=X[i].begin();it!=X[i].end();++it)cout<<*it<<' ';puts("");
//	    for(vector<int>::iterator it=Y[i].begin();it!=Y[i].end();++it)cout<<*it<<' ';puts("");
//	    puts("");
	    ans+=1ll*X[i].size()*Y[i].size();
	}
	cout<<ans-n<<endl;
}

Measured memory_bytes: 26752
#include <iostream>
#include <map>
#include <queue>
#include <algorithm>
using namespace std;
#define rep(i, n)for(int i=0; i<n; i++)

int main(){
  int N;
  cin >> N;
  int a[N];
  rep(i, N)
    cin >> a[i];
  //

  map<int, int> m;
  rep(i, N)
    m[ a[i] ]++;

  long long ans = 0;
  for(auto tmp : m)
    if(tmp.first < tmp.second)
      ans += (tmp.second-tmp.first);
    else if(tmp.second < tmp.first)
      ans += tmp.second;
      
  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 8380
import bisect





def index(a, x):
    'Locate the leftmost value exactly equal to x'
    i = bisect.bisect_left(a, x)
    if i != len(a) and a[i] == x:
        return True
    return False




def resolve():
    N=int(input())
    s=[int(i) for i in input()]
    dpt3=[False for i in range(1000)]    
    dpt2=[]
    dpt1=[]
    bisect.insort(dpt1,s[0])
    bisect.insort(dpt1,s[1])
    bisect.insort(dpt1,s[2])
    bisect.insort(dpt2,s[0]*10+s[1])
    bisect.insort(dpt2,s[1]*10+s[2])
    bisect.insort(dpt2,s[0]*10+s[2])

    dpt1=list(set(dpt1))
    dpt1.sort()
    dpt2=list(set(dpt2))
    dpt2.sort()

    cc=[0 for i in range(100)]
    cc2=[0 for i in range(10)]
    cc[s[2]]=1
    for i in dpt2:
        cc2[i%10]+=1


    dpt3[s[0]*100+s[1]*10+s[2]]=True
    count3=1
    count2=len(dpt2)
    count1=len(dpt1)
    for i in s[3:]:

        if count3==1000:
            break
        if cc[i]!=100:
            for j in dpt2:
                tn=j*10+i


                if not dpt3[tn]:
                    dpt3[tn]=True
                    cc[i]+=1
                    count3+=1
        if cc2[i]!=10:        
            for j in dpt1:
                tn=j*10+i
                if not index(dpt2,tn):
                    bisect.insort(dpt2,tn)
                    cc2[i]+=1
        if not index(dpt1,i):
            bisect.insort(dpt1,i)
    count3=0
    for i in dpt3:
        if i:
            count3+=1
    print(count3)

if __name__ == "__main__":
    resolve()

Measured memory_bytes: 51160
use std::str::FromStr;
use std::fmt::Debug;
use std::cmp;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where T: FromStr, <T as FromStr>::Err : Debug{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().split_whitespace().map(|c| T::from_str(c).unwrap()).collect()

}

#[allow(dead_code)]
fn read_as_string() -> String{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn main(){
    let line = read_as_vec::<usize>();
    let (n, k) = (line[0], line[1]);

    let p = read_as_vec::<f64>().into_iter().map(|value| (value+1.0)/2.0).collect::<Vec<f64>>();


    let mut cur = p.iter().take(k).sum::<f64>();
    let mut ans = cur;
    for i in k..n{
        cur -= p[i-k];
        cur += p[i];
        if cur > ans{
            ans = cur;
        }
    }

    println!("{:.12}", ans);
}


Measured memory_bytes: 8444
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = n; i >= 0; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 30;
const int M = 1e6+5;
int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i, n) cin >> a[i];
	
	vector<int> cnt(M, 0);
	for (auto x : a) {
		if (cnt[x] != 0) {
			cnt[x] = 2;
			continue;
		} 
		for (int j = x; j < M; j += x) cnt[j]++;
	}
	int ans = 0;
	for (auto x : a) {
		if (cnt[x] == 1) ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 7968
#include <bits/stdc++.h>
using namespace std;
#define inf 999999999
#define loop(i, a, b) for (int i = (a), i##len = (b); i < i##len; ++i)
#define rep(i, n) loop(i, 0, n)
#define lin long long
#define lfl long double

int t,x;

int main(void)
{
    cin >> t >> x;

    double res = (double)t / (double)x;

    cout << res << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
   int N,M;
   int temp1;
   int ans=-1;
   
   cin >> N >> M;
   temp1 =M/N;
   if(M%N==0)
   {
       ans=temp1;
   }
   else
   {
       for(int i=temp1;i>0;i--)
       {
           if(M%i==0){
               ans=i;
               break;
           }
       }
       
   }
  
  
   cout << ans;
   return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cfloat>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <memory>
#include <string>

#include <algorithm>
#include <complex>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>

using namespace std;

#ifdef _MSC_VER
#define _CRT_SECURE_NO_WARNINGS
#define __typeof__ decltype
#endif

#define ITER(c)         __typeof__((c).begin())
#define FOREACH(it, c)  for (ITER(c) it=(c).begin(); it != (c).end(); ++it)
#define RITER(c)        __typeof__((c).rbegin())
#define RFOREACH(it, c) for (RITER(c) it=(c).rbegin(); it != (c).rend(); ++it)
#define REP(i, n)       REPEAT(i, 0, n)
#define REPEAT(i, k, n) for (int i = (k); i < (n); ++i)
#define REVREP(i, n)    for (int i = ((n)-1); i >= 0; --i)
#define ESIZEOF(A)      (sizeof(A)/sizeof((A)[0]))
#define MIN(p1,p2)      (((p1)<(p2))?(p1):(p2))
#define MAX(p1,p2)      (((p1)>(p2))?(p1):(p2))
#define CIN_NO_SYNC     do { cin.tie(0); ios_base::sync_with_stdio(false); } while(0)

bool add(char *d, int n, string &s){
    int l = s.length();
    int j = 0;
    int carry = 0;
    while(carry || j < l){
        if(j >= n) return true;
        int dgt = (j < l) ? (s[l-j-1] - '0') : 0;
        d[j] = d[j] + dgt + carry;
        carry = d[j] / 10;
        d[j] %= 10;
        j++;
    }
    return false;
}
void print(const char *d, int n){
    bool pf = false;
    for(int i = n-1; i >= 0; i--){
        if(d[i] != 0 || pf || i == 0){
            pf = true;
            printf("%c", '0' + d[i]);
        }
    }
    printf("\n");
}

int main(void){
    CIN_NO_SYNC;
    int n;
    cin >> n;
    char d[80];

    REP(i,n){
        string s1, s2;
        cin >> s1 >> s2;
        //cout << s1 << ":" << s2 << endl;
        memset(d, 0, sizeof(d));
        if(add(d, sizeof(d), s1) || add(d, sizeof(d), s2)){
            printf("overflow\n");
        } else {
            print(d, sizeof(d));
        }
    }
    return 0;
}

Measured memory_bytes: 1212
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
  
int const INF = 100 + (int) 1e9;
ll const INFL = 100 + (ll) 1e18;
  
int const size = 1e5 + 100;
int a[size];

int main() {
//    freopen("", "r", stdin);
//    freopen("", "w", stdout);
    int n;
    cin >> n;
    int co = 0;
    int ans = 0;
    for (int i = 0; i < n; i++) {
    	cin >> a[i];
    	if (a[i] == i + 1) {
    		co++;
    	}
    	else {
    		ans += (co + 1) / 2;
    		co = 0;
    	}
    }
    ans += (co + 1) / 2;
    			
    cout << ans << '\n';
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  vector<double> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
  }
    
  double ans = 0;
  
  for (int i = 0; i < N; i++) {
    ans += 1 / A.at(i);
  }
  
  ans = 1/ ans;
    
  cout << ans;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
	int k, x, min, max;
	scanf("%d %d", &k, &x);

	min = x - k + 1;
	max = x + k - 1;

	for(; ; min++) {
		printf("%d", min);
		if(min >= max) {
			break;
		}
		printf(" ");
	}
	printf("\n");
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <map>
#include <vector>

using namespace std;

int main(){
  int n;
  cin>>n;
  map<string,int>mp;
  vector<int> T(n);
  for(int i=0;i<n;i++){
    string s;
    int t;
    cin>>s>>t;
    mp[s]=i;
    T[i]=t;
  }
  string x;
  cin>>x;
  int sum=0;
  for(int i=mp[x]+1;i<n;i++)sum+=T[i];
  cout<<sum<<endl;
}


Measured memory_bytes: 3624
// @Author :- Gaurav Bharti
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define empb emplace_back
#define mp make_pair
#define F first
#define S second
#define vii vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define vpii vector<pii>
#define mapii map<int,int> 
#define mapll map<ll,ll>
#define all(a) a.begin(),a.end()
#define test int t; cin>>t; while(t--)
#define prec(n) fixed<<setprecision(n)
#define ItsFUN ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mod 1000000007

bool comp(const pair<ll,ll> &a, const pair<ll,ll> &b) {
	return (a.second < b.second) ;
}

ll binpow(ll a, ll b) {
	ll res = 1;
	while(b) {
		if(b&1) res = res * a;
		a = a*a;
		b = b >> 1;
	}

	return res;
}


/*
BHAI EFFORT DAAL
*/


int main(){
	ItsFUN;

	int n; cin >> n;
	vii x(n), y(n);

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

	int c = 0;
	for(int i = 0; i < n; ++i) {
		if(x[i]==y[i]) {
			++c;
			if(c>=3) {
				cout << "Yes\n";
				return 0;
			}
		}
		else c = 0;
	}

	cout << "No\n";

	return 0;
}



Measured memory_bytes: 3644
use proconio::*;
use proconio::marker::*;

type Ref = Box<Node>;
type Link = Option<Ref>;

const F: usize = 26;

#[derive(Default)]
struct Node {
    cnt: u32,
    next: [Link; F],
}

impl Node {
    fn new() -> Ref {
        Box::new(Node::default())
    }
    fn insert(&mut self, s: &[u8]) {
        let mut po = self;
        for c in s.iter() {
            po.cnt += 1;
            let k = (*c - b'a') as usize;
            po = po.next[k].get_or_insert_with(Node::new);
        }
        po.cnt += 1;
    }
    fn dfs(&self, s: &[u8]) -> (u32, [[u32; F]; F]) {
        let mut add = 0;
        let mut cnt = [[0u32; F]; F];
        let mut po = self;
        for c in s.iter() {
            let k = (*c - b'a') as usize;
            add += po.cnt - po.next.iter().map(|p| p.as_ref().map_or(0, |p| p.cnt)).sum::<u32>();
            for (x, (cnt, next)) in cnt[k].iter_mut().zip(po.next.iter()).enumerate() {
                if k == x {
                    continue;
                }
                *cnt += next.as_ref().map_or(0, |p| p.cnt);
            }
            po = po.next[k].as_ref().unwrap();
        }
        (add, cnt)
    }
}

#[fastout]
fn run() {
    input! {
        n: usize,
        s: [Bytes; n],
        q: usize,
        ask: [(Usize1, Bytes); q],
    }
    let mut root = Node::new();
    for s in s.iter() {
        root.insert(s);
    }
    let root = root;
    let mut memo = vec![];
    for s in s.iter() {
        memo.push(root.dfs(s));
    }
    for (k, p) in ask {
        let memo = &memo[k];
        let mut ans = memo.0 + 1;
        for (i, x) in p.iter().enumerate() {
            let x = (*x - b'a') as usize;
            let cnt = &memo.1[x];
            for y in p.iter().take(i) {
                let y = (*y - b'a') as usize;
                ans += cnt[y];
            }
        }
        println!("{}", ans);
    }
}

fn main() {
    run();
}


Measured memory_bytes: 309284
#include <cstdio>
char s[100005];
int main() {
  int n, a, b;
  scanf("%d%d%d\n", &n, &a, &b);
  scanf("%s", s);
  int sb = 0, total = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'a') {
      if (total < a + b) {
        puts("Yes");
        ++total;
      } else {
        puts("No");
      }
    } else if (s[i] == 'b') {
      if (total < a + b && sb < b) {
        puts("Yes");
        ++sb; ++total;
      } else {
        puts("No");
      }
    } else {
      puts("No");
    }
  }
  return 0;
}

Measured memory_bytes: 768
N=int(input())
A=list(map(int,input().split()))
Even = []
Odd = []
A.sort()
for a in A:
    if a % 2 == 0:
        Even.append(a)
    if a % 2 == 1:
        Odd.append(a)
if len(Odd) % 2 == 1:
    print('NO')
else:
    print('YES')
        
        

Measured memory_bytes: 14108
import sys
input = sys.stdin.readline
N, Q = map(int, input().split())
town = [[] for _ in range(N)]
for i in range(Q):
    place, year = map(int, input().split())
    town[place-1].append([year,i])

ans = []
k = 0
for item in town:
    index = k
    item.sort()
    index = str(index+1)
    while len(index) < 6:
        index = '0' + index
    for i in range(len(item)):
        num = str(i+1)
        while len(num) < 6:
            num = '0' + num
        xxx = index + num
        ans.append([item[i][1],xxx])
    k += 1

ans.sort()
for item in ans:
    print(item[1])


Measured memory_bytes: 48540
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define int long long
#define ld long double
#define fi first
#define se second
#define all(uiet) uiet.begin(),uiet.end()
#define read(UIET) for(int i = 0; i < n; ++i) cin >> UIET[i]
#define out(UIET) for(int i = 0; i < n; ++i) cout << UIET[i] << " "
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define vpp vector<pair< int, int > >
#define pll pair<int , int >
#define ppll pair < pll , pll >
#define debug(n1) cout << n1 << endl
#define len(a) ((int) (a).size())
#define endl "\n"
#define mod 1000000007
const int INF=(1LL<<60)-1;
bool isPerfectSquare(long double x) {   
    long double sr = sqrt(x); 
    return ((sr - floor(sr)) == 0); 
} 
bool isPrime(int x){
    for(int i = 2; i * i <= x; ++i){
        if(x % i == 0) return 0;
    }
    return 1;
}
int fun(int n){
    if(n & 1) return 3 * n + 1;
    else return n/2;
}
int32_t main(){
    SPEED;
    int n;
    cin >> n;
    int ans = 1;
    for(int i = 2; i <= n; ++i){
        ans = (ans * i) % mod;
    }
    cout << ans ;
}

Measured memory_bytes: 3652
import Data.Array
import Control.Monad

makeDPTable :: Int -> Int -> Array Int [Int] -> [[Int]] -> [[Int]]
makeDPTable n i abcList ans
 | i == 0    = makeDPTable n (i + 1) abcList $ (abcList ! 0):ans
 | i == n    = ans
 | otherwise = makeDPTable n (i + 1) abcList $ newAns:ans
   where newAns0 = ((abcList ! i) !! 0) + (max ((head ans) !! 1) ((head ans) !! 2))
         newAns1 = ((abcList ! i) !! 1) + (max ((head ans) !! 0) ((head ans) !! 2))
         newAns2 = ((abcList ! i) !! 2) + (max ((head ans) !! 0) ((head ans) !! 1))
         newAns  = [newAns0, newAns1, newAns2]

getABCList = map read . words <$> getLine :: IO [Int]

main = do
 n <- read <$> getLine :: IO Int
 abcList <- replicateM n getABCList
 print $ maximum $ head (makeDPTable n 0 (listArray (0, n - 1) abcList) [])


Measured memory_bytes: 203632
import sys
import math
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    N = int(inputs[0])
    transpotation = [
        int(inputs[1]),
        int(inputs[2]),
        int(inputs[3]),
        int(inputs[4]),
        int(inputs[5])
    ]

    bottleneck = 0

    for t in transpotation:
        if bottleneck == 0 or t < bottleneck:
            bottleneck = t
    power_bottleneck = math.ceil(N / bottleneck)
    return power_bottleneck + 4


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(6))
    print(ret)


Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int N,T,ans,now;
  cin >> N >> T;
  int before = 0;
  for (int i = 0; i < N; i++)
  {
    cin >> now;
    if (T >= now - before)
    {
      ans += now - before;
    }else
    {
      ans += T;
    }
    before = now;
  }
  ans += T;
  cout << ans << endl;
}

Measured memory_bytes: 256
def rec(n):
    if n>0:
        for i in range(n,0,-1):
            if i<=ans[-1]:
                ans.append(i)
                rec(n-i)
                ans.pop()
    else:
        if len(ans)!=0:
            print ((' ').join(map(str, ans[1:])))

while True:
    n = int(input())
    if n==0: break
    ans = [n]
    rec(n)

Measured memory_bytes: 7684
#include <iostream>
#include <climits>
#include <set>
#include <string>
#include <algorithm>
#include <vector>
#define MAX 1000000007


using namespace std;
#define ll long long
#define dbg if(0)
#define ISRANGE(val,lo,hi) ((lo<=val)&&(val<hi))



int main(){
    ll binlist[43];
    ll tmp=1;
    binlist[0]=0;
    for(int i=1;i<43;i++){
        binlist[i]=tmp;
        tmp*=2;
    }
    ll ans=0,a,b;
    cin>>a>>b;
    ll num=0;

    for(int i=41;i>1;i--){
        if(b<binlist[i])continue;
        else{
            dbg cout <<"bin:"<<binlist[i]<<endl;
            ll diff=0;
            if(binlist[i]<a){
                diff=(a-binlist[i])%binlist[i+1];
            }
            ll atama=b;
            dbg cout <<"atama"<<atama<<endl;
            ll ketsu=max(binlist[i],a);
            dbg cout <<"ketsu"<<ketsu<<endl;
            ll kouho=(atama-ketsu+1)%binlist[i+1];//そのbitはいくつあるのか
            dbg cout <<"kouho"<<kouho<<endl;
            ll s=(binlist[i]<=diff)?0:(binlist[i]-diff)%binlist[i];
            ll s2=(binlist[i]<diff)?0:(binlist[i]-diff);
            dbg cout <<"S"<<s<<endl;
            ll kazu=min(kouho,s2)+min(binlist[i],((kouho+diff)/(binlist[i+1]))*((kouho+diff)%binlist[i+1]));//1のbitはいくつか
            dbg cout <<"kazu"<<kazu<<endl;
            ll flg=(kazu%2);
            ans+=binlist[i]*flg;
            dbg cout <<"added "<<binlist[i]*flg<<endl;
        }
        dbg cout <<ans<<endl;
    }
    ans+=((b-a+1)%2==0)?((b-a+1)/2%2):(((b-a)/2)%2+a%2)%2;
    cout <<ans<<endl;

    return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <list>
using namespace std;
int main(void)
{
    ios_base::sync_with_stdio(false);
    bool flag=false;
    int n,num;
    string s;
    list<int> intlist;
    list<int>::iterator it;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> s;
        if(s=="insert"){
            cin >> num;
            intlist.push_front(num);
        }
        else if(s=="delete"){
            cin >> num;
            for(it=intlist.begin();it!=intlist.end();++it){
                if(*it ==num){
                    intlist.erase(it);
                    break;
                }
            }
        }
        else if(s=="deleteFirst"){
            intlist.pop_front();
        }
        else if(s=="deleteLast"){
            intlist.pop_back();
        }
    }
    for(it=intlist.begin();it!=intlist.end();++it){
        if(flag==false){
            cout << *it;
            flag=true;
        }
        else cout << " " << *it;
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 32476
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.math.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        PrintWriter out = new PrintWriter(System.out);
        InputStreamScanner in = new InputStreamScanner(System.in);
        new Main().solve(in, out);
        out.flush();
    }

    public BigDecimal sqrt(BigDecimal a){
        //とりあえずdoubleのsqrtを求める
        BigDecimal x = new BigDecimal(
                Math.sqrt(a.doubleValue()), MathContext.DECIMAL64);
        BigDecimal b2 = new BigDecimal(2);
        for(int tempScale = 16; tempScale < 50; tempScale *= 2){
            x = x.subtract(
                    x.multiply(x).subtract(a).divide(
                    x.multiply(b2), 50, BigDecimal.ROUND_HALF_EVEN));
        }
        return x;
    }

    private void solve(InputStreamScanner in, PrintWriter out) {
        //int a = in.nextInt();
        //int b = in.nextInt();
        //int c = in.nextInt();
        BigDecimal a = sqrt(new BigDecimal(in.next()));
        BigDecimal b = sqrt(new BigDecimal(in.next()));
        BigDecimal c = sqrt(new BigDecimal(in.next()));

      	if ((a.add(b)).compareTo(c) < 0) {
            out.println("Yes");
        } else {
            out.println("No");
        }
    }

    static class InputStreamScanner {

        private InputStream in;

        private byte[] buf = new byte[1024];
        private int len = 0;
        private int off = 0;

        InputStreamScanner(InputStream in)	{
            this.in = in;
        }

        String next() {
            StringBuilder sb = new StringBuilder();
            for (int b = skip(); !isSpace(b);){
                sb.appendCodePoint(b);
                b = read();
            }
            return sb.toString();
        }

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

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

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

        char nextChar() {
            return (char)skip();
        }

        int skip() {
            for (int b; (b = read()) != -1;) {
                if (!isSpace(b)) {
                    return b;
                }
            }
            return -1;
        }

        private boolean isSpace(int c) {
            return c < 33 || c > 126;
        }

        private int read() {
            if (len == -1) {
                throw new InputMismatchException("End of Input");
            }
            if (off >= len){
                off = 0;
                try {
                    len = in.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException(e.getMessage());
                }
                if (len <= 0) {
                    return -1;
                }
            }
            return buf[off++];
        }
    }
}

Measured memory_bytes: 23380
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define ll long long
#define pll pair<ll, ll>
#define pii pair<int,int>
#define pb push_back
#define F first
#define S second
#define mod 1000000007
#define maxn 100005
#define boost ios::sync_with_stdio(false);cin.tie(0)
#define fr freopen("source.txt","r",stdin),freopen("output.txt","w",stdout)
#define SET(a,b) memset(a,b,sizeof(a))

vector<int>g[maxn];
struct zeus{
	int v,d,c;
}q[maxn];
int color[maxn],vis[maxn][15];

void cal(int v,int d,int c){
	if(d<0)return;
	if(vis[v][d]==1)return;
	vis[v][d]=1;
	if(color[v]==0)color[v]=c;
	for(int u:g[v]){
		cal(u,d-1,c);
	}
}

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

	rep(i,1,m){
		int u,v;
		cin>>u>>v;
		g[u].pb(v);
		g[v].pb(u);
	}

	int qw;
	cin>>qw;
	rep(i,1,qw)cin>>q[i].v>>q[i].d>>q[i].c;

	for(int i=qw;i>0;i--){
		int v=q[i].v;
		int d=q[i].d;
		int c=q[i].c;
		cal(v,d,c);
	}
	rep(i,1,n)cout<<color[i]<<"\n";
	return 0;
}

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

int main(){
  int a, b;
  cin >> a >> b;
  int ans = -1;
  for(int i=0; i<10; i++){
    int n = b * 10 + i;
    if((n * 8 / 100) == a) {
      ans = n;
      break;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256