akhauriyash/Code-Regression huggingface dataset:
#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
constexpr ll INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
constexpr ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
ll n, cnt, ans, a[100][100], b[ohara], c, d, tmp, m, h, w, x, y, sum, k, q;

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

  cin >> n >> m >> c;
  rep(i, m) cin >> b[i];
  rep(i, n) rep(j, m) cin >> a[i][j];

  rep(i, n) {
    cnt = 0;
    rep(j, m) { cnt += a[i][j] * b[j]; }
    cnt += c;
    if (cnt > 0) ans++;
  }
  Cout(ans);
  return 0;
}

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

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

typedef long long ll;
using namespace std;
int mod = 1000000007;

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(void){
    COMinit();
    int N; cin >> N;
    int cnt[N+1];
    rep(i, N+1) cnt[i] = -1;
    pair<int, int> same;
    rep(i, N+1){
        int a; cin >> a;
        if(cnt[a] == -1) cnt[a] = i;
        else{
            same.first = cnt[a];
            same.second = i;
        }
    }
    int a = same.first;
    int b = N - same.second;
    for(int k = 1; k <= N+1; k++){
        ll ans = COM(N+1, k);
        ll kaburi = COM(a+b, k-1);
        ans -= kaburi;
        if(ans < 0) ans += mod;
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 13568
#include<bits/stdc++.h>
using namespace std;
 
const int N = 3e3 + 20;
long double a[N], dp[N][N];
 
int main()
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++)
	{
		cin >> a[i];
	}
	dp[0][0] = 1;
	for (int i = 1; i <= n; i++)
	{
		for (int ted = 0; ted <= i; ted++)
		{
			if (ted == 0)
			{
				dp[i][ted] = (1 - a[i]) * dp[i - 1][ted];
				continue;
			}
			dp[i][ted] = dp[i - 1][ted] * (1 - a[i]) + dp[i - 1][ted - 1] * a[i];
		}
	}
	long double maj = 0;
	for (int ted = (n + 1) / 2; ted <= n; ted++)
	{
		maj += dp[n][ted];
	}
	cout << fixed << setprecision(10) << maj;
}


Measured memory_bytes: 85604
N,M,Q = map(int,input().split())
src = [tuple(map(int,input().split())) for i in range(M)]
qs = [tuple(map(int,input().split())) for i in range(Q)]

imos = [[0]*(N+1) for i in range(N+1)]
for l,r in src:
    imos[l][r] += 1
for i in range(N+1):
    for j in range(N):
        imos[i][j+1] += imos[i][j]
for i in range(N):
    for j in range(N+1):
        imos[i+1][j] += imos[i][j]

ans = []
for p,q in qs:
    ans.append(imos[q][q] - imos[q][p-1] - imos[p-1][q] + imos[p-1][p-1])
print(*ans, sep='\n')

Measured memory_bytes: 49948
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int A,B,C;
    cin>>A>>B>>C;
    if(A==B){cout<<C;return 0;}
    else{
      if(A==C){cout<<B;return 0;}
        else{cout<<A;return 0;}
    }
    return 0;

}

Measured memory_bytes: 256
#include <stdio.h>
char s[1001];
char t[1001];
int w, x, y, z;
int main() {
	scanf(" %s", s);
	scanf(" %s", t);
	while (s[x] != NULL)x++;
	while (t[y] != NULL)y++;
	w = y;
	for (int i = 0; i <= x - y; i++) {
		z = 0;
		for (int j = 0; j < y; j++) {
			if (s[i + j] != t[j])z++;
		}
		if (z < w)w = z;
	}
	printf("%d\n", w);
}

Measured memory_bytes: 1732
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <tuple>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl
#define show2(a, n, m) rep(i, n) { rep(j, m) {cout << a[i][j] << ' ';} cout << endl;} 
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<long long, long long> pll;
typedef long double ld;

const int INF = 1 << 30;
const long long INFL = 1LL << 60;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100010;

int main() {
	cout << fixed << setprecision(15);
	ld a, b, x;
	cin >> a >> b >> x;
	ld ans;
	if(x * 2.0 + 1e-20 < a * a * b) {
		ans = atan(a * b * b / (2.0 * x));
	}
	else {
		ans = atan(2 * b / a - 2 * x / pow(a, 3.0));
	}
	cout << ans * 180.0 / M_PI << endl;
}


Measured memory_bytes: 384
#include<stdio.h>
int main(){
	int a,b;
	char op;
	while(op!='?'){
		scanf("%d %c %d",&a,&op,&b);
		if(op=='+'){
			printf("%d\n",a+b);
		}
		if(op=='-'){
			printf("%d\n",a-b);
		}
		if(op=='*'){
			printf("%d\n",a*b);
		}
		if(op=='/'){
			printf("%d\n",a/b);
		}
	}
	return 0;
}

Measured memory_bytes: 1028
#include <bits/stdc++.h> 
#define ll long long
#define ull unsigned long long
#define endl '\n'
#define pb push_back
#define mp make_pair
#define sp(x) fixed<<setprecision(x)
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
ll mod = 1e9+7;

ll dp[22][(1<<22)];
int solve(vector<vector<int>>& compat, int i, int womenSubset, int N)
{
    if(i == N+1)
    {
        if(womenSubset == 0)
            return 1;
        return 0;
    }

    if(dp[i][womenSubset] != -1)
        return dp[i][womenSubset];
    ll ans = 0;
    for(int women = 0; women < N; women++)
    {
        bool available = (((1<<women)&(womenSubset)) == 0) ? 0 : 1;
        if(available && compat[i][women + 1])
        {
            ans = (ans + solve(compat, i+1, womenSubset ^ (1<<women), N)) % mod;
        }
    }
    return dp[i][womenSubset] = ans;
}

int main() {
   int n;
   cin >> n;
   vector<vector<int>> compat(n+1, vector<int>(n+1));
   memset(dp, -1, sizeof dp);
   for(int i = 1; i<=n; i++)
        for(int j = 1; j <= n; j++)
            cin >> compat[i][j];
   cout<<solve(compat, 1, ((1<<(n)) - 1), n);
   return 0;
}


