akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>

int main(void){
	char s[5];
	scanf("%s",s);
	int a= 1;
	int temp=1;
	for(int i=0;i<4;i++){
		temp = 1;
		while(s[i]==s[i+1]){
			temp++;
			i++;
		}
		if(a<temp)a=temp;
	}
	if(a>=3){
		printf("Yes");
	}else{
		printf("No");
	}
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<vector>

using namespace std;

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

	vector<int> P;
	for (int i = 0; i < N; i++) {
		int p;
		cin >> p;
		P.push_back(p);
	}

	int count = 0;
	for (int i = 1; i < N-1; i++) {
		if (P[i - 1] < P[i] && P[i] < P[i + 1]) {
			count++;
		}
		else if (P[i - 1] > P[i] && P[i] > P[i + 1]) {
			count++;
		}
	}
	cout << count << endl;
}


Measured memory_bytes: 256
#include <stdio.h> 
#include <string.h>
#include <stdlib.h>


int main(void)
{
	int n, l;
	char s[110][110], tmp[110];
	scanf("%d%d", &n, &l);
	for (int i = 0; i < n; i++) scanf("%s", s[i]);
	qsort(s, n, sizeof(s[0]), strcmp);
	for (int i = 0; i < n; i++) printf("%s", s[i]);
	printf("\n");
	return 0;
}

Measured memory_bytes: 128
#include <stdio.h>

int main(void)
{
    int i, j;
    int h = -1, w = -1;
    while (w != 0 && h != 0)
    {
        if (w != -1 && h != -1)
        {
            putchar('\n');
        }        
        scanf("%d %d", &h, &w);
        for (j = 0; j < h; j++)
        {
            for (i = 0; i < w; i++)
            {
                putchar('#');
            }
            putchar('\n');
        }
    }
    return 0;
}


Measured memory_bytes: 2036
use std::io;

fn main() {
    let mut line = String::new();
    io::stdin().read_line(&mut line).unwrap();
    let mut iter = line.split_whitespace().map(|s| s.parse::<i32>().unwrap());
    let (a, b) = (iter.next().unwrap(), iter.next().unwrap());
    if a < b {
        println!("a < b");
    } else if a > b {
        println!("a > b");
    } else {
        println!("a == b");
    }
}


Measured memory_bytes: 5032
n=int(input())

int_sqrt=lambda x:int(x**0.5)+1
def sieve(x):
  p=[]
  b=[1]*x
  for i in range(2,x):
    if b[i]:
      p+=[i]
      for j in range(2*i,x,i): b[j]=0
  return p
def prime_factor(x):
  d={}
  for i in p:
    while x%i<1:
      x//=i
      d[i]=d.get(i,0)+1
    if x<2: break
  if x>1: d[x]=1
  return d

p=sieve(int_sqrt(n))
d=prime_factor(n)
a=0
for i in d.values():
  t=c=0
  while t+c<i: c+=1; t+=c
  a+=c
print(a)

Measured memory_bytes: 20208
#include <iostream>
#include <string>
#include <vector>
#include <iterator>
#include <algorithm>
#include <cstring>

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

using namespace std;

int main()
{
	int n;
	double n2;
		
	while(cin >> n && n)
	{
		int a[5000];
		memset(a,0,sizeof(a));
		
		n2 = (n-1)/2;

		vector<int> v;
		REP(i,1,n)
		{
			int temp = i*i;
			temp %= n;
			
			vector<int>::iterator ite = find(v.begin(),v.end(),temp);
			if(ite == v.end())
			{
				v.push_back(temp);
			}
		}

		rep(i,v.size())
		{
			REP(j,i+1,v.size())
			{
				int ans = v[i] - v[j];
				if(ans < 0) ans += n;
				if(ans > n2) ans = n - ans;
				a[ans]++;
			}
		}
		
		REP(i,1,n2+1)
		{
			cout << a[i]*2 << endl;
		}
	}

	return 0;
}

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

int main() {
    int k;
    cin >> k;
    vector<ll> lunlun;
    rep(i, 9) lunlun.push_back(i+1);
    
    while (1) {
        if (k <= lunlun.size()) {
            cout << lunlun[k-1] << endl;
            break;
        }

        k -= lunlun.size();
        vector<ll> old;
        swap(old, lunlun);
        for (ll x : old) {
            for (int i = -1; i <= 1; ++i) {
                int d = x % 10 + i;
                if (d < 0 || d > 9) continue;
                ll nx = 10*x + d;
                lunlun.push_back(nx);
            }
        }
    }
    return 0;
}

Measured memory_bytes: 1712
#include <bits/stdc++.h>
using namespace std;
 
template <typename T> void print(T t) { cout<<t<<endl; }
template<typename T, typename... Args> void print(T t, Args... args) { cout<<t<<" "; print(args...); }

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define int long long
#define double long double

int mod=1e9+7;
int fact[100004];
int inv(int x)
{
    int r,y;
    for(r=1,y=mod-2;y>0;x=(x*x)%mod,y/=2)
        if(y%2==1)
            r=r*x%mod;
    return r;
}
int nCr(int n, int m)
{
    if(n<m || n==0)
        return 0;
    return fact[n] *inv(fact[m])%mod *inv(fact[n-m])%mod ;
}
int32_t main() 
{
    IOS
    int n,k;
    cin>>n>>k;
    fact[0]=1;
    for(int i=1;i<n+2;i++)
        fact[i]=(i*fact[i-1])%mod;

    int arr[n];
    for(int i=0;i<n;i++)
        cin>>arr[i];
    sort(arr,arr+n);
    int sum1=n-1;
    int sum2=0;
    int sub=0,add=0;
    sub=(sub + (arr[0]*nCr(n-1,k-1))%mod)%mod;
    for(int i=1;i<n;i++)
    {
        sub=(sub + (arr[i]*nCr(n-i-1,k-1))%mod)%mod;
        add=(add + (arr[i]*nCr(i,k-1))%mod)%mod;
    }
    print((add-sub+mod)%mod);
}   


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

