akhauriyash/Code-Regression huggingface dataset:
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
	v = [2,5,5,4,5,6,3,7,6]
	n,m = readline() |> split |> parseMap
	a = readline() |> split |> parseMap
	a = sort(a,rev=true)
	dp = -ones(Int,n+1)
	dp[1] = 0
	for i in 1:n+1
		if dp[i]>=0
			for j in a
				if i+v[j]<=n+1
					dp[i+v[j]]=max(dp[i+v[j]],dp[i]+1)
				end
			end
		end
	end
	k = n+1
	while k>1
		for j in a
			if k-v[j]>0
				if dp[k-v[j]]==dp[k]-1
					print(j)
					k -= v[j]
					break
				end
			end
		end
	end
	println("")
end

main()

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

int main(){

int n,m;
cin>>n>>m;

int A[n][m],b[m],c[n]={0};

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

for(int j=0;j<m;j++){
    cin>>b[j];
}

for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
        c[i]+=A[i][j]*b[j];
    }
}

for(int i=0;i<n;i++){
    cout<<c[i]<<endl;
}


    return 0;
}


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

int n;
vector< vector<int> > G;
vector<int> color;
vector<int> dis;

void Bfs(int start) {
  queue<int> q;
  q.push(start);
  color[start]++;
  dis[start] = 0;

  while (q.empty() == false) {
    int u = q.front();
    q.pop();
    for (int v = 0; v < n; v++) {
      if (G[u][v] == 1 && color[v] == 0) {
        color[v]++;
        dis[v] = dis[u] + 1;
        q.push(v);
      }
    }
    color[u]++;
  }
}

int main() {
  cin >> n;
  G.resize(n, vector<int>(n));
  color.resize(n);
  dis.resize(n, -1);
  for (int i = 0; i < n; i++) {
    int u, k;
    cin >> u >> k;
    u--;
    for (int j = 0; j < k; j++) {
      int v;
      cin >> v;
      v--;
      G[u][v]++;
    }
  }

  Bfs(0);

  for (int i = 0; i < n; i++) cout << i + 1 << " " << dis[i] << endl;
}


Measured memory_bytes: 3168
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int,int> PP;

/*
    freopen("input","r",stdin);
    freopen("output","w",stdout);
*/

int main() {
    ios::sync_with_stdio(false);
    ll K;
    cin >> K;
    ll p = K / 50;
    ll rem = K % 50;
    ll num[50];
    for (int i = 0;i < 50;i++) num[i] = p + i;
    if (rem) num[49]++;
    for (int j = 0;j < rem;j++) num[50 - j - 1] = num[49];
    cout << 50 << endl;
    for (int i = 0;i < 50;i++) {
    	if (i != 0) cout << ' ';
    	cout << num[i];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define MAX_N 51
#define P pair<int,int>
using namespace std;

// uからの辺の色
// u-v の色は1~G[u].size()+1
// ただし、uと一致するなら+1
// 辺u,vの色を記録

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n;
    cin>>n;
    vector<vector<int>> G(n);
    vector<P> e;
    for(int i = 0; i<(n-1); i++){
        int a,b;
        cin>>a>>b;
        a--;b--;
        G[a].emplace_back(b);
        G[b].emplace_back(a);
        e.emplace_back( make_pair(a,b));
    }
    vector<int> u_color(n,0);
    vector<int> visited(n,0);
    map<P,int> edge_color;
    int k=0;

    queue<int> que;
    que.emplace(0);
    visited[0] = 1;
    while(!que.empty()){
        int u = que.front(); que.pop();
        int cur = 1;

        if(G[u].size() > k) k = G[u].size();

        for(int j = 0; j<G[u].size(); j++){
            int v = G[u][j];
            if(visited[v]) continue;
            if(u_color[u] == cur) cur++;
            edge_color[make_pair(u,v)] = edge_color[make_pair(v,u)]  = u_color[v] = cur++;

            visited[v] = 1;
            que.emplace(v);
        }
    }
    cout<< k <<endl;
    for(int i =0; i<(n-1); i++){
        int ans = edge_color[e[i]];
        cout<< ans <<endl;
    }
    return 0;
}


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

int main() {
	int N;
	int d[110];
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> d[i];
	}

	set<int> values;
	for (int i = 0; i < N; i++) {
		values.insert(d[i]);
	}

	cout << values.size() << endl;
}

Measured memory_bytes: 3608
#include <iostream>

using namespace std;

int main() {
	int a, b;
	cin >> a >> b;
	for (int i = b * 10; i < (b + 1) * 10; i++)
	{
		if (a == static_cast<int>(i * 0.08)) {
			cout << i << "\n";
			return 0;
		}
	}
	cout << "-1\n";
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

using System.Collections;

class Program
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());

        int[] ryokanList = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

        int currentMax = 0;

        int ans = 0;

        foreach(var ryokan in ryokanList)
        {
            if(currentMax <= ryokan)
            {
                ans++;
                currentMax = ryokan;
            }
        }

        Console.WriteLine(ans);
    }
}


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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

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

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

