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

typedef long long   signed int LL;
typedef long long unsigned int LU;

#define incID(i, l, r) for(int i = (l)    ; i <  (r); i++)
#define incII(i, l, r) for(int i = (l)    ; i <= (r); i++)
#define decID(i, l, r) for(int i = (r) - 1; i >= (l); i--)
#define decII(i, l, r) for(int i = (r)    ; i >= (l); i--)
#define  inc(i, n) incID(i, 0, n)
#define inc1(i, n) incII(i, 1, n)
#define  dec(i, n) decID(i, 0, n)
#define dec1(i, n) decII(i, 1, n)

#define inII(v, l, r) ((l) <= (v) && (v) <= (r))
#define inID(v, l, r) ((l) <= (v) && (v) <  (r))

#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define UB upper_bound
#define LB lower_bound
#define PQ priority_queue

#define  ALL(v)  v.begin(),  v.end()
#define RALL(v) v.rbegin(), v.rend()
#define  FOR(it, v) for(auto it =  v.begin(); it !=  v.end(); ++it)
#define RFOR(it, v) for(auto it = v.rbegin(); it != v.rend(); ++it)

template<typename T> bool   setmin(T & a, T b) { if(b <  a) { a = b; return true; } else { return false; } }
template<typename T> bool   setmax(T & a, T b) { if(b >  a) { a = b; return true; } else { return false; } }
template<typename T> bool setmineq(T & a, T b) { if(b <= a) { a = b; return true; } else { return false; } }
template<typename T> bool setmaxeq(T & a, T b) { if(b >= a) { a = b; return true; } else { return false; } }
template<typename T> T gcd(T a, T b) { return (b == 0 ? a : gcd(b, a % b)); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }

// ---- ----

int n, a[100];

int main() {
	cin >> n;
	inc(i, n) { cin >> a[i]; }
	
	int mi = 1001, ma = -1;
	inc(i, n) {
		setmax(ma, a[i]);
		setmin(mi, a[i]);
	}
	
	cout << (ma - mi) << endl;
	
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

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

        int table[][] = new int[r+1][c+1];
        
        for(int i=0;i<r;i++){
            for(int j=0;j<c;j++){
                table[i][j] = sc.nextInt();
                table[i][c] += table[i][j];
                table[r][j] += table[i][j];
                table[r][c] += table[i][j];
            }
            sc.nextLine();
        }

        for(int i=0;i<=r;i++){
            for(int j=0;j<c;j++){
                System.out.print(table[i][j]+" ");
            }
            System.out.println(table[i][c]);
        }
    }
}


Measured memory_bytes: 46588
import java.util.*;
public class Main {
    static Scanner kbd = new Scanner(System.in);
    public static void main(String[] args) {
	
	while(kbd.hasNext()){
	    int n = kbd.nextInt();
	    int r = kbd.nextInt();
	    if(n!=0 && r!=0){
		int[] card = new int[n];
		int m = card.length;
		for(int i=0; i<card.length; i++){
		    card[i] = m;
		    m--;
		}

		while(r>0){
		    cut(card);
		    r--;
		    /*
		    for(int i=0; i<card.length; i++)
			System.out.print(card[i]+" ");
		    System.out.println();
		    */
		}
		
		System.out.println(card[0]);
	    }
	}
    }

    static void cut(int[] card) {
	int p = kbd.nextInt();
	int c = kbd.nextInt();

	int w = p-1;

	int[] move = new int[c];
	for(int a=0; a<move.length; a++){
	    move[a] = card[w];
	    w++;
	    /*
	      for(int i=0; i<card.length; i++)
	      System.out.print(card[i]+" ");
	      System.out.println();
	    */
	}
	
	w = p+c-2;
	for(int j=p-2; j>=0; j--){
	    card[w] = card[j];
	    w--;
	    /*
	    for(int i=0; i<card.length; i++)
		System.out.print(card[i]+" ");
	    System.out.println();
	    */
	}
	
	for(int k=0; k<c; k++){
	    card[k] = move[k];
	    /*
	      for(int i=0; i<card.length; i++)
		System.out.print(card[i]+" ");
	    System.out.println();
	    */
	}
    }
}
	