int main() {
  int n; cin >> n;
  int size = to_string(n).size();
  int ans = 0;
  if (size < 2) ans = min(n, 9);
  else if (size < 4) ans = max(n - 99 + 9, 9);
  else if (size < 6) ans = max(n - 9999 + 909, 909);
  else ans = 90909;
  cout << ans << endl;
}

Measured memory_bytes: 256
#define  _CRT_SECURE_NO_WARNiINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include <map>
#include <fstream>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <cassert>
#include <set>
using namespace std;
#define eps 0.000000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
#define cycle_per_sec 2806192512
int main() {
	int a, b;
	cin >> a >> b;
	int hoge = a - 1;
	if (a <= b) {
		hoge++;
	}
	cout << hoge << endl;
	return 0;
}

Measured memory_bytes: 888
//int a = stoi(c); 文字列をintへ
//小文字から大文字
//transform(a.begin(), a.end(), a.begin(), ::toupper);
//途中の出力をそのまま残さない
//数値計算 個数以外はdouble
//map<キー,値> p は辞書。p[キー] = 値
//map 全探索
//auto begin = p.begin(), end = p.end();
//for (auto it = begin; it != end; it++) {}
//mapのキー：it->first mapのバリュー：it->second
//絶対値 abs()
//入力は空白で切れる
//大文字判定 isupper(文字) 小文字判定 islower(文字)
//do{}while(next_permutation(ALL(配列)))
//while(N)で回すとき、Nはコピーを作っておく
//小文字に対応する文字コード：S[i] - 'a'
//文字コード→小文字：(char)(数字+'a')
//グラフの距離:隣接行列で扱う
//等価なものに変換する思考
//bool型　初期値はTrue
//島渡りの問題：中間ノードに着目
//配列はvector<>を使う：意味わからないエラーがなくなる。
//背反な事象にちゃんとわける
//チェックリストはマップを使う
//数が大きい時の比較はstring型で行う
//全て0になったか調べたい->0になるたびにcntする
//またはかかつか
//例外処理は最初にする
//x = p^m + q^n...の約数の個数:(n+1)*(m+1)....
//N!のどの素因数で何回割れるか
//⇔1~Nまでの数がそれぞれどの素因数で何回割り切れるかの和
//パズルの問題->一般化して全探索
//数が大きい時のせぐふぉはコードテストで試してみる
//スペルミスに注意
//stack<ll> s;
//s.push(要素);s.top();s.pop();
//queue<ll> q;
//q.push(要素);q.front();q.pop();
//同じ作業繰り返す系の問題：収束先を見つける
//関係性は隣接行列で記録
//過半数：N/2.0で判定
//ある量からある量を引く系の問題：端から定義してやる
#include <bits/stdc++.h>
#define rep(i,N) for(int i = 0; i < N;i++)
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
using namespace std;

//円周率
const double PI = 3.14159265358979323846;
//割るやつ
const ll M = (pow(10, 9) + 7);

// K進数でのNの桁数
ll dig(ll N, ll K) {
	ll dig = 0;
	while (N) {
		dig++;
		N /= K;
	}
	return dig;
}
// a,bの最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}


//a,bの最小公倍数
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}

//nC2の計算
ll C(ll N) {
	return N * (N - 1) / 2;
}

//階乗計算
ll f(ll n) {
	if (n == 0 || n == 1) return 1;
	else return (n * f(n - 1)) % M;
}

//Nをdで何回割れるか
ll divcnt(ll N, ll d) {
	ll ans = 0;
	while (1) {
		if (N%d == 0) {
			ans++;
			N /= d;
		}
		else break;
	}

	return ans;
}

//素数判定
bool prime(ll num) {
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false;
	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2) {
		if (num % i == 0) return false;
	}
	return true;
}

//フィボナッチ数列
vector<ll> memo(pow(10, 6) + 1);
ll fibo(ll n) {
	if (n == 1) return 1;
	else if (n == 2) return 1;
	else if (memo[n] != 0) return memo[n];
	else return memo[n] = fibo(n - 1) + f(n - 2);
}


int main() {
	ll N, T; cin >> N >> T;
	vector<ll> t(N); rep(i, N)cin >> t[i];

	ll ans = 0;
	rep(i, N) {
		if (i == N - 1) ans += T;
		else {
			if (t[i + 1] - t[i] <= T)ans += (t[i + 1] - t[i]);
			else ans += T;
		}
	}

	cout << ans << endl;
}

Measured memory_bytes: 9600
#include<bits/stdc++.h>
#include <queue>
#include <cstring>

#define mp make_pair
#define pb push_back
#define p push

#define FOR(a, c) for(int a = 0;a<c;a++)
#define ll long long int

#define getI(a) scanf("%d",&a)
#define getII(a, b) scanf("%d%d",&a,&b)
#define getIII(a, b, c) scanf("%d%d%d",&a,&b,&c)
#define getL(a) scanf("%lld",&a)
#define getLL(a, b) scanf("%lld%lld",&a,&b)
#define getLLL(a, b, c) scanf("%lld%lld%lld",&a,&b,&c)
#define BEND(c) (c).begin(),(c).end()
#define BEND2(c) (c).rbegin(),(c).rend()
#define fi first
#define se second
#define pi 3.1415926535897932384626
#define getS(a) scanf("%s",a)
#define pfi(a) printf("%d",a);
#define pfii(a, b) printf("%d%d",a,b);
#define pfl(a) printf("%lld",a);
#define pfll(a, b) printf("%lld%lld",a,b);
#define pfd(a) printf("%lf",a);
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);

#define sag (sol|1)
#define sol (root<<1)
#define ort (bas+son)/2
#define SIZE  ( int)(1e9 + 7)
#define MAXN (ll) (1e5+5)

using namespace std;

typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector <vector<int>> vvi;
typedef vector<long long> vl;
typedef vector <pair<int, int>> vpi;
typedef vector <pair<long long, long long>> vpl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector <vi> graph;