int main()
{
    cout << fixed << setprecision(15);
    ll H, W;
    cin >> H >> W;

    vector<vector<ll>> a(H, vector<ll>(W));

    REP(i, H){
        REP(j, W){
            cin >> a[i][j];
        }
    }

    // REP(i, H){
    //     REP(j, W){
    //         cout << a[i][j];
    //     }
    //     cout << endl;
    // }

    vector<vector<ll>> ans(H*W, vector<ll>(4));
    ll count = 0;
    REP(i, H){
        REP(j, W-1){
            //奇数だった時は右に渡す
            if(a[i][j]%2 != 0){
                a[i][j+1]++;
                // cout << i+1 << " " << j+1 << " " << i+1 << " " << j+2 << endl;
                ans[count][0] = i+1;
                ans[count][1] = j+1;
                ans[count][2] = i+1;
                ans[count][3] = j+2;
                count++;
            }
        }
    }
    REP(i, H-1){
        // 奇数だった時は下に渡す
        if(a[i][W-1]%2 != 0){
            a[i+1][W-1]++;
            // cout << i+1 << " " << W << " " << i+2 << " " << W << endl;
            ans[count][0] = i+1;
            ans[count][1] = W;
            ans[count][2] = i+2;
            ans[count][3] = W;
            count++;
        }
    }
    cout << count << endl;
    for(ll i=0; i<count; i++){
        cout << ans[i][0] << " " << ans[i][1] << " " << ans[i][2] << " " << ans[i][3] << endl;
    }
    return 0;
}

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

int main(){
    int n,m,x;
    cin >> n  >> m >> x;
    vector<int>a(m);
    int data[n+1]={0};
    for(int i=0;i<m;i++){
        cin >> a[i];
        data[a[i]]++;
        
    }
   // for(int i=0;i<n+1;i++)cout << data[i] << endl;
    
    int left=0,rgiht=0;
    for(int i=0;i<n+1;i++){
        if(data[i] != 0 && i<x)left++;
        if(i == x)continue;
        if(data[i] != 0 && i>x)rgiht++;

    }
    int ans = min(left,rgiht);
    cout << ans << endl;

 
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <limits>
#include <ios>
#include <iomanip>
#include <stdio.h>
#include <iomanip>
#include <queue>
using namespace std;

#define rep(i,N) for(int i=0; i<N; i++)
#define revrep(i,N) for(int i=N-1; i>=0; i--)
#define coutline cout<<"------------ ("<<__LINE__<<")"<<endl;

typedef long long ll;

int main(void)
{
    int N, M;
    cin >> N >> M;

    vector<vector<pair<int, int>>> p(N);
    vector<int> flg(N, -1);

    rep(i, M){
        int x,y,z;
        cin >> x >> y >> z;
        x--;y--;

        p.at(x).push_back(make_pair(y,z));
        p.at(y).push_back(make_pair(x,z));
    }

    queue<int> q;
    int ret = 0;
    rep(t, N) {
        if (flg.at(t) == -1) {
            q.push(t);
            flg.at(t) = 1;
            ret ++;
        }
        while (!q.empty()) {
            int i = q.front();q.pop();
            
            rep(j, p.at(i).size()){
                if (flg.at(p.at(i).at(j).first) == -1) {
                    if ((flg.at(i) + p.at(i).at(j).second) % 2 == 1) {
                        
                        flg.at(p.at(i).at(j).first) = 1;
                        q.push(p.at(i).at(j).first);
                    
                    } else {
                        flg.at(p.at(i).at(j).first) = 2;
                        q.push(p.at(i).at(j).first);
                    }
                }
            }
        }
    }

    cout << ret << endl;

    return 0;
}


Measured memory_bytes: 7284
#include<stdio.h>

int main(void)
{

int a,b;
int d,r;
double f;

scanf("%d",&a);
scanf("%d",&b);

d=a/b;
r=a%b;
f=(double)a/(double)b;

printf("%d %d %f\n",d,r,f);

return 0;
}

Measured memory_bytes: 1064
import copy

common = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, 365]
leep = copy.deepcopy(common)
leep[1] += 1
leep[12] += 1

def get_days(year):
    if year % 400 == 0:
        return leep
    elif year % 100 == 0:
        return common 
    elif year % 4 == 0:
        return leep 
    else:
        return common 

if __name__ == '__main__':

    while True:
        y1, m1, d1, y2, m2, d2 = map(int, raw_input().split())
        if y1 < 0 or y2 < 0 or m1 < 0 or m2 < 0 or d1 < 0 or d2 < 0:
            break
        ans = 0
        if y2 - y1 == 0:
            if m2 - m1 == 0:
                ans = d2 - d1
            else:
                days = get_days(y2)

                ans += days[m1 - 1] - d1
                ans += d2
                nm = m1
                while nm + 1 < m2:
                    ans += days[nm]
                    nm += 1
        else:

            days = get_days(y1)
            ans += days[m1 - 1] - d1 + 1
            nm = m1 + 1
            while nm <=  12:
                ans += days[nm - 1]
                nm += 1
            days = get_days(y2)
            nm = 0
            while nm + 1 < m2:
                ans += days[nm] 
                nm += 1
            ans += d2 - 1
            ny = y1 + 1
            for i in xrange(y2 - y1 - 1):
                days = get_days(ny + i)
                ans += days[12]
        print(ans)

Measured memory_bytes: 4316
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define SF scanf
#define PF printf
#define MAXN 1000010
using namespace std;
int n;
char s[MAXN];
int main(){
	SF("%s",s);
	SF("%d",&n);
	int len=strlen(s);
	for(int i=0;i<len;i+=n)
		PF("%c",s[i]);
}

Measured memory_bytes: 128
n=int(input())
a=list(map(int,input().split()))
def gcd(b,c):
    while c!=0:
        b,c=c,b%c
    return b
def lcm(b,c):
    return b*c//gcd(b,c)
temp=a[0]
for i in range(n):
    temp=lcm(a[i],temp)
ans=temp-1
total=0
for i in range(n):
    total+=ans%a[i]
print(total)


Measured memory_bytes: 3316
// Created by Nandu Vinodan
#include <bits/stdc++.h>

#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define rep(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define vi vector<int>
#define pi pair<int, int>
#define INF INT_MAX
#define _INF INT_MIN
#define TC 0

