akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
#define bit(n) (1LL << (n))
#define len(x) ((ll)(x).size())
#define debug(var) cout << "[" << #var << "]\n" << var << "\n"
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;
const double EPS = 1e-9;

template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1)
      s << ' ';
  }
  return s;
}

template <typename T>
ostream& operator<<(ostream& s, const vector<vector<T>>& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i];
    if (i != len - 1)
      cout << '\n';
  }
  return s;
}

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;
}

__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}

struct cake {
  ll id, num;
  cake() = default;
  cake(ll id, ll num) : id(id), num(num) {
  }

  bool operator<(const cake& another) const {
    return num > another.num;
  };
};


signed main() {
  int K, T;
  cin >> K >> T;
  vector<int> a(T);
  rep(i, T) {
    cin >> a[i];
  }

  sort(all(a), greater<int>());
  int ans = a[0] - 1;
  rep(i, T) {
    if (i == 0)
      continue;
    ans -= a[i];
  }

  chmax(ans, 0);
  cout << ans << "\n";
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

class Main{
    public static void main(String[] args){
    Scanner scan = new Scanner(System.in);

    int t;
    int a = scan.nextInt();
    int b = scan.nextInt();
    int c = scan.nextInt();

    if(a > b){
    t = a;
    a = b;
    b = t;
    }

    if(b > c){
    t = b;
    b = c;
    c = t;
    }

    if(a > b){
    t = a;
    a = b;
    b = t;
    }


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

Measured memory_bytes: 26200
#include<bits/stdc++.h>
using namespace std;
bool upper(char n)
{
return(n>=65&&n<97);
}
int main()
{
string a;
getline (cin,a);
int len=a.length();
if(upper(a[0]))
cout<<a[0];
for(int i=1;i<len;i++)
{
if (upper(a[i])&&a[i-1]==' ')
cout<<a[i];
}
}


Measured memory_bytes: 256
N,K = map(int,input().split())
ans = 0
c = [0]*N
da = [list(map(int,input().split())) for _ in range(K*2)]

for i in range(len(da)):
  if i%2==0:
    continue
  else:
    for j in da[i]:
      c[j-1]+=1
      
for i in c:
  if i==0:
    ans+=1
    
print(ans)

Measured memory_bytes: 9196
N = int(input())

print(0, flush=True)
S = input()
if S == "Vacant":
    exit()
lo = 0
hi = N
while hi - lo > 1:
    mid = (hi + lo) // 2
    print(mid, flush=True)
    tmp = input()
    if tmp == "Vacant":
        exit()
    else:
        if mid % 2 == 0:
            if tmp == S:
                lo = mid
            else:
                hi = mid
        else:
            if tmp != S:
                lo = mid
            else:
                hi = mid


Measured memory_bytes: 3660
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ll long long
//priority_queue<int, vector<int>, greater<int> > pq;
#define _CRT_SECURE_NO_DEPRECATE
const int N = 105;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const ll mod =  1e9+7;

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	 int n,m;
	 cin>>n>>m;
	 int c1=0;
	 string s[n];
	 rep(i,0,n)
	 {
	 	cin>>s[i];
	 	for(int j=0;j<s[i].size();j++)
	 	{
	 		if(s[i][j]=='#')
	 		c1++;
		 }
	 }
	 int mn=0;
	 int cnt=0;
	 rep(i,0,n)
	 {
	 	rep(j,0,m)
	 	{
	 		if(s[i][j]=='#')
	 		{
	 			if(mn<=j&&(abs(j-mn)<=1))
	 			{
	 				cnt++;
	 				mn=j;
				 }
			 }
		 }
	 }
	 if(c1==cnt)
	 {
	 	cout<<"Possible";
	 }
	 else
	 cout<<"Impossible";
	 }
	 



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

dis = [0] * n

for i in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    dis[a] += 1
    dis[b] += 1

for i in range(n):
    if dis[i] % 2 == 1:
        print("NO")
        exit(0)

print("YES")


Measured memory_bytes: 9468
import sys

n = int(input())
stone = []
for it in input().split():
    stone.append(int(it))

cost = [sys.maxsize]*len(stone)
cost[-1]=0
for i in range(len(stone)-1, 0, -1):
    h_now = stone[i]
    cost_now = cost[i]
    
    # one jump
    for target in [i-1, i-2]:
        if target < 0:
            continue
        tmp_cost = abs(stone[i] - stone[target])+cost[i]
        if cost[target] > tmp_cost:
            cost[target] = tmp_cost

print(cost[0])

Measured memory_bytes: 13980
from collections import deque

room_num, path_num = map(int, input().split(" "))
graph = [[] for _ in range(room_num)]
dis = [-1] * room_num
count = [0] * room_num
count[0] = 1
for _ in range(path_num):
    a, b = map(int, input().split(" "))
    graph[a-1].append(b-1)
    graph[b-1].append(a-1)
dis[0] = 0
q = deque()
q.append(0)
while q:
    pop = q.popleft()
    for n in graph[pop]:
        if count[n] ==1:
            continue
        else:
            count[n] = 1
            dis[n] = pop+1
            q.append(n)
if sum(dis) == room_num:
    print("No")
else:
    del dis[0]
    print("Yes")
    for s in dis:
        print(s)

Measured memory_bytes: 37848
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;

#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define rlp(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define ff first
#define ss second
#define vll vector<ll>
#define vld vector<ld>
#define pll pair<ll,ll> 
#define pld pair<ld,ld> 
#define vpll vector<pll>
#define vpld vector<pld>
#define all(X) X.begin(),X.end()
#define endl "\n"
#define sz(x) ((ll)((x).size()))
const ll N=1e5+5,inf=1e18;

int main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	ll k,n;
	cin >> k >> n;
	ll ary[n];
	ll ans=k;
	lp(i,0,n)
	{
		cin >> ary[i];
	}
	lp(i,0,n-1)
	{
		ans=min(k-(ary[i+1]-ary[i]),ans);
	}	    
	ans=min(k-(k-ary[n-1]+ary[0]),ans);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1792
#include<stdio.h>
#define N 36
struct card{
  char mark;
  int number;
};

void trace(struct card A[], int n){
  int i;
  for ( i = 0; i < n; i++ ){
    if ( i > 0 ) printf(" ");
    printf("%c%d", A[i].mark,A[i].number);
  }
  printf("\n");
}

void bubble(struct card[],int);
void selection(struct card[],int);

int main(){

  struct card trump[N],tmp[N];
  int length,i,flag=0;
  char ch;


  scanf("%d%c", &length,&ch);
  for ( i = 0; i < length; i++ ){
    scanf("%c%d%c", &trump[i].mark, &trump[i].number,&ch);
    tmp[i] = trump[i];
  }

  bubble(trump,length);
  printf("Stable\n");
  selection(tmp,length);

  for(i = 0;i < length;i++){

    if(trump[i].mark != tmp[i].mark){
      
      printf("Not stable\n");
      flag = 1;
      break;
      
    }
  }
  if(flag ==0) printf("Stable\n");
  return 0;
}


void bubble(struct card trump[],int length){
  int n[N],i,j;
  struct card tmp;
  
  
  for(i = 0;i < length;i++){
    for(j = length - 1;j > i;j--){
      
      if(trump[j].number < trump[j - 1].number){
	tmp = trump[j];
	trump[j] = trump[j-1];
	trump[j-1] = tmp;
      }

    } 
  } 

  trace(trump,length);


}


void selection(struct card trump[],int length){

  int i,j,mini,flag;
  struct card tmp;

  
  for(i = 0;i <  length;i++){
    flag = 0;
    mini = i;
    for(j = i;j < length;j++){
      
      if(trump[j].number < trump[mini].number){
	mini = j;
	flag = 1;	
      }
    }
    if(flag == 1){
  	tmp = trump[i];
	trump[i] = trump[mini];
	trump[mini] = tmp;
    }
  }
  
  trace(trump,length);


  
}

Measured memory_bytes: 612
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <functional>
#include <map>
#include <tuple>
using namespace std;

int dp[5009][10009], A[9], N, M; bool used[10];
int D[10] = { 0,2,5,5,4,5,6,3,7,6 };

int main() {
	cin >> N >> M;
	for (int i = 0; i < M; i++) { cin >> A[i]; used[A[i]] = true; }

	dp[0][0] = 1;
	for (int i = 0; i <= N / 2; i++) {
		for (int j = 0; j <= N; j++) {
			if (dp[i][j] == 0) continue;
			for (int k = 0; k < M; k++) dp[i + 1][j + D[A[k]]] = 1;
		}
	}

	int maxn = 0; for (int i = 0; i <= N / 2; i++) { if (dp[i][N] == 1) maxn = max(maxn, i); }
	string S = ""; int sum = N;

	for (int i = 0; i < maxn; i++) {
		for (int j = 9; j >= 1; j--) {
			if (dp[maxn - i - 1][sum - D[j]] == 1 && used[j] == true) { S += ('0' + j); sum -= D[j]; break; }
		}
	}
	cout << S << endl;
	return 0;
}

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

using namespace std;
#define ll long long int
#define X first
#define Y second
const int MAXN = 1e5 + 5;
string s, t;
int n, m;
int dp[3005][3005];

int main()
{
	cin >> s >> t;
	n = s.length(), m = t.length();

	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= m; j++)
		{
			if (s[i - 1] == t[j - 1]) dp[i][j] = dp[i - 1][j - 1] + 1;
			else dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
		}
	}
	string ans = "";
	while (n > 0 && m > 0)
	{
		if (dp[n][m] == dp[n - 1][m]) n--;
		else if (dp[n][m] == dp[n][m - 1]) m--;
		else n--, m--, ans.push_back(s[n]);
	}
	reverse(ans.begin(), ans.end());
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 35456
#include <cstdio>
#include <cstdlib>
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <iostream>
#include <limits>
#include <cmath>

#define lli long
#define minimum(a,b) ((a)<(b)?(a):(b))
#define maximum(a,b) ((a)>(b)?(a):(b))
#define abs(a) ((a)<0?-(a):(a))

using namespace std;

template <typename T>
class dijekstra {
	public:
		T *res;
		struct edge{
			int to;
			T cost;
		};
		vector<edge> *g;
		bool *use;
		int node_size;
		typedef pair<T,int> pdd;
		priority_queue<pdd,vector<pdd>,greater<pdd> > queue;
		dijekstra(int size){
			node_size = size;
			res = (T*)calloc(sizeof(T),size);
			g = (vector<edge>*)calloc(sizeof(vector<edge>),size);
			use = (bool*)calloc(sizeof(bool),size);
			T limit = numeric_limits<T>::max();
			for(int i = 0;i < size;i++){
				res[i] = limit;
			}
		}
		void reset(){
			T limit = numeric_limits<T>::max();
			for(int i = 0;i < node_size;i++){
				res[i] = limit;
				use[i] = false;
			}

		}
		void set_edge(int from,int to,T cost){
			edge e;
			e.to = to;
			e.cost = cost;
			g[from].push_back(e);
		}
		void start(int i){
			res[i] = 0;
			run(i);
		}
		void run(int i){
			if(use[i]){
				if(queue.empty()) return;
				else {
					i = queue.top().second;
					queue.pop();
					return run(i);
				}
			}
			use[i] = true;
			for(auto x : g[i]){
				if(use[x.to]) continue;
				if(res[x.to] > res[i] + x.cost){
					res[x.to] = res[i] + x.cost;
					queue.push(pdd(res[x.to],x.to));
				}
			}
			if(queue.empty()) return;
			i = queue.top().second;
			queue.pop();
			return run(i);
		}
};

struct circle {
	double x,y,r;
};
vector<circle> c;
int n;

double dist(circle a,circle b){
	double x = a.x-b.x;
	double y = a.y-b.y;
	double d = sqrt(x*x+y*y)-a.r-b.r;
	return d<0.0?0.0:d;
}

int main(){
	circle cir;
	cir.r = 0;
	cin >> cir.x >> cir.y;
	c.push_back(cir);
	cin >> cir.x >> cir.y;
	c.push_back(cir);
	cin >> n;
	for(int i = 0;i < n;i++){
		cin >> cir.x >> cir.y >> cir.r;
		c.push_back(cir);
	}
	dijekstra<double> dij(n+2);
	for(int i = 0;i < n+2;i++){
		for(int j = i + 1;j < n+2;j++){
			double d = dist(c[i],c[j]);
			dij.set_edge(i,j,d);
			dij.set_edge(j,i,d);
		}
	}
	dij.start(0);
	printf("%.10lf\n", dij.res[1]);
	return 0;
}

Measured memory_bytes: 40172
#include<iostream>
using namespace std;
int main()
{
	long long N;
	cin>>N;
	if(N%10==2||N%10==4||N%10==5||N%10==7||N%10==9)
	{
		cout<<"hon"<<endl;
	}
	else if(N%10==0||N%10==1||N%10==6||N%10==8)
	{
		cout<<"pon"<<endl;
	}
	else
	cout<<"bon"<<endl;
	return 0;
}

Measured memory_bytes: 3096
#include <algorithm>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef pair<ll, ll> LLP;

// const int INF = (1 << 30) - 1;
// const ll LL_INF = (1LL << 62) - 1;
// const ll MOD = 1e9 + 7;
// const double PI = M_PI;

int a;
// vector<int> A;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> a;
  // A.resize(N);
  // rep(i, N) { cin >> A[i]; }

  int ans = 0;
  for (int i = 1; i <= 3; i++) {
    ans += pow(a, i);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3592
#include <cstdio>
#define ll long long
using namespace std;
char s[200005];
ll a1[200005],a2[200005];
ll ans[200005];
void init(){
    ll i,cnt,x;
    for(i=1;i<200005;i++){
        cnt=0;
        x=i;
        while(x){
            if(x%2!=0) cnt++;
            x/=2;
        }
        ans[i]=ans[i%cnt]+1;
    }
}


int main(){
    ll n,i,cnt=0,f1,f2,fi;
    init();
    scanf("%lld%s",&n,s);
    for(i=0;i<n;i++){
        if(s[i]=='1') cnt++;
    }
    if(n==1){
        if(cnt==0) printf("1\n");
        else printf("0\n");
        return 0;
    }

    if(cnt==0){
        for(i=0;i<n;i++){
            printf("0\n");
        }
        return 0;
    }
    if(cnt==1){
        if(s[n-1]=='1'){
            for(i=0;i<n-1;i++){
                printf("2\n");
            }
            printf("0\n");
        }
        else{
            for(i=0;i<n-1;i++){
                if(s[i]=='0') printf("1\n");
                else printf("0\n");
            }
            printf("2\n");
        }
        return 0;
    }

    a1[0]=1%(cnt-1LL); a2[0]=1%(cnt+1LL);
    for(i=0,f1=0,f2=0;i<n;i++){
        f1=(f1*2LL+s[i]-'0')%(cnt-1LL);
        f2=(f2*2LL+s[i]-'0')%(cnt+1LL);
        a1[i+1]=a1[i]*2LL%(cnt-1LL);
        a2[i+1]=a2[i]*2LL%(cnt+1LL);
    }

    for(i=0;i<n;i++){
        if(s[i]=='1'){//f1
            fi=(f1-a1[n-i-1]+(cnt-1))%(cnt-1);
        }
        else{//f2
            fi=(f2+a2[n-i-1])%(cnt+1);
        }
        printf("%lld\n",ans[fi]+1LL);
    }
    return 0;
}


Measured memory_bytes: 6608
//#include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#include "boost/multiprecision/cpp_int.hpp"
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2

ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
//template<class T>void max(T a,T b){if(a<b)return b;else return a;}
//template<class T>void min(T a,T b){if(a>b)return b;else return a;}
//template<class T>bool Max(T&a, T b){if(a < b){a = b;return 1;}return 0;}
//template<class T>bool Min(T&a, T b){if(a > b){a = b;return 1;}return 0;}

//////////////////////////

int main(){fastio
    ll n;cin>>n;
    l_l a[n];
    rep(i,0,n-1){
        cin>>a[i].fi;
        a[i].se=i;
    }
    sort(a,a+n);
    ll sum=0;
    ll ko[n];
    rep(i,0,n-1){
        ll c=1;
        vector<ll>v;v.pb(a[i].se);
        while(i<=n-2&&a[i].fi==a[i+1].fi){
            c++;
            i++;
            v.pb(a[i].se);
        }
        for(auto x:v){
            ko[x]=c;
        }
        sum+=c*(c-1)/2;
        
    }
    //rep(i,0,n-1)cout<<ko[i]<<" ";cout<<endl;
    
    rep(i,0,n-1){
        cout<<sum-(ko[i]-1)<<endl;
    }
    
    return 0;
}


Measured memory_bytes: 7380
N, M = map(int, input().split())

E = {a: set() for a in range(1, N + 1)}
for i in range(M):
    a, b = map(int, input().split())
    E[a].add(b)
    E[b].add(a)

def degree(a): return len(E[a])
def nodes():   return range(1, N + 1)

def removeOneCycle():
    """適当なcycleを削除"""
    alive = [a for a in nodes() if degree(a) > 0]
    if len(alive) == 0:
        return False
    lasso = {}   # 投げ縄
    a = alive[0] # 適当な開始節点
    p = None
    while a not in lasso:
        lasso[a] = [b for b in E[a] if b != p][0] # 引き返し以外
        p, a = a, lasso[a]
    start = a
    b = None
    while b != start:
        b = lasso[a]
        E[a].remove(b)
        E[b].remove(a)
        a = b
    return True

yes = all(degree(a) % 2 == 0 for a in nodes()) and \
      removeOneCycle() and \
      removeOneCycle() and \
      any(degree(a) > 0 for a in nodes())

print('Yes' if yes else 'No')


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


int main(void){

        int p=0;
        int n=0;
        int cad[50];

        while(1){

                int i,j=0;
                int cad[50];
                int sum=0;
                

        cin >> n >> p;
        if(p == 0 && n == 0 )break;
        sum = p;

        for(i=0; i<50; i++){
                cad[i] = 0;
        }

      
        while(1){
              
        if(p != 0){
                cad[j] = cad[j] + 1;
                p = p-1;
              
                if(sum == cad[j])break;

        }else if(p == 0){
                
                if(cad[j] != 0){
                        p = cad[j] + p;
                        cad[j] = 0;
                        
                }
        }
        j++;
        j = j%n;
        }

        cout <<  j <<endl;

}

        return 0;

}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
#include<cctype>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define pi 3.1415926535897932384
#define E9 1000000000

int main(){
  int64_t N; cin >> N;
  cout << N*(N-1)/2 << endl;

  return 0;
}

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

// マクロ
// forループ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(ll)(b);i--)
// xにはvectorなどのコンテナ
#define ALL(x) (x)begin(),(x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
// 出力
#define PRINT(x) cout<<(x)<<endl
#define PRINTA(x,n) REP(i,n)PRINT(x[i])
// 定数
#define INF 1000000000000 // 10^12
#define MOD 1000000007 // 10^9+7
// 略記
#define PB push_back
#define MP make_pair



int main() {
    double a, b, h, m;
    cin >> a >> b >> h >> m;
    double ad = M_PI / 6 * (h + m / 60);
    double bd = 2 * M_PI * m / 60;
    double c = sqrt(a*a + b*b - 2*a*b*cos(ad-bd));
    printf("%.9f\n", c);
    return 0;
}

Measured memory_bytes: 4292
#include<iostream>
#define REP(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;

int main() {
    string ans = "Christmas";
    int d; cin >> d;
    REP(i, d - 25, 0) {
        ans += " Eve";
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
import bisect
import collections
import functools
import heapq
import math
import sys
from collections import deque
from collections import defaultdict
input = sys.stdin.readline
MOD = 10**9+7

N,H = map(int,(input().split()))
a = [[0]*2 for _ in range(N)]
for i in range(N):
    a[i] = list(map(int,(input().split())))
a.sort(key=lambda x:x[1],reverse=True)
M = max(a,key=lambda x:x[0])[0]

c = 0
for i in range(N):
    if a[i][1] > M:
        H -= a[i][1]
        c += 1
        if H <= 0:
            H = 0
            break
    else:
        break
c += math.ceil(H/M)
print(c)

Measured memory_bytes: 66080
#include <bits/stdc++.h>
#define int long long
#define MOD 1000000007
using namespace std;

signed main(){
	string s;
	cin >> s;
	bool flag = true;
	int n = s.length();
	for(int i = 0;i < (n + 1) / 2;i++){
		if(s[i] > s[n - i - 1]) swap(s[i],s[n - i - 1]);
		if(!((s[i] == 'b' && s[n - i - 1] == 'd') || (s[i] == 'p' && s[n - i - 1] == 'q'))) flag = false;
	}
	if(flag) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define m1(x) memset(x,-1,sizeof(x))
const int INF = 1e9 + 1;
const ll MOD = 1e9 + 7;
const double PI = 3.141592653589793;


int main(){
  ll a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  if(abs(c-a) <= (b-d) * e){
    cout << "YES"<<endl;
  }else{
    cout << "NO"<<endl;
  }
}

Measured memory_bytes: 3632
#pragma optimization_level 3
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
#include<bits/stdc++.h>

using namespace std;
 
#define  GODSPEED       ios:: sync_with_stdio(0);cin.tie(0);cout.tie(0);cout<<fixed;cout<<setprecision(15);
#define  f              first                 
#define  s              second
#define  newl           cout<<"\n";
#define  pb             push_back  
#define  mset(a,x)      memset(a,x,sizeof(a))
#define  debv(a)        for(auto it: a)cout<<it<<" ";newl;
#define  deb1(a)        cout<<a<<"\n";
#define  deb2(a,b)      cout<<a<<" "<<b<<"\n";
#define  deb3(a,b,c)    cout<<a<<" "<<b<<" "<<c<<"\n";
#define  deb4(a,b,c,d)  cout<<a<<" "<<b<<" "<<c<<" "<<d<<"\n";
#define  uniq(a)        a.resize(unique(a.begin(), a.end()) - a.begin());
#define  all(a)         a.begin(),a.end()           
 
typedef  long long             ll;
typedef  long double           ld;
typedef  pair<ll,ll>           pll;
typedef  vector<ll>            vll;
typedef  vector<pll>           vpll;

const ll   N     =  2e6+5;
const ll   mod   =  1e9+7;
const ll   INF   =  0x7f7f7f7f7f7f7f7f;
const int  INFi  =  0x7f7f7f7f;

ll test = 1, n, dp[N];

void solve(){
	cin>>n;
	dp[0] = 0;
	for(int i = 1; i <= n; i++){
		dp[i] = dp[i-1]+1;
		for(int j = 6; j <= i; j *= 6) dp[i] = min(dp[i],dp[i-j]+1);
		for(int j = 9; j <= i; j *= 9) dp[i] = min(dp[i],dp[i-j]+1);
	}
	deb1(dp[n])
}

int main(){
	GODSPEED;
	//cin>>test;
	for(int i = 1; i <= test; i++){
		solve();
	}
	#ifndef ONLINE_JUDGE
    cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
    #endif
}

Measured memory_bytes: 4436
input_line = input()
Line = input_line.split()
Line = [int(s) for s in Line]

input_line = input()
reizou = input_line.split()
reizou = [int(s) for s in reizou]

# print(reizou)

input_line = input()
densi = input_line.split()
densi = [int(s) for s in densi]

# print(densi)

hutuu_min = min(reizou)+min(densi)
# print(hutuu_min)

for i in range(Line[2]):
    input_line = input()
    ticket = input_line.split()
    ticket = [int(s) for s in ticket]
    # print(ticket)
    ticket_min = reizou[ticket[0]-1]+densi[ticket[1]-1]-ticket[2]
    
    if ticket_min < hutuu_min:
        hutuu_min = ticket_min

print(hutuu_min)

Measured memory_bytes: 20024
#!/usr/bin/env python

from collections import deque
import itertools as ite
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

L, R = map(int, raw_input().split())
if R / 2019 != L / 2019 or L % 2019 == 0:
    print 0
    exit()
ans = 2019
for i in range(L, R + 1):
    for j in range(i + 1, R + 1):
        ans = min(ans, i * j % 2019)
print ans

Measured memory_bytes: 30444
#include <bits/stdc++.h>
#include <iomanip>
#include <algorithm>
#define ll long long
#include <unordered_map>
using namespace std;

int main() {
  ll N, cnt =  0;
  cin >> N;
  string s;
  unordered_map<string, int> mp;
  for(ll i = 0; i < N; i++) {
    cin >> s;
    sort(s.begin(), s.end());
    mp[s]++;
  }
  for(auto& p : mp) {
    ll n = p.second;
    cnt += (ll)n * (n - 1) / 2;
  }
  cout << cnt << endl;
}


Measured memory_bytes: 10660
//(・ω・)
#include <stdio.h>
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, atoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <iomanip> //setprecision
#include <limits>
#include <sstream> //istringstream
#include <stdlib.h>
#include <list>
#include <iterator>//std::advance()
using namespace std;
int selectionSort(vector<int> &a,int n){
    int count=0;
    for(int i=0; i<n-1; i++){
        int minj=i;
        for(int j=i; j<n; j++){
            if(a[j]<a[minj]) minj=j;
        }
        swap(a[i],a[minj]);
        if(i!=minj) count++;
    }
    return count;
}
int main(){
    int n,ans;
    cin >> n;
    vector<int> a(n);
    for(int i=0; i<n; i++) cin >> a[i];
    ans=selectionSort(a,n);
    for(int i=0; i<n-1; i++) cout << a[i] << " ";
    cout << a[n-1] << endl;
    cout << ans << endl;
}



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

#define MAX 2000001
#define VMAX 10000

int main() {
	unsigned short *A, *B;

	int C[VMAX + 1];
	int n, i, j;
	cin >> n;

	// c++ではmallocはキャストしないと代入できない
	A = (unsigned short*)malloc(sizeof(short) * n + 1);
	B = (unsigned short*)malloc(sizeof(short) * n + 1);

	// 初期化
	for (i = 0; i <= VMAX; i++) C[i] = 0;

	// 配列Aの各要素が何回表れるかCに格納する
	for (i = 0; i < n; i++) {
		cin >> A[i + 1];
		C[A[i + 1]]++;
	}

	// 累積和を取ってCを更新する
	for (i = 1; i <= VMAX; i++) C[i] = C[i] + C[i - 1];

	// CからBを生成
	for (j = 1; j <= n; j++) {
		B[C[A[j]]] = A[j];
		C[A[j]]--;
	}

	for (i = 1; i <= n; i++) {
		if (i>1) cout << " ";
		cout << B[i];
	}

	cout << endl;

	return 0;
}


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

int main(int argc, char** argv){
  int n, k;

  while (cin >> n >> k) {
    for (int i = 0; i < n; i++) {
      int tmp;
      cin >> tmp;
    }
    
    int count;

    for (count = 1; (k + (count - 1) * (k - 1)) < n; count++) {
      continue;
    }

    cout << count << endl;
  }

  return 0;
}


Measured memory_bytes: 256
n,m,X,Y = map(int,input().split())
x = list(map(int,input().split()))
y = list(map(int,input().split()))

x_max = max(x)
y_min = min(y)
for i in range(-100,101):
    if X < i <= Y and x_max < i and y_min >= i:
        print("No War")
        exit()
print("War")

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

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

typedef long long ll;

const int INF = 1 << 30;
const ll LLINF = 1LL << 62;

int mod = 1000000007;

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int N; cin >> N;
    int A[N]; rep(i, N) cin >> A[i];
    sort(A, A+N);
    int sm = 0; rep(i, N-1) sm += A[i];
    if(sm > A[N-1]) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint     = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    lint n, k;
    cin >> n >> k;
    vector<lint> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
        a[i]--;
    }
    vector<vector<int>> dbl(n, vector<int>(100, 0));
    for (int i = 0; i < n; ++i) {
        dbl[i][0] = a[i];
    }
    for (int i = 1; i < 64; ++i) {
        for (int j = 0; j < n; ++j) {
            dbl[j][i] = dbl[dbl[j][i - 1]][i - 1];
        }
    }
    int curr = 0;
    for (lint i = 0; i < 64; ++i) {
        if (k >> i & 1) {
            curr = dbl[curr][i];
        }
    }
    cout << curr + 1 << "\n";
    return 0;
}

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

struct point{ int x, y, id; };

point init(int pos_x, int pos_y, int index)
{
	point p; 
	p.x = pos_x, p.y = pos_y, p.id = index; 
	return p; 
}

bool cmp_x(const point &P1, const point &P2){ if(P1.x != P2.x){ return P1.x < P2.x; } return P1.y < P2.y; }
bool cmp_y(const point &P1, const point &P2){ if(P1.y != P2.y){ return P1.y < P2.y; } return P1.x < P2.x; }
bool cmp_id(const point &P1, const point &P2){ return P1.id < P2.id; }

typedef struct node{ point mark; node *less, *more; } kd_node;

kd_node* init(point pos, node* l, node* m)
{
	kd_node* node = new kd_node;
	node->mark = pos, node->less = l, node->more = m;
	return node;
}

kd_node* kd_tree(point *P, int *S, int *T, int *U, int left, int right, int d)
{
	if(left == right) return NULL;
	if(left + 1 == right){
		kd_node* leaf = new kd_node;
		leaf->less = NULL, leaf->more = NULL;
		if((d & 1) == 0){
			leaf->mark = P[S[left]];
		}else{
			leaf->mark = P[T[left]];
		}
		return leaf;
	}

	kd_node* node = new kd_node;
	int mid = (left + right) / 2;
	int a = left, b = mid;

	if((d & 1) == 0){
		node->mark = P[S[mid]];
		for(int i = left; i < right; i++){
			if(cmp_x(P[T[i]], P[S[mid]])){
				U[a] = T[i], a++;
			}else{
				U[b] = T[i], b++;
			}
		}
		for(int i = left; i < right; i++){ T[i] = U[i]; }

	}else{
		node->mark = P[T[mid]];
		for(int i = left; i < right; i++){
			if(cmp_y(P[S[i]], P[T[mid]])){
				U[a] = S[i], a++;
			}else{
				U[b] = S[i], b++;
			}
		}
		for(int i = left; i < right; i++){ S[i] = U[i]; }
	}
	node->less = kd_tree(P, S, T, U, left, mid, d + 1);
	node->more = kd_tree(P, S, T, U, mid, right, d + 1);

	return node;
}

int cnt;

void find_pt(int *Q, int sx, int tx, int sy, int ty, kd_node* node, int d)
{
	point p = node->mark;
	int a = p.x, b = p.y;

	if(node->less == NULL && node->more == NULL){
		if(sx <= a && a <= tx && sy <= b && b <= ty){
			Q[cnt] = p.id, cnt++;
		}
		return;
	}
	if((d & 1) == 0){
		if(sx <= a){ find_pt(Q, sx, tx, sy, ty, node->less, d + 1); }
		if(a <= tx){ find_pt(Q, sx, tx, sy, ty, node->more, d + 1); }
	}else{
		if(sy <= b){ find_pt(Q, sx, tx, sy, ty, node->less, d + 1); }
		if(b <= ty){ find_pt(Q, sx, tx, sy, ty, node->more, d + 1); }
	}
	return;
}

int main()
{
	point *P;
	int *S, *T, *U;
	int Q[100];
	int i, pos_x, pos_y, n;
	scanf("%d", &n);

	P = new point [n];
	S = new int [n], T = new int [n], U = new int [n];

	for(i = 0; i < n; i++){
		scanf("%d %d", &pos_x, &pos_y);
		P[i] = init(pos_x, pos_y, i);
	}
	sort(P, P + n, cmp_x);
	for(i = 0; i < n; i++){ S[i] = P[i].id; }
	sort(P, P + n, cmp_y);
	for(i = 0; i < n; i++){ T[i] = P[i].id; }
	sort(P, P + n, cmp_id);

	kd_node* root = kd_tree(P, S, T, U, 0, n, 0);

	int sx, tx, sy, ty, q;
	scanf("%d", &q);
	while(q){
		cnt = 0;
		scanf("%d %d %d %d", &sx, &tx, &sy, &ty);
		find_pt(Q, sx, tx, sy, ty, root, 0);
		sort(Q, Q + cnt);
		for(int i = 0; i < cnt; i++){ printf("%d\n", Q[i]); }
		printf("\n");
		q--;
	}

	return 0;
}

Measured memory_bytes: 58320
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vll = vector<ll>;
#define all(x) (x).begin(), (x).end()
#define fsp(x) cout << fixed << setprecision(x)
#define endl '\n'
const ll inf = LLONG_MAX;
const long double pi = M_PI;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
  string s;
  cin >> s;
  if (s[2] == s[3] && s[4] == s[5]) Yes();
  else No();
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
//#pragma comment(linker, "/STACK:102400000,102400000")
typedef long long ll;
typedef pair<int,int> P;
#define ls(x) (x<<1)
#define rs(x) (x<<1|1)
#define lowbit(x) (x&-x)
const ll INF=0x3f3f3f3f;
const double EPS=1e-8;
const int N=2e5+10;
const ll mod=1e9+7;
inline ll read()
{  ll f=1,x=0;char ch=getchar();
   for(;ch>'9'||ch<'0';ch=getchar())if(ch=='-') f=-1;
   for(;ch<='9'&&ch>='0';ch=getchar()) x=x*10+ch-'0';
   return x*f;
}
ll n,ans,d;
int main()
{  cin>>n>>d;
   for(int i=1;i<=n;i++)
   {  ll x,y;
      cin>>x>>y;
      if(x*x+y*y<=d*d)ans++;
   }
   cout<<ans;

}

Measured memory_bytes: 3640
#include <iostream>
#include <string>

using namespace std;

int main(){
    string str; cin >> str;
    int N = str.length();
    int countS = 0;
    int countT = 0;
    for(int i=0;i<N;i++){
        if(str[i] == 'S') countS++;
        if(str[i] == 'T'){
            if(countS > 0){
                countS--;
                countT++;
            }
        }
    }
    cout << N - 2*countT << endl;
    return 0;
}

Measured memory_bytes: 640
#include <iostream> // cout, endl, cin
#include <iomanip>
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <numeric>
using namespace std;
#define _GLIBCXX_DEBUG
#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++)
const int INF = 1001001001;
const int BG = 1000000007;

int get_rank(int64_t num)
{
    int ret = 1;
    while (true)
    {
        num /= 10;
        if (num == 0)
        {
            return ret;
        }
        ret++;
    }
}

int main()
{
    int64_t n;
    cin >> n;

    int mini = 11;
    for (int64_t i = 1; i * i <= n; i++)
    {
        if (n % i != 0)
        {
            continue;
        }
        int i_d = get_rank(i);
        int j_d = get_rank(n / i);
        int maxi = max(i_d, j_d);
        mini = min(maxi, mini);
    }
    cout << mini << endl;
}


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

using namespace std;
using ll = long long;

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

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

  vector<int> d;
  for (int i = 1; i <= min(a, b); ++i) {
    if (a % i == 0 && b % i == 0) {
      d.push_back(i);
    }
  }

  sort(d.rbegin(), d.rend());
  cout << d[k - 1] << endl;
  return 0;
}


Measured memory_bytes: 3612
# coding: utf-8
# Your code here!
num, m = map(int, input().split())
item = list(map(int, input().split()))

item.sort(reverse=True)

flag = 0
for i in range(m):
    if item[i] < 1/(4*m) * sum(item):
        flag = 1
        break

if flag == 0:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
from sys import stdin
from collections import deque

S = stdin.readline().rstrip()

stack = deque([])
count = 0

for s in S:
    # スタックが空なら
    if not stack:
        stack.append(s)
    # スタックの一番上がsでなければ
    elif stack[-1] != s:
        stack.pop()
        count += 2
    else:
        stack.append(s)

print(count)

Measured memory_bytes: 45552
#include <iostream>
#include <stdio.h>
#include <string>

using namespace std;

int main() {
    int n,b,f,r,v;
    int house[4][3][10];

    for (int i = 0; i < 4; ++i) {
        for (int j = 0; j< 3; ++j) {
            for (int l = 0; l< 10; ++l) {
                house[i][j][l]=0;
            }
        }
    }

    cin>>n;
    for (int i = 0; i < n; ++i) {
        cin>>b>>f>>r>>v;
        house[b-1][f-1][r-1]+=v;
    }


    for (int i = 0; i < 4; ++i) {
        for (int j = 0; j < 3; ++j) {
            for (int l = 0; l < 10; ++l) {
                v = house[i][j][l];
                cout<<' '<<v;
            }
            cout << '\n';
        }
        if(i !=3){
            for (int m = 0; m<20; ++m) {
                cout<<'#';
            }
            cout << "\n";
        }

    }


    return 0;

}


Measured memory_bytes: 3124
#include<bits/stdc++.h>
#define rep(i, n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
ll INF=1e12;
int main(void){
    int n;
    cin>>n;
    vector<vector<int> > f(n, vector<int>(10));
    vector<vector<int> > p(n, vector<int>(11));
    rep(i, n)rep(j, 10) cin>>f[i][j];
    rep(i, n)rep(j, 11) cin>>p[i][j];
    ll ans=-INF;
    for(int i=1;i<(1<<10);i++){
        vector<int> open(10, 0);
        rep(j, 10) {
            if((i>>j)&1) open[j]=1;
        }
        vector<ll>num(n);
        rep(j, 10){
            rep(k, n){
                if(f[k][j]&open[j]) num[k]++;
            }
        }
        ll tmp=0;
        rep(j, n) tmp+=p[j][num[j]];
        ans=max(ans, tmp);
    }
    cout<<ans<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
char c[5] ;
char cc[5];
int s[5];
int cnt=0;

int main(){
	for(int i=1;i<=4;i++){
		cin>>c[i];
		int flag=0;
		for(int j=1;j<=cnt;j++){
			if(cc[j]==c[i]){
				s[j]++;
				flag=1;
			}	
		}
		if(flag==0) {
			cnt++;
			cc[cnt]=c[i];
			s[cnt]++;
		}
		//cout<<cnt<<" "<<cc[cnt]<<endl;
	}
	if(cnt==2&&s[1]==2&&s[2]==2) cout<<"Yes";
	else cout<<"No";
	return 0;
}

Measured memory_bytes: 256
n,h,w = gets.chomp.split(" ").map(&:to_i)
al = Array.new(n).map{Array.new(2, 0)}
for i in 0..n - 1
  al[i] = gets.chomp.split(" ").map(&:to_i)
end
ans = 0
for i in 0..n-1
  if al[i][0] >= h && al[i][1] >= w
    ans += 1
  end
end
puts ans


Measured memory_bytes: 1916
#include <bits/stdc++.h>
using namespace std;
int main(){
	string s;
	cin>>s;
	int ans=0;
	int anmichi=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='A'||s[i]=='C'||s[i]=='G'||s[i]=='T')ans++;
		else ans=0;
		anmichi=max(ans,anmichi);
	}
	cout<<anmichi<<endl;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES // M_PI
#include<cmath>
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define rREP(i,a,n) for(int (i)=(n)-1; (i)>=(a);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 2147483647;
constexpr ll mod = 1000000007;

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;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();


	ll N; cin >> N;
	ll ans = 0;
	if (N % 2 == 0) {
		N /= 2;
		while (N) {
			ans += N / 5;
			N /= 5;
		}
	}
	cout << ans << "\n";


	return 0;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        ArrayList<Integer> org = new ArrayList<>(n);
        for (int i = 0; i < n; i++) org.add(0);
        for (int i = 0; i < n-1; i++) {
            int tmp = sc.nextInt();
            org.set(tmp-1, org.get(tmp-1)+1);
        }
        for (var o : org) System.out.println(o);
    }
}

Measured memory_bytes: 61564
import java.util.*;
public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    String str = sc.next();
    char c[] = str.toCharArray();

    for (int i = 0 ; i < 3 ; i++ ) {
      if (c[i]=='1') {
        c[i] = '9' ;
      } else
      if (c[i] == '9') {
        c[i] = '1' ;
      }
    }
    for (int i = 0 ; i < 3 ; i++ ) {
      System.out.print(c[i]);
    }



  }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define ll long long

