akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cassert>
#include <climits>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <fstream>

using namespace std;
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REPR(i,n) for(int i=(n)-1;i>=0;i--)
#define ALL(s) (s).begin(), (s).end()
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());
#define PAU system("pause")

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<vb> vvb;
const double EPS = 1e-9;
const int MOD = 1e9 + 7;
const int INF = (1 << 28);
const ll LINF = 1e18;
const double PI = acos(-1);

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	vvll dp(N + 1, vll(5 * 5 * 5));
	vector<char> AGC({'.','A','G','C','T'});
	dp[0][0] = 1;
	FOR(i, 1, N + 1) {
		REP(j, 5 * 5 * 5) {
			int nind = j % 25;
			FOR(k, 1, 5) {
				if (k == 3 && nind == 7)continue;
				if (k == 2 && nind == 8)continue;
				if (k == 3 && nind == 11)continue;
				if (k == 3 && j / 25 == 1) {
					if ((j % 25) / 5 != 1 && j % 5 == 2)continue;
					if ((j % 25) / 5 == 2 && j % 5 != 1)continue;
				}
				dp[i][nind * 5 + k] += dp[i - 1][j];
				dp[i][nind * 5 + k] %= MOD;
			}
		}
	}
	ll ans = 0;
	REP(i, 5 * 5 * 5) {
		ans += dp[N][i];
		ans %= MOD;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>

using namespace std;

#define LL long long
inline LL read() {
	LL x=0,f=1; char ch=getchar();
	while (ch<'0' || ch>'9') {if (ch=='-') f=-1; ch=getchar();}
	while (ch>='0' && ch<='9') {x=x*10+ch-'0'; ch=getchar();}
	return x*f;
}

int main() {
	LL x=read(),y=x%11;
	x=x/11; x*=2;
	if (!y) printf("%lld\n",x); else{
	if (y<=6) x++; else x+=2;
	printf("%lld\n",x);}
	return 0;
}

Measured memory_bytes: 256
from operator import itemgetter
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in range(0,n):
  ans.append([a[i],i+1])
ans= sorted(ans,key = itemgetter(0))
for j in range(n):
  print(ans[j][1],end = " ")

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

using namespace std;
typedef tuple<long long,long long,long long> iii;
vector<iii> vivukhue;
long long up[100005];

long long Find(long long x)
{
    if(!up[x])
        return x;
    else
    {
        long long root = Find(up[x]);
        up[x] = root;
        return root;
    }
}

void Union_set(long long x,long long y)
{
    long long rootx = Find(x);
    long long rooty = Find(y);

    up[rootx] = rooty;
}

long long MST()
{
    long long x,y,cost,minicost=0;
    for(long long i=0;i<vivukhue.size();i++)
    {
        tie(cost,x,y) = vivukhue[i];
        if(Find(x)!=Find(y))
        {
            minicost += cost;
            Union_set(x,y);
        }
    }

    return minicost;
}

signed main()
{
    long long n;
    cin>>n;

    iii a[n+1];
    iii b[n+1];
    for(long long i=1;i<=n;i++)
    {
        long long x,y;
        cin>>x>>y;
        a[i] = make_tuple(x,y,i);
        b[i] = make_tuple(y,x,i);
    }

    sort(a+1,a+n+1);
    for(long long i=2;i<=n;i++)
        vivukhue.push_back(make_tuple(get<0>(a[i])-get<0>(a[i-1]),get<2>(a[i-1]),get<2>(a[i])));

    sort(b+1,b+n+1);
    for(long long i=2;i<=n;i++)
        vivukhue.push_back(make_tuple(get<0>(b[i])-get<0>(b[i-1]),get<2>(b[i-1]),get<2>(b[i])));

    sort(vivukhue.begin(),vivukhue.end());
    for(long long i=0;i<vivukhue.size();i++)
    {
        long long cost,x,y;
        tie(cost,x,y) = vivukhue[i];
        //cout<<x<<" "<<y<<" "<<cost<<'\n';
    }
    long long miniumcost = MST();
    cout<<miniumcost;
}


Measured memory_bytes: 13040
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <map>
#include <string>
#include <utility>
#include <queue>

#define reps(i,s,n) for(int (i) = (s); (i) < (n); (i)++)
#define rep(i,n) reps(i,0,n)
using namespace std;
using ll = long long;

int N;
ll K,A[100010];
ll dp[61][2];
ll inf = 1e14;

int main(){
    cin >> N >> K;
    rep(i,N){
        cin >> A[i];
    }

    rep(dgt,61){
        rep(less,2){
            dp[dgt][less] = -inf;
        }
    }
    dp[0][0] = 0;

    rep(dgt,60){
        rep(less,2){
            if(0 <= dp[dgt][less]){
                int d = 59 - dgt;
                ll msk = 1LL << d;

                int zero = 0, one = 0;
                rep(i,N){
                    if(A[i] & msk) one++;
                    else zero++;
                }

                int isless = less;
                if(K & msk) isless = 1;
                dp[dgt+1][isless] = max(dp[dgt+1][isless] , dp[dgt][less] + one * msk);
                
                if((K & msk) || less == 1){
                    dp[dgt+1][less] = max( dp[dgt+1][less] , dp[dgt][less] + zero * msk);
                }

            }
        }
    }
    cout << max(dp[60][0],dp[60][1]) << endl;

    return 0;
}

Measured memory_bytes: 1024
input = $stdin.read.split("\n")
W, H = input.shift.split(" ").map(&:to_i)
pqs = input.map(&:to_i)

pcount = 0
qcount = 0
weight = 0

spqs = pqs.map.with_index {|w, i| [(i<W) ? :p : :q, w]}.sort_by(&:last)

spqs.each do |pq, w|
  if pq == :p
    weight += w * (H - qcount + 1)
    pcount += 1
  else
    weight += w * (W - pcount + 1)
    qcount += 1
  end
end

p weight

Measured memory_bytes: 32248
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
#include<stdio.h>
#include<cmath>
#include<limits>
#include<iomanip>

using namespace std;

template <class T> using V = vector<T>;

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 long long INF = 1LL << 60;

using ll = long long;
using db = long double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
using graph = V<V<int>>;
using pq = priority_queue<ll>;



#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>=(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define pb(a) push_back(a);



ll Sum(ll n) {
ll m=0;
  while(n){
    m+=n%10;
    n/=10;
  }
  return m;
}



const int MAX = 510000;
const int MOD = 1000000007;
 
long long fac[MAX], finv[MAX], inv[MAX];
 
void Comuse() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}


