akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using ll=long long;
using namespace std;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(ll i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
template<class T> inline bool chmin(T& a, T b) {if(a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if(a < b) {a = b; return true;} return false;}
int dh[4] = {-1, 0, 0, 1};
int dw[4] = {0, -1, 1, 0}; 
using P = pair<int, int>;
const double pi = acos(-1.0);

int main(){
  int n;
  cin>>n;
  int y=n/15;
  int x=n*800-200*y;
  cout<<x<<endl;
    
    
  return 0;
}


Measured memory_bytes: 3632
#include<stdio.h>
 
void era_transform(int year, int month, int day);
 
int main(void)
{
    int year, month, day;
    while (scanf("%d %d %d", &year, &month, &day) != EOF) {
         era_transform(year, month, day);
    }
    return 0;
}
 
void era_transform(int year, int month, int day)
{
    int date_number = year * 10000 + month * 100 + day;
    int meiji_number = 1868 * 10000 + 9 * 100 + 8;
    int taisho_number = 1912 * 10000 + 7 * 100 + 30;
    int showa_number = 1926 * 10000 + 12 * 100 + 25;
    int heisei_number = 1989 * 10000 + 1 * 100 + 8;
    if (date_number < meiji_number) {
        printf("pre-meiji\n");
    } else if (date_number < taisho_number) {
        printf("meiji %d %d %d\n", year - 1867, month, day);
    } else if (date_number < showa_number) {
        printf("taisho %d %d %d\n", year - 1911, month, day);
    } else if (date_number < heisei_number) {
        printf("showa %d %d %d\n", year - 1925, month, day);
    } else {
        printf("heisei %d %d %d\n", year - 1988, month, day);
    }
}

Measured memory_bytes: 1036
#include <algorithm>
#include <array>
#include <climits> // INT_MAX, LONG_MAX, LLONG_MAX, UINT_MAX, ULONG_MAX, ULLONG_MAX
#include <cmath>
#include <cstdint>
#include <iostream>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <vector>

#define INF 1e9
#define REP(i,n) for (int i = 0; i < (n); ++i)
#define LOG(x) cerr << #x << " = " << (x) << endl

using namespace std;

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

    bool isFound = false;
    for (int i = 0; i <= N; i++) {
        for (int j = 0; j <= M; j++) {
            if (i * M + (- i + (N - i)) * j == K) {
                isFound = true;
                break;
            }
        }
    }

    cout << (isFound ? "Yes" : "No") << endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
typedef long long ll;
const int mod=1000000007;
int mul(int a,int b){return(ll)a*b%mod;}
int a[100010],d[100010],p[100010],f[100010],c[100010];
bool v[100010];
int main(){
	int n,i,j,c1,c2,ans;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",a+i);
		d[a[i]]++;
	}
	#define wrong {putchar('0');return 0;}
	ans=1;
	for(i=1;i<=n;i++){
		if(d[i]>2)wrong
		if(v[i]||d[i]<2)continue;
		j=i;
		do{
			if(v[j])wrong
			v[j]=1;
			p[a[j]]=j;
			j=a[j];
		}while(j!=i);
	}
	for(i=1;i<=n;i++){
		if(d[i]==0){
			c1=0;
			for(j=i;d[j]!=2;j=a[j]){
				c1++;
				v[j]=1;
			}
			c2=1;
			for(j=p[j];d[j]!=2;j=p[j])c2++;
			if(c1>c2)wrong
			if(c1<c2)ans=mul(ans,2);
		}
	}
	for(i=1;i<=n;i++){
		if(!v[i]){
			c1=0;
			j=i;
			do{
				v[j]=1;
				j=a[j];
				c1++;
			}while(j!=i);
			c[c1]++;
		}
	}
	for(i=1;i<=n;i++){
		c1=1+(i!=1&&(i&1));
		f[0]=1;
		f[1]=c1;
		for(j=2;j<=c[i];j++)f[j]=(mul(f[j-2],mul(j-1,i))+mul(f[j-1],c1))%mod;
		ans=mul(ans,f[c[i]]);
	}
	printf("%d",ans);
}

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

#define iota(i,n,b,s) for(int i=int(b);i!=int((b)+(s)*(n));i+=(s))
#define range(i,n,m) iota(i,(((n)>(m))?((n)-(m)+1):((m)-(n)+1)),(n),((n)>(m)?-1:1))
#define rep(i,n) iota(i,(n),0,1)

#define INF (1e9)
#define EPS (1e-9)
#define cons(a,b) (make_pair(a,b))
#define car(a) (a.first)
#define cdr(a) (a.second)
#define cadr(a) (car(cdr(a)))
#define cddr(a) (cdr(cdr(a)))
#define all(a) a.begin(), a.end()
#define trace(var) cerr<<">>> "<<#var<<" = "<<var<<endl;

typedef long long Integer;
typedef double Real;

template<class S, class T>
ostream& operator<<(ostream& os, pair<S,T> p) {
  os << '(' << car(p) << ", " << cdr(p) << ')';
  return os;
}

template<class T>
ostream& operator<<(ostream& os, vector<T> v) {
  os << v[0];
  for (int i=1, len=v.size(); i<len; ++i) os << ' ' << v[i];
  return os;
}

int dx[] = { -1, 0, 1, 0 };
int dy[] = {  0, -1, 0, 1 };

int main() {

  int k;
  stack<int> s;
  while (cin >> k, cin) {
    if (k > 0) {
      s.push(k);
    }
    else {
      cout << s.top() << endl;
      s.pop();
    }
  }

  return 0;
}

Measured memory_bytes: 1200
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
//#include <stdio.h>
//#include <stack>
//#include <queue>
//#include <cstdio>
#include <cmath>
#include <iterator>
#include <map>
#include <fstream>
//#include <list>
#include <iomanip>
//#include <stdlib.h>
//#include <cctype>

using namespace std;

#define IOS ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
#define prec std::cout << std::fixed << std::setprecision(15);
#define endl "\n"
#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define rep(i, n) for (int i = 0; i < int(n); i++)
#define ssort(z) sort(z.begin(), z.end())
#define rsort(z) sort(z.rbegin(), z.rend())
#define eerase(z) z.erase(unique(z.begin(), z.end()), z.end())
#define ccnt(z, w) count(z.begin(), z.end(), w)
#define rep(i,a,n) for(Int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(Int (i)=(a); (i)<=(n); (i)++)
const int MAX_N = 1000000;
const Int MAX_N_Int = 1000000000000;

template <typename T>
void printV(const std::vector<T>& v, const char * const separator = " ")
{
    if(!v.empty())
    {
        std::copy(v.begin(),
                  --v.end(),
                  std::ostream_iterator<T>(std::cout, separator));
        std::cout << v.back() << "\n";
    }
}


Int gcd(Int a, Int b) {
    return b != 0 ? gcd(b, a % b) : a;
}

Int lcm(Int a, Int b) {
    return a / gcd(a, b) * b;
    //a*bは64bit integer overflow
}

int Max(int a, int b, int c) {
    int temp = max(a, b);
    return max(temp, c);
}

int Min(int a, int b, int c) {
    int temp = min(a, b);
    return min(temp, c);
}

bool integer(double num) {
    return floor(num) == num;
}

Int fact(int num) {
    if (num == 0)
        return 1;
    else
        return num * fact(num - 1);
}

Int yakusu(int n) {
    int cnt = 0;
    for (int i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            cnt++;
            if (i * i != n) cnt++;
        }
    }
    return cnt;
}