Measured memory_bytes: 721152
import java.util.*;
public class Main{

  public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      int h = sc.nextInt();
      int w = sc.nextInt();
      
      char[][] chars = new char[h][w];
      
      for(int i = 0; i < h; i++) {
          chars[i] = sc.next().toCharArray();
      }

      int[] rows = new int[] { 1, -1, 0, 0, 1, -1, 1, -1};
      int[] cols = new int[] { 0, 0, -1, 1, -1, -1, 1, 1};
      for(int i = 0; i < h; i++) {
          for(int j = 0; j < w; j++) {
              int row = i;
              int col = j;
              
              if(chars[row][col] == '#') continue;
              int cnt = 0;
              for(int k = 0; k < 8; k++)  {
                  int nextRow = row + rows[k];
                  int nextCol = col + cols[k];
                  if(0 <= nextRow && nextRow < h && 0 <= nextCol && nextCol < w && chars[nextRow][nextCol] == '#')
                    cnt++;
              }
              chars[row][col] = (char)(cnt + '0');
          }
      }
      for(int i = 0; i < h; i++)
        System.out.println(new String(chars[i]));
  }
}



Measured memory_bytes: 23508
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int N = scanner.nextInt();
		int counter = 0;
		String output = "";
		
		if(N==0) {
			output = "0";
		}
		
		while(N!=0) {
			if((N-1)%(-2)==0) {
				output = "1" + output;
				N = (N-1)/(-2);
			} else {
				output = "0" + output;
				N = N/(-2);
			}
		}
		
		System.out.println(output);
		
		
	}

}

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

int n;
double arr[3001], dp[3001][3001];
//dp[konum][head_sayi]
int main(void){
	cout.precision(10);
	cin>>n;
	for(int i=0;i<n;i++)cin>>arr[i];
	dp[0][1]=arr[0];
	dp[0][0]=1-arr[0];
	for (int i = 1; i < n; ++i){
		for (int j = 0; j <= i+1; ++j){
			if(j>0)
				dp[i][j]=dp[i-1][j-1]*arr[i]+dp[i-1][j]*(1-arr[i]);
			else
				dp[i][j]=dp[i-1][j]*(1-arr[i]);
		}
		dp[i][i+1]=dp[i-1][i]*arr[i];
	}double cvp=0;
	for(int i=(n+1)/2;i<=n;i++)cvp+=dp[n-1][i];
		cout<<cvp;
	return 0;
}

Measured memory_bytes: 68864
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in Actual solution is at the top
 *
 * @author Silviase
 */
public class Main {

  public static void main(String[] args) {
    InputStream inputStream = System.in;
    OutputStream outputStream = System.out;
    Scanner in = new Scanner(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    CID solver = new CID();
    solver.solve(1, in, out);
    out.close();
  }

  static class CID {

    public void solve(int testNumber, Scanner in, PrintWriter out) {
      int n = in.nextInt();
      int m = in.nextInt();
      InTriple[] tri = new InTriple[m];
      String[] res = new String[m];
      for (int i = 0; i < m; i++) {
        tri[i] = new InTriple(in.nextInt(), in.nextInt(), i);
      }

      Arrays.sort(tri, (tri1, tri2) -> {
        if (tri1.x - tri2.x != 0) {
          return tri1.x - tri2.x;
        }
        if (tri1.y - tri2.y != 0) {
          return tri1.y - tri2.y;
        }
        return 0;
      });

      int index = 1;
      for (int i = 0; i < m; i++) {
        if (i == 0 || tri[i].x != tri[i - 1].x) {
          index = 1;
        }
        res[tri[i].z] = String.format("%06d%06d", tri[i].x, index);
        index++;
      }

      StringBuilder sb = new StringBuilder();
      for (int i = 0; i < m; i++) {
        sb.append(res[i] + "\n");
      }
      System.out.println(new String(sb));
    }

  }

  static class InTriple {

    int x;
    int y;
    int z;

    public InTriple(int x, int y, int z) {
      this.x = x;
      this.y = y;
      this.z = z;
    }

    public String toString() {
      return "(" + this.x + ", " + this.y + ", " + this.z + ")";
    }

  }
}



Measured memory_bytes: 166496
n, m=map(int, input().split())
s=[]
for i in range(m):
    inp=input().split()
    k=int(inp[0])
    tmp=[]
    for i in range(k):
        tmp.append(int(inp[i+1]))
    s.append(tmp)
p=list(map(int, input().split()))
result=0
for i in range(2**n):
    switch=[]
    flag=1
    for j in range(n):
        if (i>>j)&1:
            switch.append(1)
        else:
            switch.append(0)
    for j in range(m):
        sum=0
        for k in range(len(s[j])):
            sum=sum+switch[s[j][k]-1]
        if sum%2!=p[j]:
            flag=0
    if flag:
        result=result+1
print(result)


Measured memory_bytes: 42736
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); ++i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define fi first
#define se second
#define INF 1000000009
#define LLINF 1000000000000000009LL
using ll = long long;

int main(){
  string s,t;
  cin>>s>>t;
  bool ok=true;
  rep(i,s.size()){
    if(s[i]!=t[i])ok=false;
  }
  if(ok)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return(0);
}


Measured memory_bytes: 3624
lst = list()
for i in range(0, 6):
    a = int(input())
    lst.append(a)

cnt = 0

for i in range(1,len(lst)-1):
    diff = abs(lst[0] - lst[i])
    if diff > lst[-1]:
        cnt += 1
        print(':(')
        break

if cnt > 0:
    pass
else:
    for i in range(2, len(lst)-1):
        diff = abs(lst[1] - lst[i])
        if diff > lst[-1]:
            cnt += 1
            print(':(')
            break

if cnt > 0:
    pass
else:
    for i in range(3, len(lst)-1):
        diff = abs(lst[1] - lst[i])
        if diff > lst[-1]:
            cnt += 1
            print(':(')
            break