#define comuse Comuse()

ll combi(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll perm(int n,int k){
    if(n < k) return 0;
    if(n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] % MOD) % MOD;
}


ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}


vll div(ll n){
  vll ret;
  for(ll i=1;i*i<=n;i++){
    if(n%i==0){
      ret.push_back(i);
      if(i*i!=n){
        ret.push_back(n/i);
      }
    }
  }
  SORT(ret);
  return (ret);
}

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

    a=a*a%mod;
    
    n>>=1;
  }

  return ans;
}

void Solve();


const int MAX_N = 131072;
//segment tree 
int NN;
int seg[MAX_N*2-1];
void seguse(){
  for(int i=0;i<2*NN-1;i++){
    seg[i]=INT_MAX;
  }
}

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




/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
//segtreeの葉の先頭の添え字はn-1
void Solve(){
  //vll segtree(524287);
  //ll N=262144;
  ll h,w,n;
    cin>>h>>w>>n;
  cout<<(n+max(h,w)-1)/max(h,w)<<"\n";
}

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

using namespace std;

#define io freopen("test.txt", "r", stdin);
#define fast ios_base::sync_with_stdio(0);cin.tie(0);


#define ull unsigned long long int
#define lli long long int
#define li long int
#define ld long double

#define cout(x) cout<<x<<" "
#define coutn(x) cout<<x<<endl
#define newline cout<<endl

#define sz(x) (int)x.size()
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define ar array

#define pii pair<int,int>
#define pll pair<lli,lli>
#define pps pair<pair<int,int>, string>

const int MOD=1000000007;
const lli INF=1e18;
const int MX=100001;
const int N=1000000;

vector<vector<int>>g;
vector<bool>vis;
int n,m,x,y;

void dfs(int x){
    if(vis[x]) return;
    vis[x]=1;

    for(auto v:g[x]){
        dfs(v);
    }
}

void solve(){

    cin>>n>>m;

    g.resize(n);
    vis.resize(n);
    for(int i=0;i<n;i++) vis[i]=false;

    for(int i=0;i<m;i++){
        cin>>x>>y;
        x--,y--;
        g[x].pb(y);
        g[y].pb(x);
    }

    int c=0;

    for(int i=0;i<n;i++){
        if(!vis[i]){
            c++;
            dfs(i);
        }
    }

    cout<<c-1<<"\n";

}


int main(){
    fast
    // #ifndef godzqa
    //     io
    // #endif

    lli t=1;
    // cin>>t;

    while(t--){
        solve();
    }
    
    return 0;
}

Measured memory_bytes: 9204
#include <bits/stdc++.h>
#define fst first
#define snd second
#define rep(n) for(lint I = 0; (I) < (lint)(n); ++(I))
#define repeat(i, n) for(lint i = 0; (i) < (lint)(n); ++(i))
#define repeat_to(i, n) for(lint i = 0; (i) <= (lint)(n); ++(i))
#define repeat_from(i, m, n) for(lint i = (m); (i) < (lint)(n); ++(i))
#define repeat_from_to(i, m, n) for(lint i = (m); (i) <= (lint)(n); ++(i))
#define repeat_reverse_from_to(i, m, n) for(lint i = (m); (i) >= (lint)(n); --(i))
#define el cout<<endl
#define dump(x) cout<<" "<<#x<<"="<<x
#define vdump(v) for(size_t I=0; I<v.size(); ++I){cout<<" "<<#v<<"["<<I<<"]="<<v[I];} cout<<endl
using namespace std;
using lint = long long;
using ld = long double;

int main(void) {
    
    string a, b; cin >> a >> b;
    string s = a + b;
    int n = stoi(s);
    
    int m = sqrt(n);
    if (n == m * m) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<string>
#include<cstring>
using namespace std;
char s[200010];
int b[300], res[200010], nxt[200010][26]; 
int main() {
	scanf("%s", s);
	int n = strlen(s);
	int now_have = 0, need = 1;
	for(int i = n - 1; i >= 0; i--) {
		res[i] = need;
		if(!b[s[i]]) now_have++;
		b[s[i]] = 1;
		if(now_have == 26) {
			now_have = 0;
			memset(b, 0, sizeof(b));
			need++; 
		}
	}
	for(int i = 0; i <= 25; i++) nxt[n - 1][i] = n;
	for(int i = n - 2; i >= 0; i--) {
		for(int j = 0 ; j <= 25; j++)
		nxt[i][j] = nxt[i + 1][j];
		nxt[i][s[i + 1] - 'a'] = i + 1;
	} 
	for(int j = 0; j <= 25; j++)
	nxt[n + 1][j] = nxt[0][j];
	nxt[n + 1][s[0] - 'a'] = 0;
	int pos = n + 1;
	while(1) {
		int mi = n, mxn = pos, pre = pos;
		for(int i = 0; i <= 25; i++) {
			if(res[nxt[pos][i]] < mi) {
				mi = res[nxt[pos][i]];
				mxn = nxt[pos][i];
			}
		}
		pos = mxn; 
		if(mxn == n) {
			for(int i = 0; i <= 25; i++) {
				if(nxt[pre][i] == mxn) {
					printf("%c", 'a' + i);
					break;
				}
			}
			break;
		}
		printf("%c", s[mxn]);
	}
	
	return 0;
} 

Measured memory_bytes: 21504
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define pi 3.141592653589793238
#define int long long
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

// mt19937 gen_rand_int(chrono::steady_clock::now().time_since_epoch().count());
// mt19937_64 gen_rand_ll(chrono::steady_clock::now().time_since_epoch().count());
// mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

long long power(long long a, long long b,long long m) {
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a %m;
        a = a * a %m;
        b >>= 1;
    }
    return res;
}