Measured memory_bytes: 12000
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define LLINF 9223372036854775807
#define MOD ll(1e9+7)

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

    string key = "keyence";
    if(s==key){
        cout << "YES" << endl;
        return 0;
    }
    int l = 0;
    while(s[l]==key[l]){
        l++;
    }
    int r = s.size()-1;
    int r2 = 6;
    while(s[r]==key[r2]){
        r--; r2--;
    }
    if(l+(6-r2)>=7){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
# -*- coding: utf-8 -*-



def main():
    A, B = input().split()

    assert A in ("H", "D")
    assert B in ("H", "D")

    if A == "H":
        print("H" if B == "H" else "D")
    elif A == "D":
        print("H" if B == "D" else "D")

if __name__ == "__main__": main()


Measured memory_bytes: 2940
#include <set>
#include <map>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <bitset>
#include <string>
#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <algorithm>
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define REP(i, x, y) for(int i = (int)x; i <= (int)y; i ++)
#define FOR(i, x, y) for(int i = (int)x; i <  (int)y; i ++)
#define PER(i, x, y) for(int i = (int)x; i >= (int)y; i --)
#define trace(x) cerr << #x << " " << x << endl;
#define dprintf(...) fprintf(stderr, __VA__ARGS__)
#define dln()        fprintf(stderr, "\n")
using namespace std;
typedef long long LL;
typedef long double db;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<PII> VPI;
const	int N = 100005;
const	int P = 1e9 + 7;
const	int inf = 1e9;
const	LL Inf = 1e15;

inline int IN(){
	char ch = getchar(); int x = 0, f = 0;
	while(ch < '0' || ch > '9') ch = getchar(), f = (ch == '-');
	while(ch >= '0' && ch <= '9'){
		x = (x << 1) + (x << 3) + ch - 48;
		ch = getchar();
	}
	return f ? (-x) : x;
}

inline int Pow(int x, int y, int p){
	int an = 1;
	for(; y; y >>= 1, x = (LL)x * x % p) if(y & 1) an = (LL)an * x % p;
	return an;
}

template<typename T> inline void chkmin(T &a, const T &b) {if(a > b) a = b;}
template<typename T> inline void chkmax(T &a, const T &b) {if(a < b) a = b;}

int n, A, B, C;
int fac[10005], ifac[10005];

int Comb(int x, int y){
	if(y < 0 || x < y) return 0;
	return (LL)fac[x] * ifac[y] % P * ifac[x - y] % P;
}

int AA = 0;
int ask(int w){
	//\sum{a[i]} = B / 2
	//\sum{i * a[i]} = w
	//sum of \prod{a[i]!}
	if(B == 0) return w == 0;
	return (LL)AA * Comb(B / 2 + w - 1, B / 2 - 1) % P;	
}

int main(){
	cin >> n >> A >> B >> C;
	if(B & 1){
		puts("0");
		return 0;
	}
	ifac[0] = 1;
	REP(i, 1, 10000) ifac[i] = (LL)ifac[i - 1] * Pow(i, P - 2, P) % P;
	REP(i, 0, 10000) fac[i] = Pow(ifac[i], P - 2, P);
	AA = ifac[B / 2];
	int ans = 0;
	REP(a, 0, A) for(int b = 0; 3 * b <= C; b ++){
		int ww = C - A + a - 3 * b;
		if(ww < 0) continue;
		int cf = (LL)fac[A + b + B / 2] * ifac[a] % P * ifac[A - a] % P * ifac[b] % P;
		cf = (LL)cf * ask(ww) % P;
		ans = (ans + cf) % P;
	}
	printf("%d\n", ans);
	return 0;
}


















Measured memory_bytes: 384
// ※※※ 解答不能 ※※※
// 正解者のソースを学習する(一部改変).
// hbi1998氏
// https://atcoder.jp/contests/agc038/submissions/7638361
#include <bits/stdc++.h>
using namespace std;

const int N = 110000;

namespace Dinic{
    using F = int;
    const F INF = 1e9 + 1e8;
    const int N = 220000;
    const int M = 1100000;
    int fst[N], nxt[M], to[M];
    F cap[M];
    int dis[N], q[N], ptr[N];
    int V, E;
    void init(){
        memset(fst, -1, sizeof fst);
        V = E = 0;
    }
    inline int add_node() { V++; return V-1; }
    inline void add_edge(int u, int v, F c) {
        to[E] = v, cap[E] = c, nxt[E] = fst[u], fst[u] = E++;
        to[E] = u, cap[E] = 0, nxt[E] = fst[v], fst[v] = E++;
    }
    inline bool bfs(int S, int T, int n){
        memset(dis, -1, sizeof(int) * n);
        int h = 0, t = 0;
        dis[S] = 0, q[t++] = S;
        while(h < t){
            int u = q[h++];
            for(int e = fst[u]; ~e; e = nxt[e]){
                if(cap[e] > 0 && dis[to[e]] == -1){
                    dis[to[e]] = dis[u] + 1, q[t++] = to[e];
                    if(to[e] == T) return 1;
                }
            }
        }
        return (dis[T] != -1);
    }
    F dfs(int u, int T, F f){
        if(u == T) return f;
        for (int &e = ptr[u]; ~e; e = nxt[e]){
            if(cap[e] > 0 && dis[to[e]] > dis[u]){
                F ret = dfs(to[e], T, min(f, cap[e]));
                if(ret > 0){
                    cap[e] -= ret, cap[e ^ 1] += ret;
                    return ret;
                }
            }
        }
        return 0;
    }
    F max_flow(int S, int T, int n = V){
        F ret = 0;
        while(bfs(S, T, n)){
            memcpy(ptr, fst, sizeof(int) * n);
            for(F cur; (cur = dfs(S, T, INF)) > 0; ret += cur);
        }
        return ret;
    }
};

int a[2][N], vis[2][N], cnt[2];
vector<int> vec[2][N];
map<int, int> adj[N];

int main(){
    int n;
    scanf("%d", &n);
    int ans = 0;
    for(int i : {0, 1}){
        for(int j = 0; j < n; j++) scanf("%d", &a[i][j]);
        for(int j = 0; j < n; j++){
            if(vis[i][j]) continue;
            ++cnt[i];
            for(int k = j; !vis[i][k]; k = a[i][k]){
                vis[i][k] = cnt[i];
                vec[i][cnt[i]].push_back(k);
            }
            if(vec[i][cnt[i]].size() == 1) continue;
            ans += vec[i][cnt[i]].size();
        }
    }
    int S = 0, T = cnt[0] + cnt[1] + 1;
    Dinic::init();
    for(int i = 0; i < n; i++){
        int u = vis[0][i], v = vis[1][i];
        if(vec[0][u].size() == 1 || vec[1][v].size() == 1) continue;
        adj[u][v]++;
        if(a[0][i] == a[1][i]) adj[u][v]++;
    }
    for(int i = 1; i <= cnt[0]; i++){
        if(vec[0][i].size() == 1) continue;
        Dinic::add_edge(S, i, vec[0][i].size());
    }
    for(int i = 1; i <= cnt[1]; i++){
        if(vec[1][i].size() == 1) continue;
        Dinic::add_edge(i + cnt[0], T, vec[1][i].size());
    }
    for(int i = 1; i <= cnt[0]; i++){
        for(auto t : adj[i]){
            Dinic::add_edge(i, t.first + cnt[0], t.second);
        }
    }
    printf("%d\n", ans - Dinic::max_flow(S, T, T + 1));
    return 0;
}

Measured memory_bytes: 26752
#include<bits/stdc++.h>
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
#define lli long long int
#define ulli unsigned long long int
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define loopl(i,a,b) for(lli i=a;i<b;i++) 
#define loop(i,a,b) for(int i=a;i<b;i++)
#define all(v) v.begin(), v.end()
#define mod 1000000007
#define mod2 1000000006
#define inf 1000000000000000000
#define lld long double
#define pll pair<long long int,long long int>
#define pii pair<int,int>
#define vll vector<lli>
#define vii vector<int>
#define is indexed_set
#define eps 0.000001
#define endl '\n'
#define mo 998244353
#define pi 3.141592653589793
#define FF first
#define SS second
using namespace std ;
 
const lli dx4[] = {-1, 0, 1, 0};
const lli dy4[] = {0, 1, 0, -1};
const lli dx8[] = {-1, 0, 1, 0, -1, -1, 1, 1};
const lli dy8[] = {0, 1, 0, -1, -1, 1, -1, 1};
 
typedef tree<pll,null_type,less<pll>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count()); // can give negative values too