using namespace std;

ll a[3][3];
bool ch[3][3];

void init(){
	ll i,j;
	for(i=0;i<3;i++){
		for(j=0;j<3;j++){
			a[i][j]=0;
			ch[i][j]=false;
		}
	}
}

void find(ll t){
	ll i,j;
	for(i=0;i<3;i++){
		for(j=0;j<3;j++){
			if(a[i][j]==t){
				ch[i][j]=true;
			}
		}
	}
}

string find_ans(){
	ll i,j;
	for(i=0;i<3;i++){
		if(ch[i][0]==true&&ch[i][1]==true&&ch[i][2]==true){
			return "Yes";
		}
	}
	for(i=0;i<3;i++){
		if(ch[0][i]==true&&ch[1][i]==true&&ch[2][i]==true){
			return "Yes";
		}
	}
	if(ch[0][0]==true&&ch[1][1]==true&&ch[2][2]==true){
		return "Yes" ;
	}
	if(ch[0][2]==true&&ch[1][1]==true&&ch[2][0]==true){
		return "Yes" ;
	}
	return "No" ;
}

int main()
{
//    ios_base::sync_with_stdio(false);
//    cin.tie(0);
	ll i,j,t,k;
	init();
	for(i=0;i<3;i++){
		for(j=0;j<3;j++){
			cin >> a[i][j];
		}
	}
	ll n;
	cin >> n;
	while(n--){
		cin >> t;
		find(t);
	}
/*
	for(i=0;i<3;i++){
		for(j=0;j<3;j++){
			if(ch[i][j]){
				cout << 1 << " ";
			}
			else{
				cout << 0 << " ";
			}
		}
		cout <<endl;
	}
*/
	cout << find_ans() << endl;
    return 0;
}


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