int mm[1000005];
int pre[1000005];
int tot[1000005];
int sum[1000005];
signed main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);  
cout.tie(0);   

#ifndef ONLINE_JUDGE
    if(fopen("INPUT.txt","r"))
    {
    freopen ("INPUT.txt" , "r" , stdin);
    freopen ("OUTPUT.txt" , "w" , stdout);
    }
#endif  


    int n;
    cin>>n;
    string a;
    cin>>a;
    a="#"+a;
    int x=0;
    for(int i=1;i<=n;i++)
    {
        if(a[i]=='M')
            x++;
        else if(a[i]=='C')
        {
            mm[i]=x;        
            tot[i]++;
        }
        tot[i]+=tot[i-1];
        pre[i]=pre[i-1]+mm[i];
        sum[i]=x;
    }

    int q;
    cin>>q;
    while (q--)
    {
        int k;
        cin>>k;
        int ans=0;
        for(int i=1;i<=n;i++)
        {
            if(a[i]=='D')
            {
                ans+=pre[min(n,i+k-1)]-pre[i];            
                ans-=(tot[min(n,i+k-1)]-tot[i])*sum[i];
            }
        }
        cout<<ans<<'\n';
    }
    
} 
    


Measured memory_bytes: 35660
#include <bits/stdc++.h>
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define show(x) cout << #x << " = " << (x) << endl
#define show2(x,y) cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl
#define show3(x,y,z) cout << #x << " = " << (x) << ", " << #y << " = " << (y) <<  ", " << #z << " = " << (z) << endl
#define showv(v) rep(i,v.size()) printf("%d%c", v[i], i==v.size()-1?'\n':' ')
#define showv2(v) rep(j,v.size()) showv(v[j])
#define showt(t,n) rep(i,n) printf("%d%c", t[i], i==n-1?'\n':' ')
#define showt2(t,r,c) rep(j,r) showt(t[j],c)
#define showvp(p) rep(i,p.size()) printf("%d %d\n", p[i].first, p[i].second);
#define printv(v) rep(i,v.size()) printf("%d\n", v[i])
#define printt(t,n) rep(i,n) printf("%d\n", t[i])
#define incl(v,x) find(rng(v),x)!=v.end()
#define incls(s,c) s.find(c)!=string::npos
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define bit(n,k) ((n>>k)&1) // nのk bit目
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vs = vector<string>;
using P = pair<int, int>;
using T = tuple<int, int, int>;
using vp = vector<P>;
using vt = vector<T>;
const int mod = 1000000007;
const double EPS = 1e-9;
//const long double EPS = 1e-14;
const int INF = (1<<30)-1;
const ll LINF = (1LL<<62)-1;
#define dame { puts("No"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
inline int in() { int x; scanf("%d",&x); return x;}
//template<class T = int> inline T in() { T x; cin >> x; return (x);}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int main () {
  int n;
  cin >> n;
  vi a(n);
  rep(i,n) cin >> a[i];
  
  bool ok = true;
  rep(i,n) {
    if (a[i]%2 == 0) {
      if (!(a[i]%3 == 0 || a[i]%5 == 0)) ok = false; 
    }
  }

  if (ok) puts("APPROVED");
  else puts("DENIED");
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
struct node
{
	int first,second;
};
node dp[100][100001];
int main()
{
	 long long int m=1000000007;
     long long int n,k;
     cin >> n >> k;
     long long int arr[n],i,j;
     for(i=0;i<n;i++)
     cin >> arr[i];
     memset(dp,0,sizeof(dp));
     for(i=0;i<n;i++)
     {
     	dp[i][0].first=1;
     	dp[i][0].second=1;
	 }
     for(i=0;i<n;i++)
     {
     	for(j=1;j<=k;j++)
     	{
     		if(i==0&&j!=1)
     		{
     			if(j<=arr[i])
			 	{	
			 		dp[i][j].first=1;
					dp[i][j].second=(dp[i][j-1].second%m+dp[i][j].first%m)%m;	
			 	}
				else
				{
					dp[i][j].first=0;
					dp[i][j].second=(dp[i][j-1].second%m+dp[i][j].first%m)%m;
				}	
			}
			else if(j==1)
			{
				if(i==0)
				{
					if(arr[i]>=1)
					dp[i][j].first=1;
					else
					dp[i][j].first=0;
				}
				else
				{
					if(arr[i]>=1)
					dp[i][j].first=dp[i-1][j].first+1;
					else
					dp[i][j].first=dp[i-1][j].first;
				}
				dp[i][j].second=(dp[i][j-1].second%m+dp[i][j].first%m)%m;
			}
			else
			{
				if(j<=arr[i])
				{
					dp[i][j].first=dp[i-1][j].second;
					dp[i][j].second=(dp[i][j-1].second%m+dp[i][j].first%m)%m;
				}
				else
				{
					dp[i][j].first=(dp[i-1][j].second%m-dp[i-1][j-arr[i]-1].second%m+m)%m;
					dp[i][j].second=(dp[i][j-1].second%m+dp[i][j].first%m)%m;
				}
			}
		}
	 }
//	 for(i=0;i<n;i++)
//	 {
//	 	for(j=0;j<=k;j++)
//	 	{
//	 		cout << dp[i][j].first << " " << dp[i][j].second << "|";
//		}
//		cout << "\n";
//	 }
	 cout << dp[n-1][k].first;
     return 0;	
}

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

