akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,K,ans=0;
  cin >>N >>K;
  vector<int> A(2e5+1,0), B(2e5+1,0);  
  for(int i=0; i<N; i++){
    int a;
    cin >>a;
    A[a]++;
  }
  for(int i=0; i<2e5+1; i++){
    B[A[i]]++;
  }
  int z=2e5+1-B[0];//初期の種類数
  for(int i=1; i<N; i++){
 //   cout<<"i:"<<i<<" B[i]:"<<B[i]<<" z:"<<z<<endl;
    if(z>K){
      if(z-B[i]>K){
        ans+=B[i]*i;
        z-=B[i];
      }
      else{
        ans+=(z-K)*i;
        break;
      }
    }
    else break;
  }
  cout <<ans <<endl;
}


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

int main() {
	int a,b;
  	cin>>a>>b;
  	cout<<(a+b)%24<<endl;
}

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

f = True
for i in a:
    if i % 2 == 0:
        if i % 3 == 0 or i % 5 == 0:
            f = True
        else:
            f = False
            break
if f:
    print("APPROVED")
else:
    print("DENIED")

Measured memory_bytes: 3060
import Control.Monad
import Data.Maybe
import Debug.Trace
import Data.List
import qualified Data.Map.Strict as Map
import qualified Data.IntMap.Strict as IntMap
import qualified Data.Set as Set
import qualified Data.IntSet as IntSet
import Data.Functor
import Data.Array

main :: IO ()
main = do
  n <- readLn
  as <- replicateM n $ readLn :: IO [Int]

  putStrLn $ if solve as then "first" else "second"

solve :: [Int] -> Bool
solve as = not $ all (\x -> x `mod` 2 == 0) as 

Measured memory_bytes: 62844
N,M,X = map(int, input().split())
C = []
A = []
for _ in range(N):
    Cs,*As = map(int,input().split())
    C.append(Cs)
    A.append(As)
INF = float('inf')
ans = INF
for S in range(1<<N):
    B = [0]*M
    cst = 0
    for i in range(N):
        if (S>>i)&1:
            cst+= C[i]
            for j in range(M):
                B[j] += A[i][j]
        if min(B)>=X:
            ans = min(ans,cst)
if ans == INF:
    print(-1)
else:
    print(ans)

Measured memory_bytes: 9228
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <numeric>

#define roop(i, n) for(int i=0;i<n;i++)
#define DIV 1000000007

using namespace std;
using ll = long long int;
using ull = unsigned long long;

float myPower(int a, int n) { // aのn乗の計算
	float x = 1;
	while (n > 0) { // 全てのbitが捨てられるまで
		if ( n & 1) { // 一番右のbitが１のとき
			x *= a;
		}
		a *= a;
		n >>= 1; // bit全体を右に1つシフトして一番右を捨てる
	}
	return x;
}

ll combination(ll n, ll r) {
	if (n < 0 || r < 0 || r > n) return -1;

	if (n - r < r) r = n - r;
	if (r == 0) return 1;
	if (r == 1) return n;

	vector<ll> num(r);
	vector<ll> den(r);

	for (ll i = 0; i < r; i++) {
		num[i] = n - r + i + 1;
		den[i] = i + 1;
	}

	for (ll p = 2; p <= r; p++) {
		ll pivot = den[p - 1];
		if (pivot > 1) {
			ll offset = (n - r) % p;
			for (ll k = p - 1; k < r; k += p) {
				num[k - offset] /= pivot;
				den[k] /= pivot;
			}
		}
	}
	ll result = 1;
	for (ll k = 0; k < r; k++) {
		if (num[k] > 1) result *= num[k];
	}
	return result;
}

int main() {
	ll a, b, n;
	cin >> a >> b >> n;
	ll max = 0;
	if (b <= n) {
		max = floor((a*(b - 1))/b) - a * floor((b - 1)/b);
	} else {
		max = floor((a*(n))/b) - a * floor((n)/b);
	}
	cout << max << endl;	
	return 0;
}

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

#define REP(i,n) for(int i = 0; i < n; i++)
#define ll long long
#define PI M_PI
#define bf printf("\n");

int main(void){
    int N;
    scanf("%d",&N);
    int d[N];
    REP(i,N) scanf("%d",&d[i]);

    int ans = 0;
    REP(i,N-1){
        REP(j,N-1-i){
            ans = ans + d[i] * d[i+j+1];
        }
    }
    printf("%d",ans);
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
    int N,T;
    cin>>N>>T;
    vector<int> A(N),A_MIN(N,1e9);
    for(int i=0;i<N;i++){
        cin>>A[i];
    }
    int minimum=1e9;
    for(int i=0;i<N;i++){
        minimum=min(minimum,A[i]);
        A_MIN[i]=minimum;
    }
    int best=-1;
    int best_n=0;
    for(int i=0;i<N;i++){
        if(best<A[i]-A_MIN[i]){
            best=A[i]-A_MIN[i];
            best_n=1;
        }else if(best==A[i]-A_MIN[i]) best_n++;
    }
    cout<<best_n<<endl;
    return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>
#include <algorithm>

using namespace std;

#define N 1100
#define INF 0x3f3f3f3f

struct Node {
    int t, c;
    bool operator < (const Node &u) const {
        return t < u.t;
    }
};

Node a[N];

int main() {
    int n, t;
    while (scanf("%d%d", &n, &t) != EOF) {
        int res = INF;
        for (int i = 0; i < n; ++i) scanf("%d%d", &a[i].c, &a[i].t);
        sort(a, a + n);
        for (int i = 0; i < n; ++i) {
            if (a[i].t > t) break;
            res = min(res, a[i].c);
        }
        if (res == INF) puts("TLE");
        else printf("%d\n", res);
    }
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
#define yn {puts("unsafe");}else{puts("safe");}
#define MAX_N 200005

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

    if(a <= b)yn;
    
    return 0;
}




Measured memory_bytes: 3588
#include <stdio.h>
static int n, i;
static long t[100], t2[100];
long gcd(long a, long b) {
    if (b) return gcd(b, a % b);
    return a;
}
long lcm(long a, long b) {
    return a / gcd(a, b) * b;
}
int main(void) {
    scanf("%d", &n);
    for (i = 0; i < n; ++i) scanf("%ld", t + i);
    t2[0] = t[0];
    for (i = 1; i < n; ++i) t2[i] = lcm(t2[i - 1], t[i]);
    printf("%ld\n", t2[n - 1]);
    return 0;
}


Measured memory_bytes: 128
import sys
sys.setrecursionlimit(10 ** 6)  # 再帰関数の再帰の深さを設定
to_index = lambda x: int(x) - 1  # 入力した数字に1を引いたものを返す
print_list_in_2D = lambda x: print(*x, sep="\n")  # リストの要素を改行を挟んで表示する関数

# 入力を整数に変換して受け取る
def input_int(): return int(input())

def map_int_input(): return map(int, input())

MII = map_int_input

def MII_split(): return map(int, input().split())

def MII_to_index(): return map(to_index, input())

def MII_split_to_index(): return map(to_index, input().split())

# 入力全てを整数に変換したものの配列を受け取る
def list_int_inputs(): return list(map(int, input()))

LII = list_int_inputs

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

# 2次元リスト化
def LII_2D(rows_number): return [LII() for _ in range(rows_number)]

def LII_split_2D(rows_number): return [LII_split() for _ in range(rows_number)]

import math

A, B, H, M = MII_split()

h_dig = (H + M / 60) * math.pi / 6
dig = M * math.pi / 30 - h_dig
ans = math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(dig))
print(ans)

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

