akhauriyash/Code-Regression huggingface dataset:
#![allow(unused_mut)]
#![allow(non_snake_case)]
#![allow(unused_imports)]
use std::collections::HashSet;
use std::collections::HashMap;
use std::collections::BTreeSet;
use std::collections::VecDeque;
use std::cmp::{max, min};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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")
    };
}
use std::char;
fn main() {
    input! {
        n: usize,
        a: [i64; n],
    }
    let mut ans = VecDeque::new();
    if n % 2 == 0 {
        for i in 0..a.len() {
            if i % 2 == 0 {
                ans.push_back(a[i]);
            } else {
                ans.push_front(a[i]);
            }
        }
    } else {
        for i in 0..a.len() {
            if i % 2 == 1 {
                ans.push_back(a[i]);
            } else {
                ans.push_front(a[i]);
            }
        }

    }
    for i in 0..ans.len() {
        print!("{} ", ans[i]);
    }
    /*
    0 1 2 3 4 5

    0

    1 0

    2 0 1

    3 1 0 2

    4 2 0 1 3

    5 3 1 0 2 4
    */
}

Measured memory_bytes: 12540
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
 //Compiler version g++ 6.3.0

 int main()
 {
 	int a,b,x;
 	bool ans=false;
 	cin >> a>>b;
 	if(b==100){
 		x=a*1000+b;
 	}else if(b<10){
 		x=a*10+b;
 	}else{
 		x=a*100+b;
 	}
 	for (int i = 0; i < x/2+1; i++){
 		if(x==i*i){
 			ans=true;
 		}
 	}
 	if(ans){
 		cout << "Yes" << endl;
 	}else{
 		cout << "No" << endl;
 	}
 }

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

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll mod = 1e9+7;

int main() {
    int n;
    set<string> st;
    cin >> n;
    for (int i = 0; i < n; i++) {
        string s;
        cin >> s;
        st.insert(s);
    }
    cout << st.size() << endl;
    return 0;
}

Measured memory_bytes: 19180
#include<bits/stdc++.h>
using namespace std;
#define int long long
int a,b,c,d,g,T;
main(){
    scanf("%lld",&T);
    while(T--){
        scanf("%lld%lld%lld%lld",&a,&b,&c,&d);
        g=__gcd(d, b);
        if(a<b || d<b )cout<<"No\n";
		else if (a%b+(b-a%b-1)/g*g>c)printf("No\n");else printf("Yes\n");
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cstdlib>
#include <numeric>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stack>
#include <math.h>
#include <string.h>
#include <map>
#include <bitset>
#include <queue>


#define Z class
#define ln cout<<'\n'
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (n); ++i)
//ASCII a=97, A=65
// int H[N]; rep(i,N) scanf("%d", &H[i]);
// int max_x = *std::max_element(x.begin(), x.end());
// int min_y = *std::min_element(y.begin(), y.end());
// sort(vec.begin(), vec.end()); std::greater<>()
// reverse(vec.begin(), vec.end());
// scanf("%s",s);
// printf("%d\n",end-start+1);
// ceil (a + (b - 1)) / b

using namespace std;
using Edge = pair<int, int>;
using Graph = vector<vector<Edge>>;
using pll = pair<long long, long long>;

template<class T> inline bool chmax(T& a, T b){ if(a < b) { a=b; return 1; }return 0;}
template<class T> inline bool chmin(T& a, T b){ if(a > b) { a=b; return 1; }return 0;}
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}

int GCD(int a, int b) { return b ? GCD(b, a%b) : a; }
const long long INF = 1LL << 60;
const int MOD = 1000000007;
pair<pair<string, int>, int> p[110];

int main(){
    int N; cin >> N;
    vector<int> a(N);
    rep(i, N) cin >> a[i];
    int res = 0;
    
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < N; j++) {
            if(abs(a[j]-a[i]) > res) res = abs(a[j]-a[i]);
        }
    }
    cout << res << endl;
}





Measured memory_bytes: 256
/*---> 12 April 2020 <--- > 23:53:15 <---*/
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma GCC optimize("unroll-loops")
// #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
//#pragma GCC target ("sse4")
#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//using namespace __gnu_pbds;
using namespace std;
//template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
#define int long long
#define F first
#define S second
#define mod 1000000007
#define inf (int)1e18+5
#define sz(x) (int)x.size()
#define PI 3.141592653589793238510
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define __ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define vi vector<int>
#define vpii vector<pair<int,int> > 
#define vvi vector<vector<int> >
#define PRINT_TIME cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s." <<endl;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename   enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
typedef long double ld;
typedef pair<int,int> pii;
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
const int N=1e5+5;

