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

const int maxn=2e5+10;

int n,m,R[maxn];
struct Point{
	int x,y;
	bool operator < (const Point &p) const {return x<p.x;}
}P[maxn];
priority_queue<int,vector<int>,greater<int> > q;

int main()
{
#ifdef h10
	freopen("F.in","r",stdin);
	freopen("F.out","w",stdout);
#endif
	int i;
	scanf("%d%d",&n,&m);
	for (i=1;i<=n;i++)
		scanf("%d%d",&P[i].x,&P[i].y);
	sort(P+1,P+n+1);

	int cL=0,cR=0;
	for (i=1;i<=n;i++)
	{
		if (cL<P[i].x)
		{
			q.push(P[i].y);
			cL++;
		}
		else
		{
			q.push(P[i].y);
			R[++R[0]]=q.top();
			q.pop();
		}
	}
	for (i=1;i<=R[0];i++)
	{
		R[i]=max(R[i],cL+1);
		R[i]=m-R[i]+1;
	}
	sort(R+1,R+R[0]+1);
	for (i=1;i<=R[0];i++)
		if (cR<R[i]) cR++;
	printf("%d\n",n-cL-cR);
}


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

#define fastIO ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define ld long double
#define ll long long
#define endl '\n'
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define vi vector<ll>
#define min3(a, b, c) min(a,min(b, c))
#define min4(a, b, c, d) min(a, min(b, min(c, d)))
#define max3(a, b, c) max(a,max(b, c))
#define max4(a, b, c, d) max(a, max(b, max(c, d)))
#define INF (int)1e9



int main()
{
    fastIO
    ll r,c,k,co=0;
    cin>>r>>c>>k;
    vector<vector<char>> aa;
    
    for(int i=0;i<r;i++)
    {
        vector<char> a;
        for(int j=0;j<c;j++)
        {
            char x;
            cin>>x;
            a.pb(x);
        }
        aa.pb(a);
    }
    for (int rc=0;rc<1<<r;rc++)
    {
        for(int cc=0;cc<1<<c;cc++)
        {
            int bc=0;
            for(int i=0;i<r;i++)
            {
                for(int j=0;j<c;j++)
                {
                    if(((rc>>i) & 1)==0 && ((cc>>j) &1)==0 && aa[i][j]=='#')
                    {
                        bc++;
                    }
                }
            }
            if(bc==k)
            {
                co++;
            }
        }
    }
    
cout<<co;
    return 0;
}

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