if cnt > 0:
    pass
else:
    for i in range(4, len(lst)-1):
        diff = abs(lst[1] - lst[i])
        if diff > lst[-1]:
            cnt += 1
            print(':(')
            break

if cnt == 0:
    print('Yay!')

Measured memory_bytes: 3064
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>

using namespace std;

int main()
{
	int v[6],min=10;
	int ans=0;

	for(int i=0;i<5;i++){
		cin >> v[i];
		ans = ans + ((v[i]+9)/10)*10;
		if(v[i]%10 != 0 && min > v[i]%10) min = v[i]%10;
	}

	ans = ans + min - 10;
	
	cout << ans << endl;
	
	
	return 0;
}
				

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

int main(){
  int N, dom;
  cin >> N;
  
  vector<int> ans(N + 1, 0);
  
  for (int i = 1; i <= N; i++){
    for (int j = i; j <= N; j++){
      for (int k = j; k <= N; k++){
        dom = i*i + j*j + k*k + i*j + i*k + j*k;
        if (dom > N){
          break;
        }
        
        if (i == j && j == k){
          ans.at(dom) += 1;
        }
        else if (i == j || j == k || i == k){
          ans.at(dom) += 3;
        }
        else{
          ans.at(dom) += 6;
        }
      }
    }
  }
  
  for (int i = 1; i <= N; i++){
    cout << ans.at(i) << endl;
  }
}

Measured memory_bytes: 3524
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define ll long long
#define maxn 1000005
#define inf 1e9
#define pb push_back
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
using namespace std;

inline int read()
{
	int x=0,w=1; char c=getchar();
	while(c<'0'||c>'9') {if(c=='-') w=-1; c=getchar();}
	while(c<='9'&&c>='0') {x=(x<<1)+(x<<3)+c-'0'; c=getchar();}
	return w==1?x:-x;
}

int a[maxn];

int main()
{
	int n=read(),t=0; rep(i,1,n) a[i]=read(),t^=a[i];
	rep(i,1,n) printf("%d ",t^a[i]);
	return 0;
}