int main ( int argc, char** argv )
{
  int x;
  std::cin >> x;

  int glad500;
  glad500 = x / 500;
  x %= 500;

  int glad5;
  glad5 = x / 5;
  x %= 5;

  std::cout << std::to_string ( 1000 * glad500 + 5 * glad5 ) << std::endl;
  
  return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;

const ll INF=1e9;

struct LazySegmentTree{
private:
    ll n;
    vector<ll> node, lazy;
public:
    LazySegmentTree(vector<ll> v){
        ll sz=(ll)v.size();
        n=1;
        while(n<sz) n*=2;
        node.resize(2*n-1,INF);
        lazy.resize(2*n-1,0);
        rep(i,sz) node[i+n-1]=v[i];
        for(ll i=n-2;i>=0;i--) node[i]=min(node[2*i+1],node[2*i+2]);
    }
    void eval(ll k,ll l,ll r){
        if(lazy[k]!=0){
            node[k]+=lazy[k];
            if(r-l>1){
                lazy[2*k+1]+=lazy[k];
                lazy[2*k+2]+=lazy[k];
            }
            lazy[k]=0;
        }
    }
    void add(ll a,ll b,ll x,ll k=0,ll l=0,ll r=-1){
        if(r<0) r=n;
        eval(k,l,r);
        if(b<=l || r<=a) return;
        if(a<=l && r<=b){
            lazy[k]+=x;
            eval(k,l,r);
        }
        else{
            add(a,b,x,2*k+1,l,(l+r)/2);
            add(a,b,x,2*k+2,(l+r)/2,r);
            node[k]=min(node[2*k+1],node[2*k+2]);
        }
    }
    ll getmin(ll a,ll b,ll k=0,ll l=0,ll r=-1){
        if(r<0) r=n;
        if(b<=l || r<=a) return INF;
        eval(k,l,r);
        if(a<=l && r<=b) return node[k];
        ll vl=getmin(a,b,2*k+1,l,(l+r)/2);
        ll vr=getmin(a,b,2*k+2,(l+r)/2,r);
        return min(vl,vr);
    }
};

int main(){
    ll n;
    cin >> n;
    vector<ll> a(n,0);
    LazySegmentTree seg(a);
    ll q;
    cin >> q;
    while(q--){
        ll query;
        cin >> query;
        if(query==0){
            ll s,t,x;
            cin >> s >> t >> x;
            t++;
            seg.add(s,t,x);
        }
        if(query==1){
            ll s,t;
            cin >> s >> t;
            t++;
            cout << seg.getmin(s,t) << endl;
            
        }
    }
    return 0;
}


Measured memory_bytes: 8444
from sys import stdin
rs = stdin.readline
ri = lambda : int(rs())
ril = lambda : list(map(int, rs().split()))
from functools import reduce

def main():
    N, K = ril()
    A = ril()
    l = 1
    r = 1000000000
    while l < r:
        m = (l + r) // 2
        f = lambda i, j : i + (j - 1) // m
        k = reduce(f, A, 0)
        if k <= K:
            r = m
        else:
            l = m + 1
    print(r)

if __name__ == '__main__':
    main()


Measured memory_bytes: 31972
#include "bits/stdc++.h"
using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP0(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REP1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)

typedef long long LL;
typedef pair<int, int> pii;

const int INTINF = 1e9;
const LL LLINF = 1e18;

int c[3][3];

void solve()
{
    REP0(i, 3)
    {
        REP0(j, 3)
        {
            cin >> c[i][j];
        }
    }

    bool ok = true;

    ok = (ok and c[0][0] - c[1][0] == c[0][1] - c[1][1]);
    ok = (ok and c[0][1] - c[1][1] == c[0][2] - c[1][2]);

    ok = (ok and c[2][0] - c[1][0] == c[2][1] - c[1][1]);
    ok = (ok and c[2][1] - c[1][1] == c[2][2] - c[1][2]);

    cout << (ok ? "Yes" : "No") << endl;
}

int main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(10);
    solve();
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int n,a[10000],i,j,cnt;
	scanf("%d",&n);
	while(n!=0){
		for(i=0;i<n;i++){
			scanf("%d",&a[i]);
		}
		for(j=0;j<10;j++){
			for(i=0;i<n;i++){
				if(a[i]==j){
					printf("*");
					cnt++;
				}
			}
			if(cnt==0){
				printf("-");
			}
			printf("\n");
			cnt=0;
		}
		scanf("%d",&n);
	}
	return 0;
}

Measured memory_bytes: 612
#include<bits/stdc++.h>
#define rep(i, c) for (int i = 0; i < (int)c; i++)
using namespace std;
int main(){
  int N;
  cin >> N;
    if(N==1){
      cout << 1 << endl;
    }
    else if (N <= 3)
    {
      cout << 2 << endl;
    }
    else if (N <= 7)
    {
      cout << 4 << endl;
    }
    else if (N <= 15)
    {
      cout << 8 << endl;
    }
    else if (N <= 31)
    {
      cout << 16 << endl;
    }
    else if (N <= 63)
    {
      cout << 32<< endl;
    }
    else
    {
      cout << 64<< endl;
    }
}

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