int main (){
    ll n,a,b;
    cin >>n>>a>>b;

    if(a == b){
        cout <<1;
        return 0;
    }
   // cout << a <<" "<<b<<"\n";
    if((a-b) &1){
        if(a-1 < n-b){
            cout<<a-1 + (b-a+1)/2;
        }else{
            cout<<n-b + (b-a+1)/2;
        }
    }else{
        cout << (b-a)/2;
    }

    return 0;
}

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

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

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

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

int main (void) {
    int N;
    cin>>N;
    N--;
    vector<vector<int>> train(N,vector<int>(3));
    REP(i,N) {
        cin>>train[i][0]>>train[i][1]>>train[i][2];
    }
    REP(i,N) {
        ll tt = 0;
        ll ans = 0;
        for (int j=i;j<N;j++) {

            int c,s,f;
            c = train[j][0];
            s = train[j][1];
            f = train[j][2];
            if (tt < s) {
                tt += s - tt;
            }
            if (tt % f != 0) {
                tt += f - (tt % f);
            }
            tt += c;
        }
        cout<<tt<<endl;
    }
    cout<<0<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define ULL unsigned LL
#define PII pair<int,int>
#define VI vector<int>
#define VPII vector< PII >
#define VVI vector< VI >
#define PB push_back
#define F first
#define S second
const int INF=1e9;
const int MOD=1e9+7;
string s;
int main(){
    cin>>s;
    if(s.size()<4){
        cout<<"No\n";
        return 0;
    }
    if(s[0]=='Y'&&s[1]=='A'&&s[2]=='K'&&s[3]=='I')cout<<"Yes\n";
    else cout<<"No\n";
    return 0;
}

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

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define rsz resize
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define odd(x) ((x) % (2))
#define fastio ios_base::sync_with_stdio(false), cin.tie(0);
#define fileio freopen("template.in", "r", stdin), freopen("template.out", "w", stdout);
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const ll MOD = 1e9 + 7;

int main() {
    fastio;
    //fileio;
        
    int n;
    cin >> n;
    ll A[n];
    ll totalSum = 0;
    ll answer = 0;
    FOR(i, 0, n) {
        cin >> A[i];
        totalSum += A[i];
    }
    FOR(i, 0, n) {
        ll addend = (A[i] % MOD) * ((totalSum - A[i]) % MOD);
        addend %= MOD;
        answer += addend;
        answer %= MOD;
        totalSum -= A[i];
    }
    answer %= MOD;
    cout << answer << "\n";
    return 0;
}


Measured memory_bytes: 5216
#include <cstdio>
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#define rep(i,n) for (int i=0;i<n;i++)
using ll = long long;
using namespace std;


void solve(){

}
int main (){
    ios::sync_with_stdio(0);
    cin.tie(0);
    double a,b;
    cin >>a >> b;
    double ans;
    ans= (a+b)/2;
    int ans1;
    ans1 = ans;
    if(ans1 == ans){
        cout << ans1;
    } 
    else{
        cout << ans1 + 1;
    }

    return 0;
}

Measured memory_bytes: 256
s = list(map(str, input()))
a = 0
def judge(n):
    if n == 0:
        return 'Yes'
    else:
        return 'No'

for i, name in enumerate(s):
    if i % 2 == 0 and name == 'L':
        a += 1
    elif i % 2 == 1 and name == 'R':
        a += 1
    else:
        continue
print(judge(a))


Measured memory_bytes: 3060
//def
#include <iostream>

#include <cmath>
#include <algorithm>
#include <iomanip>

//array
#include <vector>
#include <set>
#include <map>

using namespace std;
#define rep(i,q) for(int i = 0; (q) > i; i++)
int main(){
  int n,m,c;cin>>n>>m>>c;
  int b[m];rep(i,m)cin>>b[i];
  int ret = 0;
  rep(i,n){
    int a[m];rep(i,m)cin>>a[i];
    int kekka = c;
    rep(i,m){
      kekka += a[i]*b[i];
    }
    if(kekka > 0)ret++;
  }
  cout << ret << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using namespace std;
int main()
{
    string a,b;
    cin >> a ;
    rep(i, a.length()) {
        b += "x";
    }
    cout << b << endl;
}

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

#define int long long 
#define MOD 1000000007


using namespace std;


signed main(){

	string s;
	cin >> s;
	
	int size = (int)s.size();
	
	int min = MOD;
	
	int result;
	
	for(int i=0;i<size-2;i++){
		int a = s[i]-'0'; 
		int b = s[i+1]-'0';
		int c = s[i+2]-'0';
		
		int temp = 100*a+10*b+c;
		int sub = abs(temp-753);
		if(sub<min){
			result = temp;
			min = sub;
		
		}
		
	}
 	
 	cout <<min <<endl;
 	
 	return 0;
	

}

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

int main(void) {
	int N, X;
	scanf("%d %d", &N, &X);
	int m[100];
	int mMin = 100100;
	for (int i = 0; i < N; i++) {
		scanf("%d", &m[i]);
		X -= m[i];
		mMin = min(mMin, m[i]);
	}
	printf("%d\n", N + X / mMin);

	return 0;
}


Measured memory_bytes: 3800
import sys

n = int(raw_input())
for i in xrange(n):
        im = int(raw_input())
        y = int(raw_input())
        n = int(raw_input())
        fm = 0
        for j in xrange(n):
                w, ir, c = raw_input().split()
                w, ir, c = int(w), float(ir), int(c)
                if w == 1:
                        m = im
                        for k in xrange(y):
                                m += int(m * ir)
                                m -= c
                                #print >> sys.stderr, m
                        if m > fm: fm = m
                else:
                        tmp = 0
                        m = im
                        for k in xrange(y):
                                tmp += int(m * ir)
                                m -= c
                                #print >> sys.stderr, m
                                #print >> sys.stderr, tmp
                        if m+tmp > fm: fm = m+tmp
        #print >> sys.stderr, fm
        print fm

Measured memory_bytes: 4268
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<map>
#include<set>

using namespace std;

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(a) (a).begin(),(a).end()
#define PI 3.141592653589793238
#define INF 1050000000
#define INFL (long long)(4e18)

using vi = vector<int>;


int main() {

	int M, N;

	cin >> M >> N;

	cout << (M*(M-1))/2+(N*(N-1))/2 << endl;

	return 0;
}

Measured memory_bytes: 384
require 'set'; require 'prime'
INF=Float::INFINITY; MOD=10**9+7
n,a,b = gets.chomp.split.map(&:to_i)
s = gets.chomp

count = Hash.new(0)
s.chars do |c|
  if c == 'a'
    count[c] += 1
    if count['a'] + count['b'] <= a + b
      puts 'Yes'
    else
      count[c] -= 1
      puts 'No'
    end
  elsif c == 'b'
    count[c] += 1
    if count['a'] + count['b'] <= a + b && count['b'] <= b
      puts 'Yes'
    else
      count[c] -= 1
      puts 'No'
    end
  else
    puts 'No'
  end
end

Measured memory_bytes: 2940
#include<stdio.h>

int main() {
	int N;
	scanf("%d", &N);
	int *X = (int *)malloc(sizeof(int)*N);
	int *Y = (int *)malloc(sizeof(int)*N);
	int *H = (int *)malloc(sizeof(int)*N);
	for (int i = 0; i < N; i++) {
		scanf("%d%d%d", &X[i], &Y[i], &H[i]);
	}

	for (int posx = 0; posx <= 100; posx++) {
		for (int posy = 0; posy <= 100; posy++) {
			int needH = -1;
			for (int i = 0; i < N; i++) {
				if (H[i] > 0) {
					int tmp1 = H[i] + abs(X[i] - posx) + abs(Y[i] - posy);
					if (needH == -1) {
						needH = tmp1;
					}
					else if (needH != tmp1) {
						needH = -2;
						break;
					}
				}
			}
			if (needH == -2) {
				continue;
			}
			for (int i = 0; i < N; i++) {
				if (H[i] == 0) {
					int tmp2 = abs(X[i] - posx) + abs(Y[i] - posy);
					if (needH == -1) {
						needH = tmp2;
					}
					else if (needH > tmp2) {
						needH = -2;
						break;
					}
				}
			}
			if (needH == -2) {
				continue;
			}
			printf("%d %d %d", posx, posy, needH);
			printf("\n");
			return 0;
		}
	}
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cerr << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cerr<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 500010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = (1 << 30) - 1;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
mt19937 rng; //use it by rng() % mod, shuffle(all(vec), rng)
///////////////////////////////////////////////////////////////////////////////////////////////////

int N;
int L[MAX_N], R[MAX_N];
int A[MAX_N];

void solve() {
	cin >> N;
	rep(i, 0, N) cin >> A[i];
	int tmp = 0;
	rep(i, 0, N) {
		tmp = __gcd(tmp, A[i]);
		L[i] = tmp;
	}
	tmp = 0;
	rer(i, N, 0) {
		tmp = __gcd(tmp, A[i]);
		R[i] = tmp;
	}
	int res = 1;
	rep(i, 0, N) {
		int l = i == 0 ? 0 : L[i - 1];
		int r = i == N - 1 ? 0 : R[i + 1];
		MAX(res, __gcd(l, r));
	}
	cout << res << "\n";
}

uint32_t rd() {
	uint32_t res;
#ifdef __MINGW32__
	asm volatile("rdrand %0" :"=a"(res) ::"cc");
#else
	res = std::random_device()();
#endif
	return res;
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
    cerr << fixed;
	cerr.precision(6);
	rng.seed(rd());
#ifdef LOCAL
	//freopen("in.txt", "wt", stdout); //for tester
	if(!freopen("in.txt", "rt", stdin)) return 1;
#endif	
	solve();
    cerr << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
	return 0;
}



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

using namespace std;

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  if (B < C || D < A) {
    cout << 0 << endl;
  } else {
    cout << min(B, D) - max(A, C) << endl;
  }
  return 0;
}

Measured memory_bytes: 256
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! p {
    ($($x:expr),*) => {
        $(println!("{:?}", $x);)*
    };
}
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        #[allow(unused_mut)]
        let mut 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)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $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")
    };
}
#[allow(unused_imports)]
use std::cmp::*;
trait Each: Iterator{
    fn each<F>(self, mut f: F) where
        Self: Sized, F: FnMut(Self::Item),
    {
        self.fold((), move |(), item| f(item));
    }
}
impl<T:Iterator>Each for T{}