using namespace std;
using ll = long long;

void testcase() {
    ll a; cin >> a;
    cout << a + (a * a) + (a * a * a);
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    if (TC)
        cin>>t;
    while(t--) {
        testcase();
    }
    return 0;
}

Measured memory_bytes: 3652
import Control.Applicative

getInt :: IO Int
getInt = (\a -> read a :: Int) <$> getLine

getInteger :: IO Integer
getInteger = (\a -> read a :: Integer) <$> getLine

{-
ListInt :: IO [Int]
ListInt = (map (\a -> read a :: Int) $ words) <$> getLine

ListInteger :: IO [Integer]
ListInteger = (map (\a -> read a :: Integer) $ words) <$> getLine
-}

sumInt 0 =  0
sumInt n = (mod n 10) + (sumInt $ div n 10)

cond :: Integer -> String
cond n =
    let a = sumInt n
        in if 0 == mod n a then "Yes" else "No"

main = do
    putStrLn =<< cond <$> getInteger


Measured memory_bytes: 508
#include<stdio.h>
#include<string.h>
int main(void)
{
	char s[3];
	int i,cnt,len;
	scanf("%s",s);
	len=strlen(s);
	cnt=0;
	for(i=0;i<3;i++){
		if(s[i]=='1'){
				cnt++;
		}
	}
	printf("%d\n",cnt);
	return 0;
}


Measured memory_bytes: 128
use std::io::Read;
fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut iter = buf.split_whitespace();
    let n: usize = iter.next().unwrap().parse().unwrap();
    let k: u64 = iter.next().unwrap().parse().unwrap();
    let a: Vec<u64> = (0..n)
        .map(|_| iter.next().unwrap().parse().unwrap())
        .collect();
    let mut ans: u64 = 0;
    let mut x: u64 = 0;

    for i in (0..61).rev() {
        let bit = 1u64 << i;
        let mut bit0 = 0;
        let mut bit1 = 0;
        for y in a.iter() {
            if (y & bit) != 0 {
                bit1 += 1;
            } else {
                bit0 += 1;
            }
        }
        if x + bit <= k && bit1 < bit0 {
            x += bit;
            ans += bit * bit0;
        }else {
            ans += bit * bit1;
        }
    }

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


Measured memory_bytes: 6396
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstring>
#include <iterator>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <iomanip>
#include <cassert>
//#include <utility>
//#include <memory>
//#include <functional>
//#include <deque>
//#include <cctype>
//#include <ctime>
//#include <numeric>
//#include <list>
//#include <iomanip>

//#if __cplusplus >= 201103L
//#include <array>
//#include <tuple>
//#include <initializer_list>
//#include <forward_list>
//
//#define cauto const auto&
//#else

//#endif

using namespace std;


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

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()
#define DEBUG
#ifdef DEBUG
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#else
#define dump(x) 
#define debug(x) 
#endif

#define MOD 1000000007LL
#define EPS 1e-8
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)

void mainmain(){
	int n;
	while(cin>>n,n){
		vector<map<string,int>> v(26);
		string s;
		getline(cin,s);
		rep(i,n){
			getline(cin,s);
			stringstream ss;
			ss<<s;
			while(ss>>s){
				// cout<<s<<endl;
				if(v[s[0]-'a'].count(s)==0){
					v[s[0]-'a'][s]=-1;
				}
				else{
					v[s[0]-'a'][s]--;
				}
			}
		}
		vector<pair<int,string>> dic[26];
		rep(i,26){
			for(auto x:v[i]){
				dic[i].PB(mkp(x.S,x.F));
			}
			sort(ALL(dic[i]));
		}
		char t;
		cin>>t;
		if(dic[t-'a'].size()==0){
			cout<<"NA"<<endl;
		}
		else{
			rep(i,min(5,(int)dic[t-'a'].size())){
				if(i) cout<<" ";
				cout<<dic[t-'a'][i].S;
			}
			cout<<endl;
		}
	}
}


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

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

void solve(long long N, vector<long long> a){
	long long lans = 1e18;
	for(int i = -100 ; i <= 100 ; i++){
		long long ans = 0;
		for(int j = 0 ; j < N ; j++){
			long long d = a[j] - i;
			ans += d * d;
		}
		lans = min(lans,ans);
	}
	cout << lans << endl;
}