int main(void){

    int area = 0;

    int n,x,y;
    while(cin >> n){

        for(int i = 0;i < 600 / n -1 ;i++){

            x = (i+1) * n;
            y = x * x;
            area += n * y;
        }
        cout << area << endl;
        area = 0;
    }


    return 0;
}

Measured memory_bytes: 3104
#include <iostream>
using namespace std;
int main(void){
    bool ans;
    char N, W;
    cin >> N;
    cin >> W; 
    cin >> N >> W;
    ans = 0;
    if(N==W){
    }else{
        ans = 1;
    }
    cin >> N >> W;
    if(N==W){
    }else{
        ans = 1;
    }
    if(ans==1){
        cout << "No";
    }else{
        cout << "Yes";
    }
}

Measured memory_bytes: 3596
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <functional>
#include <math.h>
#include <stdlib.h>
#include <map>
#include <deque>
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define INF 1050000000
#define INFL 1100000000000000000LL
#define EPS (1e-10)
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef long long ll;
typedef pair<int, int> Pi;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<Pi> > vvPi;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi> > pqlP;
struct Edge {
	int from, to, cost;
	bool operator<(Edge e) {
		return cost < e.cost;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
template <class T>
using vec = vector<T>;
template<class T>
using pql = priority_queue<T, vector<T>, greater<T>>;
string debug_show(Pi a) {
	return "(" + to_string(a.first) + "," + to_string(a.second) + ")";
}

template<class T>
struct augEdge {
	T from, to;
	int cost;
	bool operator<(augEdge e) { return cost < e.cost; }
	bool operator>(augEdge e) { return cost > e.cost; }
};
template<class T>
using augGraph = vector<augEdge<T>>;


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

	int a, b, c;
	cin >> a >> b >> c;
	int ans = a + b + c;
	int t = max(a, b);
	t = max(t, c);
	cout << ans - t << endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,x) for(int i=0; i<x;i++)
#define mod 1000000007
#define INF 10000000000
typedef long long ll;



vector<int> dp(100100,0);

//トポロジカルソート
vector<int>topological_sort(vector<vector<int>>G, vector<int>indegree, int N){
  
  vector<int> sorted;
  
  queue<int> que;
  rep(i,N){
  	if(indegree[i] == 0) que.push(i);
  }
  
  while (que.empty() == false){
  	int v=que.front();
    que.pop();
    
    rep(i,G[v].size()){
    	int u = G[v][i];
      indegree[u]--;
      if(indegree[u] ==0){
        que.push(u);
       	dp[u] = max(dp[u],dp[v] + 1); 
      }
    }
    
    sorted.push_back(v);
  }
  
  return sorted;
}



int main(){
 ios::sync_with_stdio(false);
  int N,M;
  cin>>N>>M;
  
  vector<vector<int>> G(N);
  vector<int> indegree(N,0);
  
  int x[M],y[M];
  rep(i,M){
    cin>>x[i]>>y[i];
    
    G[x[i]-1].push_back(y[i]-1);
    indegree[y[i]-1]++;
  }
  
  vector<int> sorted = topological_sort(G,indegree,N);
  
  int Max=0;
  
  rep(i,N){
  	Max = max(Max,dp[i]);
  }
  cout<<Max;
  
  
}

Measured memory_bytes: 13824
#!python3.8
# -*- coding: utf-8 -*-
# abc167/abc167_d
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    N, K = i2nn()
    A = list(map(lambda a:a-1, i2nn()))
    B = [0]
    B_rev = [None] * N
    B_rev[0] = 0
    left = 0
    for _ in range(N):
        a = A[B[-1]]
        if B_rev[a] is not None:
            left = B_rev[a]
            break
        B_rev[a] = len(B)
        B.append(a)
    #print(A)
    #print(B)
    #print(left)
    if K <= left:
        print(B[K] + 1)
        return
    p = (K - left) % (len(B) - left)
    print(B[left + p] + 1)
    return

main()


Measured memory_bytes: 34272
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<int,int>
#define F first
#define S second
#define mod 1000000007
#define INF 9000000000000000000
signed main(void){
    int x,a;cin>>x>>a;
    if(x<a)cout<<0;
    else cout<<10;
}

Measured memory_bytes: 256
gets
a = gets.chomp.split(" ").map(&:to_i)

h = Hash.new(0)
for i in a do
    h[i] += 1
end

ans = 0
h.sort.each do | key, val|
    ans = [ans, h[key-1] + h[key] + h[key+1]].max
end
puts ans

Measured memory_bytes: 21408
import java.util.Scanner;

class Main
{
    public static void main(String[] args)
    {     
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        
        if (a < b){
            System.out.println("a < b"); }
        if (a >b){
            System.out.println("a > b"); }
        if (a == b){
            System.out.println("a == b"); }
    }
}



Measured memory_bytes: 26196
#include<cstdio>
#include<iostream>
#include<utility>
#include<algorithm>
using namespace std;

#define rep(i, a, b) for (int i = (a); i < (b); i++)

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

    int x = (a + b) / 2;
    if ((a + b) % 2 > 0) x++;
    cout << x << endl;
}

Measured memory_bytes: 764