Int fact_mod(Int n, Int mod) {
    Int f = 1; repq(i,2,n) f = f * (i % MOD) % MOD;
    return f;
}

// 繰り返し二乗法 (modの世界での累乗)
Int mod_pow(Int x, Int n, Int mod) {
    Int res = 1;
    while(n > 0) {
        if(n & 1) res = (res * x) % mod;
        x = (x * x) % mod;
        n >>= 1;
    }
    return res;
}

// 組み合わせ nCr を求める
Int combination_mod(Int n, Int r, Int mod) {
    if(r > n-r) r = n-r;
    if(r == 0) return 1;
    Int a = 1;
    rep(i, 0, r) a = a * ((n-i) % mod) % mod;
    Int b = mod_pow(fact_mod(r, mod), mod-2, mod);
    return (a % mod) * (b % mod) % mod;
}

bool rev(string s){
    string t=s;
    reverse(s.begin(),s.end());
    return s==t;
}
int main() {
    //COMinit();
    IOS;
    prec;
    Int a=0,b=0,n,m,k,x,y=0,ans=0;
    string str,s,t,u;
    cin>>n>>k;
    for (Int i = k; i <=n+1; ++i) {
        //a=(0+i-1)*i/2;
        //b=(n-i+1 + n)*i/2;
        //cout<<i<<" "<<a<<" "<<b<<endl;
        ans+=(i*(n+1-i)+1)%MOD;
    }
    ans%=MOD;
    cout<<ans;







    //cout<<endl;
    return 0;
}

/*
テレビも無ェ ラジオも無ェ
自動車もそれほど走って無ェ
ピアノも無ェ バーも無ェ
巡査 毎日ぐーるぐる
朝起ぎで 牛連れで
二時間ちょっとの散歩道
電話も無ェ 瓦斯も無ェ
バスは一日一度来る
俺らこんな村いやだ 俺らこんな村いやだ
東京へ出るだ 東京へ出だなら
銭コァ貯めで 東京でベコ(牛)飼うだ
*/


Measured memory_bytes: 3572
def check(n,k,p,T):
    i = 0
    for j in range(k):
        s = 0
        while(s+T[i] <= p):
            s = s+T[i]
            i = i+1
            if (i==n):
                return n
    return i


def solve(n,k,T):
    left =0
    right = 100000 * 10000
    mid = 0
    while (right -left > 1):
        mid = (left + right)//2
        v = check(n,k,mid,T)
        if (v >= n):
            right = mid
        else:
            left = mid
    return right

lis=[]
a = input()
(nn,kk)=list(map(int,a.split()))
for i in range(nn):
    lis.append(int(input()))
ans = solve(nn,kk,lis)
print(ans)

Measured memory_bytes: 11652
#include<bits/stdc++.h>
using namespace std;
typedef  long long ll;
#define pb push_back
#define eb emplace_back
const  int MAX=1000000;

int main()
{
   ll t;

   t=1;

   while(t--)
   {


       ll n;

      n=5;


       ll cnt=0,a;

       while(n--)
       {
           cnt++;
           ll s;

           cin>>s;

           if(s==0)a=cnt;

       }

       cout<<a<<endl;






   }

    }











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

int main(){
    int H, W;
    string S[2000];
    cin >> H >> W;
    for(int i=0; i<H; i++) cin >> S[i];

    static int dp[2001][2001][4];
    for(int i=0; i<H; i++) for(int j=0; j<W; j++){
        if(S[i][j] == '#') continue;
        for(int k=0; k<4; k++) dp[i][j][k] = 1;
        if(i) dp[i][j][0] += dp[i-1][j][0];
        if(j) dp[i][j][1] += dp[i][j-1][1];
    }
    for(int i=H-1; i>=0; i--) for(int j=W-1; j>=0; j--){
        if(S[i][j] == '#') continue;
        dp[i][j][2] += dp[i+1][j][2];
        dp[i][j][3] += dp[i][j+1][3];
    }

    int ans = 0;
    for(int i=0; i<H; i++) for(int j=0; j<W; j++){
        int res = 0;
        for(int k=0; k<4; k++) res += dp[i][j][k];
        ans = max(ans, res);
    }
    cout << ans-3 << endl;
    return 0;
}


Measured memory_bytes: 66944
#include<stdio.h>

int main()
{
    int x,y,cnt=0,n;
    scanf("%d%d",&x,&y);
    if(x < y){
        n = x;
        x = y;
        y = n;
    }
    cnt = x % y;
    while(cnt!=0){
        x = y;
        y= cnt;
        cnt = x % y;
    }
    printf("%d\n",y);
    return 0;
}


Measured memory_bytes: 2116
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        String x = sc.nextLine();
        String[] data = x.split(" ");
        List<BigDecimal> dataDecimalList = new ArrayList();
        for(String a: data){
            BigDecimal bd = new BigDecimal(a);
            dataDecimalList.add(bd);
        }
        List<BigDecimal> targetList = new ArrayList();
        targetList.add(dataDecimalList.get(0).multiply(dataDecimalList.get(2)));
        targetList.add(dataDecimalList.get(0).multiply(dataDecimalList.get(3)));
        targetList.add(dataDecimalList.get(1).multiply(dataDecimalList.get(2)));
        targetList.add(dataDecimalList.get(1).multiply(dataDecimalList.get(3)));

        BigDecimal max = new BigDecimal("-1000000000000000000000000000000000000000000000000000000000000000000000000000");
        for(BigDecimal target: targetList){
            if(max.compareTo(target) == -1){
                max = target;
            }
        }
        System.out.println(max);
    }
}