#define N 100001

void solve()
{
    lli l,r,d;
    cin>>l>>r>>d;

    int cnt=0;

    loopl(i,l,r+1)
    {
        if(i%d == 0) cnt++;
    }
    cout<<cnt;
    
}   

int main()
{
////////////////////////////////////////////   
    fastio;
////////////////////////////////////////////
    
    lli t;
    t=1;
    while(t--)
    {
        solve();
    }
}


Measured memory_bytes: 3640
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Math;
using static System.Console;
using System.Text;

class Program
{
    static void Main(string[] args)
    {
        solve();
    }
    static Scanner cin;
    static int N, M;
    static void input()
    {
        cin = new Scanner();
        N = cin.nextInt();
        M = cin.nextInt();
    }
    static void solve()
    {
        input();
        WriteLine((1900 * M + 100 * (N - M)) * (1 << M));
    }
    class Scanner
    {
        string[] s;
        int i;

        char[] cs = new char[] { ' ' };

        public Scanner()
        {
            s = new string[0];
            i = 0;
        }
        
        public string next()
        {
            if (i < s.Length) return s[i++];
            string st = Console.ReadLine();
            while (st == "") st = Console.ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            if (s.Length == 0) return next();
            i = 0;
            return s[i++];
        }

        public int nextInt()
        {
            return int.Parse(next());
        }

        public int[] ArrayInt(int N, int add = 0)
        {
            int[] Array = new int[N];
            for(int i = 0; i < N; i++)
            {
                Array[i] = nextInt() + add;
            }
            return Array;
        }

        public long nextLong()
        {
            return long.Parse(next());
        }

        public long[] ArrayLong(int N, long add = 0)
        {
            long[] Array = new long[N];
            for(int i = 0; i < N; i++)
            {
                Array[i] = nextLong() + add;
            }
            return Array;
        }

        public double nextDouble()
        {
            return double.Parse(next());
        }

        public double[] ArrayDounble(int N, int add = 0)
        {
            double[] Array = new double[N];
            for (int i = 0; i < N; i++)
            {
                Array[i] = nextDouble() + add;
            }
            return Array;
        }
    }
}

Measured memory_bytes: 11092
#include <cmath>
#include <iostream>
#include <iomanip>

/*
ax + by = c
dx + ey = f

x = (c-by)/a
d(c-by)/a + ey = f
dc/a - dby/a + ey = f
ey - dby/a = f - dc/a
y(e-db/a) = f - dc/a
y = (f-dc/a)/(e-db/a)

aex + bey = ce
bdx + bey = bf
aex - bdx = ce - bf
x(ae - bd) = ce - bf
x = (ce - bf)/(ae - bd)
by = c - ax
y = (c - ax)/b
*/
int main()
{
    while(true){
        double a, b, c, d, e, f;
        std::cin >> a >> b >> c >> d >> e >> f;
        if(std::cin.eof()) break;
        double x, y;
        if(b == 0) return 0;
        // if(b){
            x = (c*e - b*f) / (a*e - b*d);
            y = (c - a*x) / b;
        // }else{
        //     y = (f-d*c/a)/(e-d*b/a);
        //     x = (c-b*y)/a;
        // }
        if(x == -0) x = 0;
        if(y == -0) y = 0;
        std::cout << std::fixed << std::setprecision(3);
        std::cout << x << " " << y << std::endl;
    }
    return 0;
}

Measured memory_bytes: 3280
n=gets.to_i
a=gets.split.to_a
b=gets.split.to_a

i=b.length-1
ans=0

while i>=0
    a[i+1]=a[i+1].to_i
    a[i]=a[i].to_i
    b[i]=b[i].to_i
    v=b[i]
    
   j=1
   while j>=0
    if a[i+j]>=b[i]
    a[i+j]-=b[i]
    b[i]=0
    break
    
    elsif
    vv=a[i+j]
    a[i+j]=0
    b[i]-=vv
    end
    j-=1
   end
    ans+=v-b[i]
    
    i-=1
end

puts ans

Measured memory_bytes: 13844
n=int(input())
l=[]
import copy
h=[]
for i in range(n):
    l.append(int(input()))
l_max=max(l)
#print(l_max)
h=copy.copy(l)
h.sort()
l_second=h[-2]
#print(l_second)

for i in range(n):
    if l[i] != l_max:
        print(l_max)
    else:
        print(l_second)

Measured memory_bytes: 14632
package main

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

const (
	maxBufSize = 1024 * 1024
)

var (
	sc = func() *bufio.Scanner {
		sc := bufio.NewScanner(os.Stdin)
		buf := make([]byte, 1)
		sc.Buffer(buf, maxBufSize)
		sc.Split(bufio.ScanWords)
		return sc
	}()
	out = bufio.NewWriter(os.Stdout)
)

var dpss [][]int64
var css [][]int64
var ass [][]int64

func subSolve(from int64, filter int64) int64 {
	if from == 1 {
		return 0
	}
	if dpss[from][filter] != 0 {
		return dpss[from][filter]
	}
	ret := css[from][1]
	for via := int64(0); via < 10; via ++ {
		if via == 1 {
			continue
		}
		viaFilter := int64(1) << via
		if (viaFilter & filter) == 0 {
			continue
		}
		candidate := css[from][via]
		if candidate >= ret {
			continue
		}
		candidate += subSolve(via, filter ^ viaFilter)
		if candidate < ret {
			ret = candidate
		}
	}
	dpss[from][filter] = ret
	return ret
}

func solve(h int64, w int64) int64 {
	dpss = make([][]int64, 10)
	for i := 0;i < 10; i ++ {
		dpss[i] = make([]int64, 1024)
	}
	ret := int64(0)
	for _, as := range ass {
		for _, a := range as {
			if a < 0 {
				continue
			}
			r := subSolve(a, 1023)
			ret += r
		}
	}
	return ret
}