int main(){
	int input, ans;
	while(cin >> input){
		ans = input % 39;
		cout << "3C";
		if(ans == 0) cout << "39" << endl;
		else if(0 < ans && ans <= 9) cout << "0" << ans << endl;
		else cout << ans << endl;
	}
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
#include<boost/variant.hpp>
using namespace std;
typedef long long ll;
typedef vector<boost::variant<bool, ll, int, string, double, char*, const char*>> any;
template<typename T> inline void pr(const vector<T> &xs){
	for(int i=0; i<xs.size()-1; i++) cout<<xs[i]<<" ";
	(xs.empty()?cout:(cout<<xs[xs.size()-1]))<<endl;
}
#ifdef DEBUG
#define debug(...) pr(any{__VA_ARGS__})
#define debugv(x) pr((x))
#else
#define debug(...)
#define debugv(x)
#endif

ll dp[1000+5][20000+5];
int main(){
	int H, N;
	cin >> H >> N;
	vector<int> A(N), B(N);
	for(int i=0; i<N; i++) cin >> A[i] >> B[i];

	for(int i=0; i<N; i++){
		dp[i][0] = 0;
		for(int j=0; j<20000+5; j++){
			if(j>0) dp[i][j] = 1e18;
			if(i>0) dp[i][j] = min(dp[i][j], dp[i-1][j]);
			if(j-A[i]>=0) dp[i][j] = min(dp[i][j], dp[i][j-A[i]]+B[i]);
			if(j < 110) debug(i, j, dp[i][j]);
		}
	}

	ll ans = 1e18;
	for(int j=H; j<20000+5; j++){
		ans = min(ans, dp[N-1][j]);
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 156544
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
typedef long long ll;
int main(){
    int h,w; cin >> h >> w;
    int n; cin >> n;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    vector<vector<int>> c(h, vector<int> (w));
    vector<int> v(h*w);
    vector<int> s(n);
    s[0] = 0;
    FOR(i,1,n) s[i] = s[i-1] + a[i-1];
    rep(i,n){
        rep(j,a[i]) v[s[i] + j] = i+1;
    }
    rep(i,h){
        rep(j,w){
            c[i][j] = v[i*w+j];
        }
    }
    for(int i = 1; i < h; i += 2){
        reverse(ALL(c[i]));
    }
    rep(i,h){
        rep(j,w){
            printf("%d%c", c[i][j], j == w-1 ? '\n' : ' ');
        }
    }
}

Measured memory_bytes: 480
<?php
  
$n = trim(fgets(STDIN));

$ca = [];
for($i=1; $i<=$n; $i++){
  $c = 0;
  $t = $i;
  while($t>0){
    if ($t%2 !== 0){
      break;
    } else if ($t%2 == 0) {
      $c++;
      $t = $t/2;
    }
  }
  $ca = $ca + array($i=>$c);
}

$max = max($ca);
echo array_keys($ca,$max)[0];

?>

Measured memory_bytes: 4604
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int maxn = 1e6 + 7;
const int maxe = maxn << 2;
const int inf = 1e9;
struct point
{
	int x, y;
};
point num[maxn];
int n;
int val[maxn];
int edge, fir[maxn], nex[maxe], go[maxe];
int tot;
int pos[maxn];
int cnt, dfn[maxn], low[maxn], color, col[maxn], top, st[maxn];
int id[maxn], pri[maxn], par[maxn];
inline int Get()
{
	char c;
	while(!isdigit(c = getchar()));
	int x = c - '0';
	while(isdigit(c = getchar()))
		x = x * 10 + c - '0';
	return x;
}
inline bool rule(const point &u, const point &v)
{
	return u.x < v.x;
}
inline bool cmp(const int &u, const int &v)
{
	return val[u] < val[v];
}
inline void Ins(int x, int y)
{
	nex[++edge] = fir[x];
	fir[x] = edge;
	go[edge] = y;
}
void Build(int k, int l, int r)
{
	tot = max(tot, k);
	if(l == r)
	{
		pos[l] = k;
		return;
	}
	int mid = l + r >> 1;
	Ins(k, k << 1);
	Ins(k, k << 1 | 1);
	Build(k << 1, l, mid);
	Build(k << 1 | 1, mid + 1, r);
}
void Insert(int k, int l, int r, int x, int y, int p)
{
	if(x <= l && r <= y)
	{
		Ins(p, k);
		return;
	}
	int mid = l + r >> 1;
	if(x <= mid) Insert(k << 1, l, mid, x, y, p);
	if(y > mid) Insert(k << 1 | 1, mid + 1, r, x, y, p);
}
void Tarjon(int u)
{
	dfn[u] = low[u] = ++cnt;
	st[++top] = u;
	for(int i = fir[u]; i; i = nex[i])
	{
		int v = go[i];
		if(!dfn[v])
		{
			Tarjon(v);
			low[u] = min(low[u], low[v]);
		}
		else
			if(!col[v])
				low[u] = min(low[u], dfn[v]);
	}
	if(low[u] == dfn[u])
	{
		col[u] = ++color;
		while(st[top] != u)
			col[st[top--]] = color;
		--top;
	}
}
inline int Reset()
{
	tot = 0;
	edge = 0;
	memset(fir, 0, sizeof(fir));
	cnt = 0;
	memset(dfn, 0, sizeof(dfn));
	memset(col, 0, sizeof(col));
}
inline bool Check(int e)
{
	Reset();
	Build(1, 1, n << 1);
	for(int i = 1; i <= n << 1; ++i)
	{
		int l = upper_bound(val + 1, val + 1 + (n << 1), val[i] - e) - val;
		int r = lower_bound(val + 1, val + 1 + (n << 1), val[i] + e) - val - 1;
		if(l <= i && i <= r)
		{
			if(l <= i - 1) Insert(1, 1, n << 1, l, i - 1, pos[par[i]]);
			if(i + 1 <= r) Insert(1, 1, n << 1, i + 1, r, pos[par[i]]); 
		}
		else Insert(1, 1, n << 1, l, r, pos[par[i]]);
	}
	for(int i = 1; i <= tot; ++i)
		if(!dfn[i])
			Tarjon(i);
	for(int i = 1; i <= n << 1; ++i)
		if(col[pos[i]] == col[pos[par[i]]])
			return false;
	return true;
}
inline int Divide()
{
	int l = 0, r = inf, mid, ans;
	while(l <= r)
	{
		mid = l + r >> 1;
		if(Check(mid)) l = mid + 1, ans = mid;
		else r = mid - 1;
	}
	return ans;
}
int main()
{
	n = Get();
	int x, y;
	for(int i = 1; i <= n; ++i)
	{
		x = Get(), y = Get();
		id[i] = i;
		id[i + n] = i + n;
		val[i] = x;
		val[i + n] = y;
		num[i] = (point) {x, y};
		num[i + n] = (point) {y, x};
	}
	sort(id + 1, id + 1 + (n << 1), cmp);
	for(int i = 1; i <= n << 1; ++i) pri[id[i]] = i;
	for(int i = 1; i <= n << 1; ++i)
		par[pri[i]] = pri[(i > n) ? i - n : i + n];
	sort(val + 1, val + 1 + (n << 1));
	sort(num + 1, num + 1 + (n << 1), rule);
	printf("%d\n", Divide());
}

Measured memory_bytes: 38528
using System;
using System.Linq;
class Program
{
    static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());
        string[] aInput = Console.ReadLine().Split(' ');
        int[] a = Array.ConvertAll(aInput, int.Parse);
        int[] ans = new int[200001];
        for (int i = 0; i < n - 1; i++)
        {
            ans[a[i]]++;
        }
        for(int i = 1; i < n + 1; i++)
        {
            Console.WriteLine(ans[i]);
        }
    }
}

Measured memory_bytes: 39124
import collections 
n,cc = int(raw_input()), collections.Counter(map(int,raw_input().split()))
m,s = max(cc.keys()),{ai:True for ai in cc}
for a in cc:
	c = a if cc[a] > 1 else 2 * a
	while(c <= m):
		if a in s: s[c] = False
		c += a
count = 0
for a in s:
	if s[a]: count +=1
print count

Measured memory_bytes: 228672
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;

int main() {
  ll N, L;
  cin >> N >> L;
  vector<string> S(N);
  for (int i = 0; i < N; i++) {
    cin >> S[i];
  }
  sort(S.begin(), S.end());
  for (int i = 0; i < N; i++) {
    cout << S[i];
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 3632
n=int(input())

t = list(map(int,input().split()))

ans = sum(t)

memo = [0]*100001

for i in t:
    memo[i] += 1

s=int(input())
for _ in range(s):
    b, c = (int(x) for x in input().split())
    ans += (c-b)*memo[b]
    print(ans)
    memo[c] += memo[b]
    memo[b] = 0

Measured memory_bytes: 83368
#include <iostream>
#include <vector>

using namespace std;

int main()
{
	int N;
	cin >> N;
	
	std::vector<int> H;
	for( int ii = 0; ii < N; ++ii ){
		int tmp;
		cin >> tmp;
		H.push_back(tmp);
	}
	
	//---------
	
	int accomodation = 1;
	int maxH = H[0];
	for( int ii = 1; ii < N ; ++ii ){
		if(maxH <= H[ii]){
			++accomodation;
			maxH = H[ii];
		}
	}

	cout << accomodation << endl;
	
	return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli; 

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli n,temp1,temp2,t,x,y,m,k,b,temp,a,q,d,p;
   
	cin>>n;
	lli sum=0;
	map<lli,lli> mp;
	
	for(int i =0;i<n;i++)
	{
		cin>>a;
		sum+=a;
		auto k =mp.find(a);
		
		if(k==mp.end())
		{
			mp.insert(make_pair(a,1));
		}
		else
		k->second++;
	}
	
	cin>>t;
	
	while(t--)
	{
		cin>>a>>b;
		auto k =mp.find(a);
		temp=0;
		temp1=0;
		if(k!=mp.end()){
			temp=k->second; mp.erase(k);
			k=mp.find(b);
			
			if(k!=mp.end())
			{
				temp1=temp;
				k->second+=temp;
			}
			else
			{
				temp1=temp;
				mp.insert(make_pair(b,temp));
			}
		}
		sum= sum-temp*a;
		sum=sum +temp1*b;
		cout<<sum<<endl;
		
	}
}

	
	


Measured memory_bytes: 7572
#include<stdio.h>

int main(){
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    int con1=a-b,con2=c;
    int ans=con2-con1;
    if(ans<0) ans=0;
    printf("%d\n",ans);

    return 0;
}

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

int main(){
   int N;
   std::cin >> N;
   std::vector<int> a(N);
   long long sum = 0;
   long long suma[N];
   for(int i=0; i<N; ++i){
      std::cin >> a[i];
      if(i==0) suma[i] = a[i];
      else suma[i] = suma[i-1] + a[i];
      sum += a[i];
   }
   long long ans = suma[0]*2 - sum;
   if(ans<0) ans *= -1;
   for(int i=1; i<N-1; ++i){
      long long tmp = suma[i]*2 - sum;
      if(tmp<0) tmp *= -1;
      ans = std::min(ans,tmp);
   }
   std::cout << ans << std::endl;
   return 0;
}


Measured memory_bytes: 2560
local n=io.read("n")
local h={}
for i=1,n do
    h[i]=io.read("n")
end

local INF=math.maxinteger
local dp={0,math.abs(h[2]-h[1])}
for i=3,n do
    dp[i]=INF
end
for i=3,n do
    dp[i]=math.min(dp[i],dp[i-1]+math.abs(h[i]-h[i-1]))
    dp[i]=math.min(dp[i],dp[i-2]+math.abs(h[i]-h[i-2]))
end
print(dp[n])

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

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

    vector<int> a(3);
    rep(i, 3) cin >> a[i];
    sort(a.begin(), a.end());
    cout << a[0] + a[1] << endl;

    return 0;
}


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

#define ll long long
#define ld long double

long double arr[4000];
int maxcount;

long double memo[4000][2][2000] = {};
long double dp (int pos, int menang, int count) {
//	cout << pos << " " << menang << " " << count << "\n";
	if(pos == 0) {
		return (ld)1;
	} else if(memo[pos][menang][count] != (ld)(-1)) {
		return memo[pos][menang][count];
	} else if(count == maxcount) {
		return memo[pos][menang][count] = max(memo[pos][menang][count], dp(pos-1, 1, count)*(arr[pos]));
	} else {
		return memo[pos][menang][count] = max(memo[pos][menang][count], dp(pos-1, 1, count)*(arr[pos])+dp(pos-1, 0, count+1)*(1-arr[pos]));
	}
}

int main() {
	ios_base::	sync_with_stdio(0);
	cout << fixed << setprecision(10);
	for(int i = 0; i < 4000; i++) {
		for(int j = 0; j < 2; j++) {
			for(int k = 0; k < 2000; k++) {
				memo[i][j][k] = (ld)-1;
			}
		}
	}
	
	
	int n;
	cin >> n;	
	maxcount = (n%2) ? n/2 : n/2-1;
	
	for(int i = 1; i <= n; i++) {
		cin >> arr[i];
	}
	
	
	arr[n+1] = 1;
	cout << dp(n+1, 1, 0) << "\n";
	
//	for(int i = 1; i <= n; i++) {
//		for(int j = 0; j < 2; j++) {
//			cout << memo[i][j][k] << "  ";
//		}
//		cout << "\n";
//	}
	
}

Measured memory_bytes: 250496
#include<stdio.h>
 
#define N 100
 
static const int MAX = 500;
static const int INFTY = (1<<21);
 
main(){
  int n, i, j, e, v,c=0,k=0;
  int u = 0,mincost = 0;
  int cost[N];
  int d[N];
  int p[N],M[N][N];
   
   
  scanf("%d", &n);
  for ( i = 0; i< n; i++ ){
    for ( j = 0; j < n; j++ ){
      M[i][j] = INFTY;
    }
  }
   
  for ( i = 0; i < n; i++ ){
    scanf("%d %d", &u, &k);
    for ( j = 0; j < k; j++ ){
      scanf("%d %d", &v, &c);
      M[u][v] = c;
    }
  }
   
  for(i=0;i < n;i++){
    d[i] = INFTY;
    p[i] = -1;
    cost[i] = 0;
  }
   
  d[0] = 0;
   
  while(1){
    u = -1;
    mincost = INFTY;
     
    for(i=0;i < n;i++){
      if(d[i] < mincost && cost[i] == 0){
    mincost = d[i];
    u = i;
      }
    }
     
    if(u == -1) break;
     
    cost[u] = 1;
     
    for(v=0;v <n;v++){
      if(d[v] > d[u]+M[u][v]){
    p[v] = u;
    d[v] = d[u]+M[u][v];
      }
    }
  }
   
  for ( i = 0; i < n; i++ ){
    printf("%d %d\n", i, (d[i]==INFTY?-1:d[i]));
  }
   
  return 0;
}

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


bool isvowel(char c){
    string vowels = "aeiou";
    for(int i=0; i<5; i++)if(vowels[i]==c)return true;
    return false;
}


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    char c;
    cin>>c;
    if(isvowel(c))cout<<"vowel"<<endl;
    else cout<<"consonant"<<endl;

return 0;
}


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

#define FOR(i, j, k) for(int i=j ; i<k ; i++)
#define REP(i, j) FOR(i, 0, j)
typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;

int main() {

    int N; cin >> N;
    if (N % 2 == 0) cout << N << endl;
    else cout << N * 2 << endl;
    return 0;
}


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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  
  ll a,b,c,k;
  cin>>a>>b>>c>>k;
  
  ll ans;
  if(k%2==1)
    ans=b-a;
  else
    ans=a-b;
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define ALL(c) (c).begin(), (c).end()
#define sz(v) (int)v.size()
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;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
const char EOL = '\n';
 
void solve();
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}
 
