akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;


int main() {
    int64_t A, B, C, count;
    cin >> A >> B >> C;
    if (A == B && B == C){
        if (A % 2 == 1){
            cout << 0 << endl;
            return 0;
        }
        cout << -1 << endl;
    }
    else {
        for (count = 0; A % 2 == 0 && B % 2 == 0 && C % 2 == 0; count++){
            int a, b, c;
            a = B / 2 + C / 2;
            b = A / 2 + C / 2;
            c = A / 2 + B / 2;
            A = a;
            B = b;
            C = c;
        }
        cout << count << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define mp make_pair
typedef long long int  ll;
#define loop() for(int i=0; i<(n); i++)
const ll MOD=998244353;
ll fast_exp(ll base, ll exp) 
{
    ll res=1;
    while(exp>0) 
    {
       if(exp%2==1) 
       	res=(res*base)%MOD;
       base=(base*base)%MOD;
       exp/=2;
    }
    return res%MOD;
}

ll gcdExtended(ll a, ll b, ll *x, ll *y);   

ll modInverse(ll b, ll m) 
{ 
    ll x, y; // used in extended GCD algorithm 
    ll g = gcdExtended(b, m, &x, &y); 
  
    // Return -1 if b and m are not co-prime 
    if (g != 1) 
        return -1; 
  
    // m is added to handle negative x 
    return (x%m + m) % m; 
} 
  
// Function to compute a/b under modlo m 
ll modDivide(ll a, ll b, ll m) 
{ 

    a = a % m; 
    ll inv = modInverse(b, m); 
    return (inv * a) % m; 
} 
  
// C function for extended Euclidean Algorithm (used to 
// find modular inverse. 
ll gcdExtended(ll a, ll b, ll *x, ll *y) 
{ 
    // Base Case 
    if (a == 0) 
    { 
        *x = 0, *y = 1; 
        return b; 
    } 
  
    ll x1, y1; // To store results of recursive call 
    ll gcd = gcdExtended(b%a, a, &x1, &y1); 
  
    // Update x and y using results of recursive 
    // call 
    *x = y1 - (b/a) * x1; 
    *y = x1; 
  
    return gcd; 
}
ll calc(ll diff,ll x)
{
	ll a=fast_exp(x,diff)-1;
	ll b=x-1;
	return modDivide(a,b,MOD);
}


void solve()
{
	//code	
	ll l,r,d;
	cin>>l>>r>>d;
	ll count=r/d-l/d;
	if(l%d==0)
		count++;
	cout<<count<<endl;
	
}


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

Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using Edge = pair<int,int>; // (隣接頂点, 辺番号)
using Graph = vector<Edge>;
int N;


int main() {
    cin >> N;
    Graph G[N];
    for (int i = 0; i < N-1; ++i) {
        int a, b; cin >> a >> b; --a, --b;
        G[a].emplace_back(b, i); 
        G[b].emplace_back(a, i);
    }
    int max_color = 0;
    for (int i = 0; i < N; ++i) chmax(max_color, (int)G[i].size());
    vector<int> res(N-1, -1);

    vector<int> dist(N, -1);
    queue<pair<int,int>> que; // (頂点, 前回の色)
    que.push({0, -1});
    dist[0] = 0;
    while (!que.empty()) {
        auto p = que.front(); que.pop();
        int v = p.first, c = p.second;
        int color = 1;
        if (color == c) ++color;
        for (auto e : G[v]) {
            if (dist[e.first] == -1) {
                dist[e.first] = dist[v] + 1;
                que.push({e.first, color});
                res[e.second] = color;
                ++color;
                if (color == c) ++color;
            }
        }
    }
    cout << max_color << endl;
    for (auto v : res) cout << v << endl;
}


Measured memory_bytes: 7424
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main(){
	int n;
  cin>>n;
  lli a=0, b=0;
  lli c;
  for(int i=0;i<n;i++){
  	cin>>c;
    a += c;
    a %= 1000000007;
    b += c*c;
    b %= 1000000007;
  }
  cout<<((a*a - b)%1000000007)*(500000004) % 1000000007;
  return 0;
}


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

typedef long long ll;

const int mx=1e6+7;
const int mod=1e9+7;

int phi(int n) {
	int result=n;
	for (int i=2; i*i<=n; i++) {
		if(n%i==0) result-=result/i;
		while(n%i==0) n/=i;
	}
	if(n>1) result-=result/n;
	return result;
}

// (a^b)%m
ll exp(ll a, ll b, ll m) {
	ll r=1;
	while(b) {
		if(b%2) r=(r*a)%m;
		a=(a*a)%m;
		b/=2;
	}
	return r;
}

// a^-1 %m, any m
ll inv(ll a, ll m) {
	return exp(a, phi(m)-1, m);
}

// a^-1 %m, prime m
ll invp(ll a, ll m) {
	return exp(a, m-2, m);
}

// (a*b)%m
ll mul(ll a, ll b, ll m) {
	ll x=0, y=a%m;
	while(b>0) {
		if(b%2) x=(x+y)%m;
		y=(y*2)%m;
		b/=2;
	}
  return x%m;
}

// (a+b)%m
ll add(ll a, ll b, ll m) {
	return (a+b)%m;
}

ll fact[mx], binv[mx];

ll combi(int n, int x, ll m) {
	ll p=fact[n], q=fact[x], r=fact[n-x];
	ll ret=p;
	ret=(ret*invp(q,m))%m;
	ret=(ret*invp(r,m))%m;
	return ret;
}

bool isprime(int n) {
	if(n==1) return false;
	for (int i=2; i*i<=n; i++)
		if(n%i==0) return false;
	return true;
}

int gcd(int a, int b) {
	if(!b) return a;
	else return gcd(b,a%b);
}

ll eval(int R, int C) {
	//  C(R+1,1) + ... + C(R+C,C)
	ll ret=0, cur=1;
	for (int t=1; t<=C+1; t++) {
		cur=(cur*(R+t))%mod;
		cur=(cur*binv[t])%mod;
		ret=(ret+cur)%mod;
	}
	return ret;
}

int main() {
	fact[0]=1;
	for (int i=1; i<mx; i++)
		fact[i]=(fact[i-1]*i)%mod;
	for (int i=1; i<mx; i++)
		binv[i]=invp(i,mod);
	
	int r1,c1,r2,c2;
	cin>>r1>>c1>>r2>>c2;
	cout<<(eval(r2,c2)+mod-eval(r2,c1-1)+mod-eval(r1-1,c2)+eval(r1-1,c1-1))%mod<<"\n";
	return 0;
}

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

int main() {
  
  int x,y;
  cin >> x >> y;
  
  int hantei1 = 0,hantei2 = 0;
  
  vector<int> a={1,3,5,7,8,10,12},b={4,6,9,11};
  
  for ( int i = 0; i < 7; i++){
    if ( x == a.at(i) ){
      hantei1 += 1;
    }
    if ( y == a.at(i) ){
      hantei1 += 1;
    }
  }
  
  for ( int i = 0; i < 4; i++){
    if ( x == b.at(i) ){
      hantei2 += 1;
    }
    if ( y == b.at(i) ){
      hantei2 += 1;
    }
  }
  
  if ( hantei1 == 2 || hantei2 == 2 ){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
    
}



Measured memory_bytes: 256
#include<iostream>
//#include<CastingInterop.h>
#include<string>
using namespace std;

int main()
{




	string s;
	bool t = true;
	cin >> s;
	for (int i = 97; i <= 122; i++)
	{
		t = true;
		for (int j = 0; j < s.length(); j++)
		{
			if (char(i) == s[j])
			{
				t = false;
				continue;
			}
		}
		if (t == true) {
			cout << char(i) ;
			return 0;
		}
	}
	if (t == false)
	{
		cout << "None" ;
		return 0;
	}
	
}

Measured memory_bytes: 3728
#define debug_interval ','
#define dump_interval ' '
#define debug_toggle 1
//{
#include<bits/stdc++.h>
using namespace std;
#define hi cerr<<"hi"<<endl;
#define int long long
#define INT_MAX LLONG_MAX
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define fi first
#define se second
#define mp make_pair
#define rev reverse
#define dans dump(ans)
#define MOD 1000000007
#define amp(v,n) (v).count(n)?v[n]++:v[n]=1
#define sysp system("pause")
#define PI acos(-1)
#define pf push_front
#define ins insert

//{
inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
template<class...A> inline void dump(){cout<<endl;}
template<class...A> inline void dump_rest() {cout<<endl;}
template<class T, class...A> inline void dump_rest(const T& first, const A&... rest){cout<<dump_interval<<first;dump_rest(rest...);}
template<class T,class...A> inline void dump(const T&first,const A&...rest){cout<<first;dump_rest(rest...);}
template<class...A> inline void debug(){cerr<<endl;}
template<class...A> inline void debug_rest() {cerr<<endl;}
template<class T, class...A> inline void debug_rest(const T& first, const A&... rest){cerr<<debug_interval<<first;debug_rest(rest...);}
template<class T,class...A> inline void debug(const T&first,const A&...rest){if(debug_toggle)cerr<<first,debug_rest(rest...);}
unsigned XorShift(void){static unsigned x = 123456789;static unsigned y = 362436069;static unsigned z = 521288629;static unsigned w = 88675123;unsigned t;t = x ^ (x << 11);x = y; y = z; z = w;return w = (w ^ (w >> 19)) ^ (t ^ (t >> 8));}
//}

typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}
template<int m>class mint{private:int i;public:mint() : i(0){}mint(int i): i((i%m+m)%m){}mint operator+(const mint& o){return o.i+i;}mint operator*(const mint& o){return o.i*i;}mint operator-(){return -i;}operator int() {return i;}};

//}

main(){
	int n,z,w;
	cin>>n>>z>>w;
	int a[n];rep(i,n)cin>>a[i];
	if(n==1)dump(abs(a[0]-w));
	else dump(max(abs(a[n-1]-w),abs(a[n-2]-a[n-1])));
}


Measured memory_bytes: 256
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

#include <boost/rational.hpp>
*/
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rep3(i, n) for (ll i = 1; i < (ll)(n+1); i++)
#define rep4(i, s, n) for (ll i = (s); i < (ll)(n+1); i++)
#define repr(i,n) for (ll i = (n-1); i>=0;i--)
#define repr3(i,n) for(ll i = (n);i>0;i--)
#define repr4(i,s,n) for(ll i = (n);i>=(s);i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
using Graphw = vector<vector<pair<ll,ll>>>;
#define INF1  INT_MAX;
#define INF2  LLONG_MAX;
#define PI  3.14159265358979323846;
#define MOD 1000000007;
/*
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部長が32の浮動小数点数型
using Real32 = mp::number<mp::cpp_dec_float<32>>;
// 仮数部長が1024の浮動小数点数型
using Real1024 = mp::number<mp::cpp_dec_float<1024>>;
// 有理数型
using Rat = boost::rational<Bint>;
*/


int main(){
int H,W;
cin>>H>>W;
char A[H][W];
int count=0;
rep(i,H){
    rep(j,W){
        cin>>A[i][j];
        if(A[i][j]=='#')count++;

    }
}
if(count==H+W-1)cout<<"Possible"<<endl;
else cout<<"Impossible"<<endl;
return 0;
}

Measured memory_bytes: 3596
#include <cstdlib>
#include <iostream>
#include <string>
#include <time.h>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <vector>
#include <functional>
#include <numeric>
#include <cassert>
#include <algorithm>
#include <functional>
//#include "bits/stdc++.h"
using namespace std;
//using namespace std::vector;
#define rep(i,a,b) for(ll i=(a);i<(b);++i)

#define huge 1000000007
typedef long long int ll;
ll gcd(ll a, ll b);
ll bur(ll N, ll X);


int main(void) {

	ll N = 0;
	ll A = 0;
	ll B = 0;
	ll C = 0;
	ll D = 0;
	ll X = 0;
	//ll T = 0;
	//ll M = 0;
	ll h[1000] = {};
	//ll b[100] = {};
	//ll c[100] = {};
	//ll d[100] = {};

	//ll v[3] = {};
	//ll *c, *s, *n;
	string S,T,U[52];
	ll count = 0;
	ll count2 = 0;
	float sum = 0;
	ll min = 1000000000000;
	ll max = 0;
	ll smax = 0;
	ll max2 = 0;
	ll smax2 = 0;
	int tmax = 0;
	int tmax2 = 0;
	//int flag = 0;
	char temp,head;
	//int is = 0;
	bool flag = false;
	
	//char p;

	ll all = 0;
	ll niku = 0;
	ll state = 2;
	bool down = true;
	

	//cin >> S;
	
	//vector<pair<int,int>> ch(50);
	
	

	cin >> S;

	S[5] = ' ';
	S[13] = ' ';


	cout << S << endl;

	//x = (ll *)malloc((N+1) * sizeof(ll));
	//c = (ll *)malloc((N) * sizeof(ll));
	//cin >> D >> G;
	//vector<pair<int,int>> tr(M);
	//vector<pair<int,int>> qes(Q);
	//sort(c.begin(), c.end());
	
	//cout << c[2] - c[1] << endl;

	
	/*A = N / 1000;
	N %= 1000;
	B = N / 100;
	N %= 100;
	C = N / 10;
	N %= 10;
	D = N;*/
	


	//cin >> N >> M;

	//vector<pair<int,int>> c(M);
	////vector<pair<int, int>> e(M);
	//vector<ll> d(M);

	//rep(i, 0, M) {
	//	cin >> c[i].first >> c[i].second;
	//	//e[i].first = c[i].first;
	//	//e[i].second = c[i].second;

	//}
	////sort(c.begin(), c.end());

	//

	//rep(i, 0, M) {

	//	
	//	
	//	rep(j, 0, M) {
	//		if (c[i].first == c[j].first && c[j].second < c[i].second) {
	//			d[i]++;
	//			//cout << j << endl;
	//		}
	//	}
	//	cout << std::setfill('0') << std::right << std::setw(6) << c[i].first;
	//	cout << std::setfill('0') << std::right << std::setw(6) << d[i]+1 << endl;
	//}

	return 0;

}

ll bur(ll N,ll X) {
	ll pan = 1;
	ll pat = 1;
	ll burg = 0;



	if (X > burg) {
		if (N == 0)
			return pat;


		burg += pan;
		burg += bur(N - 1, X);
		burg += pat;
		burg += bur(N - 1, X);
		burg += pan;


	}

	return burg;

}

ll gcd(ll a, ll b) {
	
	/* 自然数 a > b を確認・入替 */
	if (a<b) {
		ll tmp = a;
		a = b;
		b = tmp;
	}
	ll x = b;
	ll y = a;
	/* ユークリッドの互除法 */
	ll r = a % b;
	while (r != 0) {
		a = b;
		b = r;
		r = a % b;
	}


	return y/b*x;
}



Measured memory_bytes: 256
import java.util.*;
class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		while(true){
			int a = sc.nextInt();
			if(a == 0){break;}
			int total = 0;
			int syo = 1000;
			int dai = 0;

			for(int n = 0; n < a; n++){
				int tmp = sc.nextInt();
				total = total + tmp;
				if(tmp < syo){
					 syo = tmp;
				}
				
				if(tmp > dai){
					dai = tmp;
				}
			}
			double heikin = (double)(total - syo - dai)/(double)(a - 2);
			System.out.println((int)heikin);

		}

	}
}
		