func main() {
	defer out.Flush()

	h := nextInt()
	w := nextInt()
	css = make([][]int64, 10)
	for i := 0; i < 10; i++ {
		css[i] = make([]int64, 10)
		for j := 0; j < 10; j++ {
			css[i][j] = nextInt()
		}
	}
	ass = make([][]int64, h)
	for i := int64(0); i < h; i++ {
		ass[i] = make([]int64, w)
		for j := int64(0); j < w; j++ {
			ass[i][j] = nextInt()
		}
	}
	res := solve(h, w)
	fmt.Fprintln(out, res)
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextStringAsBytes() []byte {
	sc.Scan()
	return []byte(sc.Text())
}

func nextInt() int64 {
	a, _ := strconv.ParseInt(next(), 10, 64)
	return a
}

func nextFloat() float64 {
	a, _ := strconv.ParseFloat(next(), 64)
	return a
}

func nextInts(n int64) []int64 {
	ret := make([]int64, n)
	for i := int64(0); i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}

func nextFloats(n int64) []float64 {
	ret := make([]float64, n)
	for i := int64(0); i < n; i++ {
		ret[i] = nextFloat()
	}
	return ret
}
func nextStrings(n int64) []string {
	ret := make([]string, n)
	for i := int64(0); i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func containStr(arr []string, target string) bool {
	for _, v := range arr {
		if v == target {
			return true
		}
	}
	return false
}

func PrintOut(src interface{}, joinner string) {
	switch reflect.TypeOf(src).Kind() {
	case reflect.Slice:
		s := reflect.ValueOf(src)
		for idx := 0; idx < s.Len(); idx++ {
			fmt.Fprintf(out, "%v", s.Index(idx))
			if idx < s.Len()-1 {
				fmt.Fprintf(out, "%s", joinner)
			} else {
				fmt.Fprintln(out)
			}
		}
	default:
		fmt.Fprintln(out, "orz")
	}
}

// mapからkeysとvaluesを返す
func splitKeyValue(m map[interface{}]interface{}) (keys, values []interface{}) {
	switch reflect.TypeOf(m).Kind() {
	case reflect.Map:
		s := reflect.ValueOf(m)
		for _, v := range s.MapKeys() {
			keys = append(keys, v)
			values = append(values, s.MapIndex(v))
		}
	default:
		fmt.Fprintln(out, "orz")
	}
	return
}


Measured memory_bytes: 2308
#include<iostream>
#include<algorithm>
#include<ctime>
#include<vector>
#include<string>
#include<cmath>
#include<map>
#include<iomanip>
#include<numeric>
#include<queue>
#include<deque>
#include<cfloat>
#include<functional>
#include<tuple>
#include<math.h>
#include<bitset>
#include<stack>
#include<set>
#include<random>
#include<stdlib.h>
#define rip(i,n) for(ll i=0;i<n;i++)
#define Rip(i,n) for(ll i=1;i<=n;i++)
#define all(V) V.begin(),V.end()
#define ll long long
#define ld long double
#define MOD 1000000007
#define mod 998244353
#define sec setprecision
#define Pair pair<ll,ll>
#define _CRT_SECURE_NO_WARNINGS
#pragma target("avx")
#pragma optimize("O3")
#pragma optimize("unroll-loops")
constexpr double eps = 1e-9;
constexpr double pi = 3.141592653589793238462643383279;
using namespace std;
ll gcd(ll a, ll b)
{
	if (a % b == 0)	return(b);
	else return(gcd(b, a % b));
}
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
ll pow(ll x, ll n) {
	x %= mod;
	if (n == 0)
		return 1;
	if (n % 2 == 0)
		return (pow((x * x) % mod, n / 2) % mod);
	else
		return (x * pow(x, n - 1)) % mod;
}
int main() {
	int n, m; cin >> n >> m;
	vector<int>a(m); rip(i, m)cin >> a[i];
	vector<int>dp(n+1,0);//dp[i]deidannmeniikutoori
	dp[0] = 1;
	rip(i, m)dp[a[i]] = 0;
	vector<bool>pd(n + 1, true);
	rip(i, m)pd[a[i]] = false;
	for (int i = 1; i <= n; i++) {
		if (pd[i] == true) {
			if (i == 1)dp[i] = 1;
			else dp[i] = (dp[i - 1]%MOD + dp[i - 2]%MOD);
		}
	}
	cout << dp[n]%MOD << endl;
}


Measured memory_bytes: 3980
#include <bits/stdc++.h>
using namespace std;
using ll = unsigned long long;
template <class T, class U> using Pa = pair<T, U>;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll X;
    cin >> X;
    int ans = 0;
    ll now = 100;
    while(now<X){
        now += now/100;
        ans++;
    }
    cout << ans << "\n";
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_ll.hpp>
//typedef boost::multiprecision::cpp_ll ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E18;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define endl "\n"
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

ll n,m,s;
struct Edge{
    ll to;
    ll a,b;
};
struct Node{
    vector<Edge> v;
    ll c,d;
};

Node node[51];

ll dp[51][5001];


int main(){fastio
    cin>>n>>m>>s;
    ll u,v,a,b;
    Edge e;
    rep(i,0,m-1){
        cin>>u>>v>>a>>b;
        e.to=v;
        e.a=a;
        e.b=b;
        node[u].v.pb(e);
        e.to=u;
        node[v].v.pb(e);
    }
    ll c,d;
    rep(i,1,n){
        cin>>c>>d;
        node[i].c=c;
        node[i].d=d;
    }
    rep(i,0,50){
        rep(j,0,5000){
            dp[i][j]=inf;
        }
    }
    dp[1][min(5000,s)]=0;
    
    priority_queue<pair<ll,l_l>,vector<pair<ll,l_l>>,greater<pair<ll,l_l>>> q;
    q.push(make_pair(0,make_pair(min(5000,s),1)));
    pair<ll,l_l> pp;
    l_l p;
    while(q.size()>0){
        pp=q.top();
        q.pop();
        p=pp.second;
        ll i=p.second;
        ll j=p.first;
        
        if(dp[i][j]<pp.first)continue;
        
        if(j==5000){
            
        }else if(j+node[i].c>=5000){
            if(dp[i][5000]>dp[i][j]+node[i].d){
                dp[i][5000]=dp[i][j]+node[i].d;
                q.push(make_pair(dp[i][j]+node[i].d,make_pair(5000,i)));
            }
        }else{
            if(dp[i][j+node[i].c]>dp[i][j]+node[i].d){
                dp[i][j+node[i].c]=dp[i][j]+node[i].d;
                q.push(make_pair(dp[i][j]+node[i].d,make_pair(j+node[i].c,i)));
            }
        }
        rep(k,0,(ll)node[i].v.size()-1){
            if(j-node[i].v[k].a>=0){
                if(dp[node[i].v[k].to][j-node[i].v[k].a]>dp[i][j]+node[i].v[k].b){
                    dp[node[i].v[k].to][j-node[i].v[k].a]=dp[i][j]+node[i].v[k].b;
                    q.push(make_pair(dp[i][j]+node[i].v[k].b,make_pair(j-node[i].v[k].a,node[i].v[k].to)));
                }
            }
        }
        
    }
    ll ans;
    rep(i,2,n){
        ans=inf;
        rep(j,0,5000){
            ans=min(ans,dp[i][j]);
        }
        cout<<ans<<endl;
    }
    
    return 0;
    
    
    
}


Measured memory_bytes: 11524
#include<bits/stdc++.h>
#define ll long long 
#define inf 0x7fffffff
#define infll 0x7fffffffffffffff
#define clr(c) memset(c,0,sizeof(c))
using namespace std;
int mod=998244353;
const int M=2e5+10;
const int N=1e6+10;
inline ll read(){
    ll b=1,sum=0; char c=getchar();
    while(!isdigit(c)){if(c=='-') b=-1; c=getchar();}
    while(isdigit(c)){sum=sum*10+c-'0'; c=getchar();}
    return b*sum;
}
int T,n,m,k;
int ans;
int a[N];
char s[N],t[N]; 
int main()
{
    int i,j;
    T=1;
//	T=read();
	while(T--) {
		ans=0;
		scanf("%s %s",s+1,t+1);
		n=strlen(s+1);
		for(i=1;i<=n;i++) {
			if(s[i]!=t[i]) ans++;
		}		
		bool f=0;
		printf("%d",ans);
		puts("");
	}
    return 0;
}


Measured memory_bytes: 4212
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aajisaka
 */

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")

#include<bits/stdc++.h>

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define SPEED ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;

constexpr long double PI = 3.14159265358979323846264338327950288L;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

class CStrangeDance {
public:
    void solve(istream& cin, ostream& cout) {
      SPEED;
      int n; cin >> n;
      string t; cin >> t;

      // initialize vector size
      vector<vector<vector<int>>> v(3, vector<vector<int>>(n));
      int k = 1;
      rep(i, n) {
        rep(j, 3) {
          v[j][i].resize(k);
        }
        k *= 3;
      }
      int K = k;

      // initialize vector
      rep(i, n) {
        int idx = 0;
        rep(j, 3) {
          for(auto& e: v[j][i]) {
            e = idx;
            idx++;
          }
        }
      }

      for(auto c: t) {
        if (c=='S') {
          // swap vector
          swap(v[1], v[2]);
        } else {
          // swap by point
          int w = 0;
          rep(i, n) {
            auto v0 = v[0][i][w];
            auto v1 = v[1][i][w];
            auto v2 = v[2][i][w];
            v[1][i][w] = v0;
            v[2][i][w] = v1;
            v[0][i][w] = v2;
            w = v2;
          }
        }
      }

      // recover
      vector<int> ans(K);
      k = 1;
      rep(i, n) {
        for(int j=1; j<=2; j++) {
          for(auto e: v[j][i]) {
            for(int idx=e; idx<K; idx+=(k*3)) {
              ans[idx] += j*k;
            }
          }
        }
        k *= 3;
      }

      for(auto e: ans) {
        cout << e << ' ';
      }
    }
};

signed main() {
  CStrangeDance solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}

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

int HowMuch(vector<int> a, int x, int count)
{
  int tmp = count;
  for(int i: a){
    if(i%x != 0)
      return tmp;
  }
  tmp++;
  return HowMuch(a, 2*x, tmp);
}

int main()
{
  int N;
  int count = 0;
  cin>>N;

  vector<int> a(N);
  for(int i=0; i<N; i++){
    cin>>a[i];
  }
  
  int x = 2;
  int ans = HowMuch(a, x, count);
  cout<<ans<<endl;
}


Measured memory_bytes: 256
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int S[SIZE],T[SIZE],X[SIZE];
int an[SIZE];
int d[SIZE];
bool cmp(int x,int y){
    return X[x]<X[y];
}
int main(){
    int N,Q;
    R(N,Q);
    REP(i,N){
        R(S[i],T[i],X[i]);
        d[i]=i;
    }
    set<PII>AA;
    FOR(i,1,Q){
        int x;
        R(x);
        AA.insert({x,i});
    }
    sort(d,d+N,cmp);
    REP(i,N){
        int id=d[i];
        int l=S[id]-X[id];
        int r=T[id]-X[id];
        auto it_st=AA.lower_bound(MP(l,-1));
        auto it_ed=it_st;
        while(it_ed!=AA.end()&&it_ed->F<r){
            an[it_ed->S]=X[id];
            it_ed++;
        }
        AA.erase(it_st,it_ed);
    }
    FOR(i,1,Q){
        if(!an[i])W(-1);
        else W(an[i]);
    }
    return 0;
}


Measured memory_bytes: 28416
s = input()

ans = [0 for i in range(ord('z')-ord('a')+1)]
for i in range(ord('a'),ord('z')+1):
    c = chr(i)
    s2 = s.split(c)
    ans[i-ord('a')] = max([len(ss) for ss in s2])
print(min(ans))


Measured memory_bytes: 3060
a =[list(map(int, input().split())) for i in range(3)] 
n=int(input())
ans = 'No'
for i in range(n):
    d = int(input())
    for i in range(3):
        for j in range(3):
            if d == a[i][j]:
                a[i][j]=0

if a[0][0] == 0 and a[1][1] == 0 and a[2][2]==0:
    ans = 'Yes'
elif a[0][2] == 0 and a[1][1] == 0 and a[2][0]==0:
    ans = 'Yes'
else: 
    for l in a:
        if sum(l)==0:
            ans = 'Yes'
            break
    for l in zip(*a):
        if sum(l)==0:
            ans = 'Yes'
            break
        

print(ans)

Measured memory_bytes: 38256
fun main(args: Array<String>) = println(run {
    val n = readLine()!!.toInt()
    val b = readLine()!!.split(" ").map { it.toInt() }

    val a = IntArray(n)
    a[0] = b[0]
    a[n-1] = b[n-2]
    for (i in 1..n-2) {
        a[i] = Math.min(b[i-1], b[i])
    }
    a.sum()
})

Measured memory_bytes: 37912
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	long long int l, r, i,j,ans=2019;
	cin >> l >> r;
	if (r - l > 2018)ans = 0;
	else {
		l = l % 2019;
		r = r % 2019;
		if (l > r)ans = 0;
		else for (i = l; i < r; i++)for (j = i + 1; j <= r; j++) ans = min((i*j) % 2019, ans);
	}
	cout << ans;
    return 0;
}

Measured memory_bytes: 256
#include <iostream> 
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<iomanip>
#include<sstream>
#include<cmath>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define req(i,n) for(int i = 1;i <=  n; i++)
#define rrep(i,n) for(int i = n -1;i >= 0;i--)
typedef long long int ll;
typedef long double ld;
const int inf = (1 << 30);
const int MOD = 1000000007;
template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T & val) {
    std::fill((T*)array, (T*)(array + N), val);
}

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