void solve() {
    int n, w;
    cin >> n >> w;
    vector<vector<ll>> dp(n + 1, vector<ll>(w + 1, 0LL));
    int u, v;
    REP(i, n) {
        cin >> u >> v;
        REP1(j, w) {
            dp[i + 1][j] = dp[i][j];
            if (j - u >= 0) dp[i + 1][j] = max(dp[i + 1][j], dp[i][j - u] + v);
        }
    }
    ll ans = 0;
    REP1(i, w) chmax(ans, dp[n][i]);
    cout << ans << EOL;
}


Measured memory_bytes: 80256
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define REP(i, n) rep(i, 0, n)
#define repb(i, a, b) for(int i = a; i >= b; i--)
#define all(a) a.begin(), a.end()
#define int long long
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e12;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, d, x;
    cin >> n >> d >> x;
    vector<int> a(n);
    rep(i, 0, n){
        cin >> a[i];
    }
    int ans = x;
    rep(i, 0, n){
        ans += (d + a[i] - 1) / a[i];
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();
            int C = in.nextInt();
            for (int k = 0; k < 10000000; k++) {
                if ((k * A) % B == C) {
                    System.out.println("YES");
                    return;
                }
            }
            System.out.println("NO");
        }
    }
}


Measured memory_bytes: 23636
def main():

    n = int(input())
    x = tuple([int(t)for t in input().split()])

    m = x[0]
    ans = 0
    for i in range(1,n):
        if m>x[i]:
            ans += m-x[i]
        else:
            m = x[i]
    
    print(ans)