Measured memory_bytes: 36020
// +build ignore
package main

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

func solve(sc *scanner, wr *bufio.Writer) int {
	N := sc.i()
	M := sc.i()
	X := sc.i()
	C := make([]int, N)
	A := make([][]int, N)
	for i := 0; i < N; i++ {
		C[i] = sc.i()
		A[i] = make([]int, M)
		for j := 0; j < M; j++ {
			A[i][j] = sc.i()
		}
	}

	ans := math.MaxInt64
	for s := 0; s < (1 << N); s++ {
		cost := 0
		levels := make([]int, M)
		for i := 0; i < N; i++ {
			if (s>>i)&1 == 1 {
				cost += C[i]
				for j := 0; j < M; j++ {
					levels[j] += A[i][j]
				}
			}
		}
		passed := true
		for _, lv := range levels {
			if lv < X {
				passed = false
				break
			}
		}

		if passed {
			if ans > cost {
				ans = cost
			}
		}
	}

	if ans == math.MaxInt64 {
		fmt.Println(-1)
	} else {
		fmt.Println(ans)
	}

	return 0
}

func main() {
	sc := newScanner(os.Stdin)
	wr := bufio.NewWriter(os.Stdout)
	ret := solve(sc, wr)
	wr.Flush()
	os.Exit(ret)
}

// I/O
type scanner struct {
	sc *bufio.Scanner
}

func newScanner(input io.Reader) *scanner {
	sc := bufio.NewScanner(input)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &scanner{sc}
}

func (s *scanner) s() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *scanner) i() int {
	i, e := strconv.Atoi(s.s())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *scanner) f() float64 {
	f, e := strconv.ParseFloat(s.s(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *scanner) bs() []byte {
	return []byte(s.s())
}

func (s *scanner) is(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.i()
	}
	return res
}

func (s *scanner) fs(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.f()
	}
	return res
}


Measured memory_bytes: 2164
import math
n = int(input())
S = input()

RL = [None]*2*n

for i in range(2*n):
    if i % 2 == 0:
        if S[i] == 'B':
            RL[i] = 'L'
        else:
            RL[i] = 'R'

    else:
        if S[i] == 'B':
            RL[i] = 'R'
        else:
            RL[i] = 'L'

if S[0] == 'W' or S[-1] == 'W':
    print(0)
    exit()

left = 0
count = 1
mod = 10**9 + 7

for check in RL:
    if check == 'L':
        left += 1
    else:
        count = count * left % mod
        left -= 1

    if left < 0:
        print(0)
        exit()

count = count * math.factorial(n) % mod

if left != 0:
    print(0)
else:
    print(count)


Measured memory_bytes: 5864
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
#define int long long
#define SPEED ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
signed main()
{
    
    int a[3][3];
    for(int i=0;i<3;i++)
    {
        for(int j=0;j<3;j++)
        {
            cin>>a[i][j];
        }
    }
    int n;
    cin>>n;
    for(int l=0;l<n;l++)
    {
        int b;
        cin>>b;
        for(int i=0;i<3;i++)
        {
            for(int j=0;j<3;j++)
            {
                if(a[i][j]==b)
                {
                    a[i][j]=0;
                }
            }
        }
    }
    for(int i=0;i<3;i++)
    {
        int s1=0,s2=0;
        for(int j=0;j<3;j++)
        {
            s1+=a[i][j];
            s2+=a[j][i];
        }
        if(s1==0 || s2==0)
        {
            cout<<"Yes";
            return 0;
        }
    }
    int s1=0,s2=0;
    for(int i=0;i<3;i++)
    {
        for(int j=0;j<3;j++)
        {
            if(j==i)
            {
                s1+=a[i][j];
            }
            if(j+i==2)
            {
                s2+=a[i][j];
            }
        }
    }
    if(s1==0 || s2==0)
    {
        cout<<"Yes";
        return 0;
    }
    else
    {
        cout<<"No";
    }
}

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

using namespace std;

typedef long long ll;

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

	vector<int> v(n);
	int txor = 0;
	for(int i = 0; i < n; i++)
	{
		cin >> v[i];
		txor = txor ^ v[i];
	}

	for(int i = 0; i < n; i++)
		cout << (v[i] ^ txor) << " ";

	cout << endl;
}


Measured memory_bytes: 4052
N = int(input())
S1 = input()
S2 = input()
mod = 10**9+7

ans = 1
if(S1[0] == S2[0]):
    ans *= 3
    ans %= mod
    
    idx = 1
else:
    ans *= 6
    ans %= mod
    idx = 2

while(idx <= N-1):
    if(S1[idx] == S2[idx]):
        if(S1[idx-1] == S2[idx-1]):
            ans *= 2
            ans %= mod
            idx += 1
        else:
            ans *= 1
            ans %= mod
            idx += 1
    else:
        if(S1[idx-1] == S2[idx-1]):
            ans *= 2
            ans %= mod
            idx += 2
        else:
            ans *= 3
            ans %= mod
            idx += 2
print(ans)

Measured memory_bytes: 8944
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException{
		Otoshidama solver = new Otoshidama();
		solver.readInput();
		solver.solve();
		solver.writeOutput();
	}

	static class Otoshidama {

		private int y;
		private int n;

		private Scanner scanner;
		private String output;

		public Otoshidama() {
			scanner = new Scanner(System.in);
		}

		public void readInput() {
			n = Integer.parseInt(scanner.next());
			y = Integer.parseInt(scanner.next());
			return ;
		}

		public void solve() {
			for(int a=0;a<=n;a++) {
				for(int b=0;b<=n-a;b++) {
					if ((y-a*10000-b*5000-(n-a-b)*1000) == 0) {
						output = String.format("%d %d %d", a,b,(n-a-b));
						return ;
					}
				}
			}
			output = "-1 -1 -1";
			return;
		}

		public void writeOutput() {
			System.out.println(output);
			return;
		}

	}

}


Measured memory_bytes: 23252
#include<stdio.h>
#include<limits.h>

int main(void)
{
        int num,i,tmp;
        int min = INT_MAX;
        int max = INT_MIN;
        long sum = 0;

        scanf("%d", &num);

        for ( i = 0 ; i < num ; i++ ) {
                scanf("%d", &tmp);
                if ( tmp > max ) max = tmp;
                if ( tmp < min ) min = tmp;
                sum += tmp;
        }

        printf("%d %d %ld\n", min, max, sum);

        return 0;
}