Measured memory_bytes: 3632
N, M = list(map(int, input().split()))

listA= []
for i in range(M):
    a,b= input().split()
    listA.append((int(a),b))

hantei = []
for j in range(0,N):
    hantei.append([0,0])


for i in range(0,M):
    num = listA[i][0]-1
    if listA[i][1]=='AC':

        hantei[num][0]=1

    elif listA[i][1]=='WA' and hantei[num][0]==0:

        hantei[num][1] += 1


pena = 0
corr=0
for y in range(0, N):
    if hantei[y][0]==1:
        corr += 1
        pena += hantei[y][1]

print(corr,pena)


Measured memory_bytes: 29064
//khodaya khodet komak kon
#include <bits/stdc++.h>

#define F first
#define S second
#define pb push_back
#define all(x) x.begin(), x.end()
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#define int long long

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int N = 500 + 10;
const ll MOD = 1000000000 + 7;
const ll INF = 1000000010;
const ll LOG = 25;

int DP[110][110][N], PS[110][110][N], ps[110][110][N], L[N], n, X;

int mul(int a, int b){
	return a * 1ll * b % MOD;
}

int add(int a, int b){
	a += b;
	if (a >= MOD) a -= MOD;
	return a;
}

int minu(int a, int b){
	a -= b;
	if (a < 0) a += MOD;
	return a;
}