if __name__ == "__main__":
    main()

Measured memory_bytes: 32080
x=int(input())
flag=True
while flag:
    i=2
    fla=True
    while i<=x**0.5:
        if x%i==0:
            fla=False
            break
        else:
            if i==2:
                i+=1
            else:
                i+=2
    if fla==False:
        x+=1
    else:
        print(x)
        flag=False

Measured memory_bytes: 9428
#include<bits/stdc++.h>
#define sz(a) int((a).size())
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define tr(c,i) for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define LSOne(i) (i&(-i))
#define rep(i,a,b) for(int(i)=(a);(i)<(b);i++)
#define BUG(x) {cout<<#x<<" = "<<x<<endl;}
#define left(x) (x<<1)
#define right(x) ((x<<1) +1)
#define middle(s,e)(s+(e-s)/2)
#define size_tree(n) 2*(int)pow(2,ceil(log2(n)))
#define CL(A,I) (memset(A,I,sizeof(A)))
#define endl '\n'

static const int INF = 0x3f3f3f3f;
static const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
static const long double epsilon = 1e-15;
static const long double pi = acos((long double) -1);
using namespace std;
inline void init_io(){ios_base::sync_with_stdio(false);cin.tie(NULL);}

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
typedef long long ll;

const int maxn = 100004;
int arr[maxn];
int dp[maxn];
int n;
ll solve(int idx)
{
    int a,b;
    if(idx>=n) return INF ; 
    if(idx==n-1) return 0;
    if(~dp[idx]) return dp[idx];
    a = abs(arr[idx]-arr[idx+1]);
    b = abs(arr[idx]-arr[idx+2]);
    return dp[idx]=min(a+solve(idx+1), b + solve(idx+2));
}

int main()
{
    CL(dp,-1);
    cin>>n;
    rep(i,0,n)
        cin>>arr[i];
    cout<<solve(0);
    return 0;
}

Measured memory_bytes: 3328
# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define ALL(x) (x).begin(), (x).end()
# define RALL(x) (x).rbegin(), (x).rend()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
# define debug(x) std::cerr << #x << " : " << x << "\n";
using namespace std;
using lint = long long;
template <class T> using grid = vector<vector<T>>;
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; }
static const lint MOD = (lint)1e9+7;

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

    int x = 0;
    int max = 0;
    for (const auto& s : S)
    {
        debug(s);
        if (s == 'I')
        {
            ++x;
        }
        else 
        {
            --x;
        }

        debug(chmax(max, x));
    }

    cout << max << endl;

    return 0;
}


Measured memory_bytes: 256
gets
n = gets.split.map(&:to_i)

i = 0
a1 = n.inject([0,0]){|(sum,dif),r|
  sum += r
  if i%2==0
    if sum <= 0
      dif += 1-sum
      sum = 1
    end
  else
    if sum >= 0
      dif -= -1-sum
      sum = -1
    end
  end
  i += 1
  [sum,dif]
}[1]

i = 0
a2 = n.inject([0,0]){|(sum,dif),r|
  sum += r
  if i%2!=0
    if sum <= 0
      dif += 1-sum
      sum = 1
    end
  else
    if sum >= 0
      dif -= -1-sum
      sum = -1
    end
  end
  i += 1
  [sum,dif]
}[1]

p [a1,a2].min


Measured memory_bytes: 11148
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;
using static System.Console;

namespace A_ABC127
{
    class MainClass
    {

        static int[] s;

        public static void Main(string[] args)
        {
            s = Array.ConvertAll(ReadLine().Split().ToArray(), int.Parse);
            long tmp = s[2];
            for(int i=0;i<10;i++){
                long ans = s[0]*tmp-s[1];
                Console.WriteLine(ans);
                tmp = ans;
            }
        }
    }
}


Measured memory_bytes: 13268
a=[list(map(int, input().split())) for i in range(3)]
n=int(input())
b=[int(input()) for i in range(n)]
count=0
for i in range(3):
    for j in range(3):
        if a[i][j] in b:
            a[i][j]=0
for i in range(3):
    if a[i][0]==0 and a[i][1]==0 and a[i][2]==0:
        count += 1
    elif a[0][i]==0 and a[1][i]==0 and a[2][i]==0:
        count += 1

if a[0][0]==0 and a[1][1]==0 and a[2][2]==0:
    count +=1
elif a[0][2]==0 and a[1][1]==0 and a[2][0]==0:
    count +=1