Measured memory_bytes: 4408
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;
//#define EPS 1E-6
int main()
{
//	cut here before submit 
//	freopen("testcase.tr", "r", stdin);
	string str = "";
	while (getline (cin, str ) ){
		double q;
		stringstream ss(str);
		ss >> q;
		if (q == -1.0){
			break;
		} // end if

		double x = q/2.;

//		cout << "x: " << x << endl;
		while (fabs (x*x*x - q) >= 0.00001*q  ){
			double y = (x*x*x - q)/(3.*x*x);
			x = x - y;
//			cout << "x: " << x << endl;
//			printf ("x: %.6f\n", x);
		} // end while

		printf ("%.6f\n", x);

//		cout << x << endl;

	} // end loop

//	cout << res << endl;	
		
	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;
signed main(){
    int left = 0;
    int right = 0;
    int n, t; cin >> n >> t;
    int ans = 0;
    for(int i=0; i<n; ++i){
        int tmp;
        cin >> tmp;
        if(tmp >= right){
            ans += right - left;
            left = tmp;
        }
        right = tmp + t;
    } 
    ans += right -left;
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long 
#define f(i,x,n) for(int i=x;i<n;i++) 
#define all(c) c.begin(),c.end()
const int MOD = 1e9 + 7, N = 5e5 + 10;
const int LINF = LLONG_MAX;

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin >> s;
    int c = 0;
    for(char ch : s){
        c += (ch - '0');
    }
    cout << (c%9 == 0? "Yes" : "No");
    return 0;
}
 

Measured memory_bytes: 3744
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define N 100000
typedef long long ll;
int main(){
	string s;
	cin>>s;
	int i=0;
	ll sum=0;
	ll ans=s.size();
	while(i<s.size()-1){
		if(s.at(i)==s.at(i+1)){
			sum++;
			i+=2;
		}
		i++;
	}
	cout<<(ans-sum)<<endl;
	return 0;
}

Measured memory_bytes: 640
var
  flag:boolean;
  da,sl:int64;
  hs:array[1..2] of int64;
  x,y,n,u,m,i:longint;
  hd,nx,t,ys:array[0..200100] of longint;
  procedure jb(x,y:longint);
    begin
      u:=u+1;
      nx[u]:=hd[x];
      hd[x]:=u;
      t[u]:=y;
    end;
  function ss(q,sc:longint):boolean;
    var
      i:longint;
      cg:boolean;
    begin
      ys[q]:=sc;
      sl:=sl+1;
      hs[sc]:=hs[sc]+1;
      cg:=true;
      i:=hd[q];
      while i<>0 do
        begin
          if (ys[t[i]]=0)and(ss(t[i],3-sc)=false) then cg:=false;
          if ys[t[i]]=sc then
            begin
              cg:=false;
              flag:=false;
            end;
          i:=nx[i];
        end;
      exit(cg);
    end;
begin
  readln(n,m);
  for i:=1 to m do
    begin
      readln(x,y);
      jb(x,y);
      jb(y,x);
    end;
  for i:=1 to n do
    if ys[i]=0 then
      begin
        hs[1]:=0;
        hs[2]:=0;
        sl:=0;
        flag:=true;
        if ss(i,1)<>flag then writeln('?');
        if flag then da:=da+hs[1]*hs[2]
        else da:=da+sl*(sl-1) div 2;
      end;
  writeln(da-m);
end.

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

int main(){
    int F[44];
    F[0]=1;
    F[1]=1;
    int n;
    cin>>n;
    for(int i=2;i<=n;++i){
        F[i]=F[i-1]+F[i-2];
    }
    cout<<F[n]<<"\n";
}

Measured memory_bytes: 3092
// :)
// "Khodaya, be man "Tagwaye setiz" biamooz ta
//  dar anbuh masuliat nalaghzam ..." -Shariati
#include <bits/stdc++.h>

using namespace std;
typedef long long int64;
typedef pair<int,int> pii;
typedef pair<int64,int64> pii64;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()

const int maxn = 1e5+10;
const int64 MO = 1e9+7;
const int64 IN = 1e9;

int N, K;

int main () {
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	// 
	cin >> N >> K;
	if (K <= N / 2 + N % 2)
		cout << "YES\n";
	else
		cout << "NO\n";
	//
	//
}



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

public class Main {

    private static FastReader in = new FastReader(System.in);
    private static PrintWriter out = new PrintWriter(System.out);

    private static final long MOD = (long) 1e9 + 7;

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

    private static void solve() {
        int n = in.nextInt();
        int[] ans = new int[n];
        for (int i = 0; i < n - 1; i++) {
            int aa = in.nextInt();
            ans[aa - 1]++;
        }
        for (int an : ans) {
            out.println(an);
        }
    }

    // https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        FastReader(InputStream inputStream) {
            br = new BufferedReader(new
                    InputStreamReader(inputStream));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        // https://qiita.com/masakinpo/items/5f77f2a879578a85a0bb
        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

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


Measured memory_bytes: 54156
#include<iostream>
#include<iomanip>
#define TIMES 18
using namespace std;


int main()
{
  int N, K;
  cin >> N >> K;
  int exptwo[TIMES];
  exptwo[0] = 1;
  for(int i = 1; i < TIMES; i++)
    exptwo[i] = exptwo[i - 1] * 2;
  int* prob = new int[N];
  for(int i = 0; i < N; i++)
    prob[i] = N;
  double sum_prob = 0.0;
  for(int i = 0; i < N; i++) {
    for(int j = 0; j < TIMES; j++) {
       if((i + 1) * exptwo[j] >= K) {
           prob[i] *= exptwo[j];
         break;
       }
    }
    sum_prob += 1.0 / prob[i];
  }
  cout << fixed << setprecision(12) << sum_prob << endl;
  delete prob;
  return 0;
}

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

int main(){
  int n, m, x;
  cin >> n >> m >> x;
  int a[m];
  for(int i = 0; i < m; i++) cin >> a[i];
  int num = 0;
  for(int i = 0; i < m; i++){
    if(a[i] > x) num++;
  }
  cout << min(num, m - num) << endl;
  return 0;
}


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

typedef long long ll;
#define ar array
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
#define all(x) (x).begin(), (x).end()
#define en '\n'
#define FILL(x, v) memset(x, v, sizeof(x))
#define pb push_back
#define fast                     \
	ios::sync_with_stdio(false); \
	cin.tie(NULL);               \
	cout.tie(NULL);
#define F_OR(i, a, b, s) for (int i = (a); ((s) > 0 ? i < (b) : i > (b)); i += (s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...)       \
	F_ORC(__VA_ARGS__) \
	(__VA_ARGS__)

#define E_ACH2(x, a) for (auto &x : a)
#define E_ACH3(x, y, a) for (auto &[x, y] : a)
#define E_ACH4(x, y, z, a) for (auto &[x, y, z] : a)
#define E_ACHC(...) GET5(__VA_ARGS__, E_ACH4, E_ACH3, E_ACH2)
#define EACH(...)       \
	E_ACHC(__VA_ARGS__) \
	(__VA_ARGS__)

template <typename A, typename B>
inline void chmin(A &a, B b)
{
	if (a > b)
		a = b;
}
template <typename A, typename B>
inline void chmax(A &a, B b)
{
	if (a < b)
		a = b;
}

int main()
{
	fast;
	ll n;
	cin >> n;
	ll prev, ans=0;
	cin >> prev;
	for (ll i=1; i<n; i++) {
		ll c; cin >> c;
		if (c<prev)
			ans+=prev-c;
		prev=max(c, prev);
	}
	cout << ans;
}

Measured memory_bytes: 3652
import sys
sys.setrecursionlimit(300000)

def I(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LMI(): return list(map(int, sys.stdin.readline().split()))
MOD = 10 ** 9 + 7
INF = float('inf')


K = I()
A, B = MI()

for i in range(A, B + 1):
    if i % K == 0:
        print('OK')
        exit(0)
print('NG')

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

int main(){
    int N,K;
    cin>>N>>K;
    int A[N];
    int d[N] = {0};
    for(int i=0;i<N;i++){
        cin>>A[i];
        d[A[i]-1] += 1;
    }
    int size = 0;
    for(int i=0;i<N;i++){
        if(d[i]!=0){
            size+=1;
        }
    }
    int kakikae = 0;
    if (K-size>=0){
    }
    else{
        sort(d,d+N);
        for(int i=N-size;i<N-K;i++){
            kakikae += d[i];
        }
    }
    cout<<kakikae<<endl;
}

Measured memory_bytes: 5112
<?php
  $k = trim(fgets(STDIN));
  for($i=0; $i<$k; $i++){
      $t = trim(fgets(STDIN));
      if($i>0){
          $ans = lcm($ans, $t);
      }else{
          $ans = $t;
      }
  }
  
  echo $ans%((10**18)+7);
  
  function gcd($m, $n){
     
    while($n !== 0){
        $tmp_n = $n;
        $n = $m % $n;
        $m = $tmp_n;
    }
    return $m;
  }
  
  function lcm($m, $n){
      $gcd = gcd($m,$n);
      return ($m/$gcd)*$n;
  }

Measured memory_bytes: 4604
#pragma GCC optimize(3,"Ofast","inline")
#pragma GCC target("avx")
#include <bits/stdc++.h>
using namespace std;
#ifdef ONLINE_JUDGE
#define getchar gc
inline char gc(){
	static char buf[1<<16],*p1=buf,*p2=buf;
	if(p1==p2){
		p2=(p1=buf)+fread(buf,1,1<<16,stdin);
		if(p2==p1) return EOF;
	}
	return *p1++;
}
#endif
template<class t> inline t read(t &x){
    char c=getchar();bool f=0;x=0;
    while(!isdigit(c)) f|=c=='-',c=getchar();
    while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
    if(f) x=-x;return x;
}
template<class t> inline void write(t x){
    if(x<0) putchar('-'),write(-x);
    else{if(x>9) write(x/10);putchar('0'+x%10);}
}

const double eps=1e-9;
const double pi=acos(-1);


struct point{
	double x,y;
	inline void read(){
		scanf("%lf%lf",&x,&y);
	}
	inline point operator + (const point &nt) const {
		return (point){x+nt.x,y+nt.y};
	}
	inline point operator - (const point &nt) const {
		return (point){x-nt.x,y-nt.y};
	}
	inline point operator * (const double &nt) const {
		return (point){x*nt,y*nt};
	}
	inline double length(){
		return sqrt(x*x+y*y);
	}
};

double distance(point x,point y){ //距离 
	return sqrt((y.x-x.x)*(y.x-x.x)+(y.y-x.y)*(y.y-x.y));
}

struct segment{
	point x,y;
	inline void read(){
		x.read();y.read();
	}
	inline double length(){ //线段长度 
		return distance(x,y);
	}
};

struct line{
	point x,y;
	inline void read(){
		x.read();y.read();
	}
}a,b;

double DJ(point x,point y){ //点积 
	return x.x*y.x+x.y*y.y;
}

double CJ(point x,point y){ //叉积 
	return x.x*y.y-x.y*y.x;
}


point trpoint(segment x){ //将有向线段转成向量点 
	return x.y-x.x;
}

point trpoint(line x){ //将直线转成向量点 
	return x.y-x.x;
}

double prolen(point x,segment a){ //点在有向线段上的投影长度 
	return DJ(trpoint((segment){a.x,x}),trpoint(a))/a.length();
}

point propoint(point x,segment a){ //点在直线上的投影点 
	return a.x+trpoint(a)*(prolen(x,a)/a.length());
}

point refpoint(point x,segment a){ //点在直线上的投影点 
	return x+(propoint(x,a)-x)*2;
}

bool orthline(line x,line y){ //两条直线是否垂直 
	return DJ(trpoint(x),trpoint(y))==0;
}

bool paraline(line x,line y){ //两条直线是否平行 
	return CJ(trpoint(x),trpoint(y))==0;
}

void doit(){
	a.read();b.read();
	if(orthline(a,b)) write(1);
	else if(paraline(a,b)) write(2);
	else write(0);puts("");
}

signed main(){
	int t;
	read(t);
	while(t--) doit();
}


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

int main() {
	double a, b, df, r;
	cin >> a >> b;
	df = a / b;
	r = (int)a % (int)b;
	cout << (int)df << " " << r << " " << fixed << setprecision(5) << df << endl;
	return 0;
}


Measured memory_bytes: 3244
#include "iostream"
#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <cstring>
#include <math.h>
#include <cctype>
#include <stack>
#include <vector>
#include <list>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <iomanip>
using namespace std;
using ll=long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define MOD  1000000007


int main(int argc, char const *argv[]) {
  double x,t;
  double ans;
  std::cin >> x >> t;
  ans=x/t;
  std::cout << ans << '\n';
  return 0;
}


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

public class Main {

    Scanner sc = new Scanner(System.in);
    int h = sc.nextInt();
    int n = sc.nextInt();
    int[] power = new int[n];
    int[] cost = new int[n];
    int[][] arr = new int[n][2];

    int[] dp = new int[h+10001];

    PrintWriter out = new PrintWriter(System.out);


    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        for (int i=0; i<n; i++) {
            int pow = sc.nextInt();
            int cost = sc.nextInt();
            arr[i][0] = pow;
            arr[i][1] = cost;
//            Pair pair = new Pair(pow, cost);
        }
//        Arrays.sort(arr, (a, b) -> Integer.compare(a[0], b[0]));

//        for (int i=0; i<n; i++) {
//            System.out.print(arr[i][0]+" ");
//            System.out.println(arr[i][1]);
//        }

        for (int i=0; i<h+1; i++) dp[i] = Integer.MAX_VALUE;

        for (int i=0; i<n; i++) {
            for (int j=0; j<arr[i][0]; j++) {
                dp[j] = Math.min(dp[j], arr[i][1]);
            }
            for (int j=arr[i][0]; j<h+1; j++) {
                dp[j] = Math.min(dp[j], dp[j-arr[i][0]]+arr[i][1]);
            }
        }


//        for (int i=0; i<h+1; i++) out.print(dp[i]+" ");



        out.println(dp[h-1]);
        out.flush();
    }

    void solve(int i, int m) {
    }

    class Pair {
        int power;
        int cost;
        public Pair(int p, int c) {
            this.power = p;
            this.cost = c;
        }

        public int compareTo(Pair p) {
            if (this.cost < p.cost) return -1;
            if (this.cost > p.cost) return -1;
            return 0;
        }
    }
}


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

int main(void) {
	for(int i = 0; i < 3000; ++i) {
		int a, b;
		cin >> a >> b;
		if (a == 0 && b == 0) break;
		if (a > b) {
			int tmp = a;
			a = b;
			b = tmp;
		}
		cout << a << " " << b << endl;
	}

	return 0;
}


Measured memory_bytes: 3080
/*input
3 2
#.#
.#.
#.#
#.
.#
*/

#include <iostream>
#include <vector>

using namespace std;

void display(vector<vector<int>> &M){
	for(int i=0;i<M.size();i++){
		for(int j=0;j<M[i].size();j++){
			cout << M[i][j] << " ";
		}
		cout << endl;
	}
	cout << endl;
}

int main()
{
	int N, M;

	cin >> N >> M;

	vector<vector<int>> A(N);
	vector<vector<int>> B(M);

	for(int i=0;i<N;i++){
		string temp;
		A[i].resize(N);
		cin >> temp;
		for(int j=0;j<temp.size();j++){
			A[i][j] = temp[j] == '#';
		}
	}

	// display(A);

	for(int i=0;i<M;i++){
		string temp;
		B[i].resize(M);
		cin >> temp;
		for(int j=0;j<temp.size();j++){
			B[i][j] = temp[j] == '#';
		}
	}

	// display(B);

	for(int i=0;i<N-M+1;i++){
		for(int j=0;j<N-M+1;j++){
			for(int p=0;p<M;p++){
				for(int q=0;q<M;q++){
					if(A[i+p][j+q] != B[p][q]) goto next;
				}
			}
			cout << "Yes" << endl;
			return 0;
		next:
			int hoge = 0;
		}
	}

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


Measured memory_bytes: 256
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
//const n = +input[0];
//const a = [];
//for(let i=0;i<n;i++){
//	a.push(input[i+1].split(" ").map((x:string):number=>+x));
//}

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);

function compareFunc(a, b){
    return a-b;
}

const [k, x]: number[] = input[0].split(' ').map((x: string): number => +x);

const li: number[] = [];

for(let i = x-k+1; i < x+k; i++){
    li.push(i);
}

console.log(li.join(' '));

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

using ll = long long;
using ull = unsigned long long;

const double PI = acos(-1);
const int inf = 2e9;
const ll INF = 2e18;
const ll MOD = 1e9+7;

#define sz(s) (s).size()
#define pb push_back
#define fi first
#define se second
#define REP(i,n) for (int i = 0; i<n; i++)
#define ALL(a) begin(a), end(a)

ll gcd (ll a,ll b) {
    if (b == 0) return a;
    else return gcd(b,a%b);
}

int main (void) {
    int N;
    cin>>N;
    vector<ll> T(N);
    REP(i,N) cin>>T[i];
    sort(ALL(T));
    vector<vector<ll>> P(N+10);
    ll ans = 1;
    for (int i=0;i<N;i++) {
        ll n = T[i];
        ll g = gcd(ans,n);
        ans = ans / g * n;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <bitset>
#include <math.h>
#include <iomanip>
#include <queue>
#define inp(X) cin >> X
#define out(X) cout << X << endl
#define rep(i,n) for(int i=0;i<n;i++ )
#define rep2(i,f,n) for(int i=f;i<n;i++ )
#define MAX(A) *max_element(A.begin(),A.end())
#define MIN(A) *min_element(A.begin(),A.end())
#define SORT(A) sort(A.begin(),A.end())
using namespace std;

typedef long long int ll;
#define MOD 1000000007
#define INF 1000000001

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

bool bfs(vector<vector<int>> g, vector<int> &dist, int sv)
{
	queue<int> q;
	q.push(sv);
	dist[sv]=0;
	while(!q.empty()){
		int now = q.front(); q.pop();
		for(auto v : g[now]){
			if(dist[v]!=-1) continue;
			dist[v] = dist[now]+1;
			q.push(v);
		}
	}
}

int main(void) {
	int n,a,b; cin >> n >> a >> b;
	cout << min(n*a,b) << endl;
}




Measured memory_bytes: 256
#include <stdio.h>
#define MAX 2000000

int H,A[MAX+1];
void insert(int);
void heapinc(int,int);
int heapext(void);
void maxHeapify(int);

int main(){
  int x;
  char com[20];
  while(1){
    scanf("%s", com);
    if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    }
    else if (( com[0] == 'e' )&&(com[1] == 'n')){
      break;
    }
    else{
      printf("%d\n",heapext());
    }
  }
  return 0;
}
void insert(int key){
  H++;
  A[H]=-MAX;//新しく入れるkeyが一番最後のkey以上のときのみ、heapの変更が行われることを保証している。
  heapinc(H,key);
}
void heapinc(int i,int key){
  int c;
  if(key<A[i]){
    return;
  }
  A[i]=key;
  while((i>1)&&(A[i/2]<A[i])){
    c=A[i/2];
    A[i/2]=A[i];
    A[i]=c;
    i=i/2;
  }
}

int heapext(){
  int maxv;
  if(H<1){
    return -MAX;
  }
  maxv=A[1];
  A[1]=A[H--];
  maxHeapify(1);
  return maxv;
}

void maxHeapify(int i){
  int l,r,largest,change=0;
  l = 2*i;
  r = 2*i+1;
  // 左の子、自分、右の子で値が最大のノードを選ぶ
  if ((l <= H)&&(A[l] > A[i])){
    largest = l;
  }
  else{
    largest = i;
  }
  if ((r <= H )&& (A[r] > A[largest])){
    largest = r;
  }

  if (largest != i)/* i の子の方が値が大きい場合 */{
    //A[i] と A[largest] を交換
    change=A[i];
    A[i]=A[largest];
    A[largest]=change;
    maxHeapify(largest); // 再帰的に呼び出し
  }
}


/*
#include <stdio.h>
#define MAX 2000000

int H,A[MAX+1];

int main(){
  int ;
  char com[20];
  while(1){
    scanf("%s", com);
    if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    }
    else if (( com[0] == 'e' )&&(com[1] == 'n')){
      break;
    }
    else{

    }
  }
  return 0;
}
void insert(int key){
  H++;
  A[H]=-MAX;//新しく入れるkeyが一番最後のkey以上のときのみ、heapの変更が行われることを保証している。
  heapinc(H,key);
}
void heapinc(int i,int key){
  if(key<A[i]){
    return;
  }
  A[i]=key;
}

int heapext(){

}

void maxHeapify(int i){
  int l,r,largest,change=0;
  l = 2*i;
  r = 2*i+1;
  // 左の子、自分、右の子で値が最大のノードを選ぶ
  if ((l <= H)&&(A[l] > A[i])){
    largest = l;
  }
  else{
    largest = i;
  }
  if ((r <= H )&& (A[r] > A[largest])){
    largest = r;
  }

  if (largest != i)//i の子の方が値が大きい場合 {
    //A[i] と A[largest] を交換
    change=A[i];
    A[i]=A[largest];
    A[largest]=change;
    maxHeapify(largest); // 再帰的に呼び出し
  }
}
 */



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

using ll=long long;
using namespace std;

#define rep_i(i, n) for (int i = 0; i < (n); ++i)
#define rep_ll(i, n) for (long long i = 0; i < (n); ++i)
#define r_rep_i(i, start, end) for (int i = (start); i < (end); ++i)
#define r_rep_ll(i, start, end) for (long long i = (start); i < (end); ++i)
#define debug_vi(v) copy((v).begin(), (v).end(), ostream_iterator<int>(cout, " "));
#define debug_vll(v) copy((v).begin(), (v).end(), ostream_iterator<long long>(cout, " "));
#define debug_vd(v) copy((v).begin(), (v).end(), ostream_iterator<double>(cout, " "));
#define sort_v(v) sort((v).begin(), (v).end()); //昇順
#define d_sort_vi(v) sort((v).begin(), (v).end(), greater<int>()); //降
#define d_sort_vll(v) sort((v).begin(), (v).end(), greater<long long>()); //降
#define d_sort_vd(v) sort((v).begin(), (v).end(), greater<double>()); //昇順
#define say(t) cout << (t) << endl;
#define sum_vi(v) accumulate((v).begin(), (v).end(), 0);
#define sum_vll(v)accumulate((v).begin(), (v).end(), 0LL);

ll gcd(ll a, ll b) { return b?gcd(b, a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a, b)*b;}

const int IINF=(1<<30);
const ll LLINF = 1LL<<60;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);
    // vector<bool> spade{13, false};
    // vector<bool> hart{13, false};
    // vector<bool> club{13, false};
    // vector<bool> dya{13, false};
    vector<vector<bool>> hoge(4, vector<bool>(13, false));
    int n;cin >> n;
    char s;
    int a;
    for (int i = 0; i < n; i++){
        cin >> s >> a;
        if(s == 'S'){
            hoge[0][a - 1] = true;
            continue;
        }
        if(s == 'H'){
            hoge[1][a - 1] = true;
            continue;
        }
        if(s == 'C'){
            hoge[2][a - 1] = true;
            continue;
        }
        if(s == 'D'){
            hoge[3][a - 1] = true;
            continue;
        }
        // if(s == 'S'){
        //     spade[a - 1] = true;
        //     continue;
        // }
        // if(s == 'H'){
        //     hart[a - 1] = true;
        //     continue;
        // }
        // if(s == 'C'){
        //     club[a - 1] = true;
        //     continue;
        // }
        // if(s == 'D'){
        //     dya[a - 1] = true;
        //     continue;
        // }
    }

    for (int i = 0; i < hoge.size(); i++){
        if(i == 0)s = 'S';
        if(i == 1)s = 'H';
        if(i == 2)s = 'C';
        if(i == 3)s = 'D';
        for (int e = 0; e < hoge[i].size(); e++){
            if(!hoge[i][e]){
                cout << s << " " << e + 1 << endl;
            }
        }
    }
}


Measured memory_bytes: 3124
import java.util.HashMap;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		int max = 0;
		int maxnum = 0;
		int submax = 0;
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
			if (max <= a[i]) {
				submax = max;
				max = a[i];
				maxnum = i;
			} else if (submax <= a[i]) {
				submax = a[i];
			}
		}
		for (int i = 0; i < n; i++) {
			if (i == maxnum) {
				System.out.println(submax);
			} else {
				System.out.println(max);
			}
		}
	}
}

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

