akhauriyash/Code-Regression huggingface dataset:
import sys
sys.setrecursionlimit(1 << 25)
readline = sys.stdin.buffer.readline
read = sys.stdin.readline  # 文字列読み込む時はこっち

import numpy as np
from functools import partial
array = partial(np.array, dtype=np.int64)
zeros = partial(np.zeros, dtype=np.int64)
full = partial(np.full, dtype=np.int64)

ra = range
enu = enumerate


def a_int(): return int(read())


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import

from collections import defaultdict, Counter, deque
from operator import itemgetter, xor, add
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
from functools import reduce

K = np.array(list(map(int, list(input()))))
D = a_int()

'''
ある数xにおいて総和がDの倍数であるかの判定
x[0]+x[1]...+x[n] ≡ 0 (mod D) 各桁の和にMODを取れば良い。つまり桁ごとに処理できる

dp[i,j,k] ... K[:i]以下の整数のうち、k=mod Dとなるような数字の個数。j==1は上位桁が一致している場合の通りの個数。j==0は上位桁が一致しなくなったときの個数。

遷移
for l in range(10):
    dp[i+1,0,(k+l)%D] += dp[i,0,k] #1~9を考慮可能
for l in range(K[i]):
    dp[i+1,0,(k+l)%D] += dp[i,1,k] #1~K[i]-1をつけるとぴったりにならないグループへ行く

dp[i+1,1,(k+K[i])%D] += dp[i,1,k]
'''
# print(K, D)

from numba import njit


@njit('(i8[:],i8)', cache=True)
def solve(K, D):
    N = K.shape[0]
    dp = np.zeros((N + 1, 2, D), dtype=np.int64)
    dp[0, 1, 0] = 1
    for i in range(N):  # 各桁について
        for k in range(D):  # 各あまりについて処理
            for l in range(K[i]):
                # 1~K[i]-1をつけるとぴったりにならないグループへ行く
                dp[i + 1, 0, (k + l) % D] += dp[i, 1, k]
            for l in range(10):  # 各数字について処理
                dp[i + 1, 0, (k + l) % D] += dp[i, 0, k]  # 1~9を考慮可能
                dp[i + 1, 0, (k + l) % D] %= MOD
            # ぴったりグループ
            dp[i + 1, 1, (k + K[i]) % D] += dp[i, 1, k]
            # dp[i + 1, 1, (k + K[i]) % D] %= MOD

    print((dp[-1, :, 0].sum() - 1) % MOD)  # -1は0の分


solve(K, D)


Measured memory_bytes: 132376
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text.RegularExpressions;
using System.Diagnostics;

//var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
namespace AtCoderSolve
{
    
    class Solve
    {
        const int mod = 1000000007;
        
        
        static void Main(string[] args)
        {

            //var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            //Console.SetOut(sw);

            int N = int.Parse(Console.ReadLine());
            int K = int.Parse(Console.ReadLine());
            long ans = 1;

            for(var i = 0; i < N; i++)
            {
                if (ans < K)
                {
                    ans *= 2;
                }
                else
                {
                    ans += K;
                }
            }

            Console.WriteLine(ans);


            //Console.Out.Flush();

        }

        
    }

    public class Calculation
    {

    }

    public class Graph
    {
        
    }
}



Measured memory_bytes: 13140
N=int(input())
ab=sorted([list(map(int,input().split())) for _ in [0]*N],key=lambda x:x[1],reverse=True)
cd=sorted([list(map(int,input().split())) for _ in [0]*N],key=lambda x:x[0])
cnt=0
for i in range(N):
    for a in ab:
        if a[0]<cd[i][0] and a[1]<cd[i][1]:
            ab.remove(a)
            cnt+=1
            break
print(cnt)   

Measured memory_bytes: 3064
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("faild to read char") as char)
        .take_while(|c| !c.is_whitespace())
        .collect();
    token
        .parse()
        .ok()
        .expect("faild to parse token")
}

fn main(){
    let n: u64 = read();
    let m: u64 = read();
    let a = if n < 2 { 0 } else { combination(n, 2) };
    let b = if m < 2 { 0 } else { combination(m, 2) };
    println!("{}", a + b);
}

fn combination(n: u64, m: u64) -> u64 {
    let l = std::cmp::min(m, n - m);
    let mut ret: u64 = 1;
    for i in 0..l {
        ret = ret * (n - i) / (i + 1);
    }
    ret
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define rREP(i,m,n) for(ll i = (m); i >= (n); i--)
#define ALL(c) (c).begin(), (c).end()
#define print(x) cout << (x) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n,m;cin >> n >> m;
    int ary[m];
    rep(i,m) cin >> ary[i];

    ll ans = n;
    rep(i,m) ans -= ary[i];

    cout << max(ans, (ll)(-1)) << endl;
    
    
}




Measured memory_bytes: 3660
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<map>
using namespace std;
const int maxn=1e5+5;
int a,b,ans=2e9,n,m,dis[maxn],qian[maxn],sum[maxn];
int main(){
	scanf("%d %d",&n,&m);
	for(int i=1;i<=n;i++) scanf("%d",&dis[i]);
	for(int i=m;i<=n;i++){
		b=abs(dis[i]);
		a=abs(dis[i-m+1]);
		if(dis[i]>=0&&dis[i-m+1]<=0) ans=min(ans,a+b+min(a,b));
		else if(dis[i]<=0&&dis[i-m+1]<=0) ans=min(ans,a);
		else ans=min(ans,b);
	} 
	printf("%d\n",ans);
	return 0;
} 