int main(){	
	ios::sync_with_stdio(false);
	long long N;
	cin >> N;
	vector<long long> a(N-1+1);
	for(int i = 0 ; i <= N-1 ; i++){
		cin >> a[i];
	}
	solve(N, a);
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
//using namespace __gnu_pbds;
//typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> set_t;
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define SUM(v) accumulate(v.begin(),v.end(),lli(0))
#define rev(n,d) for(int i=n;i>=d;i--)
#define FOR0(n) for(int i=0;i<n;i++)
#define FOR(a,n) for(int i=a;i<n;i++)
#define FORQ(a,n) for(int i=a;i<=n;i++)
#define inf 1000000009
#define inff 0x3f3f3f3f
#define sz(a) int((a).size())
#define all(c) c.begin(), c.end()
#define ff first
#define ss second
#define endl "\n"
#define mod 1000000007
#define mem(ar,x) memset(ar,x,sizeof ar)
#define present(container, element) (container.find(element) != container.end())
#define max3(a,b,c) return (lli(a)>lli(b)?(lli(a)>lli(c)?a:c):(lli(b)>lli(c)?b:c))
#define max4(a,b,c,d) return (max3(a,b,c)>lli(d)?(max3(a,b,c)):d)
#define min3(a,b,c) return (lli(a)<lli(b)?(lli(a)<lli(c)?a:c):(lli(b)<lli(c)?b:c))
#define min4(a,b,c,d) return (max3(a,b,c)<lli(d)?(max3(a,b,c)):d)
typedef long long int lli;
typedef pair<int,int> pii;
typedef pair<int,pii>ppii;
typedef vector<int>vi;
typedef vector<vi>vvi;
typedef vector<pii>vpii;
const int N=100005;
int dr8[]={0,0,1,-1,1,1,-1,-1};
int dc8[]={1,-1,0,0,-1,1,-1,1};
int dr4[]={0,1,-1,0};
int dc4[]={1,0,0,-1};
int main(){
	fast
	char a;
	cin>>a;
	if(a<=90) cout<<'A';
	else cout<<'a';
}



Measured memory_bytes: 3644
#include "bits/stdc++.h"
using namespace std;
#define dbg(var) cout<<#var<<"="<<var<<" "
#define nl cout<<"\n"
#define fr(i,n) for(int i=0;i<n;i++)
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define fast ios::sync_with_stdio(false);cin.tie(0);
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define fa(v) for(auto &i:v)
#define all(v) v.begin(),v.end()
#define sz(v) (int)(v.size())
//#define int long long
int32_t main()
{
  int n; cin >> n;
  string s;
  map<string,int> mp;	
  fr(i,n){
  	cin >> s;mp[s]++;
  }
  vector<string> arr{"AC","WA","TLE","RE"};
  for(auto st: arr){
  	cout << st << " x " << mp[st] << "\n";
  }
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
#include<cmath>
using namespace std;
#define int long long int
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define mp make_pair
#define pii pair<int,int>
#define piii pair< int,pair<int,int> >
#define f first
#define s second
#define all(a) a.begin(),a.end()
#define endl '\n'
#define boost ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define N 2005
#define mod 1000000007
#define inf 1e17
#define pf push_front
#define pob pop_back
#define pof pop_front
#define debug1(x) cout<<#x<<" "<<x<<endl;
#define debug2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;

int32_t main()
{
   // boost
    int t=1;
    //cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        long double x=(long double)n;
        long double i=1.01;
        long double f=100;
        int ctr=0;
       while(f<n)
       {
           f*=i;
           f=floor(f);
           ctr++;
         //  cout<<f<<endl;
       }
       cout<<ctr;

    }


    

}

Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
struct disjoint_set {
  public:
    int n;
    vector<int> prt;
    disjoint_set (int sz) {
      n = sz;
      prt.resize(sz, -1);
    }
    bool isRoot (int x) {
      return prt[x] < 0;
    }
    int find (int x) {
      if (isRoot(x)) return x;
      else return prt[x] = find(prt[x]);
    }
    int getSize (int x) {
      return prt[find(x)];
    }
    bool is_equiv (int x, int y) {
      return find(x) == find(y);
    }
    bool unite (int x, int y) {
      x = find(x);
      y = find(y);
      if (x == y) return false;
      if (getSize(x) < getSize(y)) swap(x, y);
      prt[x] += prt[y];
      prt[y] = x;
      return true;
    }
};
int main() {
  int n, q;
  cin >> n >> q;
  disjoint_set djs(n);
  while (q--) {
    int c;
    cin >> c;
    if (c == 0) {
      int x, y;
      cin >> x >> y;
      djs.unite(x, y);
    } else {
      int x, y;
      cin >> x >> y;
      if (djs.is_equiv(x, y)) {
        cout << 1 << '\n';
      } else {
        cout << 0 << '\n';
      }
    }
  }
  return 0;
}


Measured memory_bytes: 3168
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using VI = vector<int>;

const int N = 405;
int a[N];
ll pre[N], best[N][N];

int main() {
#ifdef LOCAL_EXEC
//	freopen("sample.in", "r", stdin);
//	freopen("sample.out", "w", stdout);
#else
  ios_base::sync_with_stdio(false); cin.tie(NULL);
#endif

  int n; cin >> n;

  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    pre[i] = pre[i - 1] + a[i];
  }

  for (int len = 2; len <= n; len++) {
    for (int l = 1; l + len - 1 <= n; l++) {
      int r = l + len - 1;
      best[l][r] = 1e18;
      for (int m = l; m < r; m++) {
        best[l][r] = min(best[l][r], best[l][m] + best[m + 1][r]);
      }
      best[l][r] += pre[r] - pre[l - 1];
    }
  }

  cout << best[1][n] << endl;

  return 0;
}


Measured memory_bytes: 4928
//PDF解説に倣って
#include<bits/stdc++.h>
using namespace std;

int64_t modinv(int64_t a, int64_t m){
	int64_t b=m, u=1, v=0;
	while (b){
		int64_t t=a/b;
		a-=t*b; swap(a,b);
		u-=t*v; swap(u,v);
	}
	u%=m;
	if (u<0) u+=m;
	return u;
}

int main(){
  int x,y,M=1e9+7;
  cin>> x >> y;
  int n=(2*y-x)/3,m=(2*x-y)/3;
  if ((x+y)%3!=0 || n<0 || m<0){
    cout<< 0 <<endl;
    return 0;
  }
  int64_t a=1,b=1;
  for (int i=n+m; i>max(n,m); i--) a=a*i%M;
  for (int i=min(n,m); i>0; i--) b=b*i%M;
  cout<< a*modinv(b,M)%M <<endl;
}
//modの逆元を学んだ

Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;


public class Main {

    int N;
    int[] a;