int32_t main(){__
    int k;
    cin>>k;
    int ans=0;
    for(int i=1;i<=k;i++){
        for(int j=1;j<=k;j++){
            for(int l=1;l<=k;l++){
                ans+=__gcd(i,__gcd(j,l));
            }
        }
    }
    cout<<ans<<"\n";
return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <utility>
#include <string>
#include <stack>
#include <regex>
#include <numeric>
#include <queue>
#include <set>

#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;

int main(int argc, char const *argv[])
{
  ll r;
  cin >> r;
  cout << 3 * r * r << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,x,m[1000];
	cin>>n>>x;
	for(int i=0;i<n;i++){
		cin>>m[i];
	}
	int mi=m[0];
	for(int i=0;i<n;i++){
		x-=m[i];
		if(mi>m[i])mi=m[i];
	}
	cout<<n+(x/mi)<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
#define FOR(i,n) for(int (i)=0;(i)<(n);(i)++)s



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

    string S;
    cin >>S;
    int dif='A'-'a';

    S[K-1]=S[K-1]-dif;
    cout << S << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define rep for(int i = 0;i<n;i++)
const int MOD = 1000000007;
 
int main(){
    int n;cin >> n;
    int a[2*n];rep{
        cin >> a[i];
    }rep{
        cin >> a[n+i];
    }
    int ans = 0;
    sort(a,a+2*n);
    int i = 0;
    while(i<2*n){
        ans += min(a[i],a[i+1]);
        i+=2;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define rep(i,a,n) for(ll i=a;i<n;i++)
#define REP(i,a,n) for(ll i=n;i>a;i--)

int main(void){
    string name[10] = {};
    ll w[10] = {},l[10] = {},d[10] = {},score[10] = {};
    bool is_used[10] = {false};
    bool temp = false;
    
    while(1){
        ll n = 0;
        cin >> n;
        if(!n) break;
        if(temp)cout << endl;
        
        rep(i,0,10){
            is_used[i] = false;
            score[i] = -1;
        }
        
        rep(i,0,n){
            cin >> name[i] >> w[i] >> l[i] >> d[i];
            score[i] = w[i] * 3 + d[i];
        }
        
        
        rep(i,0,101){
            rep(j,0,n){
                if(score[j] == 100 - i) cout << name[j] << "," << score[j] << endl;
            }

        }
        temp = true;
    }
    
}


Measured memory_bytes: 3176
import java.io.*;

class Main
{
    public static void main (String[ ] args) throws Exception
    {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str[] = br.readLine().split(" ");
        
        int n = Integer.parseInt(str[0]);
        int m = Integer.parseInt(str[1]);

        int[][] a = new int[n][m];
        int[] b = new int[m];

        for(int i = 0; i < n; i++)
        {
            String str2[] = br.readLine().split(" ");
            for(int j = 0; j < m; j++)
            {
                a[i][j] = Integer.parseInt(str2[j]);
            }
        }
        
        for(int k = 0; k < m; k++)
        {
            String str3 = br.readLine();
            b[k] = Integer.parseInt(str3);
        }
        
        for(int i = 0; i < n; i++)
        {
            int ans = 0;
            for(int j = 0; j < m; j++)
            {
                ans += a[i][j] * b[j];
            }
            System.out.println(ans);
        }
    }
}

Measured memory_bytes: 26980
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;

public class Main {

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

		String str[] = br.readLine().split(" ");

		int n = Integer.parseInt(str[0]);
		int k = Integer.parseInt(str[1]);

		long num[] = new long[k];

		for (int i = 1; i <= n; i++) {
			num[i % k]++;
		}

		long res = 0;
		for (int a = 0; a < k; ++a) {
			int b = (k - a) % k;
			int c = (k - a) % k;
			if ((b + b) % k != 0)
				continue;
			res += num[a] * num[b] * num[b];
		}

		System.out.println(res);
	}
}


Measured memory_bytes: 34052
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (int i = j; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	int n,a,b; cin>>n>>a>>b;
	string s; cin>>s;
	int m=s.size();
	int cnt=0,f=0;
	rep(i,0,m){
		char c=s[i];
		if(c=='c'){
			cout<<"No"<<endl;
			continue;
		}
		else if(c=='a'){
			if(cnt<a+b){
				cout<<"Yes"<<endl;
				++cnt;
			}
			else cout<<"No"<<endl;
		}
		else {
			if(cnt<a+b && f<b){
				cout<<"Yes"<<endl;
				++cnt; ++f;
			}
			else cout<<"No"<<endl;
		}
	}

	return 0;
}

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

#define FOR(i, j, k) for (int i = j; i < k; i++)
#define REP(i, j) FOR(i, 0, j)
typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;

int main() {

  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;

  int s;
  cin >> s;

  int ans = 0;

  map<int, int> m;
  m[s]++;
  while (1) {
    ans++;
    //    cout << ans << " " << s << endl;
    if (s % 2 == 0) {
      s /= 2;
      //      cout << m[s] << endl;
      if (m[s] > 0)
        break;
      m[s]++;
    } else {
      s = 3 * s + 1;
      if (m[s] > 0)
        break;
      m[s]++;
    }
  }

  cout << ans + 1 << endl;

  return 0;
}


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

using namespace std;

int main(void){
    int H, W;
    cin >> H >> W;
    vector<string> s;
    s.push_back(string(W+2, '.'));
    for(int i=0;i<H;i++){
        string x;
        cin >> x;
        s.push_back("." + x + ".");
    }
    s.push_back(string(W+2, '.'));

    for(int i=1;i<=H;i++){
        for(int j=1;j<=W;j++){
            if(s[i][j] == '#' 
                && s[i][j+1] == '.'
                && s[i][j-1] == '.'
                && s[i+1][j] == '.'
                && s[i-1][j] == '.'){
                    cout << "No" << endl;
                    return 0;
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}

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

using namespace std;
using ll = long long int;

int main() {
    ll N, M;
    ll L, R;
    ll ans_left, ans_right;
    cin >> N >> M;
    ans_left = 0;
    ans_right = N;

    for (int i = 0; i < M; i++){
        cin >> L >> R;
        ans_left = max(ans_left, L);
        ans_right = min(ans_right, R);
    }
    if (ans_right - ans_left >= 0){
        cout << (ans_right - ans_left + 1) << endl;
    }else{
        cout << 0 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>
#include <cstring>
#include <sstream>
#include <stack>
#include <climits>

using namespace std;
typedef long long ll;
double EPS=1e-10;
typedef pair<int,int> pii;
bool EQ(double a,double b){
	return abs(a-b)<EPS;
}
map<char,int> m;
int idx;
int nums[10];

int analysis(string s){
	if(s.size()==1){
		if(s[0]>='0'&&s[0]<='9')
			return s[0]-'0';
		return nums[m[s[0]]];
	}
	if(s[0]=='('&&s[s.size()-1]==')'){
		int cnt=1;
		bool ok=false;
		for(int i=1;i<s.size()-1;i++){
			if(s[i]=='(')cnt++;
			else if(s[i]==')')cnt--;
			if(cnt==0){
				bool ok=true;
				break;
			}
		}
		if(!ok&&cnt==1){
			return analysis(s.substr(1,s.size()-2));
		}
	}
	int cnt=0;
	for(int i=s.size()-1;i>=0;i--){
		if(s[i]=='(')cnt++;
		else if(s[i]==')')cnt--;
		if(cnt==0&&s[i]=='+'){
			int a=analysis(s.substr(0,i));
			int b=analysis(s.substr(i+1));
			if(a==0)return b;
			else if(a==1){
				if(b<=1)return 1;
				return 2;
			}
			else{
				return 2;
			}
		}
	}
	cnt=0;
	for(int i=s.size()-1;i>=0;i--){
		if(s[i]=='(')cnt++;
		else if(s[i]==')')cnt--;
		if(cnt==0&&s[i]=='*'){
			int a=analysis(s.substr(0,i));
			int b=analysis(s.substr(i+1));
			if(a==0)return 0;
			else if(a==1){
				if(b==0)return 0;
				return 1;
			}
			else{
				return b;
			}
		}
	}
	cnt=0;
	if(s[0]=='-'){
		int a=analysis(s.substr(1));
		if(a==0)return 2;
		else if(a==1)return 1;
		return 0;
	}
	//for(int i=s.size()-1;i>=0;i--){
	//	if(s[i]=='(')cnt++;
	//	else if(s[i]==')')cnt--;
	//	if(cnt==0&&s[i]=='-'){
	//		int a=analysis(s.substr(i+1));
	//		if(a==0)return 2;
	//		else if(a==1)return 1;
	//		else return 0;
	//	}
	//}
}

string ins;
int res;
void rec(int depth){
	if(depth==m.size()){
		if(analysis(ins)==2){
			res++;
		}
	}
	else{
		for(int i=0;i<3;i++){
			nums[depth]=i;
			rec(depth+1);
		}
	}
}

void solve(){
	string s;
	while(cin>>s&&s!="."){
		res=0;
		ins=s;
		idx=0;
		m.clear();
		//for(int i=0;i<s.size();i++){
		//	if(m.count(s[i])==0&&(s[i]=='P'||s[i]=='Q'||s[i]=='R')){
		//		m[s[i]]=idx++;
		//	}
		//}
		m['P']=0;
		m['Q']=1;
		m['R']=2;

		rec(0);
		cout<<res<<endl;
	}
}
int main(){

	solve();

	return 0;
}

Measured memory_bytes: 0
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);


//入力変数
int a=sc.nextInt();
int b=sc.nextInt();

//入力値変換
int x;
if(b<10){
    x=10*a+b;
}else if(b<100){
    x=100*a+b;
}else{
    x=1000*a+b;
}

//出力変数
String ans="No";

//計算
for(int i=0;i<x;i++){
    if(i*i==x){
        ans="Yes";
    }
}

//出力
System.out.println(ans);

}}

Measured memory_bytes: 23636
#include<bits/stdc++.h>
using namespace std;
#define ll long long int

ll dp[100000][3]={0};

ll vacay_BU(vector<vector<int> >v,int N){
    dp[0][0]=v[0][0];
    dp[0][1]=v[0][1];
    dp[0][2]=v[0][2];
    for(int i=1;i<N;i++){
        dp[i][0]=v[i][0]+max(dp[i-1][1],dp[i-1][2]);
        dp[i][1]=v[i][1]+max(dp[i-1][0],dp[i-1][2]);
        dp[i][2]=v[i][2]+max(dp[i-1][0],dp[i-1][1]);
    }
    return max(dp[N-1][0],max(dp[N-1][1],dp[N-1][2]));
}

int main(){
    
    int N,temp;
    cin>>N;
    vector<vector<int> > happiness(N);
    for(int i=0;i<N;i++){
        for(int j=0;j<3;j++){
            cin>>temp;
            happiness[i].push_back(temp);
        }
    }
    cout<<vacay_BU(happiness,N);
}


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

//Compiler version g++ 6.3.0

int main()
{

    int x[5];
    
    for(int i=0;i<5;i++)
    {
        cin >> x[i];
    }
    
    for(int i=0;i<5;i++)
    {
        if(x[i]!=0) continue;
        cout << (i+1);
    }

}

Measured memory_bytes: 3140
#include <stdio.h>

int main() {

  char ch[1200];
  int i,n;
  n=0;
  char a[1200];

  while(1) {
    scanf("%c",&a[n]);
    if(a[n] == '\n') {
      break;
    }
    ch[n] = a[n];
    if('A' <= a[n] && a[n] <= 'Z') {
      ch[n] = a[n] + 32;
    } else if(a[n] >= 'a' && a[n] <= 'z') {
      ch[n] = a[n] - 32;

    }
    
    
    n = n +1;
    
  }
  
  for(i=0; i<n ; i++) {
    printf("%c" ,ch[i]);
  }
  printf("\n"); 
  return 0;
  
}



Measured memory_bytes: 2040
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,i=0,c;
	cin>>a>>b;
	c=b;
	while(c!=0)
	{
		c=c/10;
		i++;
	}
	int s=a*pow(10,i)+b;
	if(int(sqrt(s))*int(sqrt(s))==s)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
	return 0;
}

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

vector<bool> x(1e6 + 1, true);
vector<vector<int>> y(1e6 + 1);

// エラトステネスの篩(nは1以上) O(nloglogn)
void sieve(int n) {
  x.at(0) = x.at(1) = false;
  for (int i = 2; i <= n; i++) {
    if (x.at(i)) {
      int j = 2 * i;
      y[i].emplace_back(i);
      while (j <= n) {
        x.at(j) = false;
        y[j].emplace_back(i);
        j += i;
      }
    }
  }
  // return x;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n;
  cin >> n;
  
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a.at(i);
  
  sieve(1e6);
  
  bool pwise = true;
  vector<bool> used(1e6 + 1, false);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < y[a.at(i)].size(); j++) {
      if (used[y[a.at(i)][j]]) {
        pwise = false;
        break;
      }
      used[y[a.at(i)][j]] = true;
    }
    if (!pwise) break;
  }
  
  if (pwise) {
    cout << "pairwise coprime\n";
    return 0;
  }
  
  int keep = a.at(0);
  for (int i = 1; i < n; i++) keep = gcd(keep, a.at(i));
  
  if (keep == 1) {
    cout << "setwise coprime\n";
    return 0;
  }
  
  cout << "not coprime\n";
  return 0;
}

Measured memory_bytes: 62956
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    // get value from StandardIn
    int n = Integer.parseInt(sc.next());
    int nextNum = 0;
    int minNum = Integer.parseInt(sc.next()); // 最小値格納
    int count = 1; // 最小値更新回数

    // 最小値以下を入力されたらインクリメント
    for(int i=0; i<n-1; i++){
      // System.out.println(i);
      nextNum = Integer.parseInt(sc.next());
      if(nextNum < minNum){
        minNum = nextNum;
        count++;
      }
    }

    // int b = Integer.parseInt(sc.next());
    // String ans = "";

    System.out.println(count);
  }
}