Measured memory_bytes: 640
//Author: master19
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long int
#define ff first 
#define ss second 
#define pb push_back
#define endl "\n"
#define mod 1000000007LL // fixed...
#define modd 1000000007LL // Can be changed for global use
#define all(arr) arr.begin(),arr.end()
#define x(arr) arr.begin(),arr.end()
#define ulli unsigned long long int
#define assign(x,val) memset(x,val,sizeof(x))
#define prec(val, dig) fixed << setprecision(dig) << val
#define Sort(arr) sort(arr.begin(), arr.end())
#define lower(str) transform(str.begin(), str.end(), str.begin(), ::tolower);
#define upper(str) transform(str.begin(), str.end(), str.begin(), ::toupper);
#define crap ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define get(arr, num) vector < ll > arr(num); for(int i=0; i<num; i++)cin >> arr[i];
#define get_set(arr, num, st, type) set < type > st; for(int i=0; i<num; i++) st.insert(arr[i]);
#define put(arr, num) for(int i=0; i<num; i++)cout << arr[i] << " "; cout << endl;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update > new_ds; 
void debug_out() { cerr << endl; }
template <typename HeadStart, typename... TailEnd>
void debug_out(HeadStart H, TailEnd... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
ll lets_do_it();
pair < ll, ll > xy[] = {{-1, 0}, {1, 0} , {0, -1}, {0, 1}};
pair < ll, ll > dig[] = {{-1, -1}, {-1, 1}, {1, 1}, {1, -1}};
bool isValid(ll x, ll y, ll row, ll col){
    return ((x>=0) && (y >=0)  && (x < row) && (y < col));
}
int main(int argc, const char** argv) {
    crap;
    ll test = 1;
    // cin >> test;
    for(int loop=0; loop<test; loop++){
        // cout << "Case #" << (loop+1) << ": "; 
        lets_do_it();
    }
    return 0;
}
ll lets_do_it(){
    // Your code goes by here !!
    ll num;
    cin >> num;
    cout << !num << endl;




    return 0;
}


Measured memory_bytes: 3632
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include <time.h>
typedef long long ll;
typedef long double ld;
#define INF (1LL<<60)
/*swap 交換*/
void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a=c;}
/*2つのうち大きい数を返す*/
ll max2(ll a,ll b){return a>=b?a:b;}
/*2つのうち小さい数を返す*/
ll min2(ll a,ll b){return a>=b?b:a;}
/*絶対値*/
ll ABS(ll a){return a>=0?a:(-a);}
typedef struct{
    ll aa;
    ll bb;
}frequent;
// 小大
int compare(const void *a, const void *b){return *(ll *)a - *(ll *)b;}

int main(void){
    ll n,m;
    scanf("%lld%lld",&n,&m);
    if(n==1&&m==1){
        printf("1\n");
        return 0;
    }
    if(n==1||m==1){
        printf("%lld\n",max2(n,m)-2);
        return 0;
    }
    printf("%lld\n",(n-2)*(m-2));
    return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		if(n < 1200) {
			System.out.println("ABC");
		} else if(n >= 2800) {
			System.out.println("AGC");
		} else {
			System.out.println("ARC");
		}
	}
}


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

int main() {
  int a,b,c;
  cin >> a >> b >> c;
  b = 2199;
  b = b - a;
  cout << b/200;
}

Measured memory_bytes: 3632
using System;
using System.Collections.Generic;

class program{
  static void Main(){
    string[] s1=Console.ReadLine().Split(' ');
    string[] s2=Console.ReadLine().Split(' ');
    int H=int.Parse(s1[0]);
    int W=int.Parse(s1[1]);
    int h=int.Parse(s2[0]);
    int w=int.Parse(s2[1]);
    
    int count=H*W;
    count-=h*W;
    count-=(w*H-w*h);
    Console.WriteLine(count);
  }
}




Measured memory_bytes: 13140
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
#include<vector>
#include<deque>
#include<queue>

using std::cout;
using std::cin;
using std::setw;
using std::setfill;
using std::string;
using std::pair;
using std::make_pair;
using std::vector;
using std::queue;
using std::deque;
using std::priority_queue;
using std::next_permutation;
//using std::iota;
using std::sort;
using std::greater;
using std::max;
using std::min;

using lli = long long int;
using ulli = unsigned long long int;

#define INF 999999999;

#define EVEL 1

#ifndef EVEL
#define dbug(X) std::cout << #X << ":" <<X<<" " ;
#define dbugf(s) std::cout << s << " ";
#define dbugln std::cout<<"\n";
#else
#define dbug(X) {}
#define dbugf(s) {}
#define dbugln {}
#endif

ulli N;
string str;
ulli cntE, cntW;
ulli ans;

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

	cin >> N;
	cin >> str;
	for(ulli i = 0; i < N; i++){
		if(str[i] == 'E') cntE++;
	}
	ans = cntE;
	for(ulli i = 0; i < N; i++){
		if(str[i] == 'W') cntW++;
		if(str[i] == 'E') cntE--;
		ans = min(ans, cntW+cntE);
	}

	cout << ans;

	return 0;
}



Measured memory_bytes: 720
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define int long long
#define INF 1000000000000000000
using namespace std;

#define ANS(f) if(f) cout << "YES" << endl; else cout << "NO" << endl;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int, int> Pii;

template<typename T>
void readv(vector<T> &a){ REP(i, a.size()) cin >> a[i]; }
void readi(vector<int> &a){ REP(i, a.size()){cin >> a[i]; a[i]--;} }
void debug(mat m){REP(i, m.size()){ REP(j, m[i].size()){ cout << m[i][j] << ","; } cout << endl; }}

int modpow(int x, int n, int m){
    int a = 1;
    IREP(i, 64){
        a = (a * a) % m;
        if(((n >> i) & 1) == 1) a = (a * x) % m;
    }
    return a;
}