Measured memory_bytes: 600
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
fn main() {
    input! {
        n: i64,
        lr: [(i64, i64); n],
    }
    let mut sum = 0;
    for i in 0..lr.len() {
        sum+= lr[i].1 - lr[i].0 + 1;
    }
    println!("{}", sum);
}

Measured memory_bytes: 4352
from itertools import permutations
n, m = map(int, input().split())
edges = {tuple(map(int, input().split())) for _ in range(m)}
ans = 0
for route in permutations(range(2, n+1)):
    route = [1] + list(route)
    ans += len([1 for edge in zip(route, route[1:])
                if tuple(sorted(edge)) in edges]) == n-1
print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)

/* REPmacro */
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORR(i, a, b) for(int i = (a); i >= (b); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOREACH(x, a) for(auto x : a)

/* exchange */
#define CHMIN(a, b) (a) = min((ll)(a), (ll)(b))
#define CHMAX(a, b) (a) = max((ll)(a), (ll)(b))

/* function */
#define IN(x) cin >> x
#define DEBUG(x) cerr << (x) << " "
#define LN() cerr << "\n"
#define PRINT(x) cout << (x) << endl
#define BR cout << endl

/* const */
const int ARRAY = 100005;
const int INF = 1001001001; // 10^9
const ll LINF = 1001001001001001001; // 10^18
const int MOD = 1e9 + 7;

ll N = 0;
ll K = 0;
ll t;
ll ret = 0;
string s;

void input() {
  IN(N);
  IN(K);
  REP(i, K) {
    IN(t);
    N -= t;
  }
}

void solve() {
  PRINT((N<=0)?"Yes":"No");
}

int main(void){
  input();
  solve();
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
using namespace std;
int main(){
  long long X;
  cin>>X;
  int i=0;
  long long money=100;
  while(money<X){
    i++;
    money+=money/100;
  }
  cout<<i<<endl;
  return 0;
}

Measured memory_bytes: 3632
n = int(input())
p = list(map(int,input().split()))
flag = 0
ans = True
for i in range(0,n):
    if p[i] != i+1 and flag<=2:
        flag+=1
        if p[p[i]-1] == i+1:
            continue
        else:
            ans = False
    elif i+1 != p[i]:
        ans = False
if ans:
    print("YES")
else:
    print("NO")

Measured memory_bytes: 3060
<?php

const D_MAX = 1000000005;

fscanf(STDIN, "%d %d", $N, $K);
$G = [];
for ($i = 0; $i < $N; ++$i) {
    fscanf(STDIN, "%d %d", $t, $d);
    if (!isset($G[$t])) {
        $G[$t] = [$d];
    } else {
        $G[$t][] = $d;
    }
}

$B = [];
foreach ($G as &$arr) {
    rsort($arr);
    for ($i = 0; $i < count($arr); ++$i) {
        if ($i == 0) {
            $B[] = [$arr[$i], 1];
        } else {
            $B[] = [$arr[$i], 0];
        }
    }
}

usort($B, function ($a, $b) {
    return $a[0] < $b[0];
});

$basep = 0;
$type = 0;

$q1 = new SplPriorityQueue();
for ($i = 0; $i < $K; ++$i) {
    $b = $B[$i];
    $basep += $b[0];
    if ($b[1] == 1) ++$type;
    $q1->insert($b, -1 * ($b[0] + D_MAX * $b[1]));
}

$q2 = new SplPriorityQueue();
for ($i = $K; $i < $N; ++$i) {
    $b = $B[$i];
    $q2->insert($b, $b[0] + D_MAX * $b[1]);
}


$ans = $basep + pow($type, 2);
while (1) {
    if (!$q1->valid()) break;
    $x = $q1->extract();
    if ($x[1] == 1) continue;

    if (!$q2->valid()) break;
    $y = $q2->extract();
    if ($y[1] == 0) continue;

/* echo "x: [" . $x[0] . ", " . $x[1] . "], y: [" . $y[0] .  ", " . $y[1] . "]", PHP_EOL; */

    $basep -= $x[0];
    $basep += $y[0];

    ++$type;

    $ans = max($ans, $basep + pow($type, 2));
}


echo (int) $ans, PHP_EOL;



Measured memory_bytes: 104140
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 24 14:53:50 2018
ITP21D
@author: maezawa
"""

n, q = list(map(int, input().split()))
a = [[] for _ in range(n)]

for i in range(q):
    c = list(map(int, input().split()))
    if c[0] == 0:
        a[c[1]].append(c[2])
    elif c[0] == 1:
        print(*a[c[1]])
    else:
        a[c[1]] = []




Measured memory_bytes: 29776
#include <bits/stdc++.h>
using namespace std;
 
#define MOD 1000000007
#define INF  2000000000
//#define int ll
#define ll long long
#define ld long double
#define vi vector<int>
#define pa pair<int, int>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
 
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...)type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T& t) { cin >> t; }
template<typename First, typename...Rest>void MACRO_VAR_Scan(First& first, Rest&...rest) { cin >> first; MACRO_VAR_Scan(rest...); }
#define VEC(type, c, n) vector<type> c(n);for(auto& i:c)cin>>i;
#define MAT(type, c, m, n) vector<vector<type>> c(m, vector<type>(n));for(auto& r:c)for(auto& i:r)cin>>i;
 
#define BR cout << "\n";
#define SP cout << " ";
#define ENDL cout<<endl;
#define OUT(d) cout<<(d);
#define OUTL(d) cout<<(d); BR;
#define YES OUTL("YES")
#define Yes OUTL("Yes")
#define NO OUTL("NO")
#define No OUTL("No")
#define RET return 0;
#define SUM(a, n) accumulate(a, a+n, 0)
#define VSUM(v) accumulate(ALL(v), 0);
 
#define REP(i, n) for(int i=0;i<(n);i++)
#define RREP(i, n) for(int i=n-1;i>=0;--i)
#define FOR(i, m, n) for(int i = m;i < n; i++)
#define RFOR(i, a, b) for(int i=(b)-1;i>=(a);--i)
#define AREP(a, n) for(auto (a):(n))
#define ALL(a) (a).begin(),(a).end()
#define IN(n, a, b) ((a)<=(n)&&(n)<(b))

signed main(){ INIT;
    int s[100], top = 0, a;
    while(cin >> a){
        if(a){
            s[top++] = a;
        }else{
            OUTL(s[--top]);
        }
    }
RET;}

Measured memory_bytes: 3032
s = input()[0:-1]
for i in range(100):
    s_len = len(s)
    if s_len%2 == 0:
        half = s_len//2
        #print(s[0:half],s[half:s_len])
        if s[0:half] == s[half:s_len]:
            print(s_len)
            break
    s = s[0:-1]

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

typedef long long ll;
using namespace std;

#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define all(v) (v).begin(),(v).end()
#define UNIQUE(v) (v).erase( unique( all(v) ), (v).end() );
#define MOD 1000000007

int main(){
	ll n, k;	cin >> n >> k;
	ll p[n], c[n];
	REP(i, n){
		cin >> p[i];
	}
	REP(i, n){
		cin >> c[i];
	}

	vector<bool> list(n, 0);
	vector<ll> loop[n];
	REP(i, n){
		if( !list[i] ){
			ll j = i;
			do{
				loop[i].push_back(c[p[j] - 1]);
				list[p[j] - 1] = true;
				j = p[j] - 1;
			}while(j != i);
		}
	}

	ll sum, score, ck;
	ll ans = -1000000000;
	REP(i, n){
		sum = 0;
		score = 0;
		ck = k;

		REP(j, loop[i].size()){
			sum += loop[i][j];
		}

		if( sum > 0 && ck > (ll)loop[i].size() ){
			score = sum * (ck / loop[i].size());
			ck %= loop[i].size();

			if( k % loop[i].size() == 0 ){
				score -= sum;
				ck += loop[i].size();
			}
		}

		vector<ll> s(2 * loop[i].size() + 1, 0);
		s[0] = 0;
		REP(j, loop[i].size()){
			s[j+1] = s[j] + loop[i][j];
		}
		REP(j, loop[i].size()){
			s[j+loop[i].size()+1] = s[j+loop[i].size()] + loop[i][j];
		}

/*
		REP(j, 2*loop[i].size()+1){
			cout << s[j] << ",";
		}
		cout << " : " << sum << endl;
*/

		ll tmp = -1000000000;
		for(ll left=0; left < (ll)2 * loop[i].size() + 1; left++)
		for(ll right=left + 1; right < (ll)2 * loop[i].size() + 1; right++){
			if( right - left <= ck ){
				tmp = max(tmp, s[right] - s[left]);
			}
		}

		ans = max(ans, score + tmp);
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3924
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define int long long
#define mkp make_pair
#define pb push_back
#define ff first
#define ss second
#define debug1(a) cout<<a<<endl;
#define debug2(a,b) cout<<a<<' '<<b<<endl;
#define debug3(a,b,c) cout<<a<' '<<b<<' '<<c<<endl;
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,a,b)for(int i=a;i<b;i++)
#define repre(i,a,b)for(int i=a;i<=b;i++)
#define pi pair<int,int>
#define pii pair<int,pi>
#define mp map<int,int>
#define ump unordered_map<int,int>
#define st set<int>
#define mst multiset<int>
#define pq priority_queue
#define mpq priority_queue<int,vector<int>,greater<int> >
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace __gnu_pbds;
using namespace std;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> orderedSet;
typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update> orderedMSet;
//*p.find_by_order(index) return value at index
//p.order_of_key(key) return index
bool cmp(pair<int,pair<string,int> >&a,pair<int,pair<string,int> >&b)
{
  if(a.ss.ff==b.ss.ff)return a.ss>b.ss;
  return a.ss.ff<b.ss.ff;
}
int32_t main()
{
   fastio
   int n;
   cin>>n;
   vector<pair<int,pair<string,int> > >v;
   for(int i=1;i<=n;i++)
   {
     string s;
     int a;
     cin>>s;
     cin>>a;
     v.pb(mkp(i,mkp(s,a)));
   }
   sort(v.begin(),v.end(),cmp);
   rep(i,v.size())
   cout<<v[i].ff<<endl;
   return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define pb push_back
#define eb emplace_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define ub(v,k) (upper_bound(all(v),k)-v.begin())
#define fi first
#define se second
#define pi M_PI
#define PQ(T) priority_queue<T>
#define SPQ(T) priority_queue<T,vector<T>,greater<T>>
#define dame(a) {out(a);return 0;}
#define decimal cout<<fixed<<setprecision(15);
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef tuple<ll,ll,ll,ll> PPP;
typedef multiset<ll> S;
using vi=vector<ll>;
using vvi=vector<vi>;
using vvvi=vector<vvi>;
using vp=vector<P>;
using vvp=vector<vp>;
using vb=vector<bool>;
using vvb=vector<vb>;
const ll inf=1001001001001001;
const int INF=1001001001;
const int mod=1000000007;
const double eps=1e-10;
template<class T> bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<class T> bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<class T> void out(T a){cout<<a<<'\n';}
template<class T> void outp(T a){cout<<'('<<a.fi<<','<<a.se<<')'<<'\n';}
template<class T> void outvp(T v){rep(i,v.size())cout<<'('<<v[i].fi<<','<<v[i].se<<')';cout<<'\n';}
template<class T> void outvvp(T v){rep(i,v.size())outvp(v[i]);}
template<class T> void outv(T v){rep(i,v.size()){if(i)cout<<' ';cout<<v[i];}cout<<'\n';}
template<class T> void outvv(T v){rep(i,v.size())outv(v[i]);}
template<class T> bool isin(T x,T l,T r){return (l)<=(x)&&(x)<=(r);}
template<class T> void yesno(T b){if(b)out("yes");else out("no");}
template<class T> void YesNo(T b){if(b)out("Yes");else out("No");}
template<class T> void YESNO(T b){if(b)out("YES");else out("NO");}
template<class T> void noyes(T b){if(b)out("no");else out("yes");}
template<class T> void NoYes(T b){if(b)out("No");else out("Yes");}
template<class T> void NOYES(T b){if(b)out("NO");else out("YES");}
void outs(ll a,ll b,ll c){if(a==b)out(c);else out(a);}
ll gcd(ll a,ll b){if(b==0)return a;return gcd(b,a%b);}
ll modpow(ll a,ll b){a%=mod;if(b==0)return 1;if(b&1)return a*modpow(a,b-1)%mod;ll k=modpow(a,b/2);return k*k%mod;}
int main(){
    ll a,b,c,d,e,f;cin>>a>>b>>c>>d>>e>>f;
    string s,t,u;cin>>s>>t>>u;
    cout<<c<<' '<<a<<' '<<b<<endl;
}

Measured memory_bytes: 256
N, K = map(int, input().split())
P = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = -float("inf")
for start in range(N):
    x = start
    cyc_score = []
    total_cyc_score = 0
    while True:
        x = P[x]-1
        cyc_score.append(C[x])
        total_cyc_score += C[x]
        if x == start: # 周期を検出
            break
    t = 0
    for i in range(len(cyc_score)):
        t += cyc_score[i]
        if i + 1 > K: break
        now_score = t
        if total_cyc_score > 0:
            e = int((K - i - 1) / len(cyc_score))
            now_score += total_cyc_score * e
        ans = max(ans, now_score)
print(ans)

Measured memory_bytes: 80932
#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
//template<typename key, typename val>
//using ordered_tree =
//  tree<key, val, std::less<>, rb_tree_tag, tree_order_statistics_node_update>;
using namespace std;
typedef long long int64;
typedef complex<double> comp;
const double pi = 3.14159265358979323846;
const int inf = (int)1e+9 + 2;
const int64 inf64 = (int64)1e+18 + 2;
const double dinf = 1e+20;
const int mod = 1'000'000'007;//*/998244353;
const int base = 2187;
const double eps = 1e-8;
const int N = 100'000;
const int LOGN = 19;

int n, m, k;

void solve(int test) {
  vector<int> d(1'000'106, 0);
  d[0] = 1;
  for (int i = 0; i < 1'000'000; ++i) {
    for (int j = 0; j < 6; ++j) {
      d[i + j + 100] |= d[i];
    }
  }
  cin >> n;
  cout << d[n];
}

void precalc() {
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  precalc();
  int test = 1;
  //cin >> test;
  //auto start = chrono::high_resolution_clock::now();
  for (int i = 1; i <= test; ++i) {
    solve(i);
  }
  //cerr << chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - start).count() << '\n';
  return 0;
}


Measured memory_bytes: 4224
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <limits>
#include <algorithm>
#include <utility>
#include <sstream>
#include <numeric>
#include <iterator>

using namespace std;

#define repd(i,a,b) for (int i=(a);i<(b);++i)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef pair<int, int> P;

int main(int argc, const char * argv[]) {
  string s;
  cin >> s;
  int n = s.size();
  // cout << n/2 << endl;
  rep(i, n/2){
    // cout << s[i] << " " << s[n-i-1] << endl;
    if(s[i] != s[n-i-1]){
      // cout << i << " " << n-1 << endl;
      // cout << s[i] << " " << s[n-1] << endl;
      cout << "No" << endl;
      return 0;
    }
  }
  rep(i, n/4){
    // cout << s[i] << " " << s[(n/2)-i-1] << endl;
    if(s[i] != s[(n/2)-i-1]){
      cout << "No" << endl;
      return 0;
    }
  }
  repd(i, n/2, n/4 * 3){
    // cout << s[i] << " " << s[(n/2)-i-1] << endl;
    if(s[i] != s[(n)-i-1]){
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>	// 入出力
#include<stdio.h>	// printf()が使える 小数は%fで
#include<math.h>	// 数学の関数
#include<vector>	// 配列
#include<string>	// 文字列
#include<map>		// 連想配列
#include<stack>		// スタック
#include<queue>		// キュー
#include<algorithm> // ソートとか

using namespace std;

using ll = long long;



int main()
{

	int N, M;

	cin >> N >> M;

	cout << (M * 1900 + (N - M) * 100)*pow(2, M) << endl;
	

	return 0;

}


Measured memory_bytes: 512
#include <stdio.h>

typedef struct heap{
  int key;
  int pkey;
  int lkey;
  int rkey;
}Heap;

int main(){
  int i, nm;
  Heap heap[250];
  
  scanf("%d", &nm);
  for(i = 1; i <= nm; i++){
    scanf("%d", &heap[i].key);
    heap[2*i].pkey = heap[i].key;
    heap[2*i+1].pkey = heap[i].key;
  }

  for(i = 1; i <= nm; i++){
    if(nm >= (2*i+1)){
      heap[i].lkey = heap[2*i].key;
      heap[i].rkey = heap[2*i+1].key;
    }
    else if(nm == 2*i) heap[i].lkey = heap[2*i].key;
  }

  for(i = 1; i <= nm; i++){
    if(i == 1){
      printf("node %d: key = %d, ", i, heap[i].key);
    }
    else{
      printf("node %d: key = %d, parent key = %d, ", i, heap[i].key, heap[i].pkey);
    }
    if(nm >= (2*i+1)){
      printf("left key = %d, right key = %d, ", heap[i].lkey, heap[i].rkey);
    }
    else if(nm == 2*i) printf("left key = %d, ", heap[i].lkey);
    printf("\n");
  }

  
  return 0;
}


Measured memory_bytes: 2112
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cfloat>
#include<climits>
#include<cmath>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

using namespace std;

using lint = long long;
using P = pair<int, int>;
using LLP = pair<long long, long long>;

#define REP(i, x, n) for(int i = (x), i##_len = (int)(n) ; i < i##_len ; ++i)
#define rep(i, n) for(int i = 0, i##_len = (int)(n) ; i < i##_len ; ++i)
#define reps(i, n) for(int i = 1, i##_len = (int)(n) ; i <= i##_len ; ++i)
#define rrep(i, n) for(int i = (int)(n) - 1 ; i >= 0 ; --i)
#define rreps(i, n) for(int i = (int)(n) ; i > 0 ; --i)
#define SORT(x) sort((x).begin(), (x).end())
#define SORT_INV(x) sort((x).rbegin(), (x).rend())
#define REVERSE(x) reverse((x).begin(), (x).end())
#define TWINS(x) cout << ((x) ? "Yay!" : ":(") << '\n'
#define endl '\n'

constexpr int IINF = (1 << 30) - 1;
constexpr long long LLINF = 1LL << 61;
constexpr double EPS = 1e-10;

constexpr int dx4[] = {1, 0, -1, 0}, dy4[] = {0, 1, 0, -1};
constexpr int dx8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dy8[] = {0, -1, -1, -1, 0, 1, 1, 1};

template<typename T>
bool chmax(T& a, T b){
    if(a < b){
        a = b;
        return true;
    }
    return false;
}

template<typename T>
bool chmin(T& a, T b){
    if(b < a){
        a = b;
        return true;
    }
    return false;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    int n;
    cin >> n;

    int ans = 0;
    rep(i, n){
        int a;
        cin >> a;
        ans += a - 1;
    }

    cout << ans << endl;

    cout << flush;

    return 0;
}

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

int main() {
  string S;
  cin >> S;
  int countA = 1;
  int countB = 1;
  int countC = 1;

  for(int i = 1; i < 4; i++){
    if(S.at(0) == S.at(i)){
      countA++;
    }
  }
  for(int i = 2; i < 4; i++){
    if(S.at(1) == S.at(i)){
      countB++;
    }
  }
  if(S.at(2) == S.at(3)){
    countC++;
  }

  if(countA == 2 && countB == 2){
    cout << "Yes" << endl;
  }
  else if(countA == 2 && countC == 2){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }

    
}

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

int gcd(int a, int b, int& x, int& y) {
    int d = a;
    if(b == 0){
        x = 1;
        y = 0;
    }
    else{
        d = gcd(b, a % b, y, x);
        y -= (a / b) * x;
    }
    return 0;
}
 
int main(void) {
    int a;
    int b;
    int x;
    int y;
    cin >> a >> b;
    gcd(a, b, x, y);
    cout << x << " " << y << endl;
    return 0;
}

Measured memory_bytes: 1168
n,k=map(int,input().split())
H=list(map(int,input().split()))
INF=float('inf')

dp=[INF]*(n+1)
dp[1]=0

for i in range(2,n+1):
  ans=INF
  for j in range(1,k+1):
    if i-j-1<0:
      continue
    ans=min(ans,dp[i-j]+abs(H[i-1]-H[i-1-j]))
  dp[i]=ans

print(dp[n])

Measured memory_bytes: 85636
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        int n = scanner.nextInt();
        int s_n = 0;
        int n_sub = n;

        while(true){
            s_n += n%10;
            n /= 10;
            if(n == 0)break;
        }

        if(n_sub % s_n == 0)System.out.println("Yes");
        else System.out.println("No");

    }
}


Measured memory_bytes: 23764
using System;
using System.Linq;

namespace _1_2_B {
    class Program {
        static void Main(string[] args)
        {
            var input = Console.ReadLine();
            var array = input.Split(' ').Select(x => int.Parse(x)).ToArray();
            if (array[0] < array[1] && array[1] < array[2])
                Console.WriteLine("Yes");
            else
                Console.WriteLine("No");
        }
    }
}



Measured memory_bytes: 18440
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;

int main()
{
    ll n, a, x[100], dp[100][10010];

    cin >> n >> a;

    ll mi = 0;
    ll ma = 0;
    REP(i, n)
    {
        cin >> x[i];
        x[i] -= a;

        if (0 > x[i])
            mi += x[i];
        else
            ma += x[i];
    }

    mi += 5000, ma += 5000;

    for (int i = mi; i <= ma; i++)
    {
        if (i - 5000 == x[0])
            dp[1][i] = 1;
        else
            dp[1][i] = 0;
    }

    for (int i = 2; i <= n; i++)
    {
        for (int j = mi; j <= ma; j++)
        {
            dp[i][j] = dp[i - 1][j] + dp[i - 1][j - x[i - 1]] + (x[i - 1] == j - 5000);
        }
    }

    cout << dp[n][5000] << endl;

    return 0;
}

Measured memory_bytes: 4864
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, N) for (int i = 0; i < (int)N; ++i)
#define all(a) (a).begin(), (a).end()

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


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

int N;
int max_A = 0;
vector<int> A, C;
vector<bool> T;

void input_init(void) {
	cin >> N;
	A.resize(N);
	for (int i = 0; i < N; ++i)
		cin >> A[i];
	sort(A.begin(), A.end());
	max_A = A[N - 1];
	C.resize(max_A + 1, 0);
	for (int i = 0; i < N; ++i)
		++(C[A[i]]);
	A.erase(unique(A.begin(), A.end()), A.end());
	N = A.size();
	T.resize(max_A + 1, false);
}

void solve(void) {
	for (int i = 0; i < N; ++i) {
		if (T[A[i]])
			continue;
		if (C[A[i]] >= 2)
			T[A[i]] = true;
		for (int j = A[i] * 2; j <= max_A; j += A[i])
			T[j] = true;
	}
}

int main(void) {
	input_init();
	solve();
	int ans = 0;
	for (int i = 0; i < N; ++i) {
		if (!T[A[i]])
			++ans;
	}
	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 7936
#include <cstdio>
#include <vector>
#include <set>
#include <cstdlib>
using namespace std;

#define mp make_pair

template <typename T>
struct FenwickTree {
        vector<T> data;
        FenwickTree(int n) : data(n + 1, 0) {}
        void add(int i, T x){
                while (i <= (int)data.size()) {
                        data[i] += x;
                        i += i & -i;
                }
        }
        T sum(int i){
                T res = 0;
                while (i > 0) {
                        res += data[i];
                        i -= i & -i;
                }
                return res;
        }
        T sum(int l, int r) { return sum(r) - sum(l); }
};
long long InversionNumber(const vector<int> &a) {
        FenwickTree<long long> ft(300030);
        long long res = 0;
        for (int i = 0; i < a.size(); i ++) {
                res += i - ft.sum(a[i]);
                ft.add(a[i], 1);
        }
        return res;
}

int main() {
        int n;
        scanf("%d", &n);
        vector<vector<int>> a(3, vector<int> (n));
        for (int i = 0; i < 3; i ++) for (int j = 0; j < n; j ++) scanf("%d", &a[i][j]);
        vector<vector<int>> b(n, vector<int> (3));
        for (int i = 0; i < 3; i ++) for (int j = 0; j < n; j ++) b[j][i] = a[i][j];
        multiset<pair<pair<int, int>, int>> st;
        for (int i = 0; i < n; i ++) st.insert(mp(mp(b[i][0], b[i][1]), b[i][2]));
        for (int i = 1; i < 3 * n; i += 3) {
                int a = i, b = i + 1, c = i + 2;
                if (!((st.count(mp(mp(a, b), c)) == 0 && st.count(mp(mp(c, b), a)) == 1) ||
                    (st.count(mp(mp(a, b), c)) == 1 && st.count(mp(mp(c, b), a)) == 0))) {
                        return !puts("No");
                }
        }
        vector<int> c(n);
        for (int i = 0; i < n; i ++) {
                c[i] = b[i][1] / 3 + 1;
                if (b[i][0] > b[i][2]) c[i] *= -1;
        }
        vector<int> target(n);
        for (int i = 0; i < n; i ++) target[i] = i + 1;
        for (int i = 3; i < n; i += 4) {
                c[i] *= -1, target[i] *= -1;
                c[i - 1] *= -1, target[i - 1] *= -1;
        }
        set<int> evenst;
        for (int i = 0; i < n; i += 2) evenst.insert(abs(c[i]));
        for (int i = 0; i < n; i += 2) if (evenst.count(abs(target[i])) != 1) return !puts("No");
        evenst.clear();
        int flip_even = 0, flip_odd = 0;
        for (int i = 0; i < n; i += 2) evenst.insert(c[i]);
        for (int i = 0; i < n; i += 2) if (!evenst.count(target[i])) flip_even ++;
        set<int> oddst;
        for (int i = 1; i < n; i += 2) oddst.insert(c[i]);
        for (int i = 1; i < n; i += 2) if (!oddst.count(target[i])) flip_odd ++;
        vector<int> even, odd;
        for (int i = 0; i < n; i ++) {
                if (i & 1) odd.push_back(abs(c[i]));
                else even.push_back(abs(c[i]));
        }
        auto even_rev = InversionNumber(even);
        auto odd_rev = InversionNumber(odd);
        puts((flip_even % 2 == odd_rev % 2 && flip_odd % 2 == even_rev % 2) ? "Yes" : "No");
        return 0;
}


Measured memory_bytes: 21752
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        a = a == 1 ? 14 : a;
        b = b == 1 ? 14 : b;
        if (a > b) {
            System.out.println("Alice");
        } else if (b > a) {
            System.out.println("Bob");
        } else {
            System.out.println("Draw");
        }
    }
}

Measured memory_bytes: 23124
/*

Coded by peyha X

*/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int NMAX=1e5+1,MMAX=1e5+1;
int n,m,dp[NMAX],nbParents[NMAX];
vector<int> fils[NMAX],parents[NMAX],lexico;
vector< pair<int,int> > aretes;
queue<int> enAttente;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	
	cin >> n >> m;
	
	for(int i=1;i<=m;i++){
		int x,y;
		cin >> x >> y;
		
		aretes.push_back( make_pair(x,y) );
		fils[x].push_back(y);
		parents[y].push_back(x);
		nbParents[y]++;
	}
	
	for(int i=1;i<=n;i++){
		if(nbParents[i]==0){
			enAttente.push(i);
		}
	}
	
	while(!enAttente.empty()){
		int noeud=enAttente.front();
		enAttente.pop();
		lexico.push_back(noeud);
		
		int sz=fils[noeud].size();
		for(int id=0;id<sz;id++){
			int next=fils[noeud][id];
			nbParents[next]--;
			if(nbParents[next]==0){
				enAttente.push(next);
			}
		}
	}
	int ans,sz=lexico.size();
	
	
	for(int i=0;i<sz;i++){
		int best=0,noeud=lexico[i];
		//cout << noeud << ' ';
		int sz2=parents[noeud].size();
		
		for(int id=0;id<sz2;id++){
			int ant=parents[noeud][id];
			best=max(best,dp[ant]+1);
		}
		
		dp[noeud]=best;
		ans=max(ans,dp[noeud]);
	}
	//cout << endl;
	cout << ans << '\n';
	
	
	
}


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

int main() {
	int N, K;
	cin >> N >> K;
	string S;
	cin >> S;

	int ans = N-1;
	rep(i, N-1) {
		if (S[i] != S[i + 1]) ans -= 1;
	}

	ans = min(N-1, ans + 2 * K);
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define f first
#define s second
#define mp make_pair
#define pb push_back
#define vll vector<ll>
#define pll pair<ll,ll>
#define hahahahahahahahahahahah ios_base::sync_with_stdio(0);
using namespace std;

const ll N = 3e5+100;
const ll MOD = 1e9+7;

int main()
{

	hahahahahahahahahahahah;
	cin.tie(0);
	set<ll> se;
	ll n;
	cin>>n;
	ll a[n+1];
	for(int i =1;i<=n;i++){
		cin>>a[i];
		se.insert(a[i]);
	}
	if((int)se.size() == n) return cout<<"YES\n",0;cout<<"NO\n";

	
	return 0;
}

Measured memory_bytes: 11264
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<stdbool.h>
#include<math.h>
#include<limits.h>
int main(){
    int K;
    char S[102];
    scanf("%d %s",&K,S);
    if(strlen(S)<=K) printf("%s",S);
    else{
        for(int i=0;i<K;i++)
            printf("%c",S[i]);
        printf("...");
    }
}


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

int main() {
  	int N, X, total;
  	cin >> N >> X;
  	vector<int> m;
  	for(int i = 0;i < N; i++){
    	int spi;
      	cin >> spi;
      	m.push_back(spi);
      	X -= spi;
    }
  	sort(m.begin(), m.end());
	total = N + (X / m[0]);
  	cout << total << endl;
  	return 0;
}

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;
use std::cmp;
   
fn read<T: FromStr>() -> T {
	let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main(){
    let n: usize = read();
	let mut hs: Vec<usize> = Vec::new();
	for _i in 0..n {
		hs.push(read());
	}

	let mut v: Vec<usize> = vec![0; hs.len()];;
    for i in 1..hs.len() {
        if hs[i - 1] >= hs[i] {
            v[i] = v[i - 1] + 1;
        }
    }
    let max = v.iter().max().unwrap().clone();
	println!("{}", max);
}


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

int main () {
	int N;
	int max=0, sucmax=0, maxid=-1;
	cin >> N;
	for (int i=0; i<N; i++) {
		int tmp;
		cin >> tmp;
		if (tmp>=max) {
			sucmax = max;
			max = tmp;
			maxid = i;
		} else if (tmp>sucmax) {
			sucmax = tmp;
		}
	}
	for (int i=0; i<N; i++) {
		if (i==maxid)
			cout << sucmax << endl;
		else
			cout << max << endl;
	}
	return 0;
}

Measured memory_bytes: 1664
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int n,x,sum=0,minm=1001;
  cin >> n >> x;
  int m[n];
  for(int i=0;i<n;i++){
    cin >> m[i];
    sum += m[i];
    if (minm > m[i]){
      minm = m[i];
    }
  }
  x -= sum;
  int how = x/minm;
  cout << how+n << endl;
  return 0;
}


Measured memory_bytes: 256