fn main(){
    input!{
        n:usize, k:i32, q:usize,
        a:[usize;q]
    }
    let mut v = vec![0;n];
    a.iter().each(|x|
        v[x-1] +=1
    );
    v.iter().each(|&x|
        println!("{}", if k-q as i32+x>0 {"Yes"} else {"No"})
    )
}

Measured memory_bytes: 6780
p=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
n=int(input())
print(p[n-1])

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

// iterator
#define REP(i,from, to) for(lli i=from;i<to;i++)
#define REPE(i,from, to) for(lli i=from;i<=to;i++)
#define REP_R(i,from, to) for(lli i=from;i>to;i--)
#define REPE_R(i,from, to) for(lli i=from;i>=to;i--)
#define REPIT(it,container) for(auto it = container.begin(); it != container.end(); it++)
#define REPIT_R(it,container) for(auto it = container.rbegin(); it != container.rend(); it++)

// input
#define cin1(x)             cin >> x
#define cin2(x, y)          cin >> x >> y
#define cin3(x, y, z)       cin >> x >> y >> z
#define ncin1(n, x)         REP(i, 0, n) { cin1(x[i]); }
#define ncin2(n, x, y)      REP(i, 0, n) { cin2(x[i], y[i]); }
#define ncin3(n, x, y, z)   REP(i, 0, n) { cin3(x[i], y[i], z[i]); }
#define ncinp(n, p)         REP(i, 0, n) { lli p1,p2; cin >> p1 >> p2; p[i] = P(p1, p2); }
#define ncin1_1(n, x)       REPE(i, 1, n) { cin1(x[i]); }
#define ncin2_1(n, x, y)    REPE(i, 1, n) { cin2(x[i], y[i]); }
#define ncin3_1(n, x, y, z) REPE(i, 1, n) { cin3(x[i], y[i], z[i]); }
#define ncinp_1(n, p)       REPE(i, 1, n) { lli p1,p2; cin >> p1 >> p2; p[i] = P(p1, p2); }