signed main(){

    int N, C; cin >> N >> C;
    vec A(N), B(N);
    readv(A);
    readv(B);
    int mod = 1000000007;

    mat psum(C + 1, vec(401, 0));
    REP(n, C + 1){
        FOR(i, 1, 401) psum[n][i] = (psum[n][i - 1] + modpow(i, n, mod)) % mod;
    }

    mat g(N, vec(C + 1));
    REP(i, N){
        REP(n, C + 1){
            g[i][n] = (psum[n][B[i]] - psum[n][A[i] - 1] + mod) % mod;
        }
    }
    //debug(g);

    mat dp(N + 1, vec(C + 1, 0));
    dp[0][0] = 1;
    REP(i, N){
        REP(n, C + 1){
            REP(m, n + 1){
                dp[i + 1][n] += g[i][m] * dp[i][n - m];
                dp[i + 1][n] %= mod;
            }
        }
    }
    //debug(dp);
    cout << dp[N][C] << endl;
    
    return 0;
}

Measured memory_bytes: 4224
#include "bits/stdc++.h"

using namespace std;
using ll = long long int;

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

	ll ans = 0;
	for (int a = 1; a <= k; a++)
	{
		for (int b = 1; b <= k; b++)
		{
			for (int c = 1; c <= k; c++)
			{
				ans += gcd(gcd(a, b), c);
			}
		}
	}

	cout << ans << endl;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int main(){
int n;
cin>>n;
vector<int>a(n),b(n);
for(int i =0;i <n;i++)
    cin>>a[i];
for(int i=0;i<n;i++)
    cin>>b[i];
    ll count1=0,count2=0;
for(int i=0 ;i <n;i++){
    if(a[i]>b[i]){
        count1+=a[i];
        count2+=b[i];
    }
}

cout<<count1 -  count2<<endl;
}


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

#define INF 100000000
#define MOD9(a) (a%1000000009)
#define MOD7(a) (a%1000000007)
#define ABS(a) (a<0?-(a):a)
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define REP(i,a) for(int i=0;i<a;i++) 

using namespace std;
int main(){
  char c;
  cin >> c;
  switch(c){
    case 'a':
    case 'i':
    case 'u':
    case 'e':
    case 'o':
      cout << "vowel" << endl;
      break;

    default :
      cout << "consonant" << endl;
      break;
  }

}



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

public class Main {
    Scanner sc = new Scanner(System.in);

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

    void run(){
        for(;;){
            long n = sc.nextInt();

            if(n ==0 ){
                break;
            }

            PriorityQueue<Long> mod = new PriorityQueue<Long>((l1,l2)->Long.compare(l2,l1));

            for(long i = 1 ;i*i <= 2*n;i++){
                if((n*2) % i ==0){
                    mod.add(i);
                    mod.add((n*2)/i);
                }
            }

            for(;;){
                long width = mod.poll();
                long center = n / width;
                long from = center - (width-1)/2 ;
                long to = from + width-1;

                if(n == (from + to) * width / 2 && from > 0){
                    System.out.println(from + " "+ width);
                    break;
                }

            }


        }

        
    }
}



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

#define endl "\n"
#define ll long long
#define pb emplace_back
#define fi first
#define se second
#define pll pair<ll, ll>
#define ull unsigned long long
#define ld long double

#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;

#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=n-1; i>=0; i--)
#define repa(i,a,b) for(ll i=(a);i<=(b);i++)
#define all(x) (x).begin(), (x).end()
#define ordered_set tree<int , null_type, less<int> , rb_tree_tag, tree_order_statistics_node_update>
/*
 Ordered set docs:
 order_of_key (k) : Number of items strictly smaller than k .
 find_by_order(k) : K-th element in a set (counting from zero).
*/
#define blc boost::lexical_cast<long long>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
using namespace __gnu_pbds;
const int MOD = 1e9+7;

ll add(ll x, ll y) {ll res=x+y; return(res>=MOD?res-MOD:res);}

ll sub(ll x, ll y) {ll res=x-y; return(res<0?res+MOD:res);}

ll lcm(ll x, ll y) {ll res=(x*y)/__gcd(x,y); return res;}

ll powerLL(ll x, ll n, ll mod) 
{ 
    ll result = 1; 
    while (n) { if (n & 1) result = (result%mod * x%mod) % mod; n = n / 2; x = (x%mod * x%mod) % mod; } return result; 
} 

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

void solve()
{
    ll n;
  	string s;
    cin>>n>>s;
    ll i = 0, j = n-1, res = 0;
  	while(i<j)
    {
      if(s[i] == 'W' && s[j] == 'R')
      {
        i++;
        j--;
        res++;
      }
      else if(s[i] == 'W' && s[j] == 'W')
        j--;
      else if(s[i] == 'R')
       i++;
    }
  	cout<<res<<endl;
}
int32_t main()
{
    fast;
    int t;
    t=1;
    //cin>>t;
    while(t--)
        solve();
    return 0; 
}

Measured memory_bytes: 3728
#include <cassert>
#include <iostream>
#include <vector>
#include <stack>
#include <unordered_set>
#include <numeric>
#include <iterator>
#include <unordered_map>
#include <array>
#include <map>
#include <cstring>
#include <iomanip>
#include <string>
#include <algorithm>
#include <cmath>
#include <ctgmath>
#include <set>
#include <queue>
#include <fstream>
#include <ostream>
#include <random>
#include <chrono>
using namespace std;
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, m;
	cin >> n >> m;
	vector<vector<int>> bulbs(m);
	vector<int> p;
	for (int i = 0; i < m; i++)
	{
		int k;
		cin >> k;
		while (k--)
		{
			int x;
			cin >> x;
			x--;
			bulbs[i].push_back(x);
		}
	}
	for (int i = 0; i < m; i++)
	{
		int x;
		cin >> x;
		p.push_back(x);
	}
	int cnt = 0;
	for (int i = 0; i < (1 << n); i++)
	{
		bool flag = true;
		for (int j = 0; j < m; j++)
		{
			int on = 0;
			for (auto k : bulbs[j])
			{
				if (1 << k & i)
					on++;
			}
			if (on % 2 != p[j])
			{
				flag = false;
			}
		}
		if (flag)
			cnt++;
	}
	cout << cnt << "\n";
}



Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<deque>
#include<queue>
#include<stack>
#include <ctime>
using namespace std;
#define int long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define dup(x,y) (((x)+(y)-1)/(y))
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
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; }
typedef pair<int, int>P;
const int MOD = 1e9 + 7;
//const int MOD = 998244353;
const int INF = 1e18;
const long double PI = (acos(-1));


