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

int main() {
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = 0; i<n; i++) {
    cin >> A.at(i);
  }
  int64_t sum = 0;
  for (int i = 1; i<n; i++) {
    int s = A.at(i-1) - A.at(i);
    if (A.at(i) < A.at(i-1)) {
      A.at(i) += s;
      sum += s;
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 4044
#0:上面　1:S 2:E 3:W 4:N 5:下
class Dice:
    def __init__(self):#クラス内で用いる変数の定義（クラス作成時に代入しなくてよい）
        self.number = [i for i in range(6)]
        self.work = [i for i in range(6)]
        self.order = 'NNNNWNNNWNNNENNNENNNWNNN'
    #サイコロの目の数を設定
    def setNumber(self, n0, n1, n2, n3, n4, n5):
        self.number[0] = n0
        self.number[1] = n1
        self.number[2] = n2
        self.number[3] = n3
        self.number[4] = n4
        self.number[5] = n5
        
    #サイコロを転がせ，それぞれのいちを追跡
    def roll(self, loc):#loc:
    #初期位置
        for i in range(6):
            self.work[i] = self.number[i]
        if loc == 'E':
            self.setNumber(self.work[3],self.work[1],self.work[0],self.work[5],self.work[4],self.work[2])
        elif loc == 'N':
            self.setNumber(self.work[1],self.work[5],self.work[2],self.work[3],self.work[0],self.work[4])
        elif loc == 'S':
            self.setNumber(self.work[4],self.work[0],self.work[2],self.work[3],self.work[5],self.work[1])
        else:
            self.setNumber(self.work[2],self.work[1],self.work[5],self.work[0],self.work[4],self.work[3])
    
    def equals(self, another):
        ret = False;
        
        for i in range(len(self.order)):
            self.roll(self.order[i])
            flag = True
            for k in range(6):
                if self.number[k] != another.number[k]:
                    flag = False
                    break
            if flag == True:
                return True
        
        return ret
          

dice1 = Dice()
dice2 = Dice()
table = list(map(int, input().split()))
dice1.setNumber(table[0],table[1],table[2],table[3],table[4],table[5])#init

table2 = list(map(int, input().split()))
dice2.setNumber(table2[0],table2[1],table2[2],table2[3],table2[4],table2[5])#init
# loc_array=str(input())

# order = 'NNNNWNNNWNNNENNNENNNWNNN'
# for tmp_order in order:
#     dice1.roll(tmp_order)
#     if dice1.number[0]==dice2.number[0] and dice1.number[1]==dice2.number[1]:
#         print('Yes')
#         break
#     print('No')

if dice1.equals(dice2):
    print("Yes")
else:
    print("No")
        
        


Measured memory_bytes: 5624
while True:
    n, x = map(int, input().split())
    if n == x == 0:
        break
  
    result = 0
    for a in range(1, x // 3):
        for b in range(a + 1,  x // 2):
            c = x - a - b
            if b < c <= n:
                result += 1    
    print(result)

Measured memory_bytes: 7692
#include <iostream>
#include <vector>
#include <cstring>
#include <string>
#include <algorithm>
#include <iomanip>
using namespace std;

int dx[2] = { 1, 0 }, dy[2] = { 0, 1 };
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int H, W;
	while(cin >> W >> H, H) {
		bool ng[17][17] = { 0 };
		int n;
		cin >> n;
		while(n--) {
			int x, y;
			cin >> x >> y;
			ng[y][x] = true;
		}

		int dp[17][17] = { 0 };
		dp[1][1] = 1;
		for(int y = 1; y <= H; y++) {
			for(int x = 1; x <= W; x++) {
				for(int k = 0; k < 2; k++) {
					int nx = x + dx[k], ny = y + dy[k];
					if(1 <= nx && nx <= W && 1 <= ny && ny <= H && !ng[ny][nx]) {
						dp[ny][nx] += dp[y][x];
					}
				}
			}
		}

		cout << dp[H][W] << endl;
	}
}

Measured memory_bytes: 1192
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;

LL f(LL n)
{
	if (n % 2 == 0) return n / 2;
	else return 3 * n + 1;
}

int main()
{
	LL s;
	in >> s;

	std::set<LL>a;
	LL num = s, n = 2;
	a.insert(s);
	while (true)
	{
		num = f(num);
		auto it = a.find(num);
		if (it != a.end())
		{
			out << n << std::endl;
			return 0;
		}
		a.insert(num);
		++n;
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
void YesNo(bool);
void YESNO(bool);


int main(){
    int year;
    cin >> year;
    if (year == 1) {
        cout << "Hello World" << endl;
    }else if(year == 2){
        int a, b;
        cin >> a >> b;
        cout << a + b << endl;
    }
    
}


void YesNo(bool x){
    if (x) {
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    
}

void YESNO(bool x){
    if (x) {
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
    
}


Measured memory_bytes: 256
n = int(input())
T = tuple(map(int,input().split()))
m = int(input())
drinks = [list(map(int,input().split())) for _ in range(m)]
ans_list = []
# python はmutable objectは参照渡しにimutable object(tuple等)は値渡しになる
def swap(p,x):
  temp = list(T)
  temp[p - 1] = x
  return temp
for i in range(m):
  p,x = drinks[i][0],drinks[i][1]
  new = swap(p,x)
  ans_list.append(sum(new))
for ans in ans_list:
  print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <stack>
#include <set>
#include <queue>
#include <algorithm>
#include <deque>
#include <map>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <chrono>
using namespace std;

#define INF 1e18
#define int long long

signed main() {
    int n;
    cin >> n;
    vector<int> d(n);
    for(int i = 0; i < n; i++) cin >> d[i];
    int m;
    cin >> m;
    vector<int> t(m);
    for(int i = 0; i < m; i++) cin >> t[i];

    sort(d.begin(), d.end());
    sort(t.begin(), t.end());

    int k = 0;
    for(int i = 0; i < m; i++) {
        for(int j = k; j < n; j++) {
            if(t[i] == d[j]) {
                k = j + 1;
                break;
            }
            if(j == n - 1) {
                cout << "NO" << endl;
                return 0;
            }
        }
    }

    cout << "YES" << endl;
    return 0;
}


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

#define PI acos(-1)
#define INF64 1LL << 60
#define INF32 1 << 29
#define all(a) (a).begin(), (a).end()
#define INV ((long long int)1000000007)

using namespace std;

void execute()
{
	string A, B, C;
	cin >> A >> B >> C;
	int turn = 0;
	for (;;)
	{
		string current;
		int front;
		if (turn == 0)
			current = A;
		else if (turn == 1)
			current = B;
		else
			current = C;

		if (current.size() == 0)
		{
			break;
		}

		if (current.front() == 'a')
			front = 0;
		if (current.front() == 'b')
			front = 1;
		if (current.front() == 'c')
			front = 2;
		//cout << current.substr(1, current.size() - 1) << endl;
		current = current.substr(1, current.size() - 1);

		if (turn == 0)
			A = current;
		else if (turn == 1)
			B = current;
		else
			C = current;
		turn = front;
	}

	if (turn == 0)
		cout << "A" << endl;
	else if (turn == 1)
		cout << "B" << endl;
	else
		cout << "C" << endl;

	return;
}

int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	execute();

	int stop;
	cin >> stop;

	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
#define int long long
#define _CRT_SECURE_NO_WARNINGS
#define rep(i, n) for (int i = 0; i < n; i++)
#define _GLIBCXX_DEBUG
const int MOD = 1e9 + 7;
const int INF = 1e18 + 9;
constexpr long double pi = 3.141592653589793238462643383279; //円周率
/*---------------------便利な関数--------------------------------------*/
int fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}

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

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

int keta(int n) {        //桁数を求める
    if (n == 0) return 1;
    int count = 0;
    while (n != 0) {
        n /= 10;
        count++;
    }
    return count;
}

int ketasum(int n) {    //各桁の和
    int sum = 0;
    while (n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/*-------------ここまで---------------------------------------------*/

//C++(GCC9.2.1)

signed main() {
    //宣言
    int n, k;
    cin >> n >> k;
    int sum = 0;
    while (n > 0) {
        n /= k;
        ++sum;
    }
    cout << sum << endl;
    return 0;
}

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

int64_t intpow(int64_t n, int64_t k, int64_t INF=int64_t(1e18)){
    if(n == 0) return 0;
    int64_t ret = 1;
    while(k--){
        if(ret > INF/n) return INF;
        ret *= n;
    }
    return ret;
}

int64_t introot(int64_t n, int64_t k=2){
    if(n == 0) return 0;
    int64_t ret = pow((long double)n, 1.0L/k);
    while(intpow(ret, k, n+1) > n) ret--;
    while(intpow(ret+1, k, n+1) <= n) ret++;
    return ret;
}

int main(){
    int X;
    cin >> X;
    for(int a=1; a<=100000; a++){
        int64_t b5 = intpow(a, 5) - X;
        if(b5 >= 0){
            int b = introot(b5, 5);
            if(intpow(b, 5) == b5){
                cout << a << " " << b << endl;
                return 0;
            }
        }else{
            int b = -introot(-b5, 5);
            if(intpow(-b, 5) == -b5){
                cout << a << " " << b << endl;
                return 0;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 3700
#include<iostream>
using namespace std;
#include<cstdio>
#include<vector>
#include<utility>
#include<queue>

typedef vector<pair<int, int> > adj;

struct current_cost
{
    int index, cost;
    bool operator < (const current_cost &cur) const
    {
        return cost > cur.cost;
    }
};

current_cost init(int i, int c)
{
    current_cost cur;
    cur.index = i, cur.cost = c;
    return cur;
}

int main()
{
    int i, n, m, next, cost;
    scanf("%d", &n);
    adj *adlist;
    adlist = new adj [n];

    for(int k = 0; k < n; k++){
        scanf("%d %d", &i, &m);
        for(int j = 0; j < m; j++){
            scanf("%d %d", &next, &cost);
            adlist[i].push_back(make_pair(next, cost));
        }
    }

    int *d;
    d = new int [n];
    for(i = 1; i < n; i++){ d[i] = 200000; }
	d[0] = 0;

    priority_queue<current_cost> C;
    current_cost cur = init(0, 0);
    C.push(cur);

    int size;
    bool *check;
    check = new bool [n];
    for(i = 0; i < n; i++){ check[i] = false; }
	int rest = n;

    while(!C.empty())
    {
        cur = C.top(); C.pop();
		i = cur.index;
        if(check[i]) continue;
        check[i] = true; rest--;
 
        size = adlist[i].size();
        for(int j = 0; j < size; j++){
            int k = adlist[i][j].first;
            if(d[i] + adlist[i][j].second < d[k]){
                d[k] = d[i] + adlist[i][j].second;
                C.push(init(k, d[k]));
            }
        }
		if(rest == 0) break;
    };
    for(i = 0; i < n; i++){ printf("%d %d\n", i, d[i]); }

    return 0;
}

Measured memory_bytes: 6100
n = gets.to_i
n.times do
  s = gets.to_s
  ck = true
  t = 1
  for i in 0..s.size-1
    if s[i]=='R'
      if i%2==0
        t=1;
      else 
        t=-1
      end
    elsif s[i]=='L'
      if i%2==0
        t=-1
      else
        t=1
      end
    end
  end
  for i in 1..s.size-1
    if t==1
      ck = false if s[i]=='R'
    else 
      ck = false if s[i]=='L'
    end
    ck = false if s[i-1]==s[i]
    t = -t
  end
  if ck
    puts "Yes"
  else 
    puts "No"
  end
end


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

int main()
{
	string s,s_new;
	cin>>s;
	int n;
	
	n=s.size();
	
	for(int i=0; i<n; i++)
	{
		s_new+="x";
	}
	
	for(int i=0; i<s.size(); i++)
		cout<<s_new[i];

	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int d[100001][2]={0},i=0,n,m;
	char s[99];
	for(;gets(s);)
	{
		if(s[0]==0)
			i++;
		else
		{
			sscanf(s,"%d%d",&n,&m);
			d[n][i]++;
		}
	}
	for(i=0;i<100001;i++)
		if(d[i][0]&&d[i][1])
			printf("%d %d\n",i,d[i][0]+d[i][1]);
	return 0;
}

Measured memory_bytes: 1388
#include<stdio.h>
#define N 2000
int a,A[N];

int sum(int b,int c)
{
  if(c == 0)return 1;
  if(b>=a)return 0;
  int num = sum(b+1,c) || sum(b+1,c-A[b]);
  return num;
}

int main()
{
  int q,M,i;
  
    scanf("%d",&a);
    for(i=0;i<a;i++)scanf("%d",&A[i]);
    scanf("%d",&q);
    for(i=0;i<q;i++)
      {
        scanf("%d",&M);
        if(sum(0,M))printf("yes\n");
        else printf("no\n");
    }
    return 0;
}



Measured memory_bytes: 2104
k,n=map(int,input().split())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n):
    if i<n-1:
        b[i]=a[i+1]-a[i]
    else:
        b[n-1]=a[0]+k-a[n-1]
b.sort()
print(sum(b[:n-1]))

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

int main() {
  int n, m, x;
  cin >> n >> m >> x;

  int clo = 0, chi = 0;
  for (int i = 1; i <= m; i++) {
    int t;
    cin >> t;
    if (t < x)
      clo++;
    else
      chi++;
  }

  cout << min(clo, chi) << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define TT pair<long long, long long>
#define ordered_set tree<TT, null_type, less<TT>, rb_tree_tag, tree_order_statistics_node_update>
#define fo(i,n)   for(i=0;i<n;i++)
#define mem(a,i) memset(a,i,sizeof(a))
#define pb push_back
#define mp make_pair
#define For(m) for(auto it = m.begin();it!=m.end();it++)
#define fi first
#define se second
typedef long long ll;
typedef long double dd;
ll n;
dd dp[3000][3000];
vector<dd> v;
dd solve(ll curr,ll h){
    if(curr==n){
        if(h>(n-h))
        return 1.0;
        return 0.0;
    }
    if(dp[curr][h]!=-1)
    return dp[curr][h];
    dd ans=0;
    ans=solve(curr+1,h+1)*(v[curr]);
    ans+=solve(curr+1,h)*(1-v[curr]);
    return dp[curr][h]=ans;
}
int main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //priority_queue <int, vector<int>, greater<int> > pq;
    //cout << fixed << setprecision(9) <<ans<<endl;
    //ordered_set os;//os.order_of_key();//os.find_by_order();
    ll l,r,count,m,sum=0,ans=0,i,j,k,tt,t,y,z,c,a[200005]={},b[200005]={};
    string ss;
    set<ll> s;
    map<ll,ll> ma;
    fo(i,3000)
    fo(j,3000)
    dp[i][j]=-1;
    cin>>n;
    dd x;
    fo(i,n){
        cin>>x;
        v.pb(x);
    }
    cout << fixed << setprecision(10) <<solve(0,0)<<endl;
}

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

int main() {
    int N,m=1e9+7;
    cin >> N;
    vector<int> X(N);

    rep(i,N)
        cin >> X.at(i);
    
    rep(i,100) {
        int P = i+1,t=0;
        rep(i,N)
            t += (X.at(i)-P)*(X.at(i)-P);
        m = min(t,m);
    }

    cout << m << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define llong long long
const llong inf=0x3f3f3f3f3f3f3f3f;
int n,A,B;
int nu[5050];
llong f[5050][5050];
int main()
{
    scanf("%d%d%d",&n,&A,&B);
    for(int i=1;i<=n;++i)scanf("%d",&nu[i]);
    memset(f,0x3f,sizeof(f));
    f[0][0]=0;
    int x;
    for(int i=0;i<n;++i)
        for(int j=0;j<=n;++j)
        {
            if(f[i][j]==inf)continue;
            x=nu[i+1];
            if(j>x)f[i+1][j]=min(f[i+1][j],f[i][j]+B);
            else
            {
                f[i+1][x]=min(f[i+1][x],f[i][j]);
                f[i+1][j]=min(f[i+1][j],f[i][j]+A);
            }
        }
    llong ans=inf;
    for(int i=0;i<=n;++i)ans=min(ans,f[n][i]);
    printf("%lld\n",ans);
    return 0;
}


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

#define FOR(i,x,y) for(int i = x; i <= y; ++i)

typedef long long ll;

using namespace std;

const int MAX_N = 305;

int n;
int G[MAX_N][MAX_N];
bool vis[MAX_N][MAX_N];

int main()
{
  scanf("%d",&n);
  FOR(i,0,n - 1) FOR(j,0,n - 1) scanf("%d",&G[i][j]);
  ll ans = 0;
  FOR(i,0,n - 1) FOR(j,i,n - 1) ans += G[i][j];
  bool flag = true;
  FOR(k,0,n - 1)
  FOR(i,0,n - 1) FOR(j,0,n - 1)
    if(G[i][k] + G[k][j] < G[i][j]) {
      flag = false;
      break;
    } else if(G[i][k] + G[k][j] == G[i][j] && !vis[i][j] && k != i && k != j) {
      vis[i][j] = true;
      vis[j][i] = true;
      ans -= G[i][j];
    }
  if (!flag) printf("-1\n");
  else printf("%lld\n",ans);
  return 0;
}

Measured memory_bytes: 640
import java.io.*;
public class Main {
    private static MyScanner scanner;

    public static void main (String[] args){
        Main instance = new Main();
        scanner = instance.new MyScanner();
        instance.solve();
    }

    private void solve() {
        try {
            int x = scanner.nextInt();
            if (x < 1200) {
                System.out.println("ABC");
            } else {
                System.out.println("ARC");
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";

        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        public String next() throws IOException {
            if (i < s.length) return s[i++];
            String line = br.readLine();
            while (line.equals("")) {
                line = br.readLine();
            }
            s = line.split(reg, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }

        public long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }
    }
}

Measured memory_bytes: 8148
import           Data.Ratio
import           Data.Maybe

main :: IO ()
main = do
  n <- readLn
  case solve n of
    Nothing -> putStrLn ":("
    Just x  -> print x

solve :: Int -> Maybe Int
solve n = listToMaybe [ x | x <-[x0 .. x1], floor (x * 108 % 100) == n ]
  where
    x0 = ceiling $ n * 100 % 108
    x1 = floor $ (n + 1) * 100 % 108

Measured memory_bytes: 508
#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;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<string, string> pss;
typedef vector<ll> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<vpll> vvpll;
typedef unordered_map<ll, ll> um;
typedef unordered_set<ll> us;

#define fastio ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
#define ts ll t; in(t) while (t--) solve();
#define ks ll t; in(t) FOR(i, 1, t+1) out("Case #" << i << ": " << solve());
#define endl '\n'
#define ln cout << endl;
#define in(x) cin >> x;
#define out(x) cout << x << endl;
#define flush cout << flush;
#define reset(a, b) memset(a, b, sizeof(a));
#define ordered_set tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
#define FOR(i, a, b) for (ll i = a; i < b; ++i)
#define FORI(i, a, b, c) for (ll i = a; i < b; i += c)
#define FORD(i, a, b) for (ll i = a; i > b; --i)
#define FOREACH(it, v, r) for (auto it = v.begin() + r; it != v.end(); it++)
#define FORALL(it, v) for (auto it : v)
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define vin(v, x) vll v(x); FOR(i, 0, x) in(v[i])
#define all(v) v.begin(), v.end()
#define allr(v, r) v.begin(), v.begin() + r
#define showv(v) FORALL(it, v) cout << it << ' '; ln
#define printv(v) FORALL(it, v) out(it)
#define show2d(v) FORALL(it, v) { FORALL(j, it) cout << j << ' '; ln}
#define showm(v) FORALL(it, v) cout << it.F << ": " << it.S << ' '; ln
#define sortv(v) sort(all(v));
#define revv(v) reverse(all(v));
#define maxv(v) *max_element(all(v))
#define minv(v) *min_element(all(v))
#define gcd __gcd
#define checkbit(n, i) (n >> i) & 1               // check ith bit
#define bitcount __builtin_popcount               // count set bits
#define firstbitindex __builtin_ctz               // count trailing zeros
#define lastbitindex __builtin_clz                // count leading zeros
#define bitparity __builtin_parity                // check set bits are even or odd
#define findv(v, x) (find(all(v), x) != v.end())
#define findsm(u, x) (u.find(x) != u.end())
#define findstr(s, x) (s.find(x) != string::npos)
#define sz(a) a.size()
#define precise(x) cout << fixed << setprecision(x);

const ll MAXN = 2e5, MOD = 998244353, SIZE = 2e7, INF = 0x7f7f7f7f7f7f7f7f;
const double EPS = 1e-9, PI = acos(-1);
const int INFi = 0x7f7f7f7f;

//<<------Declare Variables Here----->>//
ll n;
string s, a = "abcdefghijklmnopqrstuvwxyz";

//<<-----Implement Functions Here---->>//
void solve()
{
    in(n)
    while(n)
        --n, s += a[n % 26], n /= 26;
    revv(s)
	out(s)
}

//<<----------Start of Main---------->>//
int main()
{
    fastio
    //ts
    solve();
    return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef map<int,int> mii;
#define pb push_back
#define mx 1000000000000000000

/*int pare(int en,int start,int par[])
{
	if(par[en]==start)
	{
		return en;
	}
	pare(par[en],start,par);
}*/


int main()
{
    int t=1;
    //scanf("%d",&t);
    while(t--)
    {
        long double a,b,c;
        cin >> a >> b;
		c=a*b;
		cout << (ll)c << endl;
    }
    return 0;
}


Measured memory_bytes: 3720
#include <bits/stdc++.h>
#define fastIO (cin.tie(0), cout.tie(0), ios::sync_with_stdio(false))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define precise(i) fixed << setprecision(i)
using lint = long;
using llint = long long;
using namespace std;

int main() {
    fastIO;

    string sa, sb, sc;
    cin >> sa >> sb >> sc;

    size_t a = 0, b = 0, c = 0;
    char turn = sa[a++];

    while (true) {

        if (turn == 'a') {
            if (sa.size() == a) {
                cout << "A\n";
                return 0;
            }
            turn = sa[a++];
        } else if (turn == 'b') {
            if (sb.size() == b) {
                cout << "B\n";
                return 0;
            }
            turn = sb[b++];
        } else if (turn == 'c') {
            if (sc.size() == c) {
                cout << "C\n";
                return 0;
            }
            turn = sc[c++];
        }
    }
}


Measured memory_bytes: 3560
#include <bits/stdc++.h>
using namespace std;
 
 
int main() {
 
  int n;
  cin>>n;

  vector<double> a(n);

  double average=0;
  for(int i=0;i<n;i++){
      cin>>a.at(i);
      average+=a.at(i);
  }

  average/=(double)n;
 
 double diff_min=1000.0;
 int frame=0;
 for(int i=0;i<n;i++){
   if(diff_min > abs(a.at(i)-average))
    {
      diff_min = abs(a.at(i)-average);
      frame=i;
    }
 }
 
 cout<<frame<<endl;

	return 0;
}

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

int main(int argc, char const *argv[])
{
	int n,k;
	cin>>n>>k;
	double ans=.0;
	for (int i = 1; i <= n; ++i)
	{
		int now=i;
		double tmp=1.0;
		while (now<k)
		{
			now*=2;
			tmp/=2.0;
		}
		ans+=tmp;
	}
	printf("%.10f\n", (double)ans/n);
	return 0;
}


Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <time.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;
 
const ll nmax = 1e9 + 7;
const ll Mod = 998244353;
const double PI = 2 * asin(1);

int N, Count[100005];
int main(){
  scanf("%d", &N);
  for (int i = 0; i < N; i++){
    int A; scanf("%d", &A);
    Count[A]++;
  }
  
  int cnt = 0;
  for (int i = 0; i < 100005; i++){
    if (Count[i]) cnt += Count[i] - 1;
  }
  if (cnt % 2 != 0) cnt++;
  printf("%d\n", N - cnt);

  return 0;
}


Measured memory_bytes: 640
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using static System.Console;
using static System.Convert;
using static System.Math;
using static Extentions;

class IO
{
    int idx;
    string[] input = In.ReadToEnd().Split(new[] { " ", "\n", "\r" },
        StringSplitOptions.RemoveEmptyEntries);

    T Get<T>(Func<string, T> parser) => parser(input[idx++]);

    public string S => Get(s => s);
    public char C => Get(char.Parse);
    public int I => Get(int.Parse);
    public long L => Get(long.Parse);
    public double F => Get(double.Parse);
    public decimal D => Get(decimal.Parse);
    public BigInteger B => Get(BigInteger.Parse);

    T[] Gets<T>(int n, Func<string, T> parser)
        => input.Skip((idx += n) - n).Take(n).Select(parser).ToArray();

    public string[] Ss(int n) => Gets(n, s => s);
    public char[] Cs(int n) => Gets(n, char.Parse);
    public int[] Is(int n) => Gets(n, int.Parse);
    public long[] Ls(int n) => Gets(n, long.Parse);
    public double[] Fs(int n) => Gets(n, double.Parse);
    public decimal[] Ds(int n) => Gets(n, decimal.Parse);
    public BigInteger[] Bs(int n) => Gets(n, BigInteger.Parse);

    public void Write<T>(params T[] xs) => WriteLine(string.Join(" ", xs));
    public void Write(params object[] xs) => WriteLine(string.Join(" ", xs));
}

class UnionFind
{
    int[] tree;

    // O(N)
    public int CountGroups => tree.Count(x => x < 0);

    // O(N)
    public UnionFind(int length)
    {
        tree = Enumerable.Repeat(-1, length).ToArray();
    }

    // O(α(N))
    public bool Union(int x, int y)
    {
        x = this.Find(x);
        y = this.Find(y);
        if (x == y) return false;
        if (tree[x] > tree[y]) Swap(ref x, ref y);
        tree[x] += tree[y];
        tree[y] = x;
        return true;
    }

    // O(α(N))
    public int Find(int x)
    {
        if (tree[x] < 0) return x;
        return tree[x] = this.Find(tree[x]);
    }

    // O(α(N))
    public bool Same(int x, int y) => this.Find(x) == this.Find(y);

    // O(α(N))
    public int Count(int x) => -tree[this.Find(x)];
}

static class Extentions
{
    public static void Swap<T>(ref T x, ref T y)
    {
        var tmp = x;
        x = y;
        y = tmp;
    }
}

static class Program
{
    public static void Main()
    {
        var sw = new StreamWriter(OpenStandardOutput()) { NewLine = "\n" };
#if DEBUG
        sw.AutoFlush = true;
#else
        sw.AutoFlush = false;
#endif
        SetOut(sw);
        Solve(new IO());
        Out.Flush();
    }

    static void Solve(IO io)
    {
        var n = io.I;
        var m = io.I;
        var a = new int[m];
        var b = new int[m];

        for (var i = 0; i < m; i++)
        {
            a[i] = io.I - 1;
            b[i] = io.I - 1;
        }

        var ans = 0;

        for (var i = 0; i < m; i++)
        {
            var uf = new UnionFind(n);
            for (var j = 0; j < m; j++) if (j != i) uf.Union(a[j], b[j]);
            if (uf.CountGroups > 1) ans++;
        }

        io.Write(ans);
    }
}

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

#define INF (int)1e9+7
#define rep(i,a,b) for(int i=a;i<b;++i)
#define rrep(i,a,b) for(int i=a;i>=b;--i)
#define vi vector<int>
#define vl vector<ll>
#define vvi vector<vector<int>>
#define vvl vector<vector<long long>>
#define pii pair<int,int>
#define pll pair<long,long>
#define vpii vector<pii>
#define vpll vector<pll>
#define N 100005
#define pb push_back
#define mp make_pair
#define PI 3.1415926535897932384626433832795

ll no_of_div(ll a)
{
  ll cnt=0,i;
  if (a==2)return 1;
  for(i=2;i*i<a;i++)
  {
if(a%i==0)cnt+=2;
  }
  if(i*i==a)cnt++;
  return cnt;
}

//vl a(1001);

ll powM(ll a,ll b, ll m)
{ 
  ll ans=1;
  while(b>0)
  {
    if(b&1)ans=ans*a%m;
    a=a*a%m;
    b>>=1;
  }

return ans%m;
}

ll abc(ll x)
{
  ll cnt_f=0,cnt_s=0;
  while(x)
  {
    ll dig=x%10;
    if(dig==4)cnt_f++;
    else cnt_s++;
    x/=10;
  }
  return (cnt_f==cnt_s);
}

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


ll n;cin>>n;

ll lb=0,rb=n,mb;
while(lb<=rb)
{
mb=(lb+rb)/2;
if((mb+(8*mb)/100)<n)lb=mb+1;
else if((mb+(8*mb)/100)==n)break;
else rb=mb-1;
}
//cout<<mb<<"\n";

if((mb+(8*mb)/100)!=n)cout<<":("<<"\n";
else cout<<mb<<"\n";

  return 0;



}



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

using namespace std;

int main() {
	int Q;
	string s,t;
	cin >> s;
	cin >> Q;
	while (Q--) {
		int op;
		cin >> op;
		if (op == 1) {
			swap(s, t);
		}
		else {
			int f; char c;
			cin >> f >> c;
			if (f == 1)t.push_back(c);
			else s.push_back(c);

		}
	}
	reverse(t.begin(),t.end());
	cout << t + s << endl;
}

Measured memory_bytes: 1248
a = [list(map(int,input().split())) for i in range(3)]
n = int(input())
b = [int(input() )for _ in range(n)]

for i in range(3):
    for j in range(3):
        if a[i][j] in b:
            a[i][j] = 0

for i in range(3):
    if a[i][0] == 0 and a[i][1] == 0 and a[i][2] == 0:
        print('Yes')
        exit()
for i in range(3):
    if a[0][i] == 0 and a[1][i] == 0 and a[2][i] == 0:
        print('Yes')
        exit()
if a[0][0] == 0 and a[1][1] == 0 and a[2][2] == 0:
    print('Yes')
    exit()
if a[2][0] == 0 and a[1][1] == 0 and a[0][2] == 0:
    print('Yes')
    exit()
print('No')

Measured memory_bytes: 3064
// https://atcoder.jp/contests/dp/tasks/dp_b

#include "algorithm"
#include "iostream"
#include "set"
#include "vector"
#define rep(i, from, to) for (ll i = from; i < (to); ++i)
using namespace std;
typedef long long ll;
template <typename T>
using V = vector<T>;
template <typename T>
inline bool chmax(T& a, T b);
template <typename T>
inline bool chmin(T& a, T b);
void print_ints(vector<ll> v);
template <typename T>
void drop(T a);

void solve() {
  ll N, K;
  cin >> N >> K;

  V<ll> hs(N);
  rep(i, 0, N) cin >> hs[i];

  V<ll> dp(N, 1e18);
  dp[0] = 0;

  rep(i, 0, N) {
    rep(j, 1, K + 1) {
      if (i + j >= N) break;

      chmin(dp[i + j], dp[i] + abs(hs[i + j] - hs[i]));
    }
  }

  cout << dp[N - 1] << endl;
}

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

template <typename T>
inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <typename T>
inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}

void print_ints(vector<ll> v) {
  rep(i, 0, v.size()) {
    if (i > 0) {
      cout << " ";
    }

    cout << v[i];
  }

  cout << endl;
}

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define ll long long
#define pii pair<int,int> 
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
string s;
int main(){
    cin>>s;
    int ans=0;
    for(int i=0;i<(int)s.size();i++)
        ans=(ans+s[i]-'0')%9;
    puts((ans==0)?"Yes":"No");
    return 0;
}

Measured memory_bytes: 3700
# ABC047B - すぬけ君の塗り絵 2 イージー / Snuke's Coloring 2 (ABC Edit)
w, h, n = list(map(int, input().rstrip().split()))
lst = [list(map(int, input().rstrip().split())) for _ in range(n)]
ans = [0, 0, w, h]
for i in range(n):
    a = lst[i][2]
    if ans[0] < ans[2] and ans[1] < ans[3]:
        if a == 1:
            ans[0] = max(ans[0], lst[i][0])
        elif a == 2:
            ans[2] = min(ans[2], lst[i][0])
        elif a == 3:
            ans[1] = max(ans[1], lst[i][1])
        else:
            ans[3] = min(ans[3], lst[i][1])
    else:
        print(0)
        break
else:
    res = (ans[2] - ans[0]) * (ans[3] - ans[1])
    print(res if res >= 0 else 0)

Measured memory_bytes: 3064
sx, sy, tx, ty = [int(x) for x in input().split()]

dx = tx - sx
dy = ty - sy

for _ in range(dx):
	print('R',end='')
for _ in range(dy):
	print('U',end='')
for _ in range(dx):
	print('L',end='')
for _ in range(dy + 1):
	print('D',end='')
for _ in range(dx + 1):
	print('R',end='')
for _ in range(dy + 1):
	print('U',end='')
print('L',end='')
print('U',end='')
for _ in range(dx + 1):
	print('L',end='')
for _ in range(dy + 1):
	print('D',end='')
print('R')

Measured memory_bytes: 4468
#include <bits/stdc++.h>
using namespace std;
#define REP(i, init, n) for(int i = (int)(init); i < (int)(n); i++)

#define vi vector<int>
#define vl vector<long>
#define vvi vector<vector<int>>
#define vvl vector<vector<long>>
#define pint pair<int, int>
#define plong pair<long, long>

int main() {
    long A, V, B, W, T;
    cin>> A >> V >> B >> W >> T;
    long d= abs(A-B);
    if(W>=V){
        cout << "NO" << endl;
        return 0;
    }
    else if((V-W) * T < d){
        cout << "NO" << endl;
        return 0;
    }else{
        cout << "YES" << endl;
        return 0;
    }
}

Measured memory_bytes: 3644
#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <utility>
#include <algorithm>
#include <set>
#include <cmath>
#include <array>
#include <bitset>
using namespace std;
typedef long long ll;
const ll mod=1000000007;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,n) for(int i=1;i<n+1;i++)
int main(){
    int N,W;
    cin>>N>>W;
    ll values[100001];
    ll val;
    int w;
    rep(i,W+1) values[i] = 0;
    Rep(i,N){
        cin>>w>>val;
        for(int ww=W;ww>-1;ww--){
            if (ww < w) continue;
            else values[ww] = max(values[ww-w] + val,values[ww]);
        }
    }
    cout<<values[W];

    return 0;
}

Measured memory_bytes: 1024
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
using namespace std;
using LL = long long;



#include <vector>

class union_find
{
private:
	std::vector<int>parent;
	std::vector<int>rank;
	std::vector<int>clump;
public:
	union_find(int siz)
	{
		parent.resize(siz);
		rank.resize(siz);
		clump.resize(siz);
		for (int i = 0; i < siz; ++i)
		{
			parent[i] = i;
			rank[i] = 0;
			clump[i] = 1;
		}
	}
	void unite(int x, int y)
	{
		int xr = find(x);
		int yr = find(y);
		if (xr == yr)return;
		if (rank[xr] > rank[yr])
		{
			parent[yr] = xr;
			clump[xr] += clump[yr];
		}
		else if (rank[yr] > rank[xr])
		{
			parent[xr] = yr;
			clump[yr] += clump[xr];
		}
		else if (xr != yr)
		{
			parent[yr] = xr;
			clump[xr] += clump[yr];
			++rank[xr];
		}
	}
	int find(int x)
	{
		if (parent[x] == x)
		{
			return x;
		}
		else
		{
			return parent[x] = find(parent[x]);
		}
	}
	bool check(int x, int y)
	{
		return find(x) == find(y);
	}
	int size(int x)
	{
		return clump[find(x)];
	}
};

int N, M;
vector<int>a, b;

int main(void)
{
	cin >> N >> M;
	for (int i = 0; i < M; ++i)
	{
		int aa, bb; cin >> aa >> bb;
		a.push_back(aa - 1);
		b.push_back(bb - 1);
	}
	int ans = 0;
	for (int i = 0; i < M; ++i)
	{
		union_find uf(N);
		for (int j = 0; j < M; ++j)
		{
			if (i != j)uf.unite(a[j], b[j]);
		}
		if (uf.size(0) != N)
		{
			++ans;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define MOD 1000000007
const int INF = 1LL<<30;

vector<pair<long long, long long> > prime_factorize(long long n) {
    vector<pair<long long, long long> > res;
    for (long long p = 2; p * p <= n; ++p) {
        if (n % p != 0) continue;
        int num = 0;
        while (n % p == 0) { ++num; n /= p; }
        res.push_back(make_pair(p, num));
    }
    if (n != 1) res.push_back(make_pair(n, 1));
    return res;
}

int main(){
    ll n,p;
    cin>>n>>p;

    auto pf=prime_factorize(p);
    ll ans=1;
    for(auto p : pf){
        ll tmp=p.second/n;
        if(tmp>0) ans*=pow(p.first,tmp);
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 3884
from itertools import accumulate

n = int(input())
a = sorted(list(map(int, input().split())))
asum = list(accumulate(a))

cnt= 1
for i in range(1,n):
    if asum[i - 1] * 2 >= a[i]:
        cnt += 1
    else:
        cnt = 1
print(cnt)


Measured memory_bytes: 14432
#include <bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
#define ff first
#define ss second
#define sfi(a) scanf("%d",&a)
#define sfi2(a,b) scanf("%d %d",&a,&b)
#define sfi3(a,b,c) scanf("%d %d %d",&a,&b,&c)
#define sfll(a) scanf("%lld",&a)
#define all(a) a.begin(),a.end()
#define keepu(a) a.erase(unique(all(a)),a.end())
#define inf 1e7
#define m_p make_pair
#define min3(a,b,c) min(a,min(b,c))
#define pb push_back
#define mem(x,val) memset(x,val,sizeof(x))
#define read freopen("output.txt","r",stdin)
#define write freopen("input.txt","w",stdout)
#define FAST  ios_base::sync_with_stdio(0);cout.tie(0)
#define sqr(x) ((x)*(x))

typedef long long ll;
const ll mod = 1e9+7;
const int sz = 500;


int main(){

    int n;
    cin >> n;
    int arr[n];
    bool flag = true;
    for(int i=0;i<n;i++){
        cin >> arr[i];
        if(arr[i]%2==0 && arr[i]%3!=0 && arr[i]%5!=0) flag = false;
    }

    if(flag) puts("APPROVED");
    else puts("DENIED");



    return 0;
}


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

#define rep(i,n) for(int i=0; i<n; i++)
#define all(x) (x).begin(),(x).end()
#define INF (1e9)

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  cout << min(c,b/a) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
typedef long long ll;
#define ip(arr, n) for(int i=0; i<n; i++) cin>>arr[i];
#define op(arr, n) for(int i=0; i<n; i++) cout<<arr[i]<<" ";
#define fstIO ios_base::sync_with_stdio(false); cin.tie(NULL);
#define MAX 100005

int main(){
    int n;
    cin>>n;
    int height[n];
    ip(height, n);
    
    ll dp[MAX]={0};
    dp[0]=0, dp[1]=abs(height[1]-height[0]);

    for(int i=2; i<n; i++){
        dp[i] = min(dp[i-1]+abs(height[i]-height[i-1]), dp[i-2]+abs(height[i]-height[i-2]));
    }
    cout<<dp[n-1]<<endl;
    return 0;
}

Measured memory_bytes: 1408
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <set>
#include <map>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

bool check_len1[26],check_len2[26][26],check_len3[26][26][26],check_len4[26][26][26][26];

char buf[400001];

//26*26*26*26 > 400000

int main(){

	for(int a = 0; a < 26; a++){
		check_len1[a] = false;
		for(int b = 0; b < 26; b++){
			check_len2[a][b] = false;
			for(int c = 0; c < 26; c++){
				check_len3[a][b][c] = false;
				for(int d = 0; d < 26; d++){
					check_len4[a][b][c][d] = false;
				}
			}
		}
	}

	int N;
	scanf("%d",&N);

	char pre_pre_pre,pre_pre,pre,current;

	for(int loop = 0; loop < N; loop++){
		scanf("%s",buf);

		for(int index = 0; buf[index] != '\0'; index++){
			current = buf[index];

			check_len1[current-'a'] = true;

			if(index > 0){
				check_len2[pre-'a'][current-'a'] = true;
			}
			if(index > 1){
				check_len3[pre_pre-'a'][pre-'a'][current-'a'] = true;
			}
			if(index > 2){
				check_len4[pre_pre_pre-'a'][pre_pre-'a'][pre-'a'][current-'a'] = true;
			}

			pre_pre_pre = pre_pre;
			pre_pre = pre;
			pre = current;
		}
	}

	for(int i = 0; i < 26; i++){
		if(check_len1[i] == false){
			printf("%c\n",'a'+i);
			return 0;
		}
	}

	for(int a = 0; a < 26; a++){
		for(int b = 0; b < 26; b++){
			if(check_len2[a][b] == false){
				printf("%c%c\n",'a'+a,'a'+b);
				return 0;
			}
		}
	}

	for(int a = 0; a < 26; a++){
		for(int b = 0; b < 26; b++){
			for(int c = 0; c < 26; c++){
				if(check_len3[a][b][c] == false){
					printf("%c%c%c\n",'a'+a,'a'+b,'a'+c);
					return 0;
				}
			}
		}
	}

	for(int a = 0; a < 26; a++){
		for(int b = 0; b < 26; b++){
			for(int c = 0; c < 26; c++){
				for(int d = 0; d < 26; d++){
					if(check_len4[a][b][c][d] == false){
						printf("%c%c%c%c\n",'a'+a,'a'+b,'a'+c,'a'+d);
						return 0;
					}

				}
			}
		}
	}


	return 0;
}

Measured memory_bytes: 4052
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    cin >> n >> k;
    vector<int> a(n,0);
    for(int i = 0; i < n; i++){
        int b;
        cin >> b;
        a[b - 1]++;
    }
    int cnt = 0;
    for(int i = 0; i < n; i++){
        if(a[i] > 0)
        cnt++;
    }
    int ans = 0;
    sort(a.begin(),a.end());
    for(int i = 0; cnt > k; i++){
        if(a[i] > 0)
        {
            cnt--;
            ans += a[i];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
from collections import deque,Counter

N = int(input())
A = list(map(int,input().split()))

memo = [0] * (10**6+10)
cnt = Counter(A)
for k,v in cnt.items():
    if memo[k] > 1:
        continue
    for j in range(k,10**6+1,k):
        memo[j] += v 

# print(memo[:max(A)+1])

ans = 0
for num in cnt:
    ans += (memo[num] == 1)

print(ans)


Measured memory_bytes: 52656
#include<iostream>
#include <cstdio>
#include <vector>
#include <algorithm>

using namespace std;
typedef unsigned long ul;
typedef pair<ul, ul> P;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)

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

  int rm=0;
  int a[n+1];
  int tmp;

  REP(i,n+1){
    a[i]=0;
  }

  REP(i,n){
    scanf("%d",&tmp);
    if (n<tmp) rm+=1;
    else a[tmp]+=1;
  }

  FOR(i,1,n+1){
    if (a[i]<i) rm+= a[i];
    else if(a[i]>i) rm+= a[i]-i;
  }

    printf("%d\n",rm);
  return 0;
}

Measured memory_bytes: 640
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e): return [[[[e] * d for j in range(c)] for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(N=None): return list(MAP()) if N is None else [INT() for i in range(N)]
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = 10 ** 18
MOD = 10 ** 9 + 7

sx, sy, tx, ty = MAP()

x = tx - sx
y = ty - sy

# 進行方向の確定
ans = ''
if x >= 0:
    x1 = 'R'
    x2 = 'L'
else:
    x1 = 'L'
    x2 = 'R'
if y >= 0:
    y1 = 'U'
    y2 = 'D'
else:
    y1 = 'D'
    y2 = 'U'

# 1周目
ans += x1 * x
ans += y1 * y
ans += x2 * x
ans += y2 * y

# 2周目(ひと回り外側を通る)
ans += y2
ans += x1 * (x+1)
ans += y1 * (y+1)
ans += x2
ans += y1
ans += x2 * (x+1)
ans += y2 * (y+1)
ans += x1

print(ans)


Measured memory_bytes: 3188
#include <iostream>
#include <vector>
#include <array>
#include <deque>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <numeric>
#include <utility>
#include <cmath>
#include <iomanip>

using namespace std;
using ll=long long int;

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

    ll ans = 0;
    for (ll i = 1; i*(i+2) <= n; ++i) {
        if (n % i == 0) {
            ans += n/i-1;
        }
    }

    cout << ans << endl;

    return 0;
}


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

int main() {
    int N,M; cin >> N >> M;
    vector<int> A(N);
    rep(i,N) cin >> A.at(i);
    int sum = 0;
    rep(i,N) sum+=A.at(i);
    //cout << sum << endl;
    int val = ceil((double)sum/(4*M));
    //cout << val << endl;
    int ans = 0;
    rep(i,N) if(A.at(i) >= val) ans++;
    if(ans >= M) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>

int main()
{
    int k;
    std::cin >> k;

    long long int sum = 0;
    for (int i =1; i <= k; ++i)
    {
        for (int j = 1; j <= k; ++j)
            for (int q = 1; q <= k; ++q)
                sum += std::__gcd(std::__gcd(i, j), q);
    }

    std::cout << sum;
}


Measured memory_bytes: 3640
#include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <vector>

const int mod = 1e9 + 7;
const int kmax = 510000;

long long fact[kmax], fact_inv[kmax], inv[kmax];

void init_comb()
{
    fact[0] = fact[1] = 1;
    fact_inv[0] = fact_inv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < kmax; i++) {
        fact[i] = fact[i - 1] * i % mod;
        inv[i] = mod - inv[mod % i] * (mod / i) % mod;
        fact_inv[i] = fact_inv[i - 1] * inv[i] % mod;
    }
}

long long comb(int n, int r)
{
    if (n < r) {
        return 0;
    }

    if (n < 0 || r < 0) {
        return 0;
    }

    return fact[n] * (fact_inv[r] * fact_inv[n - r] % mod) % mod;
}

int main()
{
    int n;
    std::cin >> n;

    auto is_ok = [](std::string last_four) {
        if (last_four.find("AGC") != std::string::npos) {
            return false;
        }

        for (int i = 0; i < 3; i++) {
            std::swap(last_four[i], last_four[i + 1]);
            if (last_four.find("AGC") != std::string::npos) {
                return false;
            }
            std::swap(last_four[i], last_four[i + 1]);
        }
        return true;
    };

    std::vector<std::unordered_map<std::string, long long>> dp(n + 1);

    auto dfs = [&](auto f, int idx, std::string last_three) -> long long {
        if (dp[idx].find(last_three) != dp[idx].end()) {
            return dp[idx][last_three];
        }

        if (idx == n) {
            return 1;
        }

        long long sum = 0;
        char agct[4] = { 'A', 'C', 'G', 'T' };
        for (auto c : agct) {
            std::string t(1, c);
            if (is_ok(last_three + c)) {
                sum += f(f, idx + 1, last_three.substr(1) + c) % mod;
                sum %= mod;
            }
        }

        dp[idx][last_three] = sum;
        return sum;
    };

    std::cout << dfs(dfs, 0, "TTT") << std::endl;
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0; i<(n); i++)
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; }
int main(){
    ll n; cin>>n;
    map<ll,ll> m;
    bool iftrue=true;
    rep(i,n){
        ll a; cin>>a;
        if(m[a]!=0)iftrue=false;
        m[a]=1;
    }
    if(iftrue) cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}

Measured memory_bytes: 12800