Measured memory_bytes: 48872
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/


int N, K;
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> N >> K;
	
	if (K == 1) cout << 0 << endl;
	else cout << N - K << endl;
}







Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int n;
    string s, t;
    cin >> n >> ws >> s >> ws >> t; 
    string ans = "";
    for (int i = 0; i < n; i++)
        ans = ans + s[i] + t[i];
    
    cout << ans <<"\n";

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdlib.h>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;

int main()
{
  long long int k,n;
  long long int max=-100;
  long long int cost=0;
  long long int count=0;
  
  cin>>k>>n;
  
  vector<long long int> a(n);
  
  for(int i=0;i<n;i++)
  {
    cin>>a[i];
  
    if(!(i==0))
    {
        cost=a[i]-a[i-1];
        count=count+cost;
    }  
    
    if(max<=cost)
    {
      max=cost;
    } 
  }
  
  cost=a[0]+k-a[n-1];
  count=count+cost;
  
  if(max<=cost)
    {
      max=cost;
    } 
  
  count=count-max;
  
  cout<<count<<endl;

  return 0;
}

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

int main() {
	char s[128];
	scanf("%s", s);
	int len = strlen(s);
	bool have_F = false;
	for (int i = len-1; i >= 0; i--)
		if (s[i] == 'F')
			have_F++;
		else if (s[i] == 'C' && have_F) {
			printf("Yes\n");
			return 0;	
		}
	printf("No\n");
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
    int a, b;
    scanf("%d %d", &a, &b);
    if(a < b) {
        printf("a < b\n");
    } else if(a > b) {
        printf("a > b\n");
    } else {
        printf("a == b\n");
    }
}