int func (int x) {
    if(x < 10) return x;
    return x % 10 + func(x / 10);
}

int main(){
  int n;
  cin >> n;
  int s = func(n);
  if((n % s) == 0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }

  return 0;
}

Measured memory_bytes: 256
# import math
# from collections import Counter

# N = int(input()) # 1行, 単数
# arg = list(map(int, input().split())) # 1行, 配列
# D = Counter(arg) # 出現数カウント

# print('Yes')
# print('No')
# print()

arg = list(map(int, input().split())) # 1行, 配列

A = arg[0]
B = arg[1]
C = arg[2]
K = arg[3]

X = 0

if K <= A:
  print(K)
else:
  if K <= (A + B):
    print(A)
  else:
    print(A - (K-(A+B)))


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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
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 X; cin >> X;

  ll i = 100;
  ll cnt = 0;
  while(true) {
    i = i * 1.01;
    cnt++;
    if(i >= X) break;
  }

  cout << cnt << endl;
}

Measured memory_bytes: 3632
import java.util.Arrays;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.stream.IntStream;

class Main{

    static int[] uf;
    static int root(int v){
        if(uf[v]<0)return v;
        return uf[v]=root(uf[v]);
    }
    static int size(int v){
        return -uf[root(v)];
    }
    static void union(int u,int v){
        u = root(u);
        v = root(v);
        if(u==v)return;
        if(size(u)<size(v)){
            int tmp = u;
            u=v;
            v=tmp;
        }
        uf[u]+=uf[v];
        uf[v]=u;
    }
    static boolean same(int u,int v){
        return root(u)==root(v);
    }

    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int F = N - M;
        int T = (F-1)*2;
        if(T>N){
            System.out.println("Impossible");
            return;
        }
        if(N==M+1){
            System.out.println(0);
            return;
        }
        class Node{
            int a,i;
            Node(int a,int i){
                this.a = a;
                this.i =i;
            }
        }
        int[] a = new int[N];
        for(int i=0;i<N;++i)a[i] = scan.nextInt();