#define fi first
#define se second
#define sz(a) (int)(a).size()
#define all(a) (a).begin(), (a).end()
#define reset(a, v) memset((a), v, sizeof(a))

using namespace std;

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

int main() {
	int n, m; scanf("%d %d", &n, &m);
	if (n==m) printf("Yes\n");
	else printf("No\n");
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>


#define MIN(X,Y) X<Y?X:Y
#define MAX(X,Y) X>Y?X:Y


int main(void){
    int A,B;
    int max = 0;
    scanf("%d %d",&A,&B);
    max = MAX(A+B,A-B);
    max = MAX(max,A*B);


    printf("%d",max);
    
    
    return 0;
}

Measured memory_bytes: 128
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 n = read_as_vec::<usize>()[0];
    let a = read_as_vec::<u64>();

    let mut ans = 100000000;
    for &elem in &a{
        let mut elem = elem;
        let mut tmp = 0;
        while elem%2 == 0{
            elem /= 2;
            tmp += 1;
        }

        ans = cmp::min(tmp, ans);
    }

    println!("{}", ans);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define Clear(a) a = decltype(a)()
#define all(a) a.begin(),a.end()
#define vec vector
typedef long long ll;
typedef pair<int,int> p;
//const ll big=998244353;
const ll big=1000000007;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
ll max(ll x,ll y){
if(x>y)return x;
else return y;
}
ll min(ll x,ll y){
if(x<y)return x;
else return y;
}
ll expm(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||x==0)return x;
    if(y%2==1)return (expm(x,y-1)*x)%big;
    ll t=expm(x,y/2);
    return (t*t)%big;
}
ll exp(ll x,ll y){
    if(y==0)return 1;//0^0=1
    if(x==1||y==0)return x;
    if(y%2==1)return exp(x,y-1)*x;
    ll t=exp(x,y/2);
    return t*t;
}
ll inv(ll x){
    return expm(x,big-2);
}


int main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    cout << fixed << setprecision(10);
    /*--------------------------------*/

    int n,m;cin >> n >> m;
    string s;cin >> s;
    vec<int> ans;
    rep(i,s.size()-m){
        bool ok=false;
        for(int j=i;j<i+m;j++){
            if(s[j]=='0'){ok=true;break;}
        }
        if(!ok){
            cout << -1 << endl;
            return 0;
        }
    }

    int now=n;
    while(now>0){
        for(int i=max(0,now-m);i<now;i++){
            if(s[i]=='0'){
                ans.push_back(now-i);
                now=i;
                break;
            }
        }
    }
    for(int i=(int)ans.size()-1;i>=0;i--)cout << ans[i] << endl;
}

Measured memory_bytes: 4028
typedef long long int li;
	
	#include<bits/stdc++.h>

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

    		li n;

    		cin>>n;

    		li a[n];

    		for(li i=0;i<n;i++)
    			cin>>a[i];

    		double temp=0;

    		for(int i=0;i<n;i++)
    		{
    			temp+=(1.00/(double)a[i]);
    		}

    		double ans=1.0/temp;

    		cout<<fixed<<setprecision(8)<<ans;

		return 0;
	}

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

int main(){
	string s,t; cin >> s >> t;
	ll n,m; n = s.size(); m = t.size();
	reverse(s.begin(), s.end());
	reverse(t.begin(), t.end());
	if(m > n){
		cout << "UNRESTORABLE" << endl;
		return 0;
	}
	bool c = false;	
	rep(i,n-m+1){
		bool r = true;
		rep(j,m)if(t[j] != s[i+j] && s[i+j] != '?')r = false;
			if(r){
				c = true;
				rep(j,m)s[i+j] = t[j];
			}
			if(c)break;
	}
	if(!c)cout << "UNRESTORABLE" << endl;
	else {
		reverse(s.begin(), s.end());
		rep(i,n)if(s[i] == '?')s[i] = 'a';
		cout << s << endl;
	}

}

Measured memory_bytes: 256
#ifdef DEBUG

#else

#    pragma GCC optimize("O3,no-stack-protector")
#    pragma GCC optimize("unroll-loops")

#    if __cplusplus >= 201703L
#        pragma GCC target("avx2")
#    else
#        pragma GCC target("avx")
#    endif

#endif
// 実数の場合
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;
typedef long double Ld;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

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

    // 頂点数と辺数
    Int N, M;
    cin >> N >> M;
    vector<Int> H(N);
    for (Int i = 0; i < N; i++) {
        cin >> H[i];
    }

    // グラフ
    Graph G(N);
    for (Int i = 0; i < M; ++i) {
        Int a, b;
        cin >> a >> b;
        a--;
        b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    vector<bool> ans(N, true);
    for (Int v = 0; v < N; v++) {
        for (auto nv : G[v]) {
            if (H[v] <= H[nv]) {
                ans[v] = false;
                break;
            }
        }
    }

    Int a = 0;
    for (Int i = 0; i < N; i++) {
        if (ans[i]) {
            a++;
        }
    }

    cout << a << endl;

    return 0;
}