Measured memory_bytes: 2080
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <vector>
#include <math.h>
#include <queue>
#include <deque>
#include <stack>
#include <map>
const int MOD = 1e9+7;
#define PI 3.14159265359
typedef long long ll;
using namespace std;

int dp[100001];

int main(){
	int n;
	cin >> n;
	for (int i = 0; i <= 100000; i++) dp[i] = MOD;

	dp[0] = 0; 
	for (int i = 0; i <= 100001; i++){
		if (dp[i] != MOD){
			for (int j = 0; j <= 7; j++){
				if (i + (int)pow(6, j) <= 100000){
					dp[i+(int)pow(6, j)] = min(dp[i+(int)pow(6, j)], dp[i] + 1); 
				}
			}
			for (int j = 1; j <= 6; j++){
				if (i + (int)pow(9, j) <= 100000){
					dp[i+(int)pow(9, j)] = min(dp[i+(int)pow(9, j)], dp[i] + 1);
				}
			}
		}
	}
	cout << dp[n] << endl;
	return 0;
}

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

int main() {
  int H, W;
  cin >> H >> W;
  string a[H];

  for (int i = 0; i < H; i++) cin >> a[i];

  for (int i = 0; i < H; i++) {
    if (i == 0) {
      for (int k = 0; k < W + 2; k++) cout << "#";
      cout << endl;
    }
    cout << "#" << a[i] << "#";
    cout << endl;
    if (i == H - 1) {
      for (int k = 0; k < W + 2; k++) cout << "#";
      cout << endl;
    }
  }
}

Measured memory_bytes: 256
# 両方から到達出来ないものに関する辺を無視してベルマンフォード
import sys
sys.setrecursionlimit(10**6)
n, m, p = map(int, input().split())
edges = []
to = [[] for _ in range(n)]
ot = [[] for _ in range(n)]
reachable_from_1 = [False] * n
reachable_to_n = [False] * n
ok = [False] * n
INF = float('inf')


def dfs(v):
    if reachable_from_1[v]:
        return
    reachable_from_1[v] = True
    for nv in to[v]:
        dfs(nv)


def rdfs(v):
    if reachable_to_n[v]:
        return
    reachable_to_n[v] = True
    for nv in ot[v]:
        rdfs(nv)


for _ in range(m):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    c -= p
    c = -c
    edges.append((a, b, c))
    to[a].append(b)
    ot[b].append(a)
dfs(0)
rdfs(n - 1)
for i in range(n):
    ok[i] = reachable_from_1[i] and reachable_to_n[i]
d = [INF] * n
d[0] = 0
upd = True
step = 0
while upd:
    upd = False
    for e in edges:
        frm, to, cost = e
        if not ok[frm]:
            continue
        if not ok[to]:
            continue
        nd = d[frm] + cost
        if nd < d[to]:
            d[to] = nd
            upd = True
    step += 1
    if step > n:
        print(-1)
        exit()