        uf = new int[N];
        Arrays.fill(uf,-1);

        while(M-->0){
            int x = scan.nextInt();
            int y = scan.nextInt();
            union(x,y);
        }

        Map<Integer, PriorityQueue<Integer> > queMap = new HashMap<>();
        for(int i=0;i<N;++i){
            if(!queMap.containsKey(root(i))){
                queMap.put(root(i), new PriorityQueue<>());
            }
                queMap.get(root(i)).add(a[i]);
        }
        long res = 0;

        PriorityQueue<Integer> que = new PriorityQueue<>();
        for(Map.Entry<Integer, PriorityQueue<Integer> > entry : queMap.entrySet()){
            res += (long)entry.getValue().poll();
            --T;
            while(!entry.getValue().isEmpty())que.add(entry.getValue().poll());
        }
        while(T-->0)res+=que.poll();
        System.out.println(res);

    }
}

Measured memory_bytes: 93396
#include<iostream>
#include<algorithm>
#include<climits>
#include<vector>
#include<utility>//pair
#include<cmath>//abs,sqrt
#include<cstring>
#include<map>
#include<string>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) cout<<arg<<"\n"
#define prin2(arg1,arg2) cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
const int INF=1e+9;
const ll INFLL=1e+17;
ll x,y;
string solve(){
  if(x==y||x+1==y||x==y+1) return "Brown";
  else return "Alice";
}
int main(){
  cin>>x>>y;
  prin(solve());
  return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<iostream>
using namespace std;
int n,a[200010],b[200010];
bool check(int k)
{
	for(int i=1;i<=2*n-1;i++) b[i]=(a[i]>=k);
	if (b[n]==b[n+1]||b[n-1]==b[n]) return b[n];
    for (int l=n,r=n;l>=1;l--,r++)
    {
        if(b[l]==b[l+1]) return b[l];
        if(b[r]==b[r-1]) return b[r];
    }
    return b[n]^(n&1)^1;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=2*n-1;i++) scanf("%d",&a[i]);
	int l=1,r=2*n-1,ans;
	while(l<=r)
	{
		int mid=(l+r)/2;
		if(check(mid)) ans=mid,l=mid+1;
		else r=mid-1;
	}
	printf("%d",ans);
}