if count>0:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k=0;
		int ans=0;
		for(int i = 0; i<n; i++){
			int h = sc.nextInt();
			if(h>=k){
				ans++;
				k=h;
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 22996
from collections import Counter
N = int(raw_input())
lis = []
for i in xrange(N):
	lis.append(int(raw_input()))
lis.sort()
lister = dict(Counter(lis)).items()
count = 0
for item in lister:
	if item[1] % 2 == 1:
		count += 1
print count

Measured memory_bytes: 19996
//😄😄😄😄😄😄😄😄😄😄😄😄😄
//Apno Swagat che//
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pi pair<int,int>
#define vp vector<pi>
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define For(i,a,b) for(ll i=a;i<b;i++)
#define endl "\n"
#define debug(x) cout<<"AA Baju Smit------> "<<#x<<" -> "<<x<<endl
#define all(x) x.begin(),x.end()
#define mint map<int,int>
#define mod 1000000007
#define ciN cin
////////////////////////////////////////////////////////////////
//Ha Moj Ha///
////////////////////////////////////////////////////////////////
////TEST CASES ATTACHED CHE BHULTO NAI......///////////////////

void jabru() {
	ll x, k, d; ciN >> x >> k >> d;
	ll z = abs(x) / d;
	if (x == 0) {
		if (k % 2) {
			cout << k << endl; return;
		}
		else {

			cout << 0 << endl; return;
		}

	}
	if (x > 0) {
		if (z >= k) {
			cout << x - 1LL * min(z, k)*d << endl; return;
		}
		else {
			k -= z;
			if (k % 2 == 0) {
				cout << x % d << endl; return;
			}
			else {
				cout << abs(x % d - d) << endl; return;
			}
		}
	}
	else {
		if (z >= k) {
			cout << abs(x) - 1LL * min(z, k)*d << endl; return;
		}
		else {
			k -= z;
			if (k % 2 == 0) {
				cout << abs(x) % d << endl; return;
			}
			else {
				cout << abs(d - abs(x) % d) << endl; return;
			}
		}
	}

}




////////////////////////////////////////////////////////////////
//Bas aabaju nai javanu///
////////////////////////////////////////////////////////////////

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
//	int t; cin >> t;
//	while (t--)
	jabru();

	return 0;
}





///////////////////////////////////////////////////////////////////////////////////////////
//Kai baju bhai???



Measured memory_bytes: 3636
#include<stdio.h>
int main(void){
  int n,num,m,e,i,j,k;
  scanf("%d",&n);
  int x[n][n];
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      x[i][j]=0;
    }
  }
  for(i=0;i<n;i++){
    scanf("%d",&num); scanf("%d",&m); 
    for(j=0;j<m;j++){
      scanf("%d",&e);
      x[num-1][e-1]=1;
    }
  }
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      printf("%d",x[i][j]);
      if(j<n-1){
	printf(" ");
      }
    }
    putchar('\n');
  }
    return 0;
}


Measured memory_bytes: 2060
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <sstream>

using namespace std;

int w[200000], h[200000];

int main(){
	
	int N, W, H;
	
	cin >> N >> W >> H;
	
	for(int i = 0; i <= W; i++){
		w[i] = 0;
	}
	
	for(int i = 0; i <= H; i++){
		h[i] = 0;
	}
	
	for(int i = 0; i < N; i++){
		int num1, num2, num3;
		cin >> num1 >> num2 >> num3;
		w[max(0, num1 - num3)]++;
		w[min(W, num1 + num3)]--;
		h[max(0, num2 - num3)]++;
		h[min(H, num2 + num3)]--;
	}
	
	bool flag1 = true;
	
	int count = 0;
	for(int i = 0; i < W; i++){
		count += w[i];
		if(count <= 0){
			flag1 = false;
		}
	}
	
	bool flag2 = true;
	
	count = 0;
	for(int i = 0; i < H; i++){
		count += h[i];
		if(count <= 0){
			flag2 = false;
		}
	}
	
	if(flag1 || flag2){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
	
	return 0;
}

Measured memory_bytes: 3880
#include <bits/stdc++.h>
#define loop2(i, s, n, a) for (int i = int(s); i < int(n); i += a)
#define loop(i, s, n) loop2(i, s, n, 1)
#define rep(i, n) loop(i, 0, n)

#define pb push_back
#define all(in) in.begin(),in.end()

using ll = long long; // typedef long long ll; と同意
using ull = unsigned long long;
using namespace std;

int main(){
    int n, m; cin >> n >> m;
    vector<int> data(n); rep(i, n) cin >> data[i];
    vector<int> ans(n,1);
    rep(i,m){
        int a,b; cin >> a >> b;
        a--; b--;
        if(data[a]>=data[b]) ans[b] = 0;
        if(data[a]<=data[b]) ans[a] = 0;
    }
    int answer = 0;
    rep(i,n) answer += ans[i];
    cout << answer << endl;
}

Measured memory_bytes: 4032
#include<iostream>
#include<queue>
#include<algorithm>
using namespace std;
int f(int n){
	int sum1=0;
	for(int i=1;i<=n;i++)
		if(n%i==0)
			sum1++;
	return sum1;
}
int main(){
	int n;
	cin>>n;
	int sum=0;
	for(int i=1;i<=n;i=i+2){
		int ans=0;
		ans=f(i);
		if(ans==8)
		sum++;
	}
	cout<<sum<<endl;
	
}

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

int main(){
    int x; cin >> x;
    if(x<4){
        cout << 1 << endl;
        return 0;
    }else{
        int n;
        int MAX = 1;
        for(int i=2;i<11;i++){
            n = pow(x, (float)1/i);
            // cout << n << endl;
            MAX = max((int)pow(n, i), MAX);
        }
        cout << MAX << endl;
    }
}

Measured memory_bytes: 256
fun main(args:Array<String>) {
    val s = readLine()!!.toMutableList()
    if(solve(s)) {
        println("Yes")
    } else {
        println("No")
    }
}

fun solve(s:MutableList<Char>):Boolean {
    if(s.size % 2 != 0) {
        return false
    }
    while (s.size > 0) {
        if(s[0] == 'h' && s[1] == 'i') {
            s.removeAt(0)
            s.removeAt(0)
        } else {
            return false
        }
    }
    return true
}


Measured memory_bytes: 33792
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args){
		Scanner s = new Scanner(System.in);
		int a = s.nextInt();
		int b = s.nextInt();
		int c = s.nextInt();

		int k = s.nextInt();

		int coefficient = (int) Math.pow(2, k);

		if(a >= b && a >= c){
			a *= coefficient;
		} else if (a <= b && b >= c){
			b *= coefficient;
		} else if (a <= c && b <= c){
			c *= coefficient;
		}

		System.out.println(a + b + c);
	}
}