ans = -d[n - 1]
ans = max(0, ans)
print(ans)


Measured memory_bytes: 87800
#include <vector>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <ctype.h>

using namespace std;

#define _CRT_SECURE_NO_WARNINGS
#define REP(i, n) for(int i=0; i<(n); i++)
#define LLREP(i,n) for(LL i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define SORT(x) sort(ALL(x))
#define REVE(x) reverse(ALL(x))
#define MP make_pair
#define PB push_back
#define INF INT_MAX

typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef vector<vector<bool>> VVB;
typedef pair<int, int> PII;
typedef vector<pair<int, int>> VPII;
typedef queue<int> QI;
typedef long long LL;

int main() {
	int x, t = 1;
	cin >> x;
	for (int t = 1; t < 100000; t++) {
		if (t*(t + 1) / 2 >= x) {
			cout << t << endl; break;
		}
	}
}

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

int main(){
    int a,b,k;
    cin >> a >> b >> k;
    int count = 0;
    if(a < b){
        swap(a,b);
    }
    for(int i=b; i>=1; i--){
        if(a%i == 0 && b%i == 0){
            count += 1;
        }
        if(count == k){
            cout << i << endl;
            return 0;
        }
    }    
}

Measured memory_bytes: 3544
"use strict"
let fs = require('fs');
let input = fs.readFileSync("/dev/stdin", "utf8").split(/\n/);

const min = (a: number, b: number) => a < b ? a : b;

let row1 = input[0].split(' ').map(mp => +mp);
let A = input[1].split(' ').map(mp => +mp);
let left = 0, right = 0, isX = false;

for(let i=0; i<row1[0]+1; i++) {
  if(i === row1[2]-1) isX = true;
  if(A.indexOf(i+1) !== -1) isX ? right++ : left++;
}

console.log(min(right, left));

Measured memory_bytes: 7500
K,A,B = list(map(int,input().split()))

if K+1 <= A:
    print(K+1)
else:
    if 2 <= B-A:
        K -= A-1
        ans = A + K//2 * (B-A)
        if K%2 == 1:
            ans += 1
    else:
        ans = K+1
    print(ans)

Measured memory_bytes: 3060
#include <cstdio>
using ll = long long;
constexpr int MOD = 998244353;
inline int Sum(int x, int y) { return (x += y) >= MOD ? (x - MOD) : x; }
inline int Sub(int x, int y) { return (x -= y) < 0 ? (x + MOD) : x; }
inline int quick_pow(int a, int n)
{
	int res = 1;
	while (n)
	{
		if (n & 1)
			res = (ll)res * a % MOD;
		a = (ll)a * a % MOD;
		n >>= 1;
	}
	return res;
}
void solve(int *ans, int *arr, int *goal, int n)
{
	if (!n)
	{
		if (!arr[0])
			ans[0] = 0;
		else
			ans[0] = (ll)goal[0] * quick_pow(arr[0], MOD - 2) % MOD;
		return;
	}
	auto trans = [&] (int &x, int &y)
	{
		int a = x, b = y;
		x = Sum(a, b);
		y = Sub(a, b);
	};
	int len = 1 << n - 1;
	for (int i = 0; i < len; i++)
	{
		trans(arr[i], arr[i + len]);
		trans(goal[i], goal[i + len]);
	}
	solve(ans, arr, goal, n - 1);
	solve(ans + len, arr + len, goal + len, n - 1);
	for (int i = 0; i < len; i++)
		trans(ans[i], ans[i + len]);
	for (int i = 0; i < len << 1; i++)
		ans[i] = (ll)ans[i] * (MOD + 1) / 2 % MOD;
}
int ans[300005], arr[300005], goal[300005];
int main()
{
	// freopen("AGC034-F.in", "r", stdin);
	int n, sum = 0;
	scanf("%d", &n);
	for (int i = 0; i < 1 << n; i++)
	{
		scanf("%d", arr + i);
		sum += arr[i];
	}
	sum = quick_pow(sum, MOD - 2);
	for (int i = 0; i < 1 << n; i++)
		arr[i] = (ll)arr[i] * sum % MOD;
	arr[0] = Sub(arr[0], 1);
	for (int i = 0; i < 1 << n; i++)
		goal[i] = MOD - 1;
	goal[0] = Sum(goal[0], 1 << n);
	solve(ans, arr, goal, n);
	for (int i = 0; i < 1 << n; i++)
		printf("%d\n", Sub(ans[i], ans[0]));
	return 0;
}


Measured memory_bytes: 5760
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)
int main(){
 
  int b,r,g,c,s,t;
  while(1){

    cin >> b >> r >> g >> c >> s >> t;
    if(b == 0 &&r == 0 &&g == 0 &&c == 0 &&s == 0  && t == 0){
      break;
    }
    int sum = 100;

    rep(i,b){
      sum -= 3;
      sum += 15;
      t--;
      rep(j,5){
	sum -= 2;
	sum += 15;
	t--;
      }
    }
    rep(i,r){
      sum -= 3;
      sum += 15;
       t--;
      rep(j,3){
	sum -= 2;
	sum += 15;
	t--;
      }
    }
    
    rep(i,g){
      sum -= 3;
      sum += 7;
      t--;
    }

    rep(i,c){
      sum -= 3;
      sum +=2;
      t--;
    }

    t -= s;

    sum -= t*3 ;

    if(sum < 0)sum = 0;
    cout << sum << endl;

  }


  return 0;
}

Measured memory_bytes: 1160
/*
    Author - Param Kothari
    Ah shit, here we go again
*/

#include <bits/stdc++.h>
 
using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back
#define mk make_pair

typedef long long ll;
typedef long double ld;