Measured memory_bytes: 1792
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long LL;
const int N=100005,p=1000000007;
LL A[2],z[N];
int f[2][N],l1[2],l2[2],i,j,k,n,m,l,r;
char c;

inline char getc()
{
	#define VV 10000000
	static char s[VV],*l=s,*r=s;
	if (l==r)
		l=s,r=s+fread(s,1,VV,stdin);
	return l==r?0:*l++;
}

LL read(){ LL z=0; do c=getc(); while (c<'0'||c>'9'); while (c>='0'&&c<='9') z*=10,z+=c-'0',c=getc(); return z; }

void plus(int &a,int b){ a+=b,a-=a<p?0:p; }
int Minus(int a,int b){ a-=b,a+=a<0?p:0; return a; }

int main()
{
	n=read(),A[0]=read(),A[1]=read();
	for (i=1;i<=n;++i) z[i]=read();
	l1[0]=l1[1]=f[0][1]=f[1][1]=1;
	for (i=2;i<=n;++i)
	{
		for (j=0;j<2;++j)
		{
			if (z[i]-z[i-1]<A[j])
				l1[j]=i;
			if (i<n)
				while (z[i+1]-z[l2[j]+1]>=A[j])
					++l2[j];
			else
				l2[j]=n-1;
		}
		for (j=0;j<2;++j)
		{
			f[j][i]=f[j][i-1];
			if (l1[j]==1)
				plus(f[j][i],1);
			l=max(l1[j]-1,1),r=min(l2[!j],i-1);
			if (l<=r)
				plus(f[j][i],Minus(f[!j][r],f[!j][l-1]));
		}
	}
	printf("%d\n",(Minus(f[0][n],f[0][n-1])+Minus(f[1][n],f[1][n-1]))%p);
	return 0;
}