Measured memory_bytes: 28764
#include<stdio.h>
#include<string.h>
int main()
{
	char a[105],b[105], tmp, tmp2,tmp3;
	scanf(" %s",a);
	scanf(" %s",b);
	int j, i,l;
	l=strlen(a);
	for(j=0;j<l;j++){
		if(0==strcmp(a,b)){ printf("Yes\n"); return 0; }
	tmp=a[l-1];
	tmp2=a[0];
	tmp3=a[1];
	for(i=1;i<l;i++) { a[i]=tmp2; tmp2=tmp3;
	tmp3=a[i+1]; }
	a[0]=tmp;
	
	
}
printf("No\n");
}

Measured memory_bytes: 1660
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <utility>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define itrep(i,x) for(auto i=(x).begin(); i!=(x).end();i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vec vector
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
#define PI 3.1415926535
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={-1,0,1,0};

using namespace std;

int main(){
    int v[100010]={0};
    int n;
    cin>>n;
    rep(i,0,n){
        int l,r;
        cin>>l>>r;
        v[l]++;
        v[r+1]--;
    }
    rep(i,0,100010)if(i)v[i]+=v[i-1];

    int ans=0;
    rep(i,0,100010){
        if(v[i])ans++;
    }
    cout<<ans<<endl;
    
    return 0;
}

Measured memory_bytes: 640
#include <iostream>
#include <utility>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <array>
#include <math.h>
#include <sstream>
typedef long long ll;
using namespace std;

int main(int argc, char const *argv[])
{
    int a, b;
    std::cin >> a >> b;
    if (a % 2 == 0 || b % 2 == 0) {
        std::cout << "No" << std::endl;
    } else {
        std::cout << "Yes" << std::endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(){
    int n,k;
    long long int l=0,r=0;
    scanf("%d%d",&n,&k);
    if(k%2==0){
        for(int i=1;i<=n;i++)if(i%k==k/2)l++;
        else if(i%k==0)r++;
        printf("%lld\n",l*l*l+r*r*r);
    }
    else{
        for(int i=1;i<=n;i++)if(i%k==0)r++;
        printf("%lld\n",r*r*r);
    }
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
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 (a>b) { a=b; return 1; } return 0; }
#define rep(i, n) REP(i, 0, n)
#define rep_rev(i, n) for (int (i) = (int)(n) - 1 ; (i) >= 0 ; --(i))
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define all(x) (x).begin(),(x).end()
ll t1,t2,t3;
const ll mod = 1000000007;
const int INF = 1e9;
const ll INFLONG = 1e18;

struct Info{
  ll x;
  ll y;
  ll score;
  Info(){

  }
  Info(ll x,ll y,ll score):x(x),y(y),score(score){

  }
};

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

int main(){
  ll h,w;
  cin >> h >> w;
  vector<vector<char>> map(h,vector<char>(w));
  vector<vector<ll>> vec(h,vector<ll>(w,INFLONG));
  ll cx,cy,gx,gy;
  cin >> cx >> cy;
  cx--,cy--;
  cin >> gx >> gy;
  gx--,gy--;
  rep(i,h){
    rep(j,w){
      cin >> map[i][j];
    }
  }
  deque<Info> q;
  Info info;
  info.x = cx;
  info.y = cy;
  info.score = 0;
  q.push_front(info);
  ll x,y,score;
  ll tx,ty;
  while(!q.empty()){
    Info info = q.front();
    q.pop_front();
    x = info.x;
    y = info.y;
    score = info.score;
    if(0 <= x && x < h && 0 <= y && y < w && map[x][y] == '.'){
      if(score < vec[x][y]){
        vec[x][y] = score;
        rep(i,4){
          tx = x + dx[i];
          ty = y + dy[i];
          Info info(tx,ty,score);
          q.push_front(info);
        }
        rep(i,5){
          rep(j,5){
            tx = x + i-2;
            ty = y + j-2;
            Info info(tx,ty,score+1);
            q.push_back(info);
          }
        }
      }
    }
  }
  // rep(i,h){
  //   rep(j,w){
  //     cout << vec[i][j] << " ";
  //   }
  //   cout << endl;
  // }
  if(vec[gx][gy] == INFLONG){
    vec[gx][gy] = -1;
  }
  cout << vec[gx][gy] << endl;
}

Measured memory_bytes: 18724
parseInt(x)=parse(Int, x)
parseMap(x::Array{SubString{String},1})=map(parseInt, x)

function main()
	n = 10000
	x = readline() |> parseInt
	f = 0
	for i in 0:n
		k = abs(x-i^5)
		j = 1
		while j^5<k
			j+=1
		end
		if i^5-j^5==x
			f=1
			println(i," ",j)
			break
		elseif i^5+j^5==x
			f=1
			println(i," ",-j)
			break
		end
	end
end

main()

Measured memory_bytes: 162668
N=int(input())
P=[int(input()) for i in range(N)]
pos=[-1]*N
for i,p in enumerate(P):
    pos[p-1]=i
x,mx=0,0
for i in range(N-1):
    if pos[i]<pos[i+1]:
        x+=1
        mx=max(mx,x)
    else:
        x=0
print(N-mx-1)

Measured memory_bytes: 18888
#include<bits/stdc++.h>
#define reg(i,a,b) for(int i=a;i<=b;i++)
#define reh(i,a,b) for(int i=a;i>b;i--)
#define in(x) scanf("%d",&x)
#define fro freopen("D:\\testdata.in", "r", stdin)
#define il inline
#define lson(q) q<<1
#define rson(q) q<<1|1
using namespace std;
typedef long long ll;
const int mx=1e5+10;
int a[mx];
int n,m;
int t;
ll res;
string str;
int main(){
	cin>>n;
	cout<<n*n*n<<endl;
	return 0;
}




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

int main() {
  int A,B;
  cin>>A>>B;
  int N ;
  N=0;
  
  for (int i = A; i < B+1; i++) {
    if( i / 10000 == i % 10 && (i/1000)%10==(i%100)/10){N++;}
  
}
cout<< N << endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <list>
#include <math.h>
using namespace std;

int main()
{
	int n, l;
	cin >> n >> l;
	vector<string> s(n);
	for (int i = 0; i < n; i++)
	{
		cin >> s[i];
	}
	sort(s.begin(), s.end());
	string ans;
	for (int i = 0; i < n; i++)
	{
		ans += s[i];
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
// Problem Code: abc172_c

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int tsundoku(int N, int M, int K, vector<long long>& A, vector<long long>& B) {
	int read, sum_a, sum_b, j;
	sum_a = sum_b = j = 0;

	for (j = 0; j < M && sum_b + B[j] <= K; j++)
		sum_b += B[j];
	read = j;
	
	for (int i = 0; i < N; i++) {
		sum_a += A[i];
		if (sum_a > K)
			break;
		while (sum_a + sum_b > K)
			sum_b -= B[--j];
		read = max(i + 1 + j, read);
	}

	return read;
}

int main() {
	int N, M, K;
	cin >> N >> M >> K;
	vector<long long> A(N), B(M);
	for (int i = 0; i < N; i++)
		cin >> A[i];
	for (int i = 0; i < M; i++)
		cin >> B[i];
	cout << tsundoku(N, M, K, A, B);
	return 0;
}

Measured memory_bytes: 6416
'''tanon  優先度付きキュー
t(=0 to M-1)日目に仕事を請けることを考えると、Ai>M-tなるiについては、
その仕事を請けるかどうかを考えなくて良い(∵この仕事を請けても、
Ai>M-t⇔Ai+t>Mより報酬はM日目より後にしかもらえません)。
したがって、tを大きい順に見ていくと、
M-1日目にはAi<=1なるiについて、報酬が最大となる仕事iを請けるべき、
M-2日目にはAi<=2なるiについて、まだ請けていない仕事の中で
報酬が最大となる仕事iを請けるべき、
…0日目にはAi<=Mなるiについて、まだ請けていない仕事の中で報酬が
最大となる仕事iを請けるべきであるといえます。
したがって、元の配列をAiの小さい順にソートしておき、
Ai=1の仕事について優先度付きキューに報酬Biを追加し、
優先度付きキューから取ってきた最大値を答えに加え、
次にAi=2の仕事について優先度付きキューに報酬Biを追加し、
優先度付きキューから取ってきた最大値を答えに加え、
…最後にAi=Mの仕事について優先度付きキューに報酬Biを追加し、
優先度付きキューから取ってきた最大値を答えに加えることで、
求める答えが得られます。
'''
import heapq
n,m=map(int,input().split())
arr=[list(map(int,input().split())) for _ in range(n)]
arr2=[[i,0] for i in range(1,m+2)] 
#すべてのAi=1 to Mについて報酬0の仕事を追加する
#こうすることで、必ずAiに対し、報酬0でも仕事がある⇒空振りがなくなる
arr.extend(arr2)
arr=sorted(arr,key=lambda x:x[0]) #Aiの小さい順にソート
q=[]
ans=0
pos=0
while 1:
 a,b=arr[pos]
 if a>m: #AiがMより大きければその仕事を請ける意味はない
   break
 if a==arr[pos+1][0]: 
  #Aiの値が等しいとき、その仕事を優先度付きキューに追加する
   heapq.heappush(q,-b)#マイナスを付けて、ヒープキューに入れている
 else:
   heapq.heappush(q,-b)
   ans-=heapq.heappop(q)#ヒープキューから最大値を持ってくるのでマイナス
  #Aiの値が変化したとき、そのAiまででの仕事の報酬の最大値を答えに加える
 pos+=1
print(ans)

Measured memory_bytes: 43664
import java.util.*;
import java.io.PrintWriter;
import static java.lang.Integer.*;
import static java.lang.Long.*;
import static java.lang.Math.*;
import static java.lang.System.*;

public class Main {
	public static void main(String[] args) {
		int i,j;
		Scanner sc = new Scanner(in);
		int l = parseInt(sc.next());
		sc.close();
		double ll = (double)l/3;
		out.printf("%.12f%n", ll*ll*ll);
	}
}


Measured memory_bytes: 20692
<?php
$n = intval(fgets(STDIN));

$minRet = ask(0);
if($minRet == 0)exit;
$maxRet = ask($n-1);
if($maxRet == 0)exit;

$min = 0;
$max = $n-1;
while($min!=$max){
    $mid = intdiv($max+$min, 2);
    $midRet = ask($mid);
    if($midRet == 0){
        exit;
    }else{
        if(($midRet != $minRet) != ($mid - $min) % 2){
            $max = $mid;
            $maxRet = $midRet;
        }else{
            $min = $mid;
            $minRet = $midRet;
        }
    }
}

function ask($a){
    echo $a,"\n";
    flush();
    $in = trim(fgets(STDIN));
    if($in == "Vacant"){
        return 0;
    }elseif($in == "Male"){
        return 1;
    }else{
        return -1;
    }
}



Measured memory_bytes: 5200
/*C - Rally*/

#include <bits/stdc++.h>
using namespace std;

int main(){

   ios_base::sync_with_stdio(0);
   cin.tie(0);
   cout.tie(0);
    
   int nums;
   long long minimo = LONG_MAX;
   long long aux = 0ll;
   
   cin >> nums;
   vector <int> arr(nums);
   
    for(int i = 0; i < nums; i++)
        cin >> arr[i];
    
   for(int i = 1; i <= 100; i++){
        
        aux = 0ll;
       for(int j = 0; j < nums; j++){
          aux += ((arr[j] - i) * (arr[j] - i));
       }
      
       if(aux < minimo)
            minimo = aux;
        
    }

    cout << minimo;
    
   return 0;
}

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

a=sorted(a,reverse=True)
if n==2:
    print(max(a))
    exit(0)

ans=a[0]
a=a[1:]
from math import floor

for i in range(n-2):
    index=floor(i/2)
    ans+=a[index]

print(ans)





Measured memory_bytes: 31752
# coding:utf-8

import sys
import math
import time
#import numpy as np
import collections
from collections import deque
from collections import Counter
import queue
import copy
import bisect
import heapq
import itertools


#sys.setrecursionlimit(10**7)
#N, Q = map(int, input().split())
#G = [list(input()) for i in range(H)]
#INF = V * 10001
#A = [int(i) for i in input().split()]
#AB = [list(map(int, input().split())) for _ in range(K)]


R = int(input())
ans = 2 * R * math.pi

print(ans)


Measured memory_bytes: 9752
#include <stdio.h>

int main(){
  int n,i,j,aaa[100],t,min=1000,count=0,k;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&aaa[i]);
  }

  for(i=0;i<n;i++){
    for(j=i;j<n;j++){
      if(aaa[j]<min){
	min=aaa[j];
	k=j;
      }
    }
    if(k!=i){
      t=aaa[k];
      aaa[k]=aaa[i];
      aaa[i]=t;
      count++;
    }
    min=1000;
  }

  for(i=0;i<n-1;i++){
    printf("%d ",aaa[i]);
  }
  printf("%d\n",aaa[n-1]);
  printf("%d\n",count);

  return 0;
}



Measured memory_bytes: 2100
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<cassert>
#include<sstream>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

template<int m>
class Prime{
  std::vector<bool> p;
  std::vector<int> ps;
public:
  Prime(){
    p = std::vector<bool>(m,true);
    assert(m>1);
    p[0]=p[1]=false;
    for(int i=4;i<m;i+=2)
      p[i]=false;
    ps.push_back(2);
    for(int i=3;i<m;i+=2){
      if(p[i]){
        ps.push_back(i);
        for(int j=i+i;j<m;j+=i)
          p[j]=false;
      }
    }
  }

  bool isPrime(int n){
    assert(m>n);
    return p[n];
  }

  int operator [] (int n){
    if(n<ps.size()) return ps[n];
    else return 0;
  }

  int size(){
    return ps.size();
  }
};

int main(){
  int n;
  Prime<10100> p;
  while(scanf("%d",&n), n){
    int sum  = 0;
    int low  = 0;
    int high = 0;
    int ans  = 0;
    while(p[low] <= n){
      //printf("[%d,%d]: %d (n=%d)\n",low,high,sum,n);
      if(sum == n) ans++;
      if(sum > n){
	sum -= p[low++];
      }else{
	sum += p[high++];
      }
    }
    printf("%d\n",ans);
  }
  return 0;
}

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

int main(int argc, char const *argv[])
{
	int a,b,c;
	cin>>a>>b>>c;
	if ((a<c&&c<b)||(b<c&&c<a))
	{
		cout<<"Yes\n";
	}
	else
	{
		cout<<"No\n";
	}
	return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline

# STEPS = ['L', 'R', 'U', 'D']

def main():
    S = input().strip()

    even = S[0::2]
    odd = S[1::2]

    e = ['R', 'U', 'D']
    o = ['L', 'U', 'D']

    ans_flag = True
    for x in even:
        if x not in e:
            ans_flag = False

    for x in odd:
        if x not in o:
            ans_flag = False

    if ans_flag:
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    main()


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

#define rep(i, n) for(int (i) = 0; i < (n); ++(i))

using ll = long long int;
const ll MOD = 1e9 + 7;

int main() {
  int A, B, C;
  std::cin >> A >> B >> C;

  if((A == B && A != C) || (B == C && C != A) || (C == A && A != B)) {
    std::cout << "Yes" << '\n';
  } else {
    std::cout << "No" << '\n';
  }
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pqueue priority_queue
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  int N;
  cin>>N;
  ll A[N];
  for(int i=0;i<N;++i) cin>>A[i];
  if(A[0]>0) {
    cout<<-1<<endl;
    return 0;
  }
  bool can = true;
  ll ans = A[N-1];
  for(int i=N-1;i>=1;--i) {
    if(A[i-1]>A[i]-1) {
      ans += A[i-1];
    }
    else if(A[i-1]<A[i]-1) can = false;
  }
  if(!can) cout<<-1<<endl;
  else cout<<ans<<endl;
}



Measured memory_bytes: 5144
import java.util.*;
public class Main {
    public static boolean isPalindrome(String s){
        char[] sc = s.toCharArray();
        for(int i=0;i<sc.length/2;i++){
            if(sc[i] != sc[sc.length-1-i]){
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String S=sc.next();
        int N = S.length();
        if(isPalindrome(S) &
                isPalindrome(S.substring(0, (N-1)/2)) &
                isPalindrome(S.substring((N+3)/2-1, N))){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}



Measured memory_bytes: 23764
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            long[] t = in.nextLongArray(n);
            out.println(Euclid.lcm(t));
        }

    }

    static class Euclid {
        public static long gcd(long a, long b) {
            return a == 0 ? b : gcd(b % a, a);
        }

        public static long lcm(long a, long b) {
            return a / gcd(a, b) * b;
        }

        public static long lcm(long[] array) {
            long ret = array[0];
            for (int i = 1; i < array.length; i++) {
                ret = lcm(ret, array[i]);
            }

            return ret;
        }

    }

    static class InputReader {
        BufferedReader in;
        StringTokenizer tok;

        public String nextString() {
            while (!tok.hasMoreTokens()) {
                try {
                    tok = new StringTokenizer(in.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return tok.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

        public long nextLong() {
            return Long.parseLong(nextString());
        }

        public long[] nextLongArray(int n) {
            long[] res = new long[n];
            for (int i = 0; i < n; i++) {
                res[i] = nextLong();
            }
            return res;
        }

        public InputReader(InputStream inputStream) {
            in = new BufferedReader(new InputStreamReader(inputStream));
            tok = new StringTokenizer("");
        }

    }
}



Measured memory_bytes: 22868
#include <iostream>

using namespace std;

int main(){
    int N;
    int H[100];
    int ans = 1;
    cin >> N;
    for(int i = 0; i < N; i++) cin >> H[i];
    for(int i = 1; i < N; i++){
        for(int j = 0; j < i; j++){
            if(H[i] < H[j]) break;
            if(j == i-1) ans++;
        }
    }
    cout << ans << endl;
}

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

int main() {
	string S;
	cin >> S;
	vector<string> T = {"ARC", "ABC"};
	if (S == T.at(0)) {
		cout << T.at(1) << endl;
	} else {
		cout << T.at(0) << endl;
	}
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;




ll n;

vector<int> a;

int main(){
	cin >> n;
	
	a.resize(n);
	ll allxor = 0;
	for ( int i = 0; i < n; i++ ){
		cin >> a[i];
		allxor ^= a[i];
	}
	
	for ( int i = 0; i < n; i++ ){
		cout << (allxor ^ a[i]) << " ";
	}
	cout << endl;
	
	return 0;
}




Measured memory_bytes: 3984
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pp = pair<ll,ll>;
const ll amari = 1e9+7;
const char BC = 'A' - 'a';
#define ben(a) a.begin(),a.end()
#define pb(a,b) a.push_back(b)

int main(){
	int n;
	cin >> n;
	int t = 0,h = 0;
	string T,H;
	for(int i = 0; i < n; i++){
		cin >> T >> H;
		if(T > H)t += 3;
		else if(T < H)h += 3;
		else{
			t++;
			h++;
		}
	}
	cout << t << " " << h << endl;
	return 0;
}


Measured memory_bytes: 3152
n = $stdin.read.to_i
n -= 1 if n % 2 == 0
a = (1..100).map{|i| i * 2 - 1 }
res = 0
a.each do |i|
  cnt = 0
  a.each do |k|
    cnt += 1 if i % k == 0
    break if i < k
  end
  res += 1 if cnt == 8
  break if i >= n
end
p res


Measured memory_bytes: 1788
#gcdは3.4.3だとfractionsにある
from fractions import gcd

from math import factorial as f

from math import ceil,floor,sqrt

from sys import exit

from copy import deepcopy
import numpy as np

import bisect
import re


ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))



def main():
    a,b = mi()
    if a>9 or b > 9:
        print(-1)
    else:
        print(a*b)


main()


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

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

    int ans = 0;
    for(int i = 0;i < n;i++){
        int a;
        cin >> a;
        if(a >= k){
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}




Measured memory_bytes: 256
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>
#include <cstdio>

using namespace std;
int n;
int h;
int w;
int a;
int b;

int main(){
    cin >> n;
    cin >> h;
    cin >> w;
    int count;
    count=0;
    for (int i=0;i<n;i++) {
        cin >> a;
        cin >> b;
        if (a >= h && b >= w) { count++; }
    }cout << count <<endl;
}
    



Measured memory_bytes: 256
using System;

namespace ATCODER123
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] S = Console.ReadLine().Split(' ');
            long L = long.Parse(S[0]);
            long R = long.Parse(S[1]);

            long Ans = 2019;
            if (R - L >= 673)
            {
                Console.WriteLine(0);
            }
            else
            {
                for (long i = L; i <= R; i++)
                {

                    for (long j = i + 1; j <= R; j++)
                    {
                        if (Ans > (i * j) % 2019)
                        {
                            Ans = (i * j) % 2019;
                        }
                    }
                }
                Console.WriteLine(Ans);

            }

        }
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int,int> pint;
typedef vector<pint> vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=n-1;i>=(0);i--)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define all(v) (v).begin(),(v).end()
#define eall(v) unique(all(v), v.end())
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll INFF = 1e18;

int main(void){
	int r, g, b; cin >> r >> g >> b;
	int d = r * 100 + g * 10 + b;
	if(d % 4 == 0) printf("YES\n");
	else printf("NO\n");
	return 0;
}

Measured memory_bytes: 764
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	char a[55][55];
	memset(a,0,sizeof(a));
	int x,y;
	cin>>x>>y;
	for(int i=1;i<=x;i++)
	{
		for(int j=1;j<=y;j++)
		{
			cin>>a[i][j];
		}
	}
	
	for(int i=1;i<=x;i++)
	{
		for(int j=1;j<=y;j++)
		{
			int flag=0;
			if(a[i][j]=='#')
			{
				if(a[i-1][j]=='#')
					flag=1;
				if(a[i][j-1]=='#')
					flag=1;
				if(a[i+1][j]=='#')
					flag=1;
				if(a[i][j+1]=='#')
					flag=1;
			}
			
			if(flag==0&&a[i][j]=='#')
			{
				cout<<"No"<<endl;
				return 0;
			}
			
		}
	}
	
	cout<<"Yes"<<endl; 
	return 0;
}

Measured memory_bytes: 256
s = int(input())

def f(ai):
    return int(ai/2) if ai%2 == 0 else ai*3+1

cn = 0
seq = [s]
while True:
    ai = f(seq[cn])
    if ai in seq:
        print(cn+2)
        break
    seq.append(ai)
    cn += 1

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

int n;
int a[101];

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	int cnt=0;
	for(int i=0;i<n;i+=2){
		if(a[i]%2==1){
			cnt++;
		}
	}
	printf("%d\n",cnt);
	return 0;
}


Measured memory_bytes: 3824
#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
using ll=long long;
#define rep(i,a,b) for(ll i=a;i<b;i++)
inline constexpr int intpow(ll a,ll b){
    if(b==0) return 1;
    ll ans=intpow(a,b/2);
    return ans*ans*(b&1?a:1);
}
int main(){
    ll n;
    cin>>n;
    ll a[101];
    a[0]=2,a[1]=1;
    rep(i,2,n+1){
        a[i]=a[i-1]+a[i-2];
    }
    cout<<a[n];
}

Measured memory_bytes: 256
#include <utility>
#include <vector>
#include <iostream>
#include <cstdlib>
#include<bits/stdc++.h>
#include <limits>
#include <set>
#include <map>
#include <string>
#include <sstream>
#define REP(i,n) for(int i=0;i<n;i++)
typedef unsigned long ul;
typedef long long ll;
ul gcd(ul a, ul b){return b? gcd(b, a%b):a;}
using namespace std;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    int C[N-1];
    int S[N-1];
    int F[N-1];
    int ans[N] = {0};

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

    for(int i = 0; i < N-1; i++){
        int tmp = 0;
        for(int j = i; j < N-1; j++){
            if(S[j] >= tmp){
                tmp = S[j];
                tmp += C[j];
            }else{
                if(tmp%F[j] != 0){
                    tmp = (tmp/F[j] + 1) * F[j];
                }
                tmp += C[j];
            }
        }
        ans[i] = tmp;
    }
    ans[N-1] = 0;

    for(int i = 0; i < N; i++){
        cout << ans[i] << endl;
    }
    return 0;
}
    


Measured memory_bytes: 256
n, k = map(int, input().split())
dlist = [s for s in input().split()]
ans = n
while True:
    blnOk = True
    for d in str(ans):
        if d in dlist:
            blnOk = False
    if blnOk:
        print(ans)
        exit()
    else:
        ans += 1


Measured memory_bytes: 2940
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

n,m,k = map(int, input().split())
ab = [list(map(int, input().split())) for i in range(m)]
cd = [list(map(int, input().split())) for i in range(k)]
uf = UnionFind(n)
for a,b in ab:
    uf.union(a-1, b-1)
ans = [uf.size(i)-1 for i in range(n)]
for a,b in ab:
    ans[a-1] -= 1
    ans[b-1] -= 1
for c,d in cd:
    if uf.same(c-1, d-1):
        ans[c-1] -= 1
        ans[d-1] -= 1
print(*ans)

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

int main () {
    string a, b, c;

    cin >> a >> b >> c;

    if (a[a.size() - 1] == b[0] and b[b.size() - 1] == c[0]) {
        cout << "YES";
    } else {
        cout << "NO";
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 256
def input_one_number():
    return int(input())


D = input_one_number()

def input_multiple_number_as_list():
    return list(map(int, input().split()))

c = input_multiple_number_as_list()
last = [-1]*26


s = [[]*26 for _ in range(D)]

def dot(day):
	k = [0]*26
	for i in range(26):
		k[i] = c[i]*(day+1-last[i])
	return k


for i in range(D):
	s[i] = input_multiple_number_as_list()

for day in range(D):
	# maxSatis = max(s[day])
	# damage = dot(day)
	# maxDamage = max(damage)

	# if(maxSatis > maxDamage):
	# 	idx = s[day].index(maxSatis)
	# 	print(idx+1)
	# 	last[idx] = day
	# else:
	# 	idx = damage.index(maxDamage)
	# 	print(idx+1)
	# 	last[idx] = day
	print(day%26+1)



Measured memory_bytes: 9508
#include<cstdio>
#include<string>
#include<string.h>
#include<cmath>
#include<algorithm>
using namespace std;
int n,ans,total;
char str[1000000];
int main(){
	scanf("%d",&n);
	scanf("%s",str);
	for(int i=0;i<n;i++)
	if(str[i]=='I'){
		total++;
		ans=max(ans,total);
	}else
	if(str[i]=='D'){
		total--;
		ans=max(ans,total);
	}
	printf("%d\n",ans);
	//AC!!!!!!!!!!!!!
	return 0;
}

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

int main() {
	int N, K, d1, d2, d, sum = 0;
	cin >> N >> K;
	for (int i = 0; i < N; i++) {
		int x;
		cin >> x;
		d1 = x;
		d2 = K - x;
		if (d2 < 0) {
			d2 = -d2;
		}
		if (d1 >= d2) {
			d = d2;
		}
		else {
			d = d1;
		}
		sum += d*2;
	}
	cout << sum;
}


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

using namespace std;
typedef long long ll;

#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back
#define lp(i,s,f) for(ll i = s; i < ll(f); i++)
#define inF freopen("input.in", "r", stdin);
#define outF freopen("output.in", "w", stdout);
#define endl '\n'
#define MOD 1000000007
#define mm(arr) memset(arr, 0, sizeof(arr))
#define first F
#define second S

int main(){
    FAST
    int n;
    string s, t; cin >> n >> s >> t;
    for(int i = 0; i < n; i++){
        cout << s[i] << t[i];
    }
    return 0;
}


Measured memory_bytes: 3624
n,T = [int(i) for i in input().split()]
t = [int(i) for i in input().split()]
ans = T
if n >= 2:
  for i in range(n-1):
    if t[i]+T >= t[i+1]:
      ans += t[i+1]-t[i]
    else:
      ans += T
print(ans)

Measured memory_bytes: 25196
#include <iostream>

int main()
{
    long long K;
    std::cin >> K;
    int x = 0;
    int count;
    for (count = 0; count < K; count++)
    {
        x = (x * 10 + 7) % K;
        if (x == 0)
            break;
    }
    if (count == K)
        std::cout << -1 << std::endl;
    else
        std::cout << count + 1 << std::endl;
}


Measured memory_bytes: 3620
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<numeric>
#include<algorithm>
#include<tuple>
#include<cmath>
#include <iomanip>

typedef unsigned long long ull;
typedef long long ll;

ll DENOM = 1000000000LL + 7LL;
ll D2 = 998244353LL;
using namespace std;

ll n, m, k;

ll calc_inv(ll x){
    vector<bool> bin;
    ll d2 = D2 -2;
    while(d2>0){
        bin.push_back(d2%2);
        d2 /= 2;
    }
    ll ret = 1;
    ll xx = x;
    for(auto it = bin.begin(); it!=bin.end(); ++it){
        if (*it){
            ret *= xx;
            ret %= D2;
        }
        xx = (xx * xx) % D2;
    }
    return ret;
 }

int main(){
    cin >> n >> m >> k;
    if(m==1){
        ll ret = 0;
        if (k == n-1){
            ret = 1;
        }
        cout << ret << endl;
        return 0;
    }
    ll a0 = m;
    ll mminv = calc_inv(m-1);
    for (ll i=0; i<n-1; ++i){
        a0 *= (m-1);
        a0 %= D2;
    }
    ll c = 1;
    ll ret = 0;
    for (ll i=0; i<k+1; ++i){
        ret += c * a0;
        ret %= D2;
        a0 *= mminv;
        a0 %= D2;
        c *= (((n-1-i) * calc_inv(i+1))%D2);
        c %= D2;
    }
    cout << ret << endl;
    return 0;
}

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
   	string s;
   	cin>>s;
   	if(s[s.size()-1]=='s'){
   		s+="es";
		   cout<<s;	
	}
	else{
		s+="s";
		cout<<s;
	}
   	return 0;
}

Measured memory_bytes: 3652
def flood(region_data,flood_data):
    height = 0
    water_num=0
    top=0
    i=-1
    for data in region_data:
        i+=1
        if(data=="\\"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="/"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
    if(height==0):
        top=-1
    return top







def flood2(region_data,flood_data):
    height = 0
    water_num=0
    top=0
    i=-1
    for data in region_data:
        i+=1
        if(data=="/"):
            if(height==0):
                top=i
            water_num+=height +0.5
            height+=1


        elif(data=="\\"):
            if(height>=2):
                water_num+=height-0.5
                height-=1
            elif(height==1):
                water_num+=0.5
                flood_data.append(water_num)
                water_num=0
                height=0


        elif(data=="_"):
            water_num+=height
    if(height==0):
        top=-1
    return top


region_data=list(input())
flood_data=[]
top=flood(region_data,flood_data)


if(top!=-1):
    region_data2=region_data[top:len(region_data)]
    region_data2.reverse()
    flood_data2=[]
    flood2(region_data2,flood_data2)
    flood_data2.reverse()
    flood_data_final=flood_data + flood_data2
else:
    flood_data_final=flood_data

flood_data_final=list(map(int,flood_data_final))
total=sum(flood_data_final)
num=[len(flood_data_final)]
flood_data_final=" ".join(list(map(str,num+flood_data_final)))

print(total)
print(f"{flood_data_final}")


Measured memory_bytes: 6192
#include<cstdio>
int a[200005];
int sum[200005][25];

int main(){
    int n;
    scanf("%d",&n);
    for(int i = 0; i < 21; i++) sum[0][i] = 0;
    for(int i = 1; i <= n; i++){
        int u;
        scanf("%d",&u);
        for(int j = 0; j < 21; j++){
            sum[i][j] = sum[i-1][j]+u%2;
            u /= 2;
        }
    }
    int ptr[25];
    for(int i = 0; i < 21; i++) ptr[i] = 1;
    long long ans = 0;
    for(int i = 1; i <= n; i++){
        int upper = n;
        for(int j = 0; j < 21; j++){
            int np = ptr[j];
            while(np+1<=n && sum[np+1][j]<=sum[i-1][j]+1) np++;
            ptr[j] = np;
            upper = np<upper?np:upper;
        }
        ans += (long long)(upper-i+1);
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 21244