void solve(){
    char c;
    cin >> c;
    if(c <= 'Z' && c >= 'A'){
        cout << "A" << "\n";
    }
    else
        cout << "a" << "\n";
    return;
}

int main(){
    IOS;
    int t = 1;
    // cin >> t;
    for(int i = 1; i <= t; i++){
        solve();
    }
    return 0;
}

Measured memory_bytes: 3616
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
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")
    };
}

//

use std::cmp::{max, min};

fn convert(s: &Vec<char>) -> Vec<usize> {
    let mut a = vec![];
    for &c in s {
        let k = match c {
            'L' => 0,
            'R' => 1,
            'U' => 2,
            'D' => 3,
            _ => unreachable!(),
        };
        a.push(k);
    }
    a
}

fn run() {
    input! {
        h: i32,
        w: i32,
        n: usize,
        p: (i32, i32),
        s: chars,
        t: chars,
    }
    let s = convert(&s);
    let t = convert(&t);
    let mut x = [1, h];
    let mut y = [1, w];
    let d = [(0, -1), (0, 1), (-1, 0), (1, 0)];
    for i in (0..n).rev() {
        let v = d[t[i]];
        x[0] = max(1, min(x[0] - v.0, x[0]));
        x[1] = min(h, max(x[1] - v.0, x[1]));
        y[0] = max(1, min(y[0], y[0] - v.1));
        y[1] = min(w, max(y[1], y[1] - v.1));
        let v = d[s[i]];
        x[0] = max(x[0] - v.0, x[0]);
        x[1] = min(x[1] - v.0, x[1]);
        y[0] = max(y[0], y[0] - v.1);
        y[1] = min(y[1], y[1] - v.1);
        if x[0] > x[1] || y[0] > y[1] {
            println!("NO");
            return;
        }
    }
    if x[0] <= p.0 && p.0 <= x[1] && y[0] <= p.1 && p.1 <= y[1] {
        println!("YES");
    } else {
        println!("NO");
    }
}

fn main() {
    run();
}


Measured memory_bytes: 13356
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcount
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC

const int N = 2007;
int n, k;
vector <int> g[N];
int dfs(int u, int p, int d) {
    if (d < 0)
        return 0;
    int ans = 1;
    for (int v : g[u]) {
        if (v != p) {
            ans += dfs(v, u, d - 1);
        }   
    }   
    return ans;
}   

signed main() {
    #ifdef HOME
    freopen("input.txt", "r", stdin);
    #else
    #define endl '\n'
    ios_base::sync_with_stdio(0); cin.tie(0);
    #endif
    cin >> n >> k;
    for (int i = 0; i < n - 1; ++i) {
        int u, v;
        cin >> u >> v;
        g[u].app(v);
        g[v].app(u);
    }   
    if (k % 2 == 0) {
        int ans = 0;
        for (int centr = 1; centr <= n; ++centr) {
            int nn = 1;
            for (int v : g[centr]) {
                nn += dfs(v, centr, k / 2 - 1);                        
            }   
            ans = max(ans, nn);
        }   
        cout << n - ans << endl;
    }
    else {
        int ans = 0;
        for (int centr = 1; centr <= n; ++centr) {
            int nn = 1, add = 0;
            for (int v : g[centr]) {
                int a = dfs(v, centr, k / 2 - 1);
                int b = dfs(v, centr, (k + 1) / 2 - 1);
                nn += a;
                add = max(add, b - a);
            }   
            nn += add;
            ans = max(ans, nn);
        }   
        cout << n - ans << endl;
    }   

}

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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

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;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    string s; cin >> s;
    bool is_res = true;
    rep(i,s.size()-1){
        if(s[i] == s[i+1]) is_res = false;
    }
    cout << (is_res?"Good":"Bad") << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		int[][][] house = new int[4][3][10];
		// 公舎配列の定義
		house[0][0] = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
		house[0][1] = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
		house[0][2] = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

		house[1][0] = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
		house[1][1] = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
		house[1][2] = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

		house[2][0] = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
		house[2][1] = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
		house[2][2] = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

		house[3][0] = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
		house[3][1] = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
		house[3][2] = new int[] {0, 0, 0, 0, 0, 0, 0, 0, 0, 0};


		Scanner scanner = new Scanner(System.in);


		int n = scanner.nextInt();

		for (int a = 0; a < n; a++) {

			int b = scanner.nextInt();
			int f = scanner.nextInt();
			int r = scanner.nextInt();
			int v = scanner.nextInt();

			// 人数計算
			 	// 入居者は0以下にならない

			house[b - 1][f - 1][r - 1] += v;
		}

		for (int i = 0; i < 4; i++) {
			for (int j = 0; j < 3; j++) {
				for (int k = 0; k < 10; k++) {
					if (i == 3 && j ==2 && k == 9) {
						System.out.println(" " + house[i][j][k]);
					} else if (j == 2 && k == 9) {
						System.out.println(" " + house[i][j][k]);
						System.out.println("####################");
					} else if (k == 9) {
						System.out.println(" " + house[i][j][k]);
					} else {
					System.out.print(" " + house[i][j][k]);
					}
				}
			}
		}
	}

}



Measured memory_bytes: 29872
#include<bits/stdc++.h>
using namespace std ;
#define ll long long
#define pb push_back
ll mx = 1e4 + 3 ;
ll cnt[20000] ;
int main() {

    ll n, m , i , k ,  j ;

    ll ans = 0 ;
    cin >> n ;

    for (i =1  ; i<= n ; i++) {
        for (j = 1 ; j<= n ; j++ ) {
            for (k = 1 ; k<= n ; k++) {
                ll num = i *i + j*j + k* k + i * j + j*k + k*i ;
                if (num>n) break ;
                cnt[num] ++ ;
            }
        }
    }
    for (i =1  ; i<= n; i++) cout << cnt[i] << '\n' ;

    return 0 ;
}