Measured memory_bytes: 4224
from itertools import combinations_with_replacement
N = int(input())
ans = list(0 for _ in range(N))
for L in combinations_with_replacement(range(1, 100), 3):
  x = L[0]
  y = L[1]
  z = L[2]
  A = x**2 + y**2 + z**2 + x*y + y*z + z*x
  if A <= N:
    if x == y and y == z:
      ans[A - 1] += 1
    elif x == y or y == z or z == x:
      ans[A - 1] += 3
    else:
      ans[A - 1] += 6

for a in ans:
  print(a)

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define contains(v, t) (find(v.begin(), v.end(), t) != v.end())
#define MOD 1000000007
typedef long long ll;
typedef unsigned long long ull;

int main() {
  string t;
  cin >> t;
  if (t == "ABC") {
    cout << "ARC";
  } else {
    cout << "ABC";
  }
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;

int main() {
    int x, t;
    cin >> x >> t;
    cout << max(0, x-t) << endl;
    return 0;
}

Measured memory_bytes: 3628
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func main() {
	var count int
	fmt.Scanf("%d", &count)

	list := strToInt(strings.Split(readLine(), " "))

	if len(list) < count {
		fmt.Printf("-1\n")
		return
	}

	fmt.Printf("%d\n", sortBreak(list[:count]))
}

var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func readLine() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, e := rdr.ReadLine()
		if e != nil {
			panic(e)
		}
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func strToInt(p []string) (ret []int) {
	for _, v := range p {
		t, _ := strconv.Atoi(v)
		ret = append(ret, t)
	}
	return ret
}

func sortBreak(list []int) int {
	check := 1
	var ret int

	index1 := index(list, 1)
	if index1 == -1 {
		return -1
	}

	for _, v := range list {
		if check == v {
			check++
		} else {
			ret++
		}
	}
	return ret
}

func index(list []int, match int) int {
	for k, v := range list {
		if v == match {
			return k
		}
	}
	return -1
}


Measured memory_bytes: 13440
n, m = map(int, input().split())
import heapq

Work = []
for i in range(n):
    Work.append(list(map(int, input().split())))
Work.sort(key=lambda x: (x[0], x[1]), reverse=True)
#print(Work)

total = 0
job_stock = []
#-1をかけた値を格納
heapq.heapify(job_stock)
for day in range(m, -1, -1):
    allowed_delay = m - day
    try:
        while Work[-1][0] <= allowed_delay:
            delay, money = Work.pop()
            heapq.heappush(job_stock, -money)
    except:
        pass
    if len(job_stock) >= 1:
        job_today = -heapq.heappop(job_stock)
        total += job_today
print(total)

Measured memory_bytes: 100276