Measured memory_bytes: 9800
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define invrepr(i,a,b) for(int i=b-1;i>=a;i--)
#define invrep(i,n) invrepr(i,0,n)
const int MOD=1e9+7;
 
int main() {
    string s;
    cin >> s;
    if (s[2]==s[3] && s[4]==s[5]) cout << "Yes" << endl;
    else cout << "No" << endl; 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
//typedef tree <int,null_type,less <int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;
#define rep(g, i, n) for (ll g = i; g < n; g++)
#define rev(g, n, i) for (ll g = n - 1; g >= i; g--)
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define all(v) v.begin(), v.end()
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define um unordered_multiset
#define us unordered_set
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define cc continue
#define bb break
#define rem 1000000007
#define debug(n1) cout<<"debug... "<<n1<<"\n"
#define PI 3.141592653589793238462643383279502
//fflush(stdin);
// do {
// // process permutation
// } while (next_permutation(permutation.begin(),permutation.end()));
class abc
{
    public:
    ll x,y;
};
int main()
{
    FAST
    // freopen("input1.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    /*ll tests;
    cin>>tests;
    rep (gg,0,tests)
    {}*/
    ll a,b,c;
    cin>>a>>b>>c;
    if (a+b+c>=22)
    {
        cout<<"bust\n";
    }
    else
    {
        cout<<"win\n";
    }
    
}


Measured memory_bytes: 256
t[9999],W,N,a,b,i;main(c){for(;scanf("%d%d",&W,&N)-1;printf("Case %d:\n%d\n%d\n",c++,t[W],i),memset(t,0,W*9)){for(;N--&&scanf("%d,%d",&a,&b);)for(i=W;i>=b;i--)t[i]=fmax(t[i],t[i-b]+a);for(i=0;t[++i]-t[W];i);}}

Measured memory_bytes: 0
import java.util.Scanner;
public class Main {
	public static void main(String[] args) throws java.io.IOException {
		Scanner scan = new Scanner(System.in);
		String t;
		int a = 0;
		int b = 0;
		int ab = 0;
		int o = 0;
		while(scan.hasNext()){
			t = scan.next();
			if(t == null){
				break;
			}
			String[] k = t.split(",", 0);
			if(k[1].equals("A")){
				++a;
			}else if(k[1].equals("B")){
				++b;
			}else if(k[1].equals("AB")){
				++ab;
			}else{
				++o;
			}
		}
		System.out.println(a + "\n" + b + "\n" + ab + "\n" + o);
	}
}

Measured memory_bytes: 17164
import numpy as np
n,k = map(int,input().split())
p_ls = list(map(int, input().split()))
e_ls = [0] * n
for i in range(n):
    p = p_ls[i]
    e = (p*(1+p) // 2) / p
    e_ls[i] = e
e_csum = list(np.cumsum(e_ls))
max_exp = 0
for start in range(n):
    if start > 0 and start+k-1 < n:
        sum_exp = e_csum[start+k-1] - e_csum[start-1]
    elif start == 0:
        sum_exp = e_csum[start + k - 1]
    max_exp = max(max_exp, sum_exp)
print(max_exp)


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

def squ(x):
    if x == 0:
        return '0'
    a = ""
    while x != 0:
        x, mod = divmod(x, 4)
        a += str(mod)
    return a[::-1]


ans = 0

for x in range(10**6):
    x_squ = squ(x)
    x_str = x_squ.replace('3', '7').replace('2', '5').replace('1', '3')

    if "0" in x_str:
        continue

    if int(x_str) > n:
        break

    if len(set(x_str)) != 3:
        continue

    ans += 1

print(ans)


Measured memory_bytes: 3188
#include<stdio.h>

int main(){
  int a,b,c,d,e,f;
  scanf("%d%d%d%d%d%d",&a,&b,&c,&d,&e,&f);

  double maxnodo=0;
  int a0,b0,c0,d0;
  for(int i=0;100*a*i<=f;i++){
    for(int j=0;100*a*i+100*b*j<=f;j++){
      for(int k=0;100*a*i+100*b*j+c*k<=f;k++){
        int m=f-(100*a*i+100*b*j+c*k);
        int dnum=m/d;
        for(int l=0;l<=dnum;l++){
          double nodo=((double)(c*k+d*l))/((double)(100*a*i+100*b*j+c*k+d*l));
          //printf("%d %d %d %d %lf %lf\n",i,j,k,dnum,nodo,((double)(e))/((double)(100+e)));
          if(maxnodo<=nodo && nodo<=((double)(e))/((double)(100+e))){
            maxnodo=nodo;
            a0 = i;
            b0 = j;
            c0 = k;
            d0 = l;
          }
        }
      }
    }
  }
  printf("%d %d\n",100*a*a0+100*b*b0+c*c0+d*d0,c*c0+d*d0);
  return 0;
}


Measured memory_bytes: 128
k = int(input())
s = input()
n = len(s)
mod = 10 ** 9 + 7

fac = [1] * (n + k + 2)
for i in range(1, n + k + 1):
    fac[i] = fac[i - 1] * i % mod


def c(n, k):
    return fac[n] * pow(fac[n - k] * fac[k] % mod, mod - 2, mod) % mod


ans = 0
for i in range(k + 1):
    ans += c(n - 1 + k - i, k - i) * \
        pow(25, k - i, mod) * pow(26, i, mod) % mod
    ans %= mod
print(ans)


Measured memory_bytes: 91344
fun main(args:Array<String>) {
    val n = readLine()!!.toInt()
    val a = readLine()!!.split(" ").map { it.toLong() }
    val arr = mutableListOf<Long>()
    arr.add(a[0])
    (1 until n).forEach {arr.add(Math.max(arr.last(), a[it]))}
    var ans = (0 until n).count { a[it] >= arr[it] }
    println(ans)
}


Measured memory_bytes: 36872
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int a, b, c;
  int k;
  cin >> a >> b >> c >> k;
  int mx = max(a, max(b, c));
  int ans = mx * pow(2, k) + a + b + c - mx;
  cout << ans << endl;
}

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

using namespace std;

#define ll long long

ll n, a[200005], l[200005], r[200005], ans;

int main() {
    cin >> n;
    for (int i = 1; i <= n; i++){
        cin >> a[i];
        if (i - a[i] > 0){
            l[i - a[i]]++;
        }
        if (i + a[i] <= n){
            r[i + a[i]]++;
        }
    }
    ans = 0;
    for (int i = 1; i <= n; i++){
        ans += (l[i] * r[i]);
    }
    cout << ans;
}

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

using namespace std;
const int Nmax = 1e5 + 100;

int n, avail[Nmax], ass[Nmax], t, res;
vector<int> a[Nmax];

bool visit(int u) {
    if (avail[u] != t) avail[u] = t;
    else return false;
    for(int i = 0; i < (int)a[u].size(); ++i) {
        int v = a[u][i];
        if (!ass[v] || visit(ass[v])) {
            ass[v] = u;
            return true;
        }
    }
    return false;
}

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    cin >> n;
    for(int i = 1; i <= n-1; ++i) {
        int u, v; cin >> u >> v;
        a[u].push_back(v);
        a[v].push_back(u);
    }
    for(int i = 1; i <= n; ++i) {
        ++t;
        res += visit(i);
    }
    cout << (res == n ? "Second" : "First");
}