using namespace std;
int main(){
  double A, B, H, M, X, Y;
  cin >> A >> B >> H >> M;
  Y = (M/360) * 11;
  Y = Y - H/6;
  X = A*A + B*B - 2*A*B*cos(M_PI*Y);
  X = pow(X, 0.5);

  cout << fixed << setprecision(10) << X <<endl;
}


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

using namespace std;

typedef long long ll;

const int __SIZE = 1 << 18;
char ibuf[__SIZE], *iS, *iT;

#define ge (iS == iT ? (iT = (iS = ibuf) + fread(ibuf, 1, __SIZE, stdin), (iS == iT ? EOF : *iS++)) : *iS++)
#define ri read_int()
#define rl read_ll()
#define FILE(s) freopen(s"in", "r", stdin), freopen(s"out", "w", stdout)

template<typename T>
inline void read(T &x) {
	char ch, t = 0; x = 0;
	while(!isdigit(ch = ge)) t |= ch == '-';
	while(isdigit(ch)) x = x * 10 + (ch ^ 48), ch = ge;
	x = t ? -x : x;
}
inline int read_int() { int x; return read(x), x; }
inline ll read_ll() { ll x; return read(x), x; }

template<typename T>
inline void chkmin(T&a, T b) { a = a < b ? a : b; }

const int MAXN = 110;

int a[MAXN];
int js[MAXN];

int main() {
#ifdef LOCAL
	FILE("");
#endif
	int cnt = 0;
	int n = ri;
	int m = ri;
	if(m == 1) {
		if(n == 1) {
			cout << 1 << endl;
			cout << 1 << endl;
			cout << 1 << endl;
		} else {
			cout << n << endl;
			cout << 2 << endl;
			cout << 1 << ' ' << n - 1 << endl;
		}
	}
	else {
		for(int i = 1; i <= m; i++) {
			a[i] = ri;
			if(a[i] & 1)
				js[cnt++] = i;
		}
		if(cnt > 2) puts("Impossible");
		else {
			if(js[0] && js[0] != 1) swap(a[1], a[js[0]]);
			if(js[1] && js[1] != m) swap(a[m], a[js[1]]);
			for(int i = 1; i <= m; i++) printf("%d ", a[i]); puts("");
			a[1]++, a[m]--;
			if(!a[m]) --m;
			printf("%d\n", m);
			for(int i = 1; i <= m; i++) printf("%d ", a[i]); puts("");
		}
	}
	return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
	Scanner sc = new Scanner(System.in);	
    while(sc.hasNext()){
    	int n=sc.nextInt();
    	for(int i=0;i<10;i++){
    		if(n%2==1){
    		    System.out.print((int)Math.pow(2, i));
    		    if(n!=1)System.out.print(" ");
    		}
    		if(n==1)break;
    		n/=2;
    }
    System.out.println();
    }
    }
}

Measured memory_bytes: 17224
import java.util.*;

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

    String S = sc.next();
    char[] c = new char[3];

    for(int i = 0 ; i < S.length() ; i ++){
      c[i] = S.charAt(i) ;
    }

    boolean result = (c[0] != c[1]) && (c[1] != c[2]) && (c[2] != c[0]);

    System.out.println(result ? "Yes" : "No" );
  }
}


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

using namespace std;

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

	int be, en;

	int key = (B - A) - 2 * K + 1;

	be = K;
	en = K + ((key<0)?key:0);
	for (int i = 0; i < be&&A + i<=B; i++) {
		cout << A + i << endl;
	}
	for (int i = en - 1; i >= 0&&B - i<=B; i--) {
		cout << B - i << endl;
	}
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int i,j,n,a[100],t,s,mini,p;
    while(scanf("%d",&n)!=EOF)
    {
        s=0;
        for(i=0;i<n;i++)
            scanf("%d",&a[i]);
        for(i=0;i<n;i++)
        {
            mini=i;p=0;
            for(j=i;j<n;j++)
                if(a[j]<a[mini])
                    {mini=j;p=1;}
            if(p==1)
            {t=a[i];a[i]=a[mini];a[mini]=t;s++;}
        }
        for(i=0;i<n-1;i++)
            printf("%d ",a[i]);
        printf("%d\n%d\n",a[n-1],s);
    }
    return 0;
}



Measured memory_bytes: 2092
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        
        Scanner in = new Scanner(System.in);
        int tap = in.nextInt();
        int hole = in.nextInt();
        int sumhole = 1;
        int count = 0;
        while(hole - sumhole > 0){
            sumhole += tap - 1;
            count++;
        }

        System.out.println(count);

    }
}


Measured memory_bytes: 23380
#include <cstring>
#include <map>
#include <unordered_map>
#include <string>
#include <list>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cstdio>
#include <iostream>
#include <set>
#include <unordered_set>
using namespace std;

#define MAX(a,b) (a>b?a:b)
#define MIN(a,b) (a<b?a:b)
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int, int> pii;

int gi() {
    int a;
    scanf("%d", &a);
    return a;
}

ll gli() {
    ll a;
    scanf("%lld", &a);
    return a;
}

#define N 100000

int l[N];
int r[N];
int v[N];

bool fnl(int p, int q) {
    return r[p] < r[q];
}

bool fnr(int p, int q) {
    return l[p] > l[q];
}

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

    int n = gi();
    list<int> sl, sr;
    for (int i = 0; i < n; i++) {
        l[i] = gi();
        r[i] = gi();
        sl.push_back(i);
        sr.push_back(i);
    }

    sl.sort(fnl);
    sr.sort(fnr);

    ll res = 0;

    for (int t = 0; t < 2; t++) {
        list<int>::iterator itl = sl.begin(), itr = sr.begin();
        int c;
        ll resa;
        memset(v, 0, sizeof(v));
        if (t) {
            c = r[*itl];
            if (c > 0)
                continue;
            resa = -c;
            v[*itl] = 1;
        } else {
            c = l[*itr];
            if (c < 0)
                continue;
            resa = c;
            v[*itr] = 1;
        }
        for (int i = 1; i < n; i++) {
            while (v[*itl])
                itl++;
            while (v[*itr])
                itr++;

            int d1 = c - r[*itl];
            int d2 = l[*itr] - c;

            if (d1 < 0 && d2 < 0) {
                v[*itl] = 1;
            } else if (d1 > d2) {
                v[*itl] = 1;
                resa += d1;
                c = r[*itl];
            } else {
                v[*itr] = 1;
                resa += d2;
                c = l[*itr];
            }
        }
        resa += (c < 0 ? -c : c);

        res = MAX(res, resa);
    }

    cout << res << endl;

    return 0;
}


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