int32_t main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> X;
	for (int i = 1; i <= n; i++){
		cin >> L[i];
	}
	sort(L + 1, L + n + 1);
	reverse(L + 1, L + n + 1);
	DP[1][1][L[1]] = 1;
	for (int i = 0; i < N; i++) PS[1][1][i] = (i == 0?DP[1][1][i]:add(PS[1][1][i - 1], DP[1][1][i])), ps[1][1][i] = add((i == 0?0:ps[1][1][i - 1]), mul(DP[1][1][i], i));
	for (int i = 2; i <= n; i++) for (int j = 1; j <= i; j++) for (int k = 1; k <= X; k++){
		if (k >= L[i]) DP[i][j][k] = mul(j, DP[i - 1][j - 1][k - L[i]]);
		DP[i][j][k] = add(DP[i][j][k], mul(DP[i - 1][j][k], (k - (L[i] - 1) * j)));
		DP[i][j][k] = add(DP[i][j][k], mul(2 * j, minu(PS[i - 1][j][k - 1], PS[i - 1][j][max(0ll, (k - L[i]))])));
		DP[i][j][k] = add(DP[i][j][k], mul(j, add(mul(L[i] - 1, minu(PS[i - 1][j + 1][k], PS[i - 1][j + 1][max(0ll, k - (L[i] - 2) - 1)])), minu(minu(ps[i - 1][j + 1][k], ps[i - 1][j + 1][max(0ll, k - L[i] + 1)]), mul(k, minu(PS[i - 1][j + 1][k], PS[i - 1][j + 1][max(k - L[i] + 1, 0ll)]))))));
		PS[i][j][k] = add(PS[i][j][k - 1], DP[i][j][k]);
		ps[i][j][k] = add(ps[i][j][k - 1], mul(k, DP[i][j][k]));
//		cout << i << ' ' << j << ' ' << k << ' ' << DP[i][j][k] << '\n';
	}
 	int ans = 0;
 	for (int i = 1; i <= n; i++) ans = add(ans, DP[n][i][X]);
 	cout << ans;









	return 0;
}


Measured memory_bytes: 65188
#include<bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define CIN(n)  int(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) <<endl

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

#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(obj) (obj).begin(),(obj).end()