    private void solve() {
        N = nextInt();
        a = new int[N];

        TreeMap<Integer,Integer> map = new TreeMap<>();
        for(int i = 0;i < N;i++) {
            a[i] = nextInt();
            if(map.containsKey(a[i])) {
                map.put(a[i], map.get(a[i]) + 1);
            } else {
                map.put(a[i], 1);
            }
        }

        int ans = 0;

        for(int key : map.keySet()) {
            int value = map.get(key);
            if (value < key) {
                ans += value;
            } else if(value > key) {
                ans += value - key;
            }
        }

        out.println(ans);
    }

    public static void main(String[] args) {
        out.flush();
        new Main().solve();
        out.close();
    }

    /* Input */
    private static final InputStream in = System.in;
    private static final PrintWriter out = new PrintWriter(System.out);
    private final byte[] buffer = new byte[2048];
    private int p = 0;
    private int buflen = 0;

    private boolean hasNextByte() {
        if (p < buflen)
            return true;
        p = 0;
        try {
            buflen = in.read(buffer);
        } catch (IOException e) {
            e.printStackTrace();
        }
        if (buflen <= 0)
            return false;
        return true;
    }

    public boolean hasNext() {
        while (hasNextByte() && !isPrint(buffer[p])) {
            p++;
        }
        return hasNextByte();
    }

    private boolean isPrint(int ch) {
        if (ch >= '!' && ch <= '~')
            return true;
        return false;
    }

    private int nextByte() {
        if (!hasNextByte())
            return -1;
        return buffer[p++];
    }

    public String next() {
        if (!hasNext())
            throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = -1;
        while (isPrint((b = nextByte()))) {
            sb.appendCodePoint(b);
        }
        return sb.toString();
    }

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

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

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}

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