Measured memory_bytes: 6656
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll n,a,b,k,tmp,ans;
int main(){
	scanf("%d%d%d",&n,&a,&b);
	for(int i=1;i<=n;i++){
		k=i;tmp=0;
		while(k){
			tmp+=k%10;
			k/=10;
		}
		if(tmp>=a&&tmp<=b) ans+=i;
	}
	printf("%lld",ans);
}

Measured memory_bytes: 256
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	string s;int a;
    cin>>s;
    a=s.size();
    for(int i=0;i<a;i++)
    {
        if(s[i]=='C')
        {
            for(int j=i+1;j<a;j++)
            {
                if(s[j]=='F')
                {
                    cout<<"Yes"<<endl;
                    return 0;
                }
            }
        }
    }
    cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fi(i,a,b) for(ll i=a-1;i>=b;i--)
#define endl '\n'
#define spc " "
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define pi 3.14159265358979323
#define sz(a) (int)((a).size())
#define len(a) (int)(a.length())
#define FOR(i,j,k,l) for(ll i=j;i<k;i+=l)
#define CC(x) cout<<x<<endl


void Fast_IO() {
   ios::sync_with_stdio(0);
   cin.tie(0);
   #ifndef ONLINE_JUDGE
   freopen("input.in","r",stdin);
   freopen("output.out","w",stdout); 
   #endif
} 

int main(){
   Fast_IO();
   ll l,r,d;
   cin>>l>>r>>d;
   ll ans=0;
   f(i,l,r+1){
      if(i%d==0) ans++;
   }
   CC(ans);
}



Measured memory_bytes: 3608
#include<iostream>
#include<vector>
#include<queue>
using namespace std;

int INF = 100000000;
bool res = true;

struct edge {
	int to;
	int cost;
};

vector<int> vis(100010, INF);
vector<edge> G[100010];

void bfs(int k) {
	queue<int> que;
	que.push(k);
	vis[k] = 0; //訪れた

	while (!que.empty()) {
		int p = que.front(); que.pop();

		for (int i = 0; i < G[p].size(); i++) {
			edge e = G[p][i];

			//cout << e.to << " " << e.cost << endl;

			if (vis[e.to] == INF) {
				vis[e.to] = vis[p] + e.cost;
				que.push(e.to);
			}
			else if (vis[e.to] != vis[p] + e.cost) {
				res = false;
			}
		}
	}
}