Measured memory_bytes: 3704
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long int ll;
#define pb push_back
typedef pair<ll,ll> pp;

ll mod = 1e9+7;
ll INF = 1e15;

ll powm(ll a , ll b , ll mod)
{
  ll res = 1;
  while(b)
  {
    if(b & 1)
    res = (res *a)%mod;
    a = (a*a)%mod;
    b>>1;
  }
  return res;
}
ll gcd(ll a , ll b);
ll power(ll x , ll y , ll m);

ll modInverse(ll a , ll m)
{
  ll g = gcd(a,m);
  if(g != 1)
  return 1;
  else
  return power(a,m-2,m);

}

ll power(ll x , ll y , ll m)
{
  if(y == 0)
  return 1;
  ll p = power(x , y/2 , m)%m;
  p = (p*p)%m;

  return (y%2 == 0) ? p : (x *p) % m;
}

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





void solve()
{
  ll x;
  cin>>x;
  ll p = 100,ans = 0;
  while(p<x)
  {
    p+=p/100;
    ans++;
  }
  cout<<ans<<"\n";


}



int main()
{
  int tc;
  // cin>>tc;
  tc = 1;
  while(tc--)
  {
    solve();
  }
}


Measured memory_bytes: 3592
#include <iostream>

#define NMAX 2001
#define MOD 1000000007

using namespace std;

int n, k;
long long pascal[NMAX][NMAX];

int main()
{
	cin >> n >> k;
	int blueBalls = k;
	int redBalls = n - k;

	pascal[0][0] = 1;
	for (int i = 1; i <= n; i++)
		for (int j = 0; j <= n; j++)
			if (j - 1 >= 0)
				pascal[i][j] = (pascal[i - 1][j] + pascal[i - 1][j - 1]) % MOD;
			else
				pascal[i][j] = pascal[i - 1][j];

	for (int i = 1; i <= k; i++)
		cout << pascal[redBalls + 1][i] * pascal[blueBalls - 1][i - 1] % MOD << '\n';

	return 0;
}

Measured memory_bytes: 31488
from operator import mul
from functools import reduce
import copy
def cmb(n,r):
    r = min(n-r,r)
    if r == 0: return 1
    over = reduce(mul, range(n, n - r, -1))
    under = reduce(mul, range(1,r + 1))
    return over // under

n = int(input())
A = list(map(int,input().split()))
aset = set(A)
aDict = {}
for aName in aset:
    aDict.update({aName:0})
for a in A:
    aDict[a] += 1

combNumDict = {}
sum = 0
for i in aset:
    if aDict[i] == 0 or aDict[i] == 1:
        tmpsum = 0
    else:
        tmpsum = cmb(aDict[i],2)
    combNumDict.update({i:tmpsum})
    sum += tmpsum
for i in range(n):
    k = A[i]
    if aDict[k] == 1:
        print(sum)
    else:
        if aDict[k] == 2:
            tmp = 1
        else:
            tmp = cmb(aDict[k],2)-cmb(aDict[k]-1,2)
        print(sum-tmp)

Measured memory_bytes: 36496
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int A, B, n = 0;
  cin >> A >> B;
  
  for(int i = A; i <= B; i++){
    int a, b, c, d, e;
    a = i / 10000;
    b = i / 1000 % 10;
    c = i / 100 % 10;
    d = i / 10 % 10;
    e = i % 10;
    
    if(a == e && b == d)
      n++;
  }
  
  cout << n << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long a,b,ct,ct1,ct2,ct3,n,k,y,x,z,p,q,r,flag;
   cin>>n>>k;
   for(x=0;x<=n;x++)
   {
       for(y=0;x+y<=n;y++)
       {
           z=n-(x+y);
           if(10000*x+5000*y+z*1000==k)
           {
               cout<<x<<" "<<y<<" "<<z;
               return 0;
           }
       }
   }
   cout<<"-1 -1 -1";
   return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;//自动取模2^64 
const double pi=acos(-1.0);
const int mod = 1e9+7; // 998244353;
const int inf = 0x7fffffff;//2^31-1	
const ll INF = 0x7fffffffffffffff;
const int dx[]={-1,0,1,0},dy[]={0,1,0,-1};
//double begin_time=clock();    double end_time=clock();printf("time= %f ms\n",end_time-begin_time);
//bool operator < (const mmp &a) const{return x<a.x||x==a.x&&y<a.y;}       //map<int,map<int,int> >z;
//map<int,int>::iterator it;for(it=z.begin();it!=z.end();it++)printf("%d %d\n",it->first,it->second);
//ll pow(ll a,ll b){ll s=1;while(b){if(b&1){s=(s*a)%mod;b--;}b/=2;a=a*a%mod;}return s;}  //快速幂取模 
//lower_bound(begin,end,num); 第一个>=num的数字 upper_bound(begin,end,num); 第一个>num的数字,返回地址
//freopen("input.in","r",stdin);     freopen("output.out","w",stdout);      //文件读写提交 
//reverse(s.begin(),s.end());   //翻转字符串 ||        floor(); 向下取整  ceil(); 向上取整
//x&(x-1)==0 //是2的N次方||         x%9 //x各个位的和||           log10(x)+1   //x的位数|| 
//数轴上的n个点移动到同一位置，移动到该组数字的中位数的总距离最短