// output
#define cout1(x)         cout << #x << ": " << x << endl;
#define cout2(x, y)      cout << #x << ": " << x << ", " << #y << ": " << y << endl;
#define cout3(x, y, z)   cout << #x << ": " << x << ", " << #y << ": " << y << ", " << #z << ": " << z << endl;;
#define ncout1(n, x)     REP(i, 0, n) {cout << #x << "[" << i << "]: "<< x[i] << endl;}

#define coutp(p)         cout << #p << ":" <<  " (" << p.first << ", " << p.second << ")" << endl;

// sort
#define sort_r(x, y)        sort(x, y, greater<lli>()); // 降順(5,4,3,,,)

#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))

typedef long long int lli;
typedef pair<lli, lli> P;
typedef tuple<lli, lli, lli> tup;
typedef vector<lli> vlli;

int main() {
    lli n,m;
    cin2(n,m);
    lli a[n];
    ncin1(n,a);

    a[0] %= m;
    // FIXME: m は 10^9 以下の制約なので、これだとメモリ確保しすぎになる。
    // vec.push_back(make_pair(0, [1,3,4])) みたいな感じにすれば、たかだかn個になる。
    map<lli, vlli> loc;
    loc[a[0]].push_back(0);
    REP(i,1,n) {
        a[i] = (a[i-1] + a[i]) % m;
        //cout2(a[i], i);
        loc[a[i]].push_back(i);
    }
    //REP(i,0,n) {
    //    cout2(i,loc[i].size());
    //}
    lli cur = 0;
    lli ans = 0;
    REP(i,0,n) {
        if (loc[cur].size() == 0) {
            cur = a[i];
            continue;
        }
        auto it = lower_bound(loc[cur].begin(), loc[cur].end(), i);
        if (it == loc[cur].end()) {
            cur = a[i];
            continue;
        }
        ans += loc[cur].size() - ((it - loc[cur].begin()));
        //cout3(i, cur,loc[cur].size() - ((it - loc[cur].begin())));
        //cout1(it - loc[cur].begin());

        cur = a[i];
    }
    cout << ans << endl;


}


Measured memory_bytes: 8320
#include <iostream>
#include <fstream>
#include <cstring>
#include <climits>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;

#define ll long long

ll dp[101][100000];

ll solve(int i, int W, ll int* w, ll int* v, int n) {

	if (W < 0)
		return INT_MIN;
	if (i == n)
		return 0;

	if (dp[i][W] == -1)
		dp[i][W] = max(solve(i+1, W, w, v, n), solve(i+1, W-w[i], w, v, n) + v[i]);
	return dp[i][W];
}

int main() {

	int n, W;
	cin >> n >> W;
	ll v[n], w[n];
	for (int i = 0; i < n; ++i)
		cin >> w[i] >> v[i];
	memset(dp, -1, sizeof(dp));
	cout << solve(0, W, w, v, n);

	return 0;
}

Measured memory_bytes: 79104
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    private static final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    public static void main(String args[]) throws Exception {
        String[] tokens = br.readLine().split(" ");
        int x = Integer.parseInt(tokens[0]);
        int n = Integer.parseInt(tokens[1]);
        Set<Integer> set = new HashSet<>();
        if(n>0){
            tokens = br.readLine().split(" ");
            for(int i=0;i<n;i++){
                set.add(Integer.parseInt(tokens[i]));
            }
        }
        int ans = x;
        for(int diff=0;diff<=Integer.MAX_VALUE;diff++){
            int left = x-diff;
            int right = x+diff;
            if(!set.contains(left)){
                ans = left;
                break;
            }
            if(!set.contains(right)){
                ans = right;
                break;
            }
        }
        System.out.println(ans);
    }




    private static class Pair{
        int first,second;

        public Pair(int first,int second){
            this.first = first;
            this.second = second;
        }

        public int hashCode(){
            return Objects.hash(first,second);
        }

        public boolean equals(Object obj){
            if(obj!=null || !(obj instanceof  Pair))
                return false;
            Pair pair = (Pair)obj;
            return pair.first == first && pair.second == second;
        }
    }




}