int main() {
	int n, m;
	int l, r, d;

	cin >> n >> m;

	for (int i = 1; i <= m; i++) {
		cin >> l >> r >> d;

		G[l].push_back(edge{ r, d }); // [100010]を付けると解決
		G[r].push_back(edge{ l, -d });
	}

	for (int i = 1; i <= n; i++) {
		if (vis[i] == INF && G[i].size() != 0) bfs(i); //まだ訪れていないかつG[i]の要素があるとき幅優先探索
	}

	if (res) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 10740
#include<iostream>
#include<vector>
#include<cstring>

using namespace std;

long long memo[60][1000];

vector<int> X;

long long solve(int i, long long j) {
	if (memo[i][j] != -1) return memo[i][j];
	if (i == X.size()) return (j == 0);
	return memo[i][j] = (solve(i + 1, j) + solve(i + 1, j + X[i]));
}

int main() {
	int n, a;
	cin >> n >> a;
	X.resize(n);
	for (int i = 0; i < n; i++)cin >> X[i];
	for (auto &v : X)v -= a;
	memset(*memo, -1, sizeof(memo));
	cout << solve(0, 0) - 1 << endl;
}

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

int main(void) {
	int A, B, K; cin >> A >> B >> K;
	int i;

	if ((B - A) / 2 + 1 <= K) {
		for (i = A; i <= B; i++) {
			cout << i << endl;
		}
	}
	else {
		for (i = A; i < A + K; i++) {
			cout << i << endl;
		}
		for (i = B - K + 1; i <= B; i++) {
			cout << i << endl;
		}
	}

	return 0;
}




Measured memory_bytes: 256
#include <iostream>
#include<bits/stdc++.h>
#include<vector>
#include<string>
#define ll long long
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define vi vector<ll>
#define el printf("\n")
#define N 100001
using namespace std;



int main()
{   IOS;
cout.precision(30);
   ll n,q;
   cin >> n >> q;
   string ch;
   cin >> ch;
   vi L(n,0);
   for(int j=0;j<n-1;j++)
   {    L[j+1]=L[j];
       if (ch[j]=='A' && ch[j+1]=='C')
        L[j+1]++;
   }

   for(int i=0;i<q;i++)
   {
       ll l , r,res=0;
       cin >> l >> r;
       res=L[r-1]-L[l-1];

       cout << res << endl;
   }

    return 0;
}


Measured memory_bytes: 1872
using System;

namespace ChokudaiScanner
{
    class MainClass
    {
        static void Main()
        {
            Scanner cin = new Scanner();

            int N = cin.NextInt();
            int A = cin.NextInt();

            if (N % 500 <= A)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }

    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }

        public string Next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return Next();
            i = 0;
            return s[i++];
        }

        public string[] ArrayNext(int N)
        {
            string[] Array = new string[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = Next();
            }
            return Array;
        }

        public int NextInt()
        {
            return int.Parse(Next());
        }
        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = NextInt() + add;
            }
            return Array;
        }

        public long NextLong()
        {
            return long.Parse(Next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = NextLong() + add;
            }
            return Array;
        }

        public double NextDouble()
        {
            return double.Parse(Next());
        }


        public double[] ArrayDouble(int N, double add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = NextDouble() + add;
            }
            return Array;
        }
    }
}



Measured memory_bytes: 27508
n, k = map(int, input().split())
#n=num of lagage
#k=num of trucks
a = []

#import sys
#input = sys.stdin.readline

a = [int(input()) for _ in range(n)]

def isOk(mx):
    num_t = 0
    t = 0
    for i in range(n):
        if a[i]>mx:
            return False
        t += a[i]
        if t>mx:
            t = a[i]
            num_t += 1
            if num_t == k:
                return False
    return True

l = sum(a)//k - 1
r = sum(a)

while l<r:
    m = (l+r)//2
    if isOk(m):
        r = m 
    else:
        m += 1
        l = m

print(m)


Measured memory_bytes: 9560
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <utility>
#include <tuple>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<int, int>;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...) do{ } while(false)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template<typename T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }
template<typename T> void print(T a) { cout << a << endl; }
template<typename T, typename... Ts> void print(T a, Ts... ts) { cout << a << ' '; print(ts...); }
template<typename T> istream &operator,(istream &in, T &t) { return in >> t; }
// clang-format on

class UnionFind {
public:
    vector<int> par;
    int N;
    UnionFind(int n) {
        par.resize(n, -1);
        N = n;
    }
    int Find(int n) {
        return par[n] < 0 ? n : par[n] = Find(par[n]);
    }
    bool Union(int x, int y) {
        x = Find(x);
        y = Find(y);
        if (x == y) return false;
        if (-par[x] > -par[y]) swap(x, y);
        par[y] += par[x];
        par[x] = y;
        N--;
        return true;
    }
    bool Same(int x, int y) {
        return Find(x) == Find(y);
    }
    int size(int x) {
        return -par[Find(x)];
    }
    int size() {
        return N;
    }
};

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, m, k;
    cin, n, m, k;
    UnionFind uf(n);
    vector<int> ans(n, 0);
    REP(i, 0, m) {
        int a, b;
        cin, a, b;
        a--;
        b--;
        uf.Union(a, b);
        ans[a]--;
        ans[b]--;
    }

    REP(i, 0, k) {
        int a, b;
        cin, a, b;
        a--;
        b--;
        if (uf.Same(a, b)) {
            ans[a]--;
            ans[b]--;
        }
    }
    REP(i, 0, n) {
        ans[i] += uf.size(i);
    }

    REP(i, 0, n) {
        cout << ans[i] - 1 << " \n"[i + 1 == n];
    }

    return 0;
}


Measured memory_bytes: 1664
'use strict';
const main = val => {
  const s = val[0].trim();
  let ans;
  if (s == 'Sunny') ans = 'Cloudy';
  if (s == 'Cloudy') ans = 'Rainy';
  if (s == 'Rainy') ans = 'Sunny';
  console.log(ans);
}
main(require("fs").readFileSync("/dev/stdin", "utf8").split('\n'));


Measured memory_bytes: 7372
while True:
    h,w = map(int,input().split())
    if h==0 and w==0:
        break

    for i in range(0,h):
        for k in range(0,w):
            if (i+k)%2==0:
                print('#',end='')
            else:
                print('.',end = '')
        print()
    print()


Measured memory_bytes: 7004
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define enld endl //* missspell check
const ll INF = 1LL << 60;


void solve(long long A, long long B, long long C){
    ll ans = B+C;

    if(A+B>=C-1){
        cout << ans<<endl;
    }
    else{
        cout << ans - (C-(A+B))+1<<endl;
    }
    
}

int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long C;
    scanf("%lld",&C);
    solve(A, B, C);
    return 0;
}


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


long long  INF=1000000000000000000;
long long mod=1000000007;
using namespace std;


int main(){
int  N;
cin>>N;
double ans;
if(N%2==0){
double n=N;
 ans=(n/2)/n;
}
else{
    double n=N;
    ans=((N/2)+1)/n;
}
cout<<ans<<endl;
 return 0;
}

Measured memory_bytes: 256
A = list(input())
B = list(input())
C = list(input())
ans = 'A'
moji = A.pop(0)