int main()
{
	int m, f, r;

	do
	{
		cin >> m >> f >> r;

		if (m == -1 && f == -1 && r == -1)
		{
			break;
		}

		else if (m == -1 || f == -1)
		{
			cout << "F" <<endl;
		}

		else if (m + f >= 80)
		{
			cout << "A" << endl;
		}

		else if (80 > m + f && m + f >= 65)
		{
			cout << "B" << endl;
		}

		else if ((65 > m + f && m + f >= 50) || (r >= 50))
		{
			cout << "C" << endl;
		}

		else if (50 > m + f && m + f >= 30)
		{
			cout << "D" << endl;
		}

		else if (30 > m + f )
		{
			cout << "F" << endl;
		}

	} while (1);

	return 0;
}

Measured memory_bytes: 1152
#include<iostream>
#include<cstdlib>
using namespace std;
#define MAX 500000

struct Node{
  int key;
  Node *p, *r, *l;
};

int m;
Node *root, *NIL;

void inorder(Node* r){
  if ( r->l != NIL){
    inorder(r->l);
  }
  cout << " " << r->key;
  if ( r->r != NIL){
    inorder(r->r);
  }
}

void preorder(Node* r){
  cout << " " << r->key;
  if ( r->l != NIL){
    preorder(r->l);
  }
  if ( r->r != NIL){
    preorder(r->r);
  }
}

void print(){
  inorder(root);
  cout << endl;
  preorder(root);
  cout << endl;
}

void insert(int key){
  Node *y = NIL; // xの親
  Node *x = root;
  Node *z;

  z = (Node *)malloc(sizeof(Node));

  z->key = key;
  z->l = NIL;
  z->r = NIL;
  while( x != NIL){
    y = x;
    if ( z->key < x->key){
      x = x->l;
    } else {
      x = x->r;
    }
  }

  z->p = y;
  if ( y == NIL){
    root = z;
  } else if ( z->key < y->key){
    y->l = z;
  } else {
    y->r = z;
  }
}

bool find(int key){
  Node *x = root;
  while( x != NIL){
    if ( key == x->key){
      return 1;
    } else if ( key < x->key){
      x = x->l;
    } else {
      x = x->r;
    }
  }

  return 0;
}

int main(){
  cin >> m;
  string order;
  int key;
  for ( int i = 0; i < m; i++){
    cin >> order;
    if (order == "insert"){
      cin >> key;
      insert(key);
    } else if (order == "print") {
      print();
    } else if ( order == "find"){
      cin >> key;
      if(find(key)){cout << "yes" << endl;}
      else { cout << "no" << endl;}
    }
  }

  return 0;
}


Measured memory_bytes: 21900
A1 = list(map(int, input().split()))
A2 = list(map(int, input().split()))
A3 = list(map(int, input().split()))
N = int(input())

get_list1 = []
get_list2 = []
get_list3 = []
for n in range(N):
  _ = int(input())
  for idx,a1 in enumerate(A1):
    if a1 == _:
      get_list1.append(idx)

  for idx,a2 in enumerate(A2):
    if a2 == _:
      get_list2.append(idx)
      
  for idx,a3 in enumerate(A3):
    if a3 == _:
      get_list3.append(idx)
    

ans = 'No'
# OKなパターンを一つづつ
# 縦
if 0 in get_list1:
  if 0 in get_list2:
    if 0 in get_list3:
      ans = 'Yes'
if 1 in get_list1:
  if 1 in get_list2:
    if 1 in get_list3:
      ans = 'Yes'      
if 2 in get_list1:
  if 2 in get_list2:
    if 2 in get_list3:
      ans = 'Yes'      

# 横      
if len(get_list1) == 3:
  ans = 'Yes'
if len(get_list2) == 3:
  ans = 'Yes'
if len(get_list3) == 3:
  ans = 'Yes'

# 斜め
if 0 in get_list1:
  if 1 in get_list2:
    if 2 in get_list3:
      ans = 'Yes'