#define P pair<int,int>
#define V vector<int>
#define S set<int>
#define pb(v) push_back(v)
int main(){
    CIN(N);
    vector<int> T,Q,X;
    REP(i,N){
        CIN(b);
        T.pb(b);
    }
    CIN(M);
    REP(i,M){
        CIN(a);
        CIN(b);
        Q.pb(a);
        X.pb(b);
    }
    REP(i,M){
        int ans = 0;
        REP(a,N){
            if(Q.at(i)-1==a){
                ans+=X.at(i);
            }else{
                ans+=T.at(a);
            }
        }
        COUT(ans);
    }
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i =(b)-1;i>=(a);--i)
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define sz(x) (int) (x).size()
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef double db;
typedef vector<int> vi;
const int mod = 1e9 + 7;
const int maxn = 2e6 + 10;
map<ll,int> ms;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,x;
	ll ans = 0;
	cin >> n;
	rep(i,0,n){
		cin >> x;
		ms[x+i]++;
		ans += ms[i - x];		
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 26320
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define endl "\n"
#define ff first
#define ss second
#define inp(a) int a; cin>>a;
#define inpa(a,n) vector<int>a(n+1); FOR(i,1,n) cin>>a[i];
#define PI 3.141592653589793238
#define vec(x) vector<x>
#define pii pair<int,int>
#define mem(a,b) memset(a, b, sizeof a)
#define FOR(i,j,n) for(int i= j; i<=n; i++)
#define CASE int t; cin>>t; while(t--)
#define prec(n) fixed<<setprecision(n)
#define print(x) for(auto c : x) cout << c << " ";
#define dbg(x) cerr << #x << " :: "<< x << endl;
#define dbg2(x,y) cerr << #x << " :: "<<x <<"\t" << #y << " :: "<<y <<endl;
const int INF = 1e9 + 7;
const int maxn = 1e6 + 3;
const int MOD = 1e9 + 7; 
//////////// template ends here //////////////////////////



void solve(){

	// axyb abyxb
	string s1 = "X",s2 = "Y",k1,k2; 
	cin>>k1>>k2; s1+=k1; s2+=k2;
	int l1 = s1.length(), l2 = s2.length();
	
	vec(vec(int))dp(l1, vec(int)(l2, 0));
	
	for(int i = 1; i <l1; i++){
		for(int j = 1; j <l2; j++){
			if(s1[i] == s2[j]){
				dp[i][j]+=1;
				dp[i][j]+=dp[i-1][j-1];
				continue;
			}
			dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
		}
	}

	int len = 0;

	for(int j = 0; j<l2; j++){
		len = max(len, dp[l1-1][j]);
	}	
	
	char ans[len];
	ans[len--] = '\0';

	int i = l1-1, j= l2-1;	

	while(i > 0 && j > 0){
		if(s1[i]==s2[j]){
			ans[len--] = s1[i--];
			j--;
		}
		else if (dp[i-1][j] > dp[i][j-1])
			i--;
		else
			j--;
	}

	cout << ans << endl;







}


int32_t main(){
	#ifndef ONLINE_JUDGE 
		freopen ("input.txt","r",stdin);
		freopen ("output.txt","w",stdout);
	#endif	
	 ios::sync_with_stdio(0); 
	 cin.tie(0); cout.tie(0);
	//CASE{
		solve();
	//}

	cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
}

Measured memory_bytes: 38548
#define _USE_MATH_DEFINES

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <utility>
#include <climits>
#include <vector>
#include <map>
#include <queue>
#include <set>
using namespace std;

#define ll long long
const int MOD = 1000000007;//10^9+7
const string SPACE = " ";

ll powsur(ll a, ll b, ll p) {

	if (b == 0) {

		return 1;

	}
	else if (b % 2 == 0) {

		ll d = powsur(a, b / 2, p);
		return ((d%p)*(d%p)) % p;

	}
	else {

		return ((a%p)*powsur(a, b - 1, p) % p) % p;

	}

}
//pは素数,aのb乗をpで割った余り

ll CMOD(ll n, ll r, ll p) {

	ll a = 1, b = 1, c = 1, re;
	for (int i = 1; i <= n; i++) {

		a *= i;
		a = a%p;

	}
	for (int i = 1; i <= r; i++) {

		b *= i;
		b = b%p;

	}
	for (int i = 1; i <= n - r; i++) {

		c *= i;
		c = c%p;

	}
	b = powsur(b, p - 2, p);
	c = powsur(c, p - 2, p);
	re = ((a%p)*(b%p)) % p;
	re = ((re%p)*c%p) % p;

	return re;

}
//pは素数,(nCr)%p

ll gcd(ll a, ll b) {

	if (a > b) {

		ll tmp = a;
		a = b;
		b = tmp;

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

}
//最大公約数

ll lcm(ll a, ll b) {

	return (a / gcd(a, b))*b;

}
//最小公倍数

ll MAX(ll a, ll b) {

	if (a > b)return a;
	else return b;

}
//MAX

ll MIN(ll a, ll b) {

	if (a < b)return a;
	else return b;

}
//MIN

bool p_judge(ll p) {

	if (p == 1)return false;
	else if (p == 2)return true;
	else {

		bool flag = true;
		for (int i = 2; i <= sqrt(p); i++) {

			if (p%i == 0) {

				flag = false;
				break;

			}

		}
		return flag;

	}

}
//素数判定,素数=true,合成数=false

int main() {

	int N, M, X, A[105], l = 0, r = 0;

	cin >> N >> M >> X;
	for (int i = 0; i < M; i++)cin >> A[i];
	for (int i = X; i >= 0; i--) {

		for (int j = 0; j < M; j++) {

			if (i == A[j]) {

				l++;

				break;
			}

		}

	}
	for (int i = X; i <= N; i++) {

		for (int j = 0; j <= M; j++) {

			if (i == A[j]) {

				r++;

				break;
			}

		}

	}

	cout << min(l, r) << endl;

	return 0;
}

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



int main(){

	int n;
	cin>>n;
	
	vector<int> d(n),D(n);
	
	rep(i,n)cin>>d[i]>>D[i];
	string ans ="No";
	rep(i,n-2){
		if(d[i]==D[i] && d[i+1]==D[i+1] && d[i+2]==D[i+2]){
			ans = "Yes";
		}
	}
	
	cout<<ans<<endl;

	return 0;
}



Measured memory_bytes: 3632
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>

namespace adaptor = boost::adaptors;

void solve()
{
    int64_t N;
    std::cin >> N;
    int64_t four = 0, two = 0, none = 0;
    for (int64_t i = 0; i < N; i++)
    {
        int64_t a;
        std::cin >> a;
        if (a % 4 == 0)
        {
            four++;
            continue;
        }
        if (a % 2 == 0)
        {
            two++;
            continue;
        }
        none++;
    }

    if (two == 0)
    {
        std::string ans = none <= four + 1 ? "Yes" : "No";
        std::cout << ans << std::endl;
    }
    else
    {
        std::string ans = none <= four ? "Yes" : "No";
        std::cout << ans << std::endl;
    }

}

int main()
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    solve();
}


Measured memory_bytes: 3632
let call n =
  let rec check_num i =
    if i <> 1 && i > n then print_newline ()
    else
    if i mod 3 = 0 then begin
      Printf.printf " %d" i; check_num (i+1)
    end
    else
      let rec include3 j =
        if j mod 10 = 3 then begin
          Printf.printf " %d" i; check_num (i+1)
        end
        else
          let k = j/10 in
          if k > 0 then include3 k else check_num (i+1)
      in include3 i
  in check_num 1;;
let () = Scanf.scanf "%d\n" (fun n -> call n);;


Measured memory_bytes: 3648
import java.util.Scanner

object Main extends App {

  val sc = new Scanner(System.in)

  val n = sc.nextInt

  val al = Seq.fill(n)(sc.nextInt)

  val oddCnt = al.count(_ % 2 != 0)

  val res = if(oddCnt % 2 == 0) "YES" else "NO"

  println(res)


}


Measured memory_bytes: 54800
#import sys
#import numpy as np
#import math
#import itertools
#from fractions import Fraction
#import itertools
from collections import deque
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
#import bisect

h,w,n=map(int,input().split())
d={}
p=((1,1),(1,0),(1,-1),(0,1),(0,0),(0,-1),(-1,1),(-1,0),(-1,-1))
for i in range(n):
    a,b=map(int,input().split())
    a-=1
    b-=1
    for idx in p:
        s,t=idx
        if 0<a+s<h-1 and 0<b+t<w-1:
          if (a+s,b+t) not in d:
            d[(a+s,b+t)]=1
          else:
            d[(a+s,b+t)]+=1
ans=[0]*10
for x in d.values():
  ans[x]+=1
ans[0]=(h-2)*(w-2)-sum(ans)
print(*ans)

Measured memory_bytes: 142324
/*
 * Author : Sadi
 * Sun 05/07/2020
 * 16:41:07.47
 */
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <cassert>

using namespace std;

#define    watch(x); cout << "\n" <<  #x << " is: " << x << "\n";
#define    all(a) (a).begin(), (a).end()
#define    fi first
#define    se second

template<class A, class B>
ostream& operator << (ostream& output, const pair<A, B>& p) {
    output << "(" << p.first << ", " << p.second << ")";
    return output;
}

template<class A>
ostream& operator << (ostream& output, const vector<A>& a) {
    output << "[";
    for(auto it = a.begin(); it != a.end(); ++it) {
        if(it != a.begin()) {
            output << ", ";
        }
        output << *it;
    }
    output << "]";
    return output;
}

using lld = long long;
using pii = pair<int, int>;
using pll = pair<lld, lld>;

//const int inf = 1e9;
//const int mod = 1e9 + 7;
//const double PI = acos(-1.0);
//const int mx = 1e5 + 5;

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


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
#ifndef ONLINE_JUDGE
//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);
#endif // ONLINE_JUDGE

    long long A, B, C, D;
    cin >> A >> B >> C >> D;
    long long mula = B / C;
    long long mulb = B / D;
    long long lcm = (C / gcd(C, D) * D);
    long long commondiv = B / lcm - (A - 1) / lcm;
    long long less1 = (A - 1) / C;
    long long less2 = (A - 1) / D;
    cout << B - A + 1 - (mula - less1) - (mulb - less2) + commondiv << endl;
    return 0;
}