while True:
    
    if moji == 'a':
        
        if len(A) == 0:
            ans = 'A'
            break
        moji = A.pop(0)
    
    elif moji == 'b':
        
        if len(B) == 0:
            ans = 'B'
            break
        moji = B.pop(0)
        
    elif moji == 'c':
        
        if len(C) == 0:
            ans ='C'
            break
        moji = C.pop(0)
    
print(ans)

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

int n, q, m;
int A[50];

bool solve(int i, int m) {
  if (m == 0) {
    return true;
  }
  if (i > n - 1) {
    return false;
  }
  bool res = solve(i + 1, m) || solve(i + 1, m - A[i]);
  return res;
};


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

  cin >> q;
  for (int i = 0; i < q; i++) {
    cin >> m;
    if (solve(0, m)) cout << "yes" << endl;
    else cout << "no" << endl;
  }
};



Measured memory_bytes: 3112
#include <stdio.h>
#define N 102

int main()
{
  int i,j,k,l,n,m;
  int Adj[N][N];
  
  scanf("%d",&n);

  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      Adj[i][j] = 0;
    }
  }

  for(i=1;i<=n;i++){
    scanf("%d%d",&k,&l);
    for(j=1;j<=l;j++){
      scanf("%d",&m);
      Adj[k][m]=1;
    }
  }
  
  for(i=1;i<=n;i++){
    for(j=1;j<=n;j++){
      if(j==n){
	printf("%d\n",Adj[i][j]);
      }
      else {
	printf("%d ",Adj[i][j]);
      }
    }
  }
  return 0;
}

Measured memory_bytes: 636
// g++ macro.cpp -std=c++14
#include <bits/stdc++.h> //STL include
typedef long long ll;// long long int
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;//namespace

#define dump(x)  cout << #x << " = " << (x) << endl;// debug cout
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl;

#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)// for macro
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)

#define FOREACH(x,a) for(auto& (x) : (a) )

#define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);// warshall-floyd

#define CIN(x) int x;cin>>x;
#define CIN2(x,y) int x,y;cin>>x>>y;
#define CIN3(x,y,z) int x,y,z;cin>>x>>y>>z;
#define SCIN(x) string x;cin>>x;
#define SCIN2(x,y) string x,y;cin>>x>>y;
#define COUT(x) cout<<(x)<<endl;
#define SCOUT(x) cout<<(x)<<" ";
#define ENDL cout<<endl;

#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_;
#define VECIN2(x,y) REP(i,x.size())cin>>x[i]>>y[i];
#define VECCOUT(x) for(auto&youso_: (x) )cout<<youso_<<" ";cout<<endl;

#define ALL(obj) (obj).begin(),(obj).end()// iterator

#define EXIST(n,x) (find(ALL(n),x)!=n.end())
#define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end())


#define P pair<int,int>
#define V vector<int>
#define M map<int,int>
#define S set<int>
#define L list<int>

#define pb(a) push_back(a)//push_back
#define mp make_pair// make_pair


int main(){
    CIN2(n,t);V v(n);VECCIN(v);
    ll ans=0;
    ll now=0;
    REP(i,n){
        ans+=max(0LL,min(1LL*t,v[i]+t-now));
        now=v[i]+t;
    }
    COUT(ans);

    return 0;
}


Measured memory_bytes: 1024
function Main(input) {
  input=input.split("\n");
　var array=input[0].split(" ");
  array.sort();
  var counter=0;
  var previous="";
  array.forEach(e=>{
    counter+=(previous===e)?0:1;
    previous=e;
  });
  
  
  console.log(counter);
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
  
  


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

int main(){
  int N;
  cin >> N;
  
  vector<int> H(N);
  for(int i=0; i<N; i++){
    cin >> H.at(i);
  }
  
  bool can=true;
  for(int i=N-1; i>=1; i--){
    if(H.at(i-1)-1==H.at(i)){
      H.at(i-1) -= 1;
    }
    else if(H.at(i-1)-1>H.at(i)){
      can=false;
      cout << "No" << endl;
      break;
    }
  }
  if(can) cout << "Yes" << endl;
  return 0;
}

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

int main() {
  int a,b,num,sum = 0;
  cin >> a >> b;

  for(int i = a; i <= b; ++i){
    int r = 0;
    num = i;
    for(int j = 0; j < 5; ++j){
      r = r*10 + num%10;
      num /= 10;
    }
    if(i==r) ++sum;
  }
  cout << sum << endl;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll> 
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) a.begin(),a.end()
#define rep(i,n) for(ll i=0;i<(ll)n;++i)
#define print(a) cout << a << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;cin>>n;
  lvector A(n+1,0);
  rep(i,n) cin>>A[i+1];
  vector<lvector> dp(3,lvector(n+2,-1e18));
  dp[0][0]=0;
  rep(i,n+1) {
    rep(j,3) if(i) dp[j][i+1]=max(dp[j][i+1],dp[j][i-1]+A[i]);
    rep(j,2) dp[j+1][i+1]=max(dp[j+1][i+1],dp[j][i]);
  }
  print(dp[1+n%2].back());
  return 0;
}


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

int main(){
  int num[13] = {-1, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1};
  int a, b;
  cin >> a >> b;
  if ( num[a] == num[b] ) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    int n;
    cin>>n;
    if(n==25)cout<<"Christmas"<<endl;
    else if(n==24) cout<<"Christmas Eve"<<endl;
    else if(n==23)cout<<"Christmas Eve Eve"<<endl;
    else {
        cout<<"Christmas Eve Eve Eve"<<endl;
    }

}

Measured memory_bytes: 3556