if 2 in get_list1:
  if 1 in get_list2:
    if 0 in get_list3:
      ans = 'Yes'
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
using namespace std;
const long INF = 1e9;
int main(){
    long n;
    cin >> n;
    long x[n];
    rep(i,n) cin >> x[i];
    long ans = INF;
    rep(i,101){
        long tmp = 0;
        rep(j,n){
            tmp+=pow(x[j]-i,2);
        }
        ans = min(ans,tmp);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<string>
#include<set>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
typedef long long ll;

int main(){//A
/*
    int l,r,d;
    cin>>l>>r>>d;
    int c=0;
    rep(i,l,r+1){
        if(i%d==0) c++;
    }
    cout<<c<<endl;
    */
   //B
    int n;
    cin>>n;
    int c=0;
    vector<int> a(n);
    rep(i,0,n){
        cin>>a[i];
        if(i%2==0&&a[i]%2!=0) c++;
    }
    cout<<c<<endl;
}


Measured memory_bytes: 3624
#include <cstdio>

int a, b, c, k;

int main()
{
	scanf("%d%d%d%d", &a, &b, &c, &k);
	while(b <= a) b *= 2, --k;
	while(c <= b) c *= 2, --k;
	if(k >= 0) printf("Yes\n");
	else printf("No\n");
	return 0;
}

Measured memory_bytes: 1632
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <cstring>
#include <numeric>
#include <algorithm>
#include <functional>
#include <array>
#include <map>
#include <queue>
#include <time.h>
#include <limits.h>
#include <set>
#include <stack>
#include <random>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#define rep(i,s,n) for(int i = (s); (n) > i; i++)
#define REP(i,n) rep(i,0,n)
#define RANGE(x,a,b) (min(a,b) <= (x) && (x) <= max(a,b)) //hei
#define DUPLE(a,b,c,d) (RANGE(a,c,d) || RANGE(b,c,d) || RANGE(c,a,b) || RANGE(d,a,b))
#define INCLU(a,b,c,d) (RANGE(a,c,d) && (b,c,d))
#define PW(x) ((x)*(x))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define MODU 1000000007LL
#define bitcheck(a,b)   ((a >> b) & 1)
#define bitset(a,b)      ( a |= (1 << b))
#define bitunset(a,b)    (a &= ~(1 << b))
#define MP(a,b) make_pair((a),(b))
#define Manh(a,b) (abs((a).first-(b).first) + abs((a).second - ((b).second))
#define pritnf printf
#define scnaf scanf
#define itn int
#define PI 3.141592653589


#define izryt bool
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T & val) {
	std::fill((T*)array, (T*)(array + N), val);
}
pll Dir[4] = {
	{ -1 ,0 },{ 0 , 1 },{ 1 ,0 },{ 0 ,-1 }
};

//[a, b)
#define Getsum(ar, a,b) (ar[b] - ar[a])
#define INF 10000000000000000LL
#define chmax(a,b) a = max(a,b)
#define chmin(a,b) a = min(a,b)

struct Edge {
	int from, to;
	ll w;
	bool operator<(const Edge& rhs) const {
		return MP(w, MP(from, to)) < MP(rhs.w, MP(rhs.from, rhs.to));
	}

};
signed main(void) {

	int n;
	cin >> n;
	vector<int> d(n);
	REP(i, n) {
		cin >> d[i];
	}
	sort(ALL(d));
	int cou = 0;
	REP(k, 100002) {
		int ind = lower_bound(ALL(d), k) - d.begin();

		if (ind == n - ind) {
			cou++;
		}

	}
	cout << cou << endl;
	return 0;
}


Measured memory_bytes: 640
//In the name of ALLAH
#include <bits/stdc++.h>
#define pb push_back
#define X first
#define Y second
const bool DEBUG = false;
#define cerr if(DEBUG)cerr
using namespace std;

typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;

const long long maxn = 3e5 + 5;
const long long INF = 1e18 + 1;
const long long M = 998244353;
const int lg = 21;

ll n, a, b, k, ans, f[maxn], rf[maxn];

ll POW(ll a, ll b){
	if(b == 0)
		return 1;
	ll p = POW(a, b >> 1);
	p = p * p % M;
	if(b & 1)
		p = p * a % M;
	return p;	
}

ll C(ll n, ll k){
	if(k == 0 or k == n) return 1;
	return f[n] * rf[k] % M * rf[n - k] % M;
}

int main(){
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	cin >> n >> a >> b >> k;
	f[0] = rf[0] = 1;
	for(int i = 1; i < maxn; i++)
		f[i] = f[i - 1] * i % M, rf[i] = rf[i - 1] * POW(i, M - 2) % M;
	for(int i = 0; i <= n; i++){
		ll x = i * a;
		if(x <= k and (k - x) % b == 0 and (k - x) / b <= n){
			ll t = (k - x) / b;
			ans = (ans + C(n, i) * C(n, t)) % M;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4992
package main

import (
	"fmt"
)

func main() {
	var N, M int
	fmt.Scan(&N, &M)

	var DupList []int

	for i := 0; i < N; i++ {

		var K int
		fmt.Scan(&K)
		numList := make([]int, K)
		for i := 0; i < K; i++ {
			fmt.Scan(&numList[i])
		}
		if i == 0 {
			DupList = numList
		}
		DupList = DuplicatedList(DupList, numList)
	}

	fmt.Println(len(DupList))
	return
}

func DuplicatedList(a []int, b []int) []int {
	var resultList []int
	for _, n := range a {
		if Contains(b, n) {
			resultList = append(resultList, n)
		}
	}
	return resultList
}

func Contains(a []int, x int) bool {
	for _, n := range a {
		if x == n {
			return true
		}
	}
	return false
}


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

int n;
vector<pair<int,string>> ve;
string s;
map<string,int> ma;
vector<string> sa;
int x;
int main(){
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> s;
		ma[s]++;
	}
	int maxi = 0;
	for(auto u : ma){
		maxi = max(maxi,u.second);
	}
	for(auto u : ma){
		if(u.second == maxi) sa.push_back(u.first);
	}
	sort(sa.begin(), sa.end());
	for(auto u : sa) cout << u << " ";

}


Measured memory_bytes: 26868
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef  unsigned long long int ull;
typedef pair<ll,ll> P;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
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; }
struct geo{
   double x,y;
   //0で初期化
   geo(double x=0.0,double y=0.0):x(x),y(y) {}
   geo& operator+=(const geo& v){ x+=v.x; y+=v.y;return *this; }
   geo operator+(const geo& v) const{return geo(*this)+=v;}
   geo& operator-=(const geo& v) { x -= v.x; y -= v.y; return *this;}
   geo operator-(const geo& v) const { return geo(*this) -= v;}
   geo& operator*=(double s) { x *= s; y *= s; return *this;}
   geo operator*(double s) const { return geo(*this) *= s;}
   geo& operator/=(double s) { x /= s; y /= s; return *this;}
   geo operator/(double s) const { return geo(*this) /= s;}
   //内積
   double dot(const geo& v) const{return x*v.x+y*v.y;}
   //外積
   double cross(const geo& v)const{return x*v.y-v.x*y;}
   //長さの２乗
   double norm2() const{return x*x+y*y;}
   //長さ
   double norm()const{return sqrt(norm2());}
   //象限(orthant)
   int ort() const{
     if(y>0)return x>0?1:2;
     else   return x>0?4:3;
   }
   //偏角ソートのための比較関数
   bool operator<(const geo& v) const{//反時計回りを正
       int o=ort(),vo=v.ort();
       if(o!=vo)return o<vo;
       else return cross(v)>0;
       }
	friend istream& operator>>(istream& is,geo& v){//cinで読み込める
    	is>>v.x>>v.y;  return is;
	}
	friend ostream& operator<<(ostream& os,const geo& v){//出力
   		os<<"("<<v.x<<","<<v.y<<")";return os;
	}
};
int main(){
	int n;
	cin>>n;
	V<geo> v(n);
	for(int i=0;i<n;i++)cin>>v[i];
	sort(all(v));
	double ans=0.0;
	for(int i=0;i<n;i++){
		int r=i;
		geo now;
		for(int j=0;j<n;j++){
			now+=v[r];
			chmax(ans,now.norm());
			r++;
			r%=n;
		}
	}
	cout<<ans<<endl;
}



Measured memory_bytes: 256
//Author ::  ABHINAV3010 ::

#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define fast ios_base::sync_with_stdio(false)
typedef long long ll;
typedef pair<ll,ll> p;
ll mod=1000000007;
ll gcd(ll a,ll b)
{
    return (b==0)?a:gcd(b,a%b);
}
ll power(ll x, ll y, ll p=mod)
{ll res = 1;x = x % p;while (y > 0){if (y & 1){res = (res*x) % p;}y = y>>1;x = (x*x) % p;}return res;}
int main()
{
fast;
ll a,b;
cin>>a>>b;
if((a>=1&&a<=9)&&(b>=1&&b<=9))
{
    cout<<a*b<<endl;
}else
{
    cout<<-1<<endl;
}
return 0;
}

Measured memory_bytes: 256
import math
N,D = map(int,input().split())
k = []
ans_2 = 0
ans_1 = 0
now = 0
for i in range(N):
    k.append(list(map(int,input().split())))
for i in range(0,N):
    for j in range(i+1,N):
        for _ in range(D):
            now += (k[i][_]-k[j][_])**2
        ans_1 = math.sqrt(now)
        if ans_1%1 == 0:
            ans_2 += 1
        now = 0
        ans_1 = 0
print(ans_2)

Measured memory_bytes: 3064
#include <stdio.h>

int main()
{
	int a[10];
	int b, c, tmp;
	for(b=0;b<10;b++) {
		scanf("%d", &a[b]);
	}
	for(b=0;b<=9;b++) {
		for(c=9;c>b;c--) {
			if(a[c]>a[c-1]) {
				tmp = a[c];
				a[c] = a[c-1];
				a[c-1] = tmp;
			}
		}
	}
	for(b=0;b<3;b++) {
		printf("%d\n", a[b]);
	}
	return (0);
}


Measured memory_bytes: 2044
#include <stdio.h>
int main(void){
    // Your code here!
  int i,j,v,N,k;
  scanf( "%d" , &N );
  int A[N];

    for( i = 0 ; i < N ; i++ ){
        scanf( "%d" , &A[i] );
      if( i != 0 ){ printf( " " ); }
      printf( "%d" , A[i] );
    }
    printf( "\n" );

  for( i = 1; i <= N-1 ; i++ ){
    v = A[i];
    j = i - 1;
    while( j >= 0 && A[j] > v ){
      A[j+1] = A[j];
      j--;
    }
    A[j+1] = v;

    for( k = 0 ; k < N ; k++ ){
      if( k != 0 ){ printf( " " ); }
      printf( "%d" , A[k] );
    }
    printf( "\n" );
  }
}


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

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

    long H_max = 0;
    long cnt = 0;
    for (long i = 0; i < n; i++) {
        if (H[i] >= H_max) {
            cnt++;
            H_max = H[i];
        }
    }

    cout << cnt << endl;

    return 0;
}


Measured memory_bytes: 256
/*
 * Author: ylx
 * Lang: c++
 * Prog: a
 */
#include<bits/stdc++.h>
#define ll long long
using namespace std;
void qmax(int &x,int y) {if (x<y) x=y;}
void qmin(int &x,int y) {if (x>y) x=y;}
inline int read()
{
	char s;
	int k=0,base=1;
	while ((s=getchar())!='-'&&s!=EOF&&!(isdigit(s)));
	if (s==EOF) exit(0);
	if (s=='-') base=-1,s=getchar();
	while (isdigit(s)) k=k*10+(s^'0'),s=getchar();
	return k*base;
}
inline void write(ll x)
{
	static char cnt,num[20];cnt=0;
	if (!x)
	{
		putchar('0');
		return;
	}
	for (;x;x/=10) num[++cnt]=x%10;
	for (;cnt;putchar(num[cnt--]+48));
}
int n;
int a[10];
int main()
{
#ifdef ylx
	freopen("a.in","r",stdin);
	freopen("a.out","w",stdout);
#endif
	n=4;
	for (int i=1;i<=n;i++) a[i]=read();
	sort(a+1,a+n+1);
	if (a[1]==1&&a[2]==4&&a[3]==7&&a[4]==9)
	{
		printf("YES");
	} else
	{
		printf("NO");
	}
	return 0;
}
//2019年 01月 24日 星期四 16:37:00 CST


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

int card[255][14]={{0}};

int main(void){
    int n;
    cin >> n;
    for(int i=0; i<n;i++){
        char c; /*0~255*/
        int num;
        cin >> c >> num;
        card[(int)c][num]=1; //発見
    }
    // Sを探す
   for(int i=1; i<=13;i++){
        if(card[(int)'S'][i]==0){
            cout << "S" <<" "<< i << endl;
        }
    }
    //Hを探す
    for(int i=1; i<=13;i++){
        if(card[(int)'H'][i]==0){
            cout << "H" <<" "<< i << endl;
        }
    }
    //Cを探す
    for(int i=1; i<=13;i++){
        if(card[(int)'C'][i]==0){
            cout << "C" <<" "<< i << endl;
        }
    }
    //Dを探す
    for(int i=1; i<=13;i++){
        if(card[(int)'D'][i]==0){
            cout << "D" <<" "<< i << endl;
        }
    }
}



Measured memory_bytes: 3080
#include<stdio.h>
#include<iostream>
#include<stdlib.h>
#include<utility>
#include<string.h>
#include<queue>
#include<stack>
using namespace std;

typedef long long ll; 
#define REP(i,n) for(int i=0;i<(int)(n);i++)

int main(void)
{
    int n;
    scanf("%d\n",&n);
    int a[105]={};
    REP(i,n)scanf("%d ",&a[i]);
    a[n]=0;
    int point=0;
    int count=0;
    int now=a[0];
    int keep[105]={};
    int kpo=0;
    while(point<=n)
    {
        if(now==a[point])count++;
        else
        {
            now=a[point];
            keep[kpo]=count;
            kpo++;
            count=1;
        }
        point++;
    }
    int ans=0;
    REP(i,kpo)
    {
        ans+=keep[i]/2;
    }
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        while (true) {
            int a = Integer.parseInt(sc.next());
            int b = Integer.parseInt(sc.next());
            int c = Integer.parseInt(sc.next());
            
            if (a == -1 && b == -1 && c == -1) {
                return;
            }
            
            if (a == -1 || b == -1) {
                System.out.println("F");
            } else if (a + b >= 80) {
                System.out.println("A");
            } else if (a + b < 80 && a + b >= 65) {
                System.out.println("B");
            } else if (a + b < 65 && a + b >= 50) {
                System.out.println("C");
            } else if (a + b < 50 && a + b >= 30) {
                if (c >= 50) {
                    System.out.println("C");
                } else {
                    System.out.println("D");
                }
            } else {
                System.out.println("F");
            }
        }
    }
}