vector<int>y[200005];
int z[200005];
int main()
{
	int a,b,c,d,e,f,T;
	//scanf("%d",&T);
	//while(T--)
	{
		memset(z,0x3f,sizeof(z));
		scanf("%d%d",&a,&e);
		for(int i=0;i<e;i++)
		{
			scanf("%d%d",&b,&c);
			y[b].push_back(c);
			y[c].push_back(b);
		}
		queue<int>q;
		q.push(1);
		int n=1;z[1]=0;
		while(q.size()&&n!=a)
		{
			b=q.front();
			q.pop();
			for(int i=0;i<y[b].size();i++)
			{
				c=y[b][i];
				if(z[c]==0x3f3f3f3f)
				{
					n++;
					z[c]=b;
					q.push(c);
				}
				if(n==a)break;
			}
		}
		d=0;
		for(int i=2;i<=a;i++)
		{
			if(z[i]==0x3f3f3f3f)
			{
				d=1;break;
			}
		}
		if(d)printf("No\n");
		else
		{
			printf("Yes\n");
			for(int i=2;i<=a;i++)printf("%d\n",z[i]);
		}
		
	}
	
}





Measured memory_bytes: 13268
n = int(input())
a = [int(i) for i in input().split()]
even = [i for i in a if i%2==0]
res = 'APPROVED'
for i in even:
    if i%3==0:
        continue
    elif i%5==0:
        continue
    res = 'DENIED'
    break
print(res)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define dhoom ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);  
typedef long long ll;
typedef long double ld;
const ll inf = 1e18;
const int nax = 2e6 + 7;
const ll mod = 1e9 + 7;
//ll tree[4 * nax];
//9uS-22RSwk7gQqh
ll gcd(ll a , ll b){
	if(b == 0) return a;
	return gcd(b , a % b);	
}
ll lcm(ll a , ll b){
	ll g = gcd(a , b);
	ll lc = (a/g) * b;
	return lc;
}
map< ll , ll > mp;
int main()
{
	int n;
	cin >> n;
	for(int i = 1 ; i <= n ; i++){
		ll x;
		cin >> x;
		mp[x] ^= 1;
	} 
	ll ans = 0;
	for(auto it : mp){
		if(it.second == 1)
			ans++;
	}
	cout << ans << endl;
	return 0;
} 




Measured memory_bytes: 6528
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>

using namespace std;

int main(){
	int a[26];
	for(int i=0;i<26;i++) a[i] = 0;
	char s[100001];
	scanf("%s",s);

	for(int i=0;i<strlen(s);i++){
		a[s[i]-'a']++;
	}
	bool found = false;
	for(int i=0;i<26;i++){
		if(a[i]==0){
			printf("%c\n",(char)('a'+i));
			found = true;
			return 0;
		}
	}
	if(!found){
		printf("None\n");
	}

	return 0;
}


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

#define REP(i, n) for(int (i)=0;(i)<(n);(i)++)
#define MOD 1000000007

typedef long long ll;

using namespace std;

const int max_a = 10;
const int max_b = 10;
const int max_n = 40;
const int inf = 100000;
int a[max_n], b[max_n], c[max_n];
int dp[max_n + 1][max_n * max_a + 1][max_n * max_b + 1];

int main(){
    int N, M_a, M_b;
    cin >> N >> M_a >> M_b;
    REP(i, N) {
    	cin >> a[i] >> b[i] >> c[i];
    }

    REP(i, max_n + 1) {
	    REP(j, max_n * max_a + 1) {
	    	REP(k, max_n * max_b + 1) {
	    		dp[i][j][k] = inf;
	    	}
	    }
	}	

	// 初期条件
	dp[0][0][0] = 0;

	// dp[i + 1][j][k] : i 番目までの薬品を使って薬品a, bがj, k グラムになるときの最小コスト
    REP(i, N ) {
    	REP(j, max_n * max_a + 1) {
    		REP(k, max_n * max_b + 1) {
    			if (dp[i][j][k] == inf) {
    				continue;
    			}
    			else {
	    			dp[i + 1][j][k] = min(dp[i + 1][j][k], dp[i][j][k]);
	    			dp[i + 1][j + a[i]][k + b[i]] = min(dp[i + 1][j + a[i]][k + b[i]], dp[i][j][k] + c[i]);
    			}
    		}
    	}
    }

    int ans = inf;
    // a : b = M_a : M_b になる組み合わせの最小コストを求める
    for(int i = 1; i < max_n * max_a + 1; ++i) {
    	for(int j = 1; j < max_n * max_b + 1; ++j) {
    		if (i * M_b == j * M_a) ans = min(ans, dp[N][i][j]);
    	}
    }

    if (ans == inf) ans = -1;

    cout << ans << endl;
}


Measured memory_bytes: 25984
def get_int
  gets.chop.to_i
end

def get_ints
  gets.chop.split.map(&:to_i)
end

def get_double
  gets.chop.to_f
end

def get_str
  gets.chop
end

def get_strs
  gets.chop.split
end

def main
  s = get_str
  k = get_int
  if s.size == 1 or s.chars.uniq.size == 1
    puts (s.size * k / 2)
    exit 0
  end
  groups = []
  pre_c = s[0]
  count = 1
  1.upto(s.size - 1) do |i|
    c = s[i]
    if pre_c == c
      count += 1
    else
      if count > 1
        groups << [count, i - count, i]
      end
      count = 1
    end
    pre_c = c
  end
  if count > 1
    groups << [count, s.size - count, s.size]
  end

  ans = 0
  if s[0] != s[-1]
    groups.each do |g|
      ans += (g[0] / 2) * k
    end
    puts ans
  else
    groups.each do |g|
      if g[1] != 0 and g[2] != s.size
        ans += (g[0] / 2) * k
      end
    end
    l = 0
    if groups.size > 1 and groups[0][1] == 0
      l += groups[0][0]
      ans += (groups[0][0] / 2)
    else
      l += 1
    end
    if groups.size > 1 and groups[-1][2] == s.size
      l += groups[-1][0]
      ans += (groups[-1][0] / 2)
    else
      l += 1
    end
    ans += (l / 2) * (k - 1)
    puts ans
  end
end

if __FILE__ == $0
  main
end


Measured memory_bytes: 1788