Measured memory_bytes: 25368
#include <bits/stdc++.h>
using namespace std;
void divmod (vector<int>& vi, int a, int b) {
    int q;
    int r;
    if (b < 0) {
        b = -b;
        a = -a;
    }
    q = 0;
    r = a;
    if (r > 0) {
        while (r - b >= 0) {
            q += 1;
            r -= b;
        }
    } else if (r < 0) {
        do {
            q -= 1;
            r += b;
        } while (r < 0);
    }
    vi[0] = q;
    vi[1] = r;
}
int main() {
    vector<int> vi (2);
    int         N;
    cin >> N;
    string S    = "";
    int    base = 2;
    while (N) {
        S = to_string (abs (N % base)) + S;
        N -= abs (N % base);
        N = N / -base;
        // divmod (vi, N, base);
        // S = to_string (vi[1]) + S;
        // N -= vi[1];
        // divmod (vi, N, -base);
        // N = vi[0];
    }
    if (S != "") cout << S << endl;
    else
        cout << "0" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5 + 11;
int n, a[N];
int main(){
    //freopen("agc002e.in", "r", stdin);
    cin>>n;
    for(int i = 1;i <= n; i++){
        scanf("%d", &a[i]);
    }
    sort(a + 1, a + 1 + n, greater<int>());
    for(int i = 1;i <= n; i++){
        if(a[i+1] < i + 1){
            int j = i;
            while(a[j+1] == i && j < n)j++;
            int ans = ((a[i] - i) & 1) | ((j - i) & 1);
            //printf("i=%d j=%d\n", i, j);
            puts(ans == 1 ? "First" : "Second");
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 640
import sys
input = sys.stdin.readline
def main():
    N, C, K = map( int, input().split())
    T = [ int( input()) for _ in range(N)]
    T.sort()
    deadline = -1
    ans = 0
    count = 0
    for t in T:
        if deadline < t or count >= C:
            ans += 1
            deadline = t+K
            count = 1
            continue
        count += 1

    print(ans)
if __name__ == '__main__':
    main()


Measured memory_bytes: 7384
#include <stdio.h>
#define N 101

int main(){
  int i,j,n,A[N],flag,temp,c=0;

  scanf("%d",&n);
  for(i=0;i<n;i++)
    scanf("%d",&A[i]);


  //bubblesort 
  flag = 1; // 逆の隣接要素が存在する
  while (flag){
    flag = 0;
    for(j=n-1;j>0;j--){
      if (A[j] < A[j-1]){
	temp=A[j];
	A[j]=A[j-1];
	A[j-1]=temp;  
	  flag = 1;
	  c=c+1;
	  
      }
    }
  }

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






Measured memory_bytes: 2048
#include<iostream>
#include<math.h>

using namespace std;

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

  cin >> a >> b >> h;

  ans = ((a + b) * h) / 2;
 
  cout << ans << endl;

}


Measured memory_bytes: 256
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = input()

cmd = []
total = 0

for i in range(N):
    if i < K or cmd[i-K] != T[i]:
        if T[i] == "r":
            total += P
        elif T[i] == "s":
            total += R
        elif T[i] == "p":
            total += S
        cmd.append(T[i])
    else:
        cmd.append("")

print(total)


Measured memory_bytes: 4212
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

string s[101];
int main(){
    int n,m,d;
    cin>>n>>m>>d;
    rep(i,n) cin>>s[i];
    int sum=0;
    rep(i,n){
        int cnt=0;
        rep(j,m){
            if(s[i][j]=='.') ++cnt;
            else sum+=max(cnt-d+1,0),cnt=0;
        }
        sum+=max(cnt-d+1,0);
    }
    rep(i,m){
        int cnt=0;
        rep(j,n){
            if(s[j][i]=='.') ++cnt;
            else sum+=max(cnt-d+1,0),cnt=0;
        }
        sum+=max(cnt-d+1,0);
    }
    cout<<sum<<endl;
    return 0;
}


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

using namespace std;

const int N = 2*1e5 + 2137;
int maks[N];

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n;
	cin>>n;
	int t[n];
	for(int i=0; i<n; i++)
		cin>>t[i];
	int dp[n];
	for(int i=1; i<=n; i++)
		maks[i] = -1;
	maks[0] = 0;
	int wmaks = -1;
	for(int i=0; i<n; i++) {
		dp[i] = -1;
		if(maks[t[i]-1]!=-1)
			dp[i] = max(dp[i], maks[t[i]-1]+1);
		//cout<<maks[t[i]-1]<<endl;
		maks[t[i]] = max(maks[t[i]], dp[i]);
		wmaks = max(wmaks, dp[i]);
	}
	int w = n - wmaks;
	if(w<0 || w>n)
		cout<<-1;
	else
		cout<<w;
}


Measured memory_bytes: 2560
#include <stdio.h>
#include <string.h>
/*
SからTへの置換が存在するための条件は，
集合{'a','b',...,'z'}上の変換Rが存在して，任意のiに対して
  R(S_{i}) = T_{i}
が成り立つことである．
*/

int main(){
  char S[200010] = {};
  char T[200010] = {};
  char R1[30] = {};//SからTへの置換
  char R2[30] = {};//TからSへの置換
  scanf("%s %s", S, T);
  int l = strlen(S);

  int flag = 1;
  for(int i = 0; i < l; i++){

    if(R1[S[i] - 'a'] == 0){
      R1[S[i] - 'a'] = T[i];
    }else if(R1[S[i] - 'a'] != T[i]){
      flag = 0;
      break;
    }

    if(R2[T[i] - 'a'] == 0){
      R2[T[i] - 'a'] = S[i];
    }else if(R2[T[i] - 'a'] != S[i]){
      flag = 0;
      break;
    }

  }
  if(flag == 1){
    printf("Yes\n");
  }else{
    printf("No\n");
  }


  return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A,B;
  cin >> A >> B;
  int ans = 0;
  if (A >= B) {
    ans += A;
    if (A - 1 >= B){
      ans += A-1;
    }else {
      ans += B;
    }
  } else {
    ans += B;
    if (B - 1 >= A){
      ans += B-1;
    }else {
      ans += A;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
package main

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

type node struct{
	no, parent, depth int
	t string
	children []int
}

func get_depth(i, d int) int{
	if tree[i].parent != -1{
		return get_depth(tree[i].parent, d+1)
	}
	return d
}

func get_type(i int){
	if tree[i].parent == -1{
		tree[i].t = "root"
	} else{
		if len(tree[i].children) == 0{
			tree[i].t = "leaf"
		} else {
			tree[i].t = "internal node"
		}
	}
}

var tree []node

func main(){
	var n, cn, no int
	var children []int
	sc := bufio.NewScanner(os.Stdin)
	buf := make([]byte, 10000)
	sc.Buffer(buf, 1000000)
	sc.Scan()
	n, _ = strconv.Atoi(sc.Text())
	tree = make([]node, n)
	for i:=0; i<n; i++{
		tree[i] = node{no : i, parent : -1}
	}
	for i:=0; i<n; i++{
		sc.Scan()
		arr := strings.Split(sc.Text(), " ")
		no, _ = strconv.Atoi(arr[0])
		cn, _ = strconv.Atoi(arr[1])
		children = []int{}
		if cn != 0{
			for _, v := range(arr[2:]){
				c, _ := strconv.Atoi(v)
				children = append(children, c)
			}
		}
		tree[no].children = children
		for _, v := range(children){
			tree[v].parent = no
		}
	}
	for i:=0; i<n; i++{
		tree[i].depth = get_depth(i, 0)
		get_type(i)
		a := tree[i]
		s := []string{}
		for _, v := range(a.children){
			s = append(s, strconv.Itoa(v))
		}
		out := "[" + strings.Join(s, ", ") + "]"
		fmt.Printf("node %d: parent = %d, depth = %d, %s, %s\n", a.no, a.parent, a.depth, a.t, out)
	}
}


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

using Int = long long;
using ll = long long;

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

template<typename T> void drop(T x){cout<<x<<endl;exit(0);};

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

  int n;
  cin>>n;

  vector<int> rs(n),cs(n);
  for(int i=0;i<n;i++) cin>>rs[i]>>cs[i],rs[i]--,cs[i]--;

  vector<int> as(n,0),bs(n,0);
  for(int i=0;i<n;i++) as[rs[i]]++;
  for(int i=0;i<n;i++) bs[cs[i]]++;

  if(*min_element(as.begin(),as.end())==0) drop(-1);
  if(*min_element(bs.begin(),bs.end())==0) drop(-1);

  using P = pair<int, int>;
  vector<P> vp;
  for(int i=0;i<n;i++) vp.emplace_back(rs[i],cs[i]);

  sort(vp.begin(),vp.end());
  vector<int> ds(n);
  for(int i=0;i<n;i++) ds[i]=vp[i].second;

  int ans=0;
  for(int i=0;i<n;i++){
    while(ds[i]!=i){
      //cout<<i<<":"<<ds[i]<<endl;
      swap(ds[i],ds[ds[i]]);
      ans++;
    }
  }
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 5696
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int K = sc.nextInt();
    int S = sc.nextInt();
    
    int count = 0;
    
    for(int x = 0; x <= K; x++) {
    	for(int y = 0; y <= K; y++) {
    		int z = S - (x+y);
    		if(z < 0)
    			break;
    		if(z <= K)
    			count++;
    	}
    }
    System.out.println(count);
    
  }
}

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

#define ll long long

using namespace std;

bool chk_bit(ll n, ll k)
{
    return n & (1LL << k);
}

ll set_bit(ll n, ll k)
{
    return n | (1LL << k);
}

ll flip_bit(ll n, ll k)
{
    return n ^ (1LL << k);
}

ll fnc(ll n)
{
    if(n % 4 == 0) return n;

    if(n % 2 == 0) return (n ^ 1LL);

    if((n + 1) % 4 == 0) return 0LL;

    return 1LL;
}

int main()
{
    ll a, b;

    cin >> a >> b;

//    if(a == b){
//        cout << a << endl;
//        return 0;
//    }

    cout << (fnc(b) ^ fnc(a - 1)) << endl;

    return 0;
}


Measured memory_bytes: 3604
#include <iostream>
#include <vector>

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

    std::vector<std::vector<int>> ada_mat(n, std::vector<int>(n, 0));
    
    for (int i = 0; i < n; i++) {
        int u, k, v;
        std::cin >> u >> k;
        for (int j = 0; j < k; j++) {
            std::cin >> v;
            ada_mat[u - 1][v - 1] = 1;
        }
    }

    for (auto && row : ada_mat) {
        for (int i = 0; i < n; i++) {
            if (i != 0) {
                std::cout << " ";
            }
            std::cout << row[i];
        }
        std::cout << std::endl;
    }
}



Measured memory_bytes: 3116
N = int(input())
H = [int(i) for i in input().split()] 
C = 0
F = 0
for i in range(N-1, 0, -1):
	if H[i-1] > (H[i]+1):
		C = 1
		break
	elif H[i-1] == (H[i]+1):
		if F == 0:
			F = 1
		else:
			C = 1
			break
	elif H[i-1] < H[i]:
		F = 0
		

if C == 1:
	print("No")
else:
	print("Yes")

Measured memory_bytes: 14704
#include <bits/stdc++.h>
    using namespace std;
    const int inf=1e5+9;
    long long  dp[inf],a[inf],n;

    int solve(int pos){
        if(pos==n)
            return 0;
        if(pos>n)
            return 1e9+9;
        long long  &ret=dp[pos];
        if(ret!=-1)
            return ret;
        ret=min(abs(a[pos]-a[pos+1])+solve(pos+1),abs(a[pos]-a[pos+2])+solve(pos+2)  );
        return ret;
    }

    int main(){

        cin>>n;
        for(int i=1;i<=n;i++)
            cin>>a[i];
        memset(dp,-1,sizeof(dp));
        cout<<solve(1)<<endl;
    }


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

using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF (1LL << 55)
#define MOD (1000 * 1000 * 1000 + 7)
#define maxn 500111

typedef long long ll;
typedef long double ld;

int main(){
	int n, m, ans = 0;
	scanf("%d%d", &n, &m);
	ans += 100 * (n - m) + 1900 * m;
	for(int i = 0; i < m; i++)
		ans = ans * 2;

	printf("%d\n", ans);	
	return 0;
}

Measured memory_bytes: 256
package main

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

func main() {
	var h1, m1, h2, m2, k int
	r := bufio.NewReader(os.Stdin)
	fmt.Fscan(r, &h1)
	fmt.Fscan(r, &m1)
	fmt.Fscan(r, &h2)
	fmt.Fscan(r, &m2)
	fmt.Fscan(r, &k)
	var ans = 0
	ans = (h2-h1)*60 + (m2 - m1) - k
	if ans <= 0 {
		ans = 0
	}
	fmt.Println(ans)

}


Measured memory_bytes: 1840
from math import *
from bisect import *
s=input()
t=input()
n=len(s)
nn=len(t)
ss=[[]for i in range(26)]
tt=[[] for i in range(26)]
ans=0
k=0
for i in range(n):
    ss[ord(s[i])-97].append(i+1)
for i in t:
    j=ss[ord(i)-97]
    if len(j)==0:
        print(-1)
        exit()
    else:
        if j[-1]<=ans:
            ans=j[0]
            k+=1
        else:
            ans=j[bisect(j,ans)]
print(k*n+ans)

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

int main(void){
  int e;
  while(cin >> e && e >0){
    int sum;
    int minsum=0;
    for(int z=0;z*z*z<=e;z++){
      int temp=e-z*z*z;
      for(int y=0;y*y<=temp;y++){
	int x=temp-y*y;
	sum=x+y+z;
	
	if(minsum==0 || sum < minsum){
	  
	  minsum=sum;
	}
      }
    }
    cout<<minsum<<endl;
  }
  return 0;
}
	  

Measured memory_bytes: 1160
#include <iostream>
 
using namespace std;
 
int main() {
    long a, b;
    cin >> a >> b;
 
    double k = (a + b) / 2.0;
    long ik = (a + b) / 2;
    if (k == ik)
        cout << ik << '\n';
    else
        cout << "IMPOSSIBLE\n";
}

Measured memory_bytes: 256
//g++ -std=gnu++14 a.cpp

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <random>
#include <math.h>

using namespace std;

#define ll long long
#define rep(i, n) for(ll i = 0; i < (n); i++)
ll MOD = 1e9 + 7;
int INF = 1 << 30;
ll INFL = 1LL << 60;

int main(){
  int A,B,C,D;
  cin >> A >> B >> C >> D;
  while(A>0 && B>0){
    C -= B;
    if(C <= 0)break;
    A -= D;
    if(A <= 0)break;
  }
  if(C <= 0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
 }


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


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

Measured memory_bytes: 1152
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        LimitInput limit = LimitInput.getInstance();
        Input input = Input.getInstance();
        Scanner sc = new Scanner(System.in);
        String sResult = "";

        // Int変換することで速度向上
        limit.setLimit(Integer.parseInt(sc.next()));
        input.setInput((sc.next()));

        final String sInput = input.getInput();
        final int iLimit = limit.getLimit();
        if (iLimit < sInput.length()) {
            input.setSubStrInput(sInput.substring(0, iLimit));
            sResult = input.addLimitOverVal(input.getSubStrInput());
        } else {
            sResult = sInput;
        }

        System.out.print(sResult);

    }

    static class LimitInput {

        private int m_iLimit;

        private static LimitInput m_Me = null;

        private LimitInput() {
            m_iLimit = 0;

        }

        private int getLimit() {
            return m_iLimit;
        }

        private void setLimit(final int iLimitInput) {
            m_iLimit = iLimitInput;
        }

        public static LimitInput getInstance() {
            return m_Me = new LimitInput();
        }
    }

    static class Input {

        private static final String ADD_STR_VAL = "...";

        private String m_sInput;
        private String m_sSubStrInput;
        private static Input m_Me = null;

        Input() {
            m_sInput = "";
            m_sSubStrInput = "";
        }

        private void setInput(final String sInput) {
            m_sInput = sInput;
        }

        private String getInput() {
            return m_sInput;
        }

        private void setSubStrInput(final String sSubStrInput) {
            m_sSubStrInput = sSubStrInput;
        }

        private String getSubStrInput() {
            return m_sSubStrInput;
        }

        private String addLimitOverVal(final String sInput) {
            StringBuilder sb = new StringBuilder();
            sb.append(sInput);
            sb.append(ADD_STR_VAL);
            return sb.toString();
        }

        public static Input getInstance() {
            return m_Me = new Input();
        }

    }
}


Measured memory_bytes: 35732
#include <bits/stdc++.h>
#define int long long
#define ALL(v) (v).begin(),(v).end()
#define Vi vector<int>
#define pb push_back
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>b;i--)
#define leng(n) (int)(log10(n)+1)
#define INF 9000000000000000000
using namespace std;

int gcd(int a,int b){return b?gcd(b,a%b):a;}  //  最大公約数gcd
int lcm(int a,int b){return a/gcd(a,b)*b;}  //  最小公倍数lcm

signed main() {
  int n;
  cin >> n;
  int a,b,ans;
  cin >> a;
  ans = a;
  rep(i,0,n-1){
    cin >> a;
    ans = gcd(ans,a);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import numpy as np


def zero_padding(x, num):
    return "0" * (num - len(x)) + x


def main():
    h, w, k = map(int, input().split())
    c = [None] * h
    for i in range(h):
        c[i] = list(map(lambda x: 1 if x == "#" else 0, list(input())))
    c_origin = np.array(c)
    ret = 0
    for i in range(2 ** h):
        for j in range(2 ** w):
            tmp = c_origin.copy()
            a = [_i for _i, x in enumerate(list(zero_padding(f"{i:b}", h))) if x == "1"]
            if a != []:
                tmp[a] = 0
            b = [_j for _j, x in enumerate(list(zero_padding(f"{j:b}", w))) if x == "1"]
            if b != []:
                tmp[:, b] = 0
            if np.sum(tmp) == k:
                ret += 1
    print(ret)


if __name__ == "__main__":
    main()


Measured memory_bytes: 26860
#include <bits/stdc++.h>
using namespace std;
ifstream f("A.in");
typedef long long ll;

int main()
{
   ll X,Y,a,b;
   cin>>X>>Y;
   if(Y%2==0  )
   {
      a=(2*X)-(Y/2);
      b=(Y/2)-X;
      //cout<<a<<' '<<b<<'\n';
      if(a>=0&&b>=0) cout<<"Yes";
      else cout<<"No";
   }
   else cout<<"No";

}


Measured memory_bytes: 3628
from collections import deque

dyx = [(0, 1), (0, -1), (1, 0), (-1, 0)]
H, W = map(int, input().split())
edge = ['#']*(W+2)
field = [edge]
q = deque()

for i in range(H):
    field.append(['#'] + list(input()) + ['#'])
    for j in range(W):
        if field[i+1][j+1] == '#':
            q.append((i+1, j+1, 0))
field.append(edge)
res = 0

while q:
    y, x, lv = q.popleft()
    res = max(lv, res)

    for dy, dx in dyx:
        if field[y+dy][x+dx] == '.':
            field[y+dy][x+dx] = '#'
            q.append((y+dy, x+dx, lv+1))

print(res)


Measured memory_bytes: 158972
#!/usr/bin/env python
#pyrival orz
import os
import sys
from io import BytesIO, IOBase

"""
    for _ in range(int(input())):
    n,m=map(int,input().split())
    n=int(input())
    a = [int(x) for x in input().split()]
"""

def main():
    n,m=map(int,input().split())
    print(n*m)

# region fastio

BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip("\r\n")

# endregion

if __name__ == "__main__":
    main()

Measured memory_bytes: 62704