Measured memory_bytes: 26340
n = int(input())%10
if n==0:
    print("pon")
if n==1:
    print("pon")
if n==2:
    print("hon")
if n==3:
    print("bon")
if n==4:
    print("hon")
if n==5:
    print("hon")
if n==6:
    print("pon")
if n==7:
    print("hon")
if n==8:
    print("pon")
if n==9:
    print("hon")

Measured memory_bytes: 9176
#define _DEBUG 1
#define _GLIBCXX_DEBUG

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

using ll = long long;

#ifdef _DEBUG
#define dump(x) cerr << #x << "=" << x << endl
#define dump2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define dump3(x, y, z)                                                     \
  cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z \
       << endl
#define check(s) cerr << s << endl
#else
#define dump(x)
#define dump2(x, y)
#define dump3(x, y, z)
#define check(s)
#endif

#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define unique(v) v.erase(unique(v.begin(), v.end()), v.end());

const ll LINF = 2e18;
const int INF = 1e9;

void solve(ll N) {
  ll a = N * 100 / 108;
  ll b = a + 1;

  if (floor(a * 1.08) == N) {
    cout << a << endl;
  } else if (floor(b * 1.08) == N) {
    cout << b << endl;
  } else {
    cout << ":(" << endl;
  }
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  ll N;
  scanf("%lld", &N);
  solve(N);
  return 0;
}