signed main() {
	int X, K, D;
	cin >> X >> K >> D;
	if (X < 0)X = -X;
	int num1 = X / D;
	if (K <= num1) {
		int ans = X - K * D;
		cout << ans;
		return 0;
	}
	K -= num1;
	if (K % 2 == 0) {
		int ans = X - num1 * D;
		cout << ans;
	}
	else {
		int ans = X - num1 * D;
		ans = abs(ans - D);
		cout << ans;
	}
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n)cin >> a[i];
    int ans = 1;
    int cnt = 0;
    rep(i, n-1){
        if(a[i] < a[i+1]){
            if(cnt == -1){
                ans++;
                cnt = 0;
            }else if(cnt == 0){
                cnt = 1;
            }
        }else if(a[i] > a[i+1]){
            if(cnt == 1){
                ans++;
                cnt = 0;
            }else if(cnt == 0){
                cnt = -1;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3716
#include <cstdio>

int main(){
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    if(a == 5 && b == 5 && c == 7)
        printf("YES\n");
    else if(a == 5 && b == 7 && c == 5)
        printf("YES\n");
    else if(a == 7 && b == 5 && c == 5)
        printf("YES\n");
    else printf("NO\n");

    return 0;
}


Measured memory_bytes: 128
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"

using namespace std;
using namespace __gnu_pbds;


#define ll long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(),a.end()

typedef tree <ll, null_type, less <ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// order_of_key(val): returns the number of values less than val
// find_by_order(k): returns an iterator to the kth largest element (0-based)
const ll nax = (1 << 21);
ll dp[22][nax];
int main(void)
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n, i, j, mod = 1e9 + 7;
    cin>>n;
    vector<pair<ll, ll>> bits;
    for(i = 0; i < (1 << n); i++) {
        bits.pb(mp(__builtin_popcount(i), i));
    }
    sort(all(bits));
    dp[0][0] = 1;
    ll a[n + 1][n];
    for(i = 1; i <= n; i++) {
        for(j = 0; j < n; j++) {
            cin>>a[i][j];
        }
    }
    ll prev = 1, count = 1;
    for(auto u: bits) {
        if(u.ff == count) {
            prev++;
            count++;
        } 
        for(i = 0; i < n; i++) {
            if(!a[prev][i]) {
                continue;
            }
            ll bit = (1 << i);
            if(!(u.ss & bit)) {
                dp[prev][u.ss | (1 << i)] = (dp[prev][u.ss | (1 << i)] + dp[prev - 1][u.ss]) % mod;
            }
        }
    }
    cout<<dp[n][(1 << n) - 1]<<"\n";
}

Measured memory_bytes: 342368
import math

n, d = map(int, input().split())
x = []
for i in range(n):
    t = [int(d) for d in input().split()]
    x.append(t)

def distance(x,y):
    temp = 0
    for i in range(len(x)):
        temp += abs(y[i]-x[i])**2
    d = math.sqrt(temp)
    return d

ans = 0
for i in range(n):
    for j in range(i+1,n):
        d = distance(x[i],x[j])
        if d == int(d):
            ans += 1

print(ans)


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

using namespace std;


#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 (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()

#define int long long

#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second

template <typename T>
void print(T x)
{
	std::cout << x <<" " ;
}


template <typename T>
void println(T x)
{
	std::cout << x << "\n";
}

signed main(void) {
	int N;
	cin >> N;
	double a;
	if (N % 2 == 0) {
		a = 0.5;
	}
	else {
		a = (double)(N / 2 + 1) / N;
	}
	cout << setprecision(6) << a;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
#include<complex>
#include <cassert>
using namespace std;

#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 4000001;
const double eps = 1E-18;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

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

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

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};

class mint {
	long long x;
public:
	mint(long long x = 0) : x((x% MOD + MOD) % MOD) {}
	mint operator-() const {
		return mint(-x);
	}
	mint& operator+=(const mint& a) {
		if ((x += a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator-=(const mint& a) {
		if ((x += MOD - a.x) >= MOD) x -= MOD;
		return *this;
	}
	mint& operator*=(const  mint& a) {
		(x *= a.x) %= MOD;
		return *this;
	}
	mint operator+(const mint& a) const {
		mint res(*this);
		return res += a;
	}
	mint operator-(const mint& a) const {
		mint res(*this);
		return res -= a;
	}
	mint operator*(const mint& a) const {
		mint res(*this);
		return res *= a;
	}

	mint pow(ll t) const {
		if (!t) return 1;
		mint a = pow(t >> 1);
		a *= a;
		if (t & 1) a *= *this;
		return a;
	}

	// for prime MOD
	mint inv() const {
		return pow(MOD - 2);
	}
	mint& operator/=(const mint& a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint& a) const {
		mint res(*this);
		return res /= a;
	}

	friend ostream& operator<<(ostream& os, const mint& m) {
		os << m.x;
		return os;
	}
};

mint pw(mint a, ll b) {
	if (b == 0) { return 1; }
	mint ret = pw(a, b >> 1);
	ret *= ret;
	if (b & 1) { ret *= a; }
	return ret;
}

typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;

typedef vector<mint> vmint;
typedef vector<vector<mint>> vvmint;
typedef vector<vector<vector<mint>>> vvvmint;

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


int main(){
	ll N, M, K;
	cin >> N >> M >> K;

	ll L = (N + M - 1) / (K - 1);

	vvmint dp(L + 1, vmint(N + M, 0));
	
	dp[0][0] = 1;

	//cout << L << endl;

	repn(i, L)rep(j, N + M) {
		rep(k,K) {
			ll x = j - k;
			if (x < 0) { continue; }
			dp[i][j] += dp[i - 1][x];
		}
		//cout << i << " " << j << " " << dp[i][j] << endl;
	}

	mint ans = 0;
	rep(i, L) {
		rep(j, N + M) {

			repn(k, K - 1) {
				ll x = j + k;
				ll y = i * (K - 1) + K - x;
				if (x<0 || y<0 || x>N || y>M) { continue; }
				if ((N - x) % (K - 1) != 0) { continue; }
				if ((M - y) % (K - 1) != 0) { continue; }

				ans += dp[i][j];
			}


		}
	}

	cout << ans << endl;

}



Measured memory_bytes: 128284
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
template<class T,class U> inline bool chmin(T&x,U y){if(x>y){x=y;return true;}return false;}
template<class T,class U> inline bool chmax(T&x,U y){if(x<y){x=y;return true;}return false;}
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n,s{1};
    cin>>n;
    while(n>0){
        s*=26;
        n-=s;
    }
    n+=s-1;
    while(s>1){
        cout<<char('a'+(n%s)/(s/26));
        s/=26;
    }
    cout<<'\n';
}

Measured memory_bytes: 3652
#include <stdio.h>
int main(){
  int a, b;
  scanf("%d%d", &a, &b);
  if( a < b ){
    printf("a < b\n");
  } else if( a > b ){
    printf("a > b\n");
  } else {
    printf("a == b\n");
  }
 return 0;
}


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

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

ll mod = (ll)(1e9+7);

int main(){
  string L;
  cin >> L;

  vector<vector<ll>> dp(100005,vector<ll>(2));
  dp[0][0] = 1;
  
  rep(i,L.size()){
    // i桁目が0になるような遷移
    if(L[i]=='0'){
      dp[i+1][0] += dp[i][0];
      dp[i+1][1] += dp[i][1];
    }else{
      dp[i+1][1] +=  (dp[i][0]+dp[i][1]);
      dp[i+1][1] %= mod;
    }

    // i桁目が1になるような遷移
    if(L[i]=='0'){
      dp[i+1][1] += dp[i][1]*2;
      dp[i+1][1] %= mod;
    }else{
      dp[i+1][0] += dp[i][0]*2;
      dp[i+1][0] %= mod;
      dp[i+1][1] += dp[i][1]*2;
      dp[i+1][1] %= mod;
    }
  }

  ll ans = dp[L.size()][0]+dp[L.size()][1];
  ans %= mod;
  cout << ans << endl;

  return 0;
} 



Measured memory_bytes: 5760
using System;
using System.Collections.Generic;

namespace ABC075B
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ');
            var H = int.Parse(input[0]);
            var W = int.Parse(input[1]);
            var S = new List<string>();
            for (var i = 0; i < H; i++)
            {
                S.Add(Console.ReadLine());
            }

            for (var i = 0; i < H; i++)
            {
                for (var j = 0; j < W; j++)
                {
                    if (S[i][j] == '#')
                    {
                        Console.Write('#');
                    }
                    else
                    {
                        var count = CountBomb(S, j, i);
                        Console.Write(count);
                    }
                }
                Console.WriteLine();
            }
        }

        static int CountBomb(List<string> S, int x, int y)
        {
            var count = 0;
            for (var i = y - 1; i <= y + 1; i++)
            {
                if (i < 0 || S.Count <= i)
                {
                    continue;
                }
                for (var j = x - 1; j <= x + 1; j++)
                {
                    if (j < 0 || S[i].Length <= j || (i == y && j == x))
                    {
                        continue;
                    }
                    if (S[i][j] == '#')
                    {
                        count++;
                    }
                }
            }
            return count;
        }
    }
}


Measured memory_bytes: 27832
#include <iostream>
#include <algorithm>
#include <array>
#include <cstdint>
#include <functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <utility>
#include <vector>

#define INF 1000000000
#define MOD 1000000007
#define rep(i,a,b) for(uint32 i = (a); i < (b); ++i)
#define bitget(a,b) (((a) >> (b)) & 1)
#define ALL(x) (x).begin(),(x).end()
#define C(x) std::cout << #x << " : " << x << std::endl
#define scanf scanf_s

using int32 = std::int_fast32_t;
using int64 = std::int_fast64_t;
using uint32 = std::uint_fast32_t;
using uint64 = std::uint_fast64_t;

template<typename T>
class hashmap64 {
	std::vector<std::pair<uint64, T>> map;
	uint64 mask, temp, count;
#define hash64(x) std::hash<unsigned long long>()(x)
public:
	hashmap64() :map(8192, std::make_pair(~static_cast<std::uint_fast64_t>(0), T())) {
		mask = 8191; count = 0;
	}
	hashmap64(size_t s) {
		s |= s << 1;
		s |= s >> 2;
		s |= s >> 4;
		s |= s >> 8;
		s |= s >> 16;
		s |= s >> 32;
		mask = s;
		count = 0;
		map.resize(s + 1, std::make_pair(~static_cast<std::uint_fast64_t>(0), T()));
	}
	T &operator[](uint64 suf) {
		temp = mask&hash64(suf);
		while (map[temp].first != suf) {
			temp = mask&(temp + 1);
		}
		return map[temp].second;
	}
	void insert(uint64 key, const T &value) {
		temp = mask&hash64(key);
		while (~map[temp].first) {
			if (map[temp].first == key) {
				map[temp].second = value;
				return;
			}
			temp = mask&(temp + 1);
		}
		map[temp] = std::make_pair(key, value);
		++count;
		if ((count << 1) > mask) {
			std::pair<uint64, T> mkey;
			uint64 t = mask;
			mask = mask << 1 | 1;
			map.resize(mask + 1, std::make_pair(~static_cast<std::uint_fast64_t>(0), T()));
			while (~map[t].first) {
				--t;
			}
			while (++t <= (mask >> 1)) {
				mkey = map[t];
				map[t].first = ~static_cast<std::uint_fast64_t>(0);
				temp = mask&hash64(mkey.first);
				while (~map[temp].first) {
					temp = mask&(temp + 1);
				}
				map[temp] = mkey;
			}
			for (t = 0;t <= mask >> 1;++t) {
				if (~map[t].first) {
					mkey = map[t];
					map[t].first = ~static_cast<std::uint_fast64_t>(0);
					temp = mask&hash64(mkey.first);
					while (~map[temp].first) {
						temp = mask&(temp + 1);
					}
					map[temp] = mkey;
				}
			}
		}
		return;
	}
	bool find(uint64 key) {
		temp = mask&hash64(key);
		while (~map[temp].first) {
			if (map[temp].first == key) {
				return true;
			}
			temp = mask&(temp + 1);
		}
		return false;
	}
	bool empty(void) {
		return !count;
	}
	size_t size(void) {
		return count;
	}
};

int main(void) {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	hashmap64<uint32> map(100000);
	uint32 n;
	std::cin >> n;
	int64 a, sum = 1e15;
	uint32 ans = 0;
	map.insert(sum, 0);
	rep(i, 0, n) {
		std::cin >> a;
		sum += a;
		if (map.find(sum)) {
			ans = std::max(ans, i + 1 - map[sum]);
		}
		else {
			map.insert(sum, i + 1);
		}
	}
	std::cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 15008
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define shosu(n) setprecision(n)
#define INF 999999999
using namespace std;
int main() {
  int N;
  while (cin >> N, N) {
    int a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g, ans = 1;
    string s;
    rep(i, N) {
      cin >> s;
      if (s[0] == 'N') {
        g = a;
        a = b;
        b = f;
        f = e;
        e = g;
      } else if (s[0] == 'E') {
        g = a;
        a = d;
        d = f;
        f = c;
        c = g;
      } else if (s[0] == 'W') {
        g = a;
        a = c;
        c = f;
        f = d;
        d = g;
      } else if (s[0] == 'S') {
        g = a;
        a = e;
        e = f;
        f = b;
        b = g;
      } else if (s[0] == 'R') {
        g = b;
        b = c;
        c = e;
        e = d;
        d = g;
      } else if (s[0] == 'L') {
        g = b;
        b = d;
        d = e;
        e = c;
        c = g;
      }
      ans += a;
    }
    cout << ans << endl;
  }
  return 0;
}

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

int main() {
    int n, k;
    cin >> n >> k;
    double ans = 0;
    REP(i,n){
        double tmp = 1.0 / n;
        int now = i + 1;
        while(now < k){
            now *= 2;
            tmp /= 2;
        }
        ans += tmp;
    }
    printf("%.12f\n",ans);
}


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

N = int(input())
A = input()
B = input()
C = input()


count = 0
for i in range(N):
    if A[i] == B[i] == C[i]:
        count += 0
    elif A[i] == B[i]:
        count += 1
    elif A[i] == C[i]:
        count += 1
    elif B[i] == C[i]:
        count += 1
    else:
        count += 2

    #print(i, ": ", count)

print(count)

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

int find_order(const vector<int>& a) {
	int n = a.size();
	int res = 1;
	vector<int> c(n);
	for (int i = 0; i < n; ++i) c[i] = i+1;
	while (a != c) {
		next_permutation(c.begin(), c.end());
		++res;
	}
	return res;
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n;
	cin >> n;
	vector<int> a(n), b(n);
	for (int i = 0; i < n; ++i) {
		cin >> a[i];
	}
	for (int i = 0; i < n; ++i) {
		cin >> b[i];
	}
	int x = find_order(a), y = find_order(b);
	cout << abs(x-y) << endl;
	return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <complex>
#include <cstdio>
#include <utility>
using namespace std;
typedef complex<double> P;
typedef pair<P,P> L;
#define X real()
#define Y imag()

double dot(P a, P b){
  return a.X * b.X + a.Y * b.Y;
}
double cross(P a, P b){
  return a.X * b.Y - a.Y * b.X;
}

L angle_bisector(P a, P b, P c){
  //角abcをの二等分線
  //a, b or b, cが一致するとゼロ徐算が発生しREになる
  P p = b + (a-b)/abs(a-b) + (c-b)/abs(c-b);
  return L(b,p);
}

P intersection(L a, L b){
  //直線aと直線bの交点
  return a.first + cross(b.second-b.first,a.first-b.first)/(-cross(b.second-b.first,a.second-b.first)+cross(b.second-b.first,a.first-b.first))*(a.second-a.first);
}

double p_to_s_dist(P a, L s){
  return abs(cross(s.first-s.second,a-s.second))/abs(s.first-s.second);
}

int main(){
  P p[3];
  double x, y;
  for(int i = 0; i < 3; ++i){
    cin >> x >> y;
    p[i] = P(x,y);
  }
  L bisectors[3];
  for(int i = 0; i < 3; ++i){
    bisectors[i] = angle_bisector(p[(i+2)%3],p[i],p[(i+1)%3]);
  }
  P inner_center = intersection(bisectors[0],bisectors[1]);
  double ans = 0.0;
  for(int i = 0; i < 3; ++i){
    P a = p[i], b = inner_center;
    L l = L(p[i],p[(i+1)%3]);
    for(int j = 0; j < 10000; ++j){
      P m = (a+b)/2.0;
      double d1 = p_to_s_dist(m,l)*2;
      P k = intersection(bisectors[(i+1)%3], L(m,m+p[(i+1)%3]-p[i]));
      double d2 = abs(k-m);
      if(d1 < d2){
	a = m;
      }else{
	b = m;
      }
    }
    ans = max(ans,p_to_s_dist((a+b)/2.0,l));
  }
  printf("%.12f\n",ans);
  return 0;
}





Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long H,i=0,left=0,right=0;
	cin>>H;
	while(!(left<=H&&right>H)){
		left=pow(2,i);
		right=pow(2,i+1);
		i++;
	}
	i--;
	long long ans=0;
	for(int j=0;j<=i;j++)ans+=pow(2,j);
	cout<<ans;
    return 0;
} 


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

int main()
{
    int a, b;
    cin >> a >> b;
    int la = a / 0.08;
    int ua = (a + 1) / 0.08;
    int lb = b / 0.1;
    int ub = (b + 1) / 0.1;
    int ans = -1;
    for (int x = min(la, lb); x < max(ua, ub); x++) {
        if ((int)(x * 0.08) == a && (int)(x * 0.1) == b) {
            ans = x;
            break;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
typedef long long ll;
int n;
int main(void){
    cin>>n;
    int a[n+3],dis[n+3],two[n+2];
    int sum=0;
    a[0]=a[n+1]=0;
    for(int i=0;++i-n-1;)cin>>a[i];
    for(int i=0;++i-n-2;){
        dis[i]=abs(a[i-1]-a[i]);
        sum+=dis[i];
    }
    for(int i=0;++i-n-1;)two[i]=abs(a[i-1]-a[i+1]);
    for(int i=0;++i-n-1;)cout<<sum-dis[i]-dis[i+1]+two[i]<<"\n";
}

Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<algorithm>
#include<string.h>
#include<complex>
using namespace std;
typedef long long int llint;
int main(){
	int x, a, b;
	cin >> x >> a >> b;
	a = abs(a - x);
	b = abs(b - x);
	if (a < b){
		cout << "A" << endl;
	}
	else{
		cout << "B" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <functional>
#include <typeinfo>

#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REP1(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREP1(i, x) for (int i = ((int)(x)); i > 0; i--)
/*
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };

#define all(x) (x).begin(),(x).end()
*/

using namespace std;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    long long a,b;
    cin >> a >> b;

    if (a*b%2==1)
        cout << "Yes";
        else
            cout << "No";
}

Measured memory_bytes: 256
<?php
list($n,$k,$s)=explode(" ",trim(fgets(STDIN)));
$ans=array_fill(0,$k,$s);
if($s==1){
  $ans+=array_fill($k,$n-$k,$s+1);
}else{
  $ans+=array_fill($k,$n-$k,$s-1);
}
echo join(" ",$ans);

Measured memory_bytes: 14840
#!usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from itertools import permutations
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    k,q = LI()
    d = LI()
    for _ in range(q):
        n,x,m = LI()
        a = [((i-1)%m)+1 for i in d]
        S = sum(a)
        r = (n-1)//k
        s = S*r+(x%m)
        for i in range((n-1)%k):
            s += a[i]
        print(n-1-(s//m))
    return

#Solve
if __name__ == "__main__":
    solve()


Measured memory_bytes: 61148
#include <bits/stdc++.h>
#define int ll
#define rep(i, l, r) for (int i = l; i <= r; i++)
#define per(i, r, l) for (int i = r; i >= l; i--)
#define IMAX 0x3f3f3f3f
#define LLMAX 0x3f3f3f3f3f3f3f3f
using namespace std;
typedef long long ll;
typedef double db;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}

typedef long long ll;

signed main() {
  ll X = read();
  ll now = 100;
  ll num = 0;
  while (now < X) {
    now = now * 1.01;
    num++;
  }
  printf("%lld\n", num);
  return 0;
}


Measured memory_bytes: 3760
let () =
  let n = Scanf.scanf "%d\n" (fun n -> n) in
  let as_ = Array.init n (fun _ -> Scanf.scanf "%d\n" (fun a -> a)) in
  Array.fold_left (fun (acc, prev) a ->
    if prev && 1 <= a then (acc + 1 + (a - 1) / 2, (a - 1) mod 2 = 1)
    else (acc + a / 2, a mod 2 = 1)) (0, false) as_
  |> fst
  |> Printf.printf "%d\n"

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

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef unordered_set<int> si;
typedef pair<int, int> pp;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)


template <typename T>
void printV(vector<T> A) {
    if (A.empty()) cerr << "EMTPY\n";
    else { 
        cerr << "\n[";
        for (int i = 0; i < A.size() -1 ; ++i) {
            cerr << A[i] << ", ";
        }
        if (A.size()) cerr << A.back() << "]\n";
    }
}


template <typename T>
void printVV(vector<vector<T>> A) {
    cerr << "\n[";
    for (auto v : A) {
        printV<T>(v);
    }
    cerr << "]\n";
}

template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cerr << name << ": " << arg1 << endl;
}

template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&& ...args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << ": " << arg1 << " |";
    __f(comma + 1, args...);
}

int main(int argc, char **argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    string s;
    cin >> n >> s;
    
    int ans = 0;

    for (int i = 0; i < n; ++i) {
        if (i-2 >= 0 && s[i] == 'C' && s[i-1] == 'B' && s[i-2] == 'A') ans += 1;
    }

    cout << ans << '\n';

    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define FOR(i, i0, n) for(int i = (i0); i < (n); i ++)
#define COUT(val) cout << (val) << "\n";
using namespace std;
using ll = long long int;

int main(void){
    int n;
    cin >> n;
    vector<double> p(n);
    FOR(i, 0, n) cin >> p[i];
    
    vector<vector<double>> dp(n, vector<double>(n+1));
    dp[0][0] = 1-p[0], dp[0][1] = p[0];
    FOR(i, 1, n){
        dp[i][0] = (1-p[i]) * dp[i-1][0];
        FOR(j, 1, i+2){
            dp[i][j] = (1-p[i]) * dp[i-1][j] + p[i] * dp[i-1][j-1];
        }
    }

    double ans = 0;
    for(int j = n; j > n/2; j --) ans += dp[n-1][j];
    printf("%.10f", ans);
}


Measured memory_bytes: 70656
/* ＵＴＦ－８ */
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <array>
#include <queue>
#include <stack>
#include <algorithm>
#include <tuple>
#include <numeric>
#include <type_traits>
#include <limits>

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>

#define USE_COLORED 1

#ifdef USE_COLORED
static const char stdout_pre[]  = "\033[1m"; // bold black
static const char stderr_pre[]  = "\033[31;1m"; // bold red
static const char stdxxx_post[] = "\033[m";

// 当然ながら GCC(g++)/libstdc++ 依存
#include <ext/stdio_filebuf.h>
using stdio_filebuf = __gnu_cxx::stdio_filebuf<char>;
class colored_stdio_filebuf : public stdio_filebuf {
private:
	const char* const pre_;
	const char* const post_;

public:
	colored_stdio_filebuf(FILE* fp, const char* pre, const char* post) : stdio_filebuf(fp, std::ios_base::out), pre_(pre), post_(post)
	{
	}

protected:
	std::streamsize xsputn(const char* s, std::streamsize count) override
	{
		stdio_filebuf::xsputn(pre_, strlen(pre_));
		auto ret = stdio_filebuf::xsputn(s, count);
		stdio_filebuf::xsputn(post_, strlen(post_));
		return ret;
	}
};
#endif

int main()
{
#ifdef USE_COLORED
	if (getenv("DEBUG")) {
		std::cout.rdbuf(new colored_stdio_filebuf(stdout, stdout_pre, stdxxx_post));
		std::cerr.rdbuf(new colored_stdio_filebuf(stderr, stderr_pre, stdxxx_post));
	} else
#endif
	{
		int fd = open("/dev/null", O_WRONLY);
		dup2(fd, 2);
		close(fd);
	}
	
	int N;
	std::cin >> N;
	if (N % 2 == 0) {
		std::cout << N << "\n";
	} else {
		std::cout << (N*2) << "\n";
	}
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<unordered_map>
#include<random>
#include<array>
#include<cassert>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define uniq(v) v.erase(unique(all(v)),v.end())





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

	int a[3][3];
	int n;
	rep(i, 3)rep(j, 3)cin >> a[i][j];

	cin >> n;
	rep(_, n) {
		int b;
		cin >> b;
		rep(i, 3)rep(j, 3)if (a[i][j] == b)a[i][j] = -1;
	}
	
	string ans = "No";
	rep(i, 3) {
		if (count(a[i], a[i]+3, -1) == 3) {
			ans = "Yes";
			goto OUT;
		}
	}
	rep(i, 3) {
		if (a[0][i] == -1 && a[1][i] ==-1 && a[2][i] ==-1) {
			ans = "Yes";
			goto OUT;
		}
	}
	if (a[0][0] == -1 && a[1][1] == -1 && a[2][2] == -1) {
		ans = "Yes";
		goto OUT;
	}
	if (a[2][0] == -1 && a[1][1] == -1 && a[0][2] == -1) {
		ans = "Yes";
		goto OUT;
	}


OUT:
	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(x,y) (x=min(x,y))
#define chmax(x,y) (x=max(x,y))
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}

int main(){
  int a, b;
	cin>>a>>b;
  cout<<(a-1)*(b-1)<<endl;
	return 0;
}


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

ll inf = (1ll<<50);

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

  int a,b,q;
  cin>>a>>b>>q;
  vector<ll> st1, st2;
  st1.push_back(inf*-1ll);
  st2.push_back(inf*-1ll);
  for(int i=0;i<a;i++){
    ll v;cin>>v;st1.push_back(v);
  }
  for(int i=0;i<b;i++){
    ll v;cin>>v;st2.push_back(v);
  }
  st1.push_back(inf);
  st2.push_back(inf);

  for(int i=0;i<q;i++){
    ll res=inf;
    ll x;cin>>x;
    // 右側にいく
    auto it1_right = lower_bound(st1.begin(), st1.end(), (x));
    auto it2_right = lower_bound(st2.begin(), st2.end(), (x));
    // 左側にいく
    auto it1_left = it1_right-1;
    auto it2_left = it2_right-1;

    auto right_dist_1 = (*it1_right) - x;
    auto right_dist_2 = (*it2_right) - x;

    auto left_dist_1 = abs(x- (*it1_left));
    auto left_dist_2 = abs(x- (*it2_left));

    // 右・右
    res = min(res, max(right_dist_1, right_dist_2));
    // 右・左その1
    res = min(res, right_dist_1*2+left_dist_2);
    // 右・左その2
    res = min(res, right_dist_1+left_dist_2*2);
    // 左・右その1
    res = min(res, left_dist_1*2+right_dist_2);
    // 左・右その2
    res = min(res, left_dist_1+right_dist_2*2);
    // 左・左
    res = min(res, max(left_dist_1, left_dist_2));

    cout<<res<<endl;
  }


  return 0;
}


Measured memory_bytes: 3060