Measured memory_bytes: 19668
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

ll n,ans;
int main(){
	cin >> n;
	ans = 1e18;
	for(ll i=1;i*i<=n;i++){
		if(n%i != 0) continue;
		ans = min(ans,i-1+n/i-1);
	}
	cout<<ans<<endl;

}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<cmath>
#include<iomanip>
#include<map>
#include<cstring>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const ll LLINF = 1LL<<60;
/* -- template -- */

int main(){
    int N;
    int Ma, Mb;
    cin >> N >> Ma >> Mb;
    int a[N], b[N];
    int c[N];
    rep(i, N){
        cin >> a[i] >> b[i] >> c[i];
    }
    int dp[N + 1][401][401];//dp[i][a][b] : i番目までの薬品を見たとき，a[g],b[g]を達成するための最低コスト
    for(int i = 0;i <= N;++i){
        for(int aa = 0;aa <= 400;++aa){
            for(int bb = 0; bb <= 400;++bb){
                dp[i][aa][bb] = INF;
            }
        }
    }
    dp[0][0][0] = 0;
    for(int i = 0;i < N;++i){
        for(int aa = 0;aa <= 400;++aa){
            for(int bb = 0; bb <= 400;++bb){
                dp[i + 1][aa][bb] = dp[i][aa][bb];
                if(a[i] <= aa && b[i] <= bb){
                    dp[i + 1][aa][bb] = min(dp[i][aa][bb], dp[i][aa - a[i]][bb - b[i]] + c[i]);
                }
            }
        }
    }
    int minv = INF;
    for(int aa = 1; aa <= 400;++aa){
        for(int bb = 1; bb <= 400;++bb){
            if(aa * Mb == Ma * bb){
                minv = min(dp[N][aa][bb], minv);
            }
        }
    }
    cout << ((minv == INF) ? -1 : minv) << endl;
}


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

using namespace std;

typedef long long ll;