Measured memory_bytes: 256
// Contest: AtCoder Beginner Contest 179 (https://atcoder.jp/contests/abc179)
// Problem: B: Go to Jail (https://atcoder.jp/contests/abc179/tasks/abc179_b)


// region boilerplate
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <chrono>
#include <cstdint>
#include <deque>
#include <exception>
#include <forward_list>
#include <functional>
#include <initializer_list>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#if __cplusplus >= 201703L
#   include <optional>
#   include <string_view>
#   include <variant>
#endif

using namespace std;

#if __cplusplus >= 201703L
#   define all(a)      begin(a),end(a)
#   define sz(x)       ((int)size(x))
#else
#   define all(a)      (a).begin(),(a).end()
#   define sz(x)       ((int)(x).size())
#endif

#define rep(a, b)      for(int a = 0; a < (b); ++a)
#define reps(a, b, c)  for(int a = (b); a < (c); ++a)
#define trav(a, b)     for(auto& a : b)

using ll = long long;
using ld = long double;
using u64 = uint64_t;
using u32 = uint32_t;

using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vpi = vector<pi>;

#if __cplusplus >= 201703L
#   define MAYBE_UNUSED [[maybe_unused]]
#else
#   define MAYBE_UNUSED
#endif

MAYBE_UNUSED static constexpr int INF = (int)1e9 + 5;
MAYBE_UNUSED static constexpr ll INFL = (ll)1e18 + 5;
MAYBE_UNUSED static mt19937 rng((u32)chrono::duration_cast<chrono::nanoseconds>(chrono::high_resolution_clock::now().time_since_epoch()).count());
//endregion

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

    int n; cin >> n;
    vector<bool> d(n);
    rep(i, n) {
        int a, b; cin >> a >> b;
        d[i] = a == b;
    }

    bool trip = false;
    rep(i, n - 2)
        trip |= d[i] && d[i+1] && d[i+2];

    cout << (trip ? "Yes\n" : "No\n");
    return 0;
}


Measured memory_bytes: 3652
<?php 
fscanf(STDIN, '%d', $a);
fscanf(STDIN,'%s %s',$b,$c);
$b2 = str_split($b);
$c2 = str_split($c);
for($i = 0; $i <= $a; $i++) {
  echo $b2[$i].$c[$i];
}
?>

Measured memory_bytes: 4604
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

//// < "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\a.txt" > "d:\d_download\visual studio 2015\projects\programing_contest_c++\debug\b.txt"