Measured memory_bytes: 3588
package main

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

func solve() {
	n := nextInt()
	d := nextInts(n)

	l := unique(d)
	// println(l)
	println(len(l))
	return
}

func unique(list []int) []int {
	m := make(map[int]bool)
	uniq := make([]int, 0)
	for _, ele := range list {
		if !m[ele] {
			m[ele] = true
			uniq = append(uniq, ele)
		}
	}
	return uniq
}

func main() {
	defer out.Flush()
	in.Split(bufio.ScanWords)

	solve()
}

// --- template ---

var (
	in  = bufio.NewScanner(os.Stdin)
	out = bufio.NewWriter(os.Stdout)
)

func println(a ...interface{}) {
	fmt.Fprintln(out, a...)
}

func printf(format string, a ...interface{}) {
	fmt.Fprintf(out, format, a...)
}

func next() string {
	in.Scan()
	return in.Text()
}

func nextInt() int {
	s := next()
	i, e := strconv.Atoi(s)
	if e != nil {
		fmt.Println(e)
	}
	return i
}

func nextInts(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = nextInt()
	}
	return res
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#define f first
#define s second
#define MOD 1000000007
#define PMOD 998244353
#define pb(x) push_back(x)
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> plii;
typedef pair<int, pii> piii;
const int INF = 1e9+10;
const ll LINF = 1LL*INF*INF;
const int MAXN = 2e5+10;
const int MAXM = 5e3+10;

priority_queue<int> pq;
vector<vector<int> > graph;
queue<int> que;

int A[MAXN];
char S[MAXN];

int main()
{
    int n,m,k,a,b,x,y,q;
    int sum = 0;
    int cnt = 0;
    int mx = 0;
    int mn = INF;
    int cur = 0, idx = -1;
    int tc;

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin>>n;

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

    for(int i=0;i<n;i++)
        if(A[i]==0)cnt++;

    ll res = 0;

    for(int i=0;i<n;i++)
            res+=(ll)abs(A[i]);

    if(cnt){
        cout<<res<<"\n";
        return 0;
    }

    cnt = 0;

    for(int i=0;i<n;i++)
        if(A[i]<0)cnt++;

    if(cnt&1){
        mn = INF;
        for(int i=0;i<n;i++)
            mn = min(mn,abs(A[i]));
        res-=2LL*mn;
    }
    cout<<res<<"\n";

    return 0;
}


Measured memory_bytes: 640
import re
N, K = map(int, input().split())
S = input()
S = re.sub(r"R+", "R", S)
S = re.sub(r"L+", "L", S)
L_num = S.count("L")
num = min(L_num, N - L_num)

if num <= K:
    print(N - 1)
else:
    print(N - len(S) + 2 * K)

Measured memory_bytes: 4632