int main(){
  int N;
  int x;
  int a[100];
  
  scanf("%d%d",&N,&x);
  for(int n=0;n<N;n++)
    scanf("%d",&a[n]);
  
  sort(&a[0],&a[N]);
  int sum=0;
  int n;
  for(n=0;n<N;n++){
    sum+=a[n];
    if(sum>x)break;
  }
  if(sum<x)n--;
  printf("%d\n",n);
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <list>
#include <utility>
#include <tuple>
#include <cstdio>
#include <set>
#include <queue>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <cmath>
#define _GLIBCXX_DEBUG
using namespace std;
const long long INF = 1LL << 60;
int main() {
    long long H, W;
    cin >> H >> W;
    long long ans ;
    if((H==1)||(W==1)){
        ans= 1;
    }
    else{
            // 1
        if((H%2==0)&&(W%2==0)){
            ans = (H*W/2) ;
        }
        // 2
        else if((H%2==1)&&(W%2==0)){
            ans = (H-1)*(W/2);
            ans = ans + W/2;
        }
        // 3
        else if((H%2==0)&&(W%2==1)){
            ans = (H/2)*(W-1);
            ans = ans + H/2;
        }
        // 4
        else {
            ans = ((H-1)/2)*(W-1);
            ans = ans + (H-1)/2 ;
            ans = ans + (W-1)/2 ;
            ans = ans + 1;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3524
import std.stdio;
import std.string;
import std.conv;
import std.math;

int main() {
    auto digit = 0;
    string buf;
    while ((buf = strip(readln())) != null) {
        digit = calc_digit(buf);
        writeln(calc_digit(buf));
    }

    return 0;
}

int calc_digit(string src) {
    string[] seed = split(src);
    int sum = to!(uint)(seed[0]) + to!(uint)(seed[1]);
    uint digit = 0;

    while (pow(10, digit) <= sum) {
        digit += 1;
    }

    return digit;
}

Measured memory_bytes: 1060
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
const double EPS = 1e-9;
#define INF (1LL<<60)
#define D double
#define fs first
#define sc second
#define int long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for(int i = (b-1);i>=(a);--i)
#define REP(i,n)  FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " << 
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

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

  int n;
  cin >> n;

  vector<int> h(n);
  REP(i,n) cin >> h[i];
  
  int max = 0;
	int ans = 0;

	REP(i,n){
  	if(h[i] >= max){
			ans ++;
			max = h[i];
  	}
	}

	cout << ans << endl;

  return 0;
}

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

using namespace std;

int main()
{
  string s; int k; cin >> s >> k;
  int len = s.length();
  int a[105]; for (int i = 0; i < len; ++i) a[i] = s[i] - '0';
  
  long long dp[105][5][2] = {}; dp[0][0][0] = 1;
  for (int i = 0; i < len; ++i)
    for (int j = 0; j <= 3; ++j) {
      dp[i+1][j+1][1] += dp[i][j][1]*9;
      dp[i+1][j][1] += dp[i][j][1];
      if (a[i] == 0)
        dp[i+1][j][0] += dp[i][j][0];
      else {
        dp[i+1][j+1][0] += dp[i][j][0];
        dp[i+1][j+1][1] += dp[i][j][0]*(a[i]-1);
        dp[i+1][j][1] += dp[i][j][0];
      }
    }
  
  cout << dp[len][k][0] + dp[len][k][1] << endl;
  return 0;
}

Measured memory_bytes: 256
MOD=10**9+7
n, k = map(int, input().split())
a = list(map(int, input().split()))
n = len(a)
li = [0] * 2001
t1 = 0
for i in range(n):
  for j in range(i + 1, n):
    if a[i] > a[j]:
      t1 += 1
for x in a:
  li[x] += 1
t2 = 0
for i in range(2000):
  t2 += li[i + 1] * li[i]
  li[i + 1] += li[i]
print((t1 * k + t2 * k * (k - 1) // 2) % MOD)

Measured memory_bytes: 3316
((input) => {
  const data = input.split('\n');
  const line1 = data[0].split(' ');
  const N = +line1[0];
  const D = +line1[1];
  const coords = data.slice(1, N + 1).map((line) => line.replace(/\s\s/g, ' ').split(' ').filter(Boolean).map(Number));
 
  console.log(
    coords.reduce((total, coord1, i) => (
      total + coords.slice(i + 1).reduce((count, coord2) => (
        Number.isInteger(distance(coord1, coord2, D)) ? count + 1 : count
      ), 0)
    ), 0)
  );
})(
  require("fs").readFileSync("/dev/stdin", "utf8")
);
 
function distance(coords1, coords2, D) {
  var sum = 0;
  for (var i = 0; i < D; i += 1) {
    sum += Math.pow(coords1[i] - coords2[i], 2);
  }
  return Math.sqrt(sum);
//  return Math.hypot.apply(null, Array(D).fill(null).map((_, i) => (
//    coords1[i] - coords2[i]
//)));
}


Measured memory_bytes: 7372
#include <iostream>
#include <vector>

using namespace std;

int main(){
	int h, w, i, j, k;//horizontal, vertical
	cin >> h >> w;
    vector<vector<char>> a;
    for(i=0;i<h;i++){
    	vector<char> sub_a(w);
		a.push_back(sub_a);
		for(j=0;j<w;j++){
			cin >> a[i][j];
		}
    }

    bool whiteOnly;

    //horizontal
    for(i=0;i<h;i++){
		whiteOnly = true;
		for(j=0;j<w;j++){
			if(a[i][j]=='#'){
				whiteOnly = false;
				break;
			}
		}
		if(whiteOnly){
			a.erase(a.begin()+i);
			h = h-1;
			i--;
		}
    }

    //vertical
    for(j=0;j<w;j++){
		whiteOnly = true;
		for(i=0;i<h;i++){
			if(a[i][j]=='#'){
				whiteOnly = false;
				break;
			}
		}
		if(whiteOnly){
			for(k=0;k<h;k++){
				a[k].erase(a[k].begin()+j);
			}
			w = w-1;
			j--;
		}
    }

    for(i=0;i<(int)a.size();i++){
		for(j=0;j<(int)a[i].size();j++){
			cout << a[i][j];
			if(j+1==(int)a[i].size()){
				cout << endl;
			}
		}
    }

	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<stdio.h>
#include<cstring>
#include<math.h>
#include<map>
#include<bitset>
#include<iomanip>
#include<queue>
#include<functional>
#include<stack>
#include<tuple>
#include<cassert>
using namespace std;

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

long long N, K;
long long P[5000];
long long C[5000];
vector<long long> v[5000];
const long long INF = 1000000000;

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

  rep(i, N) {
    long long temp = 0;
    long long ni = i;
    while(true) {
      ni = P[ni];
      // cout << ni << endl;
      temp += C[P[ni]];
      v[i].push_back(temp);
      if(ni == i) break;
    }
  }


  // rep(i, N) {
  //   rep(j, v[i].size()) {
  //     cout << v[i][j] << " ";
  //   }
  //   cout << endl;
  // }

  long long ans = -INF;

  rep(i, N) {
    if(v[i][v[i].size()-1] <= 0) {
      long long temp = v[i][0];
      long long end = v[i].size();
      if(v[i].size() >= K) {
        end = K;
      }
      rep(j, end) {
        temp = max(temp, v[i][j]);
      }
      ans = max(ans, temp);
      // cout << temp << endl;
    } else {
      if(K > v[i].size()) {
        long long temp = 0;
        long long tans = v[i][0];
        long long end = K % v[i].size();
        if(end == 0) end = v[i].size();
        temp = v[i][v[i].size()-1] * ((K-1) / v[i].size());

        for(long long j = 0; j < v[i].size(); j++) {
          if(j < end) {
            tans = max(tans, v[i][end-1-j] + temp);
          } else {
            tans = max(tans, v[i][end-1-j+v[i].size()] + temp - v[i][v[i].size()-1]);
          }
        }
        ans = max(ans, tans);
        // cout << "ここ" << tans << endl;
      } else {
        long long tans = v[i][0];
        rep(j, K) {
          tans = max(tans, v[i][j]);
        }
        ans = max(ans, tans);
        // cout << "こっち" << tans << endl;
      }
    }
  }

  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 218788
#include <cstring>
#include <cstdint>
#include <iostream>
#include <string>
#include <memory>
#include <queue>
#include <limits>
#include <list>
#include <utility>
#include <sstream>
#include <random>
using namespace std;
int main() {
	int N,T;
	int t0,t1;
	cin >> N >> T;
	long long result;
	long long fin_time =0;
	long long last_push =0;
	cin >> t0;
	result = T;
	for (int i = 1; i < N; i++)
	{
		cin >> t1;
		result += min(t1- t0, T);
		t0 = t1;
	}
	cout << result;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define FORR(i,a,b) for (int i=(a);i>=(b);i--)
#define pb push_back
#define pcnt __builtin_popcount
#define show(x) cout<<#x<<" = "<<x<<endl;
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define fi first
#define se second
#define rng(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define sz(x) (int)(x).size()
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
typedef set<int> si;
typedef pair<ll,ll> pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<pll> vpll;
typedef set<ll> sl;
typedef __int128_t lll;
typedef pair<lll,lll> plll;
typedef vector<lll> vlll;
template<typename T>string join(vector<T>&v)
{stringstream s;FOR(i,0,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename A, size_t N, typename T>void Fill(A (&array)[N], const T&v)
{fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0; return gcd(a, b, x, y);}
ll modpow(lll a,lll n,ll m){if(a==0)return a;lll p=1;for(;n>0;n/=2,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
void dout(double d){printf("%.12f\n",d);}
void YN(bool z){cout<<(z?"YES\n":"NO\n");}
void Yn(bool z){cout<<(z?"Yes\n":"No\n");}
void yn(bool z){cout<<(z?"yes\n":"no\n");}

const int iinf = 1e9;
const ll linf = 1e18;
const int mod = 1e9+7;
const double pi = acos(-1);
const double eps = 1e-10;
const int N = 0;
map<int, int> m[2];
int n, v;
vpii vv[2];
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  FOR(i, 0, n){
    cin >> v;
    m[i%2][v]++;
  }
  FOR(i, 0, 2){
    m[i][-1] = 0;
    each(itr, m[i]) vv[i].pb(pii(itr->se, itr->fi));
    sort(rng(vv[i]));
    reverse(rng(vv[i]));
  }
  int ans;
  if(vv[0][0].se != vv[1][0].se){
    ans = vv[0][0].fi + vv[1][0].fi;
  }else{
    ans = max(vv[0][0].fi + vv[1][1].fi, vv[0][1].fi + vv[1][0].fi);
  }
  cout << n-ans << endl;
  return 0;
}

Measured memory_bytes: 6140
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) rep(i,v.size())cout<<" "<<v[i];cout<<endl<<endl;
#define show2d(v) rep(i,v.size()){rep(j,v[i].size())cout<<" "<<v[i][j];cout<<endl;}cout<<endl;
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
// #define mt make_tuple
// typedef tuple<int,int,int> tp;
// typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1,1,1,-1,-1};
int dy[]={1,0,-1,0,1,-1,1,-1};//RDLU
int t;
string s;
map<string,int>ma;
bool h;
int di(){
	int a=0;
	while(t<s.size()&&isdigit(s[t])){
		a*=10;
		a+=s[t]-'0';
		t++;
	}
	return a;
}
int f(){
	int sum=0;
	while(t<s.size()){
		if(s[t]==')')break;
		if(s[t]=='('){
			t++;
			int c=f();
			t++;
			int bai=di();
			if(bai)c*=bai;
			sum+=c;
		}else{
			string n="";
			n+=s[t];
			t++;
			if(islower(s[t])){
				n+=s[t];
				t++;
			}
			int c=ma[n];
			if(c==0)h=false;
			int bai=di();
			if(bai)c*=bai;
			sum+=c;
			
		}
	}
	return sum;
}
int main(){
	while(cin>>s,s.size()<4){
		int a;
		cin>>a;
		ma[s]=a;
	}
	while(cin>>s,s!="0"){
		t=0;
		h=true;
		int out=f();
		if(!h)cout<<"UNKNOWN"<<endl;
		else cout<<out<<endl;
	}
}
/*
int n;
vvi in;
map<pii,int>ma;
bool dfs(int a){
	rep(i,n+1){
		if(i==n)return true;
		if(in[i][3]==0){
			
		}
	}
}
int main(){
	while(cin>>n,n){
		in=vvi(n,vi(4));
		ma.clear();
		rep(i,n){
			int a,b;
			char c;
			cin>>a>>b>>c;
			in[i]={a,b,c=='y',0};
			ma[{a,b}]=i+1;
			if(c=='x')a++;
			else b++;
			ma[{a,b}]=i+1;
		}
		if(dfs(0))cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
}
*/









Measured memory_bytes: 3080
#include<bits/stdc++.h>
const int N=1e5+10;
const int inf=0x3f3f3f3f;
using namespace std;
int dp[N],v[N],w[N];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	int n,m,i,j;
	cin>>n>>m;
	for(i=1;i<=m;i++)
		cin>>v[i]>>w[i];
	memset(dp,inf,sizeof(dp));
	dp[0]=0;
	for(i=1;i<=m;i++)
		for(j=1;j<=2e4;j++)
			if(j-v[i]>=0)
				dp[j]=min(dp[j],dp[j-v[i]]+w[i]);
	int ans=inf;
	for(i=n;i<=2e4;i++)
		ans=min(ans,dp[i]);
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 640
#include<stdio.h>
int main(void){
  int n,i,k;
  int a[200000];
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  k=1;
  i=0;
  while(i<n){
    if(a[i]==k){
      k++;
    }
    i++;
  }
  if(k==1)
    printf("-1\n");
  else
    printf("%d\n",n-k+1);
  return 0;
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
typedef long long ll; //10^19 < 9223372036854775807
typedef unsigned long long ull; //10^20 < 18446744073709551615


int main(){
  int n; cin>>n;
  vector<int> a(n);
  set<int> check;
  rep(i,n) {
    int ai;
    cin>>ai;
    a.at(i)=ai;
    check.insert(ai);
  }
  
  if(check.size()==a.size()){
    cout<<"YES";
  } else {
    cout<<"NO";
  }
}

Measured memory_bytes: 13552
#include<map>
#include<cmath>
#include<stack>
#include<queue>
#include<cstdio>
#include<vector>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
template<class Read>void in(Read &x){
    x=0;
    int f=0;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
        f|=(ch=='-');
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        x=(x<<1)+(x<<3)+(ch^48);
        ch=getchar();
    }
    x=f?-x:x;
    return;
}
map<int,bool>g;
int n;
int main(){
    in(n);
    while(n--){
        int x;
        in(x);
        if(!g[x])g[x]=1;
        else{
            puts("NO");
            return 0;
        }
    }
    puts("YES");
    return 0;
}


Measured memory_bytes: 9600
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define FOR(i,start,end) for(int i=start;i<=end;i++)
const int INF = 1001001001;
using namespace std;
typedef long long ll;

int main()
{
  int N, M;
  char a[51][51], b[51][51];
  int res=0;
  cin >> N >> M;

  rep(i,N) cin >> a[i];
  rep(i,M) cin >> b[i];

  FOR(j,0,N-M){
    FOR(i,0,N-M){
      bool match=true;
      rep(m,M){
        rep(n,M){
          if(a[i+n][j+m] != b[n][m])match=false;
        }
      }
      if(match) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }

  cout << "No" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    string a, b, c;
    cin >> a >> b >> c;

    char ans[3];
    ans[0] = toupper(a[0]);
    ans[1] = toupper(b[0]);
    ans[2] = toupper(c[0]);
    cout << ans[0] << ans[1] << ans[2] << endl;

}

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

class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(br.readLine());

        int N = Integer.parseInt(st.nextToken());

        String S = br.readLine();

        int ans=0;
        int init=0;
        for (int i=0; i<N; i++){
            if(S.charAt(i)=='I'){
                init++;
                ans = Math.max(ans, init);
            }
            else
                init--;
        }

        System.out.println(ans);
    }
}


Measured memory_bytes: 23124
W, H, N = map(int, input().split())
w, h = 0, 0

for _ in range(N):
	x, y, a = map(int, input().split())
	if a == 1:
		if w < x:
			w = x
	elif a == 2:
		if W > x:
			W = x
	elif a == 3:
		if h < y:
			h = y
	elif a == 4:
		if H > y:
			H = y

if W-w < 0 or H-h < 0:
	print(0)
else:
	print((W-w)*(H-h))

Measured memory_bytes: 3064
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define P pair<int, int>
#define rep(i,n)         for(int i=0; i<(n); i++)
#define prtd(n, var)     cout << fixed << setprecision(n) << var << "\n"

//----------------------------------------------------

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    int A = a*10+b+c;
    int B = a+b*10+c;
    int C = a+b+c*10;
    int ans = max(A, B);
    ans = max(ans, C);
    cout << ans << endl;
}

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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef set<int> si;
typedef map<string, int> msi;

#define rep(i, n) \
for(int i = 0; i <n; i++)
#define REP(i, a, b) \
for(int i = int(a); i <= int(b); i++)
#define TRvi(c, it) \
for(vi::iterator it = (c).begin(); it != (c).end(); it++)
#define TRvii(c, it) \
for(vii::iterator it = (c).begin(); it != (c).end(); it++)
#define TRmsi(c, it) \
for(msi::iterator it = (c).begin(); it != (c).end(); it++)

#define INF 2000000000

#define MEMSET_INF 127
#define MEMSET_HALF_INF 63

void solve(){
    int n;
    cin>>n;
    map<string, int> mp;
    mp["AC"] = 0;
    mp["WA"] = 0;
    mp["TLE"] = 0;
    mp["RE"] = 0;
    string s;
    rep(i,n){
        cin>>s;
        mp[s]+=1;
    }
    cout<<"AC"<<' '<<"x"<<' '<<mp["AC"]<<endl;
    cout<<"WA"<<' '<<"x"<<' '<<mp["WA"]<<endl;
    cout<<"TLE"<<' '<<"x"<<' '<<mp["TLE"]<<endl;
    cout<<"RE"<<' '<<"x"<<' '<<mp["RE"]<<endl;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
    return 0;
}


Measured memory_bytes: 3608
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cassert>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#include <set>
#include <map>
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), cout << fixed << setprecision(20);
#define rep(i,n) for (int i=0; i<n;++i)
#define ALL(a)  (a).begin(),(a).end()
#define PI 3.14159265358979
typedef long long ll;
using namespace std;
const ll MOD = 1e9+7LL;
const int INF = 2e9;
int N, A[200005];

ll calc() {
  int left=0;
  int right=0;
  int B=0;
  ll cnt=0;
  while(left<N && right<N) {
    assert(left<=right);
    bool ok=true;
    rep(i, 20) {
      int mask = 1<<i;
      int a = A[right]&mask;
      int b = B&mask;
      if (a&b) {
        ok = false;
        break;
      }
    }
    if (right<N-1 && ok) {
      B = B^A[right];
      right++;
    } else {
      cnt+=right-left;
      if (ok) cnt++;
      left++;
      if (right==left) B=0;
      else {
        if (left==N) break;
        rep(i, 20) {
          int mask = 1<<i;
          if (A[left-1]&mask) {
            assert(B&mask);
            B-=mask;
          }
        }
      }
    }
  }
  return cnt;
}

int main() {
  INCANT;
  cin >> N;
  rep(i, N) cin >> A[i];
  cout << calc() << "\n";
  return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

typedef long long ll;

ll gcd(ll x, ll y){
  if(y == 0) return x;
  return gcd(y,x%y);
}

const int MAX_N = 1e5 + 10;

int main(int argc, char const *argv[])
{
    int n;
    cin >> n;
    ll A[MAX_N];
    for (int i = 0; i < n; ++i) scanf("%lld", &A[i]);

    ll x = A[0];
    
    for (int i = 0; i < n; ++i) {
        x = gcd(x, A[i]);
    }

    cout << x << endl;

    return 0;
}

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

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

    int num[3];
    int k;

    cin >> num[0] >> num[1] >> num[2] >> k;
    sort(num, num + 3);

    cout << num[2] * pow(2, k) + num[0] + num[1] << endl;
    return 0;
}


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

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

Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define endl '\n'
#define all(a) (a).begin(), (a).end()
#define len(a) (int) (a).size()
#define forn(i, n) for (int (i) = 0; (i) < (n); ++(i))
#define int long long
using namespace std;
void solve();
mt19937 rnd(2007);
signed main(){
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
    swap(rng, rnd);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    solve();
}

void solve() {
    int s, w; cin >> s >> w;
    if (s <= w)
        cout << "unsafe" << endl;
    else
        cout << "safe" << endl;
}


Measured memory_bytes: 3668