int main() {
	int ans = 0;
	string st;
	while (cin >> st) {
		string rev;
		reverse(st.begin(), st.end());
		rev = st;
		reverse(st.begin(), st.end());
		ans += st == rev;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3168
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

using u128 = __uint128_t;

#define int unsigned long long
#define idxSet tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
#define atIdx find_by_order
#define idxOf order_of_key
#define MOD 1000000007
#define MAX 200005
#define endl '\n'

#define v(type) vector<type>
#define p(type1, type2) pair<type1 , type2>
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

int dp[MAX];

void solve() {
    int n;
    cin>>n;
    if(n == 0 || n == 1){
        cout<<0<<endl;
        return;
    }
    if(n % 2 == 0){
        n /= 2;
        int sum = 0;
        for(int i = 5 ; i <= n ; i *= 5 ){
            sum += n / i;
        }
        cout<<sum<<endl;
    }else {
        cout<<0<<endl;
    }
}

int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int t = 1;
    //cin>>t;
    while (t--)
        solve();
    return 0;
}

Measured memory_bytes: 256
// {{{
#include <iostream>
#include <iomanip>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <complex>
#include <vector>
#include <list>
#include <set>
#include <unordered_set>
#include <queue>
#include <stack>
#include <map>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <numeric>
using namespace std;

#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define FOR(i, a, b) for(ll i = static_cast<ll>(a); i < static_cast<ll>(b); i++)
#define FORR(i, a, b) for(ll i = static_cast<ll>(a); i >= static_cast<ll>(b); i--)
#define REP(i, n) for(ll i = 0ll; i < static_cast<ll>(n); i++)
#define REPR(i, n) for(ll i = static_cast<ll>(n); i >= 0ll; i--)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> IP;
typedef pair<ll, LP> LLP;

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

constexpr int INF = 100000000;
constexpr ll LINF = 10000000000000000ll;
constexpr int MOD = static_cast<int>(1e9 + 7);
constexpr double EPS = 1e-9;

static inline ll mod(ll x, ll m)
{
    ll y = x % m;
    return (y >= 0 ? y : y+m);
}

// }}}

int N;
vector<int> p, q;

void solve()
{
    int pt, qt;
    int t = 0;
    vector<int> x;
    REP (i, N) x.pb(i+1);
    do {
        bool psame = true, qsame = true;
        REP (i, N) {
            if (x[i] != p[i]) psame = false;
            if (x[i] != q[i]) qsame = false;
        }
        if (psame) {
            pt = t;
        }
        if (qsame) {
            qt = t;
        }
        t++;
    } while (next_permutation(ALL(x)));
    cout << abs(pt-qt) << endl;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N;
    p.resize(N);
    q.resize(N);
    REP (i, N) cin >> p[i];
    REP (i, N) cin >> q[i];
    solve();
    return 0;
}

// vim:set foldmethod=marker:


Measured memory_bytes: 256
"""
~~ Author : Bhaskar
~~ Dated : 10~06~2020
"""

import sys
from bisect import *
from math import floor,sqrt,ceil,factorial as F,gcd,pi
from itertools import chain,combinations,permutations,accumulate
from collections import Counter,defaultdict,OrderedDict,deque
from array import array
INT_MAX = sys.maxsize
INT_MIN = -(sys.maxsize)-1
mod = 1000000007
ch = "abcdefghijklmnopqrstuvwxyz"
lcm = lambda a,b : (a*b)//gcd(a,b)
setbit = lambda x : bin(x)[2:].count("1")
input = lambda : sys.stdin.readline()

def solve():
    n = int(sys.stdin.readline())
    # print((n-1)%26)
    ans = ""
    while n:
        ans += ch[((n-1) % 26)]
        n = n - 1
        n //= 26
    print(ans[::-1])


if __name__ == "__main__":
    try:
        sys.stdin = open('input.txt','r')
        sys.stdout = open('output.txt','w')
    except:
       pass
    solve()



Measured memory_bytes: 9444
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;

namespace AtCoder
{
    static class Program
    {
        static void Main()
        {
            //ここから

            var M = IO.ReadLineToIntList()[1];

            var min = int.MinValue;
            var max = int.MaxValue;

            for(var i = 0; i < M; i++)
            {
                var vs = IO.ReadLineToIntList();
                min = Math.Max(min, vs[0]);
                max = Math.Min(max, vs[1]);
            }
            var ans = Math.Max(max - min + 1,0);



            //ここまで
            Console.WriteLine(ans);
            Console.ReadKey();
        }
    }

    static class Func
    {
        static long mod = 1000000007;
        static public void Swap<T>(ref T a, ref T b) { T temp = a; a = b; b = temp; }
        static public long GCD(long a, long b) { return b != 0 ? GCD(b, a % b) : a; }
        static public long LCM(long a, long b) { return (long)a * b / GCD(a, b); }
        static public int Factorial(int a) { return a == 1 ? a : a * Factorial(a - 1); }


        public static double ToAngle(this double radian)
        {
            return (double)(radian * 180 / Math.PI);
        }

        public static double ToRadian(this double angle)
        {
            return (double)(angle * Math.PI / 180);
        }

        static public long Conbination(int n,int m)
        {
            if (m == 0) return 1;
            if (n == 0) return 0;
            return n * Conbination(n - 1, m - 1) / m;
        }

        static public void Factoring(long num, ref long[] vs)
        {
            if (num == 1)
            {
                vs[1]++;
            }
            for (long i = 2; i < Math.Sqrt(num); i++)
            {
                if (num % i == 0)
                {
                    vs[i]++;
                    Factoring(num / i, ref vs);
                }
            }
            vs[1]++;
        }
    }

    static class IO
    {
        static public string ReadLineToString() { return Console.ReadLine(); }
        static public int ReadLineToInt() { return int.Parse(Console.ReadLine()); }
        static public long ReadLineToLong() { return long.Parse(Console.ReadLine()); }
        static public List<string> ReadLineToStringList() { return Console.ReadLine().Split(' ').ToList(); }
        static public List<int> ReadLineToIntList() { return Console.ReadLine().Split(' ').Select(int.Parse).ToList(); }
        static public List<long> ReadLineToLongList() { return Console.ReadLine().Split(' ').Select(long.Parse).ToList(); }

        static public List<double> ReadLineToDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }

        static public void WriteStrings(object[] strings) { foreach (var o in strings) { Console.Write(o + " "); } }
    }
}

Measured memory_bytes: 17360
#include<bits/stdc++.h>
using namespace std;
int n,q;
vector<int> z[200005];
int cnt[200005];
int ans[200005];
void dfs(int a,int b,int c)
{
	c+=cnt[a];
	ans[a]=c;
	for (int i=0;i<z[a].size();i++)
	{
		int v=z[a][i];
		if(v!=b)
		{
			dfs(v,a,c);			
		}
	}
}
int main()
{
	cin>>n>>q;
	for(int i=1;i<n;i++)
	{
		int x,y;
		cin>>x>>y;
		z[x].push_back(y);
		z[y].push_back(x);
	}
	for(int i=1;i<=q;i++)
	{
		int x,y;
		cin>>x>>y;
		cnt[x]+=y;
	}
	dfs(1,0,0);
	for(int i=1;i<=n;i++)
	{
		cout<<ans[i]<<" ";		
	}
	cout<<endl;
	return 0;
}


Measured memory_bytes: 27136
'use strict'

const main = (INPUT) => {
  const input = INPUT.split('\n')
  const H = input[0].split(' ')[0]
  let W = input[0].split(' ')[1]
  const a = input.slice(1)
  let ans = []
  for (let i = 0; i < H; i++) {
    if (a[i].indexOf('#') != -1) {
      ans.push(a[i])
    }
  }

  for (let i = 0; i < W; i++) {
    let cnt = 0
    for (let j = 0; j < ans.length; j++) {
      if (ans[j][i] == '#') {
        cnt++
      }
    }

    if (cnt == 0) {
      for (let j = 0; j < ans.length; j++) {
        let tmp = ans[j].split('')
        tmp.splice(i, 1)
        ans[j] = tmp.join('')
      }
      i--
      W--
    }
  }
  for (let i = 0; i < ans.length; i++) {
    console.log(ans[i])
  }
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


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

int main(void) {
	long long N; cin >> N;
	vector<long long> A(N);
	vector<long long> sum(N);
	for (int i = 0; i < N - 1; i++) {
		cin >> A[i]; A[i]--;
		sum[A[i]]++;
	}

	for (int i = 0; i < N - 1; i++) {
		cout << sum[i] << endl;
	}
	cout << 0 << endl;

	return 0;
}

Measured memory_bytes: 6404