int dg(ll n)
{
  if(n == 0)
    return 1;
  int ret = 0;
  while (n) {
    ret++;
    n /= 10;
  }
  return ret;
}
int main()
{
 ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
 ll n;
 cin >> n;
 int ans = 1e9;
 for(ll i = 1; i * i <= n; i++)
 {
   if(n % i == 0)
   {
     ll first = i, second = n / i;
     ans = min(ans, max(dg(first), dg(second)));
   }
 }
 cout << ans;
 return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include<iostream>
#include<map>
#include<algorithm>
#include<vector>
#include <cmath>
#include <iomanip>
#include <regex>
#include <bits/stdc++.h>
#include <string>
using namespace std;
using ll = long long;
const ll MOD = 1000000007; 
using plong = pair<ll,ll>;
 
 
int main(){
    string S;cin>>S;
    ll Q;cin>>Q;
    bool flag=true;
    ll q;
    ll f;
    char c1[Q];
    char c2[Q];
    ll c1_ind=0;
    ll c2_ind=0;
    char c;
    for(ll i=0;i<Q;i++){
        cin>>q;
        if(q==1)flag=!flag;
        else{
            cin>>f;
            cin>>c;
            bool fl=true;
            if(!flag)fl=!fl;
            if(f == 1)fl=!fl;
            if(fl){
                c2[c2_ind] = c;
                c2_ind++;
            }else{
                c1[c1_ind] = c;
                c1_ind++;
            }
        }
    }
    if(!flag){
        for(ll i=c2_ind-1;i>=0;i--){
            cout<<c2[i];
        }
        reverse(S.begin(),S.end());
        cout<<S;
        for(ll i=0;i<c1_ind;i++){
            cout<<c1[i];
        }
        
    }else{
        for(ll i=c1_ind-1;i>=0;i--){
            cout<<c1[i];
        }
        cout<<S;
        for(ll i=0;i<c2_ind;i++){
            cout<<c2[i];
        }
    }
    cout<<endl;

}

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

using namespace std;

#define rep(i,j) REP((i), 0, (j))
#define REP(i,j,k) for(int i=(j);(i)<(k);++i)
#define BW(a,x,b) ((a)<=(x)&&(x)<=(b))
#define ALL(v) (v).begin(), (v).end()
#define LENGTHOF(x) (sizeof(x) / sizeof(*(x)))
#define AFILL(a, b) fill((int*)a, (int*)(a + LENGTHOF(a)), b)
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define INF 1 << 30
#define EPS 1e-10
#define MAX_V 100000

typedef pair<int, int> P;
typedef pair<int, P> pii;
typedef vector<int> vi;
typedef queue<int> qi;
typedef long long ll;

struct edge{ int to, cost;};

int V, E, r;
vector<vector<edge> >G(MAX_V);
int d[MAX_V];

void dijkstra(int s){
  priority_queue<P, vector<P>, greater<P> >q;
  fill(d, d + V, INF);
  d[s] = 0;
  q.push(P(0, s));

  while(!q.empty()){
    P p = q.top(); q.pop();
    int v = p.second;
    if(d[v] < p.first) continue;
    rep(i, G[v].size()){
      edge e = G[v][i];
      if(d[e.to] > d[v] + e.cost){
	d[e.to] = d[v] + e.cost;
	q.push(P(d[e.to], e.to));
      }
    }
  }
}

int main(){
  scanf("%d%d%d", &V, &E, &r);
  int a, b, c;
  rep(i, E){
    scanf("%d%d%d", &a, &b, &c);
    edge e;
    e.to = b; e.cost = c;
    G[a].PB(e);
  }

  dijkstra(r);

  rep(i, V){
    if(d[i] == INF) puts("INF");
    else printf("%d\n", d[i]);
  }
  return 0;
}

Measured memory_bytes: 11328
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const ll mo = 1000000007;
const ll INF = 1LL << 60; //MAX 9223372036854775807
ll ans = 0;

int main()
{
string n;
cin >> n;
int len=(int)(n.length());
if(n[0]==n[len-1]){
    if(len%2)cout << "Second" << endl;
    else cout << "First" << endl;
}
else {
    if(len%2)cout << "First" << endl;
    else cout << "Second" << endl;
}


return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()

int main(void){
    ll n, k;
    cin >> n >> k;

    ll d[k];
    rep(i, 0, k){
        cin >> d[i];
    }

    ll ans;
    rep(i, n, 10000000){
        string t = to_string(i);
        ll flag = true;
        rep(j, 0, t.size()){
            rep(l, 0, k){
                if(t[j] == to_string(d[l])[0]) flag = false;
            }
        }

        ans = i;
        if(flag) break;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 384
#include <algorithm>     //sort,二分探索,など
#include <bitset>        //固定長bit集合
#include <cmath>         //pow,logなど
#include <complex>       //複素数
#include <deque>         //両端アクセスのキュー
#include <functional>    //sortのgreater
#include <iomanip>       //setprecision(浮動小数点の出力の誤差)
#include <iostream>      //入出力
#include <map>           //map(辞書)
#include <numeric>       //iota(整数列の生成),gcdとlcm(c++17)
#include <queue>         //キュー
#include <set>           //集合
#include <stack>         //スタック
#include <string>        //文字列
#include <unordered_map> //イテレータあるけど順序保持しないmap
#include <unordered_set> //イテレータあるけど順序保持しないset
#include <utility>       //pair
#include <vector>        //可変長配列

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int mod = 1e+9 + 7;

//マクロ
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = (ll)(n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define FORD(i, a, b) for (ll i = (a); i >= (b); i--)
#define ALL(x) (x).begin(), (x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size())      //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000
#define MOD 10000007
#define PB push_back
#define MP make_pair
#define F first
#define S second

ll gcd(ll x, ll y)
{
  return y ? gcd(y, x % y) : x;
}

vector<pair<ll, int>> factorize(ll n)
{
  vector<pair<ll, int>> res;
  for (ll i = 2; i * i <= n; i++)
  {
    if (n % i)
      continue;
    res.emplace_back(i, 0);
    while (n % i == 0)
    {
      n /= i;
      res.back().second++;
    }
  }
  if (n != 1)
    res.emplace_back(n, 1);
  return res;
}

int main()
{
  ll a, b;
  cin >> a >> b;
  ll g = gcd(a, b);
  vector<pair<ll, int>> f = factorize(g);
  int ans = f.size() + 1;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
string = gets.chomp
first_i = string[0..1].to_i
last_i = string[2..3].to_i
if first_i > 12
  if last_i == 0 || last_i > 12
    puts "NA"
  else
    puts "YYMM"
  end
elsif first_i == 0
  if 0 < last_i && last_i < 13
    puts "YYMM"
  else
    puts "NA"
  end
else
  if last_i == 0
    puts "MMYY"
  elsif last_i < 13
    if last_i == 0
      puts "NA"
    else
      puts "AMBIGUOUS"
    end
  else
    puts "MMYY"
  end
end

Measured memory_bytes: 1788
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define inf INT_MAX
using namespace std;

void fast(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
}

int main(){
	fast();
	ll a,b,c;
	cin>>a>>b>>c;
	cout<<c<<" "<<a<<" "<<b;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<vector>
#define ll long long
#define INF 0x3f3f3f3f
using namespace std;
const int N=1e5+5;
template<class T>inline void read(T &res)
{
char c;T flag=1;
while((c=getchar())<'0'||c>'9')if(c=='-')flag=-1;res=c-'0';
while((c=getchar())>='0'&&c<='9')res=res*10+c-'0';res*=flag;
}
int n,k;
int main(){
	read(n),read(k);
	if(n%k==0)cout<<n/k<<endl;
	else cout<<n/k+1<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main() {
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
  	long long t,a,k;
	while(cin>>t>>a>>k){

        if(k<=t)cout<<(t-k)<<" "<<a<<endl;
        else if(k<=(t+a)) cout<<"0 "<<(a-(k-t))<<endl;
        else cout<<"0 0"<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
n, k = map(int, input().split())
a = list(map(int, input().split()))


for i in range(k):
    b = [0] * (n+1)
    for j in range(n):
        l = max(0, j-a[j])
        r = min(n, j+a[j]+1)
        b[l] += 1
        b[r] -= 1
    for j in range(n):
        b[j+1] += b[j]
    b.pop()
    if a == b:
        break
    a = b
print(' '.join(map(str, a)))

Measured memory_bytes: 154904
//Exp val.
//https://atcoder.jp/contests/dp/tasks/dp_j
//https://codeforces.com/blog/entry/64250?#comment-523543
#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
//#define MOD (998244353)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
//ifstream cinn("input.txt");ofstream coutt("output.txt");

int n;
int fr[4];
double pdp[301][301][301];

double f(int one,int two,int three){
    if(one<0 || two<0 || three<0)return 0;
    if(one==0 && two==0 && three==0)return 0;
    double &ans=pdp[one][two][three];
    
    if(ans>=0)return ans;
    double k= (one+two+three);
    ans=0;
    ans+=(f(one,two+1,three-1)*(1.0*three/k));
    ans+=(f(one+1,two-1,three)*(1.0*two/k));
    ans+=(f(one-1,two,three)*(1.0*one/k));
    ans+=(n/k);
    return ans;
}

signed main(){
    FASTER;
    memset(pdp,-1,sizeof pdp);
    
    cin>>n;
    for(int i=0;i<n;i++){
        int in;cin>>in;
        fr[in]++;
    }
    cout<<fixed<<setprecision(10)<<f(fr[1],fr[2],fr[3]);
}


Measured memory_bytes: 426496
#include<iostream>
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
int main(){
	string s;
	int i=0,j=0;
	cin>>s;
	for(;s[i]!='A';++i){
	}for(j=s.length();s[j]!='Z';--j){
	}j++;
	printf("%d",j-i);
	

	return 0;}

Measured memory_bytes: 640
N = int(input())
C0, C1, C2, C3 = 0, 0, 0, 0
for i in range(N):
    Si = input()
    if Si == 'AC':
        C0 = C0+1
 
    elif Si == 'WA':
        C1  =C1+1
 
    elif Si == 'TLE':
        C2  =C2+1
 
    else:
        C3  =C3+1
 
print('AC x ' + str(C0))
print('WA x ' + str(C1))
print('TLE x ' + str(C2))
print('RE x ' + str(C3))

Measured memory_bytes: 9092
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
using namespace std;
typedef long long ll;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define sc(x) scanf("%d",&x);
typedef pair<int, int> P;
int main(){
    int n,t;
    sc(n) sc(t)
    int A[n];
    REP(i, n) sc(A[i])
    P minA = P(A[0], 1), maxA = P(A[0], 1), ans = P(0, 1);
    for (int i = 1; i < n; i++){
        if (A[i] < minA.first){
            minA.first = A[i];
            minA.second = 1;
            maxA.first = A[i];
            maxA.second = 0;
        }else if (A[i] == minA.first) minA.second += 1;
        else if (A[i] > maxA.first){
            maxA.first = A[i];
            maxA.second = 1;
            if (maxA.first - minA.first > ans.first){
                ans.first = maxA.first - minA.first;
                ans.second = min(maxA.second, minA.second);
            }else if (maxA.first - minA.first == ans.first){
                ans.second += min(maxA.second, minA.second);
            }
        }else if (A[i] == maxA.first) maxA.second += 1;
    }
    cout << ans.second << endl;
    return 0;
}

Measured memory_bytes: 640
import java.util.*;

public class Main {
    static int n;
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        int sum = sc.nextInt() / 1000;
        paper10000(sum);
        System.out.println(-1 +" " + -1 + " " + -1);
    }
    
    static void paper10000(int num) {
        int p = 10;
        for(int x = num/p; x >= 0; x--) {
            paper5000(num - x*p, x);
        }
    }
    
    static void paper5000(int num, int x) {
        int p = 5;
        for(int y = num/p; y >= 0; y--) {
            paper1000(num - y*p, x, y);
        }
    }
    
    static void paper1000(int num, int x, int y) {
        if(num+x+y == n) {
            System.out.println(x +" " + y + " " + num);
            System.exit(0);
        }
    }
}

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

void solver() {
  int n;
  cin >> n;

  map<long long, int> mp;
  bool f = false;
  for (int i = 0; i < n; i++) {
    long long a;
    cin >> a;

    if (f) continue;
    if (mp[a] >= 1) {
      f = true;
      continue;
    }
    mp[a]++;
  }

  if (!f) {
    cout << "YES\n";
  } else {
    cout << "NO\n";
  }
}

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


Measured memory_bytes: 12800
# DP
N, M = map(int, input().split())
broken = set([int(input()) for _ in range(M)])

MOD = 10**9+7
dp = [0 for i in range(N+2)]
dp[N] = 1

for i in reversed(range(N)):
    if i in broken:
        continue
    dp[i] = (dp[i+1] + dp[i+2]) % MOD

print(dp[0])


Measured memory_bytes: 59476
#include <iostream>

using namespace std;

int main(){
  double xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2;
  while(cin>>xa1>>ya1>>xa2>>ya2>>xb1>>yb1>>xb2>>yb2){
    if(xa1<=xb2&&xb1<=xa2&&ya1<=yb2&&yb1<=ya2) cout<<"YES";
    else cout<<"NO";
    cout<<endl;
  }
  return 0;
}

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

int main(){
  vector<int> x(5,0);
  REP(i,5){
    cin>>x.at(i);
    if(x.at(i)==0){
      cout<<i+1;
      return 0;
    }
  }
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
#define sp setprecision
#define pb(x) push_back(x)
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, ll> pil;
typedef pair<ll, int> pli;
typedef pair<ld, ld> pdd;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const int inf = 1e8;
const ll INF = 1e16;
const string alpha = "abcdefghijklmnopqrstuvwxyz";

//aとbの最大公約数
ll gcd(ll a, ll b){
    if(b == 0) return a;
    else return gcd(b, a%b);
}

//aとbの最小公倍数
ll lcm(ll a, ll b){
    return a*b/gcd(a,b);
}

int main(){
    ll N;
    cin >> N;
    cout << lcm(N, 2) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
using namespace std;
const int mod = 1000000007;
#define ll long long


int main()
{
	int N;
	cin >> N;
	int ans = 1;
	while (ans * 2 <= N) {
		ans *= 2;
	}
	cout << ans << endl;
}


Measured memory_bytes: 3644
#include<stdio.h>
#include<string.h>

int main(){
char s[27];
char a;
int i;
int z=0;
int d;
int q=0;
scanf("%s",s);
for(i=0;i<strlen(s);i++){
	
	
	
	a=s[i];
	for(d=0;d<strlen(s);d++){
		if(a==s[d]){
			
			
			z++;
			
			
			
			
			
		}
		
		
		
		
		
		
		
	}
	if(z>1){
		
		
		
		q++;
		
		
		
		
		
		
	}
	z=0;
	
	
	
	
	
	
	
	
}
if(q==0){
	printf("yes\n");
	
	
}else{
	printf("no\n");
	
	
}
	return 0;
}

Measured memory_bytes: 128
'use strict'
const main = arg => {
	const input = arg.trim().split("\n");
	let A = input[0].split(' ')[0]
	let B = input[0].split(' ')[1]
	let C = input[0].split(' ')[2]
	let D = input[0].split(' ')[3]
	console.log(Math.max(A * B, C * D))
}   
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 11468
import bisect
import math
import sys
input = sys.stdin.readline

N, M = map(int, input().split())
if M % N == 0:
    print(M//N)
else:
    upper = math.ceil(M/N)
    factor = set()
    for i in range(1, int(M**0.5)+1):
        if M % i == 0:
            factor.add(i)
    
    factor1 = set()
    for i in factor:
        factor1.add(M//i)
    factor |= factor1
    
    factor = sorted(list(factor))
    print(factor[bisect.bisect_right(factor, upper)-1])

Measured memory_bytes: 3188