akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<int, int>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr int MOD = 1e9 + 7;

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

    int n, m;
    while (cin >> n >> m, n || m)
    {
        vector<vector<int>> g(n);
        for (int i = 0; i < m; i++)
        {
            int u, v;
            cin >> u >> v;
            u--;
            v--;
            g[u].push_back(v);
            g[v].push_back(u);
        }
        bool f = true;
        int cnt = 0;
        vector<int> node(n, -1);
        queue<int> q;
        q.push(0);
        node[0] = 0;
        cnt = 1;
        while (!q.empty())
        {
            int v = q.front();
            q.pop();
            for (auto next : g[v])
            {
                if (node[next] == -1)
                {
                    node[next] = 1 - node[v];
                    if (node[next] == 0)
                        cnt++;
                    q.push(next);
                    continue;
                }
                if (node[next] != node[v])
                    continue;
                f = false;
                break;
            }
        }
        if (!f)
        {
            cout << 0 << endl;
            continue;
        }
        set<int> st;
        if (cnt % 2 == 0)
            st.insert(cnt / 2);
        if ((n - cnt) % 2 == 0)
            st.insert((n - cnt) / 2);
        
        cout<<st.size()<<endl;
        for(auto val:st){
            cout<<val<<endl;
        }
    }
}



Measured memory_bytes: 3240
#include<stdio.h>
#include<math.h>

int main(void){


        unsigned long a;
        scanf("%lu", &a);
        int i;
        int b = sqrt(a);
        for(i=b;i>0;i--){
                if(a%i==0)break;
        }
        int c = a/i;

        int d= i>c?i:c;

        int count=0;
        while(d!=0){
                d/=10;
                count++;
        }

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

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<random>
#include<set>
#include<map>
#include<functional>
using namespace std;
#define int long long
#define inf 1145141919
#define mod 1000000007
#define rep(i,n) for(int i=0;i<n;i++)
typedef pair<int, int>P;
typedef pair<int, P> PP;
struct edge { int to, cost; };
vector<int>C[26],D[26];
int af[26],bf[26];
signed main() {
	string s, t; cin >> s >> t;
	rep(i, s.size()) {
		C[(t[i] - 'a')].push_back((s[i] - 'a'));
	}
	int flg = 0;
	rep(i, 26) {
		sort(C[i].begin(), C[i].end());
		C[i].erase(unique(C[i].begin(), C[i].end()), C[i].end());
		if (C[i].size() >= 2)flg++;
	}

	rep(i, t.size())D[(s[i] - 'a')].push_back((t[i]-'a'));
	int flg1 = 0;
	rep(i, 26) {
		sort(D[i].begin(), D[i].end());
		D[i].erase(unique(D[i].begin(), D[i].end()), D[i].end());
		if (D[i].size() >= 2)flg1++;
	}
	rep(i, s.size()) {
		if (s[i] != t[i]) {
			af[s[i] - 'a']++;
			bf[t[i] - 'a']++;
		}
	}
	int f1 = -26,f2=-26;
	rep(i, 26) {
		if (af[i])f1++;
		if (bf[i])f2++;
	}
	
	if (flg||flg1||(!f1)||(!f2))puts("No");
	else puts("Yes");
}


Measured memory_bytes: 4892
//Deep Godhani
//DAIICT

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

#define N 100000000000
#define PI acos(-1)
#define INF LONG_LONG_MAX
#define NINF LONG_LONG_MIN
#define ll long long int
#define ld long double
#define precision(x,d) cout << fixed << setprecision(d) << x
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);srand(time(NULL))

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

void solve()
{
	ll M = 1e9+7;
	ll n,k;
	cin >> n >> k;
	ll sum = 0;
	for(ll i=k;i<=n+1;i++)
	{
		sum += (i*n)%M - (i*(i-1))%M;
		sum = (sum+1)%M;
	}
	cout << sum << endl;
}
int main()
{
    FAST;
    ll t=1;
    //cin >> t;
    while(t--)
    {
      //cout << "************" << endl;
      solve();
      //cout << "************"  << endl;
    }
		return 0;
}


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

int main() {
  int n;
  while(cin >> n && n) {
    int m;
    string s;
    cin >> m >> s;
    string t="I";
    for(int i=0; i<n; i++) t+="OI";
    int cnt=0;
    for(int i=0; i<s.size()-t.size()+1; i++) {
      if(s.substr(i,t.size())==t) cnt++;
    }
    cout << cnt << endl;
  }
  return 0;
}


Measured memory_bytes: 2124
#!/usr/bin/env python
# -*- coding: utf-8 -*-

def main():
    N, H, W = map(int, input().strip().split())
    count = 0
    for _ in range(N):
        A, B = map(int, input().strip().split())
        if H <= A and W <= B:
            count += 1

    print(count)

if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

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

    int n; ll T; cin >> n >> T;
    vll h(n); for(auto& e : h) cin >> e;

    vll se(n); se[0] = h[0];

    auto f = [&](ll hh, ll h_o){
        ll ret = (T + (hh - 1)) / hh;
        if(T % hh == 0) ret++;
        if(T % hh >= h_o) ret++;
        return ret;
    };
    vll res(n); res[0] = f(h[0], h[0]);
    T -= h[0];

    ll sum = h[0];
    rep(i, 1, n){
        if(T <= 0){
            res[i] = 1;
            continue;
        }
        se[i] = max(se[i - 1] + h[i - 1], sum + h[i]);
        res[i] = f(max(h[i], se[i] - sum), h[i]);
        T -= h[i];
        sum += h[i];
    }

    for(auto& e : res){
        cout << e << endl;
    }

    return 0;
}

Measured memory_bytes: 5292
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


#define NUM 1005

enum Type{
	BOY,
	GIRL,
};

struct Info{
	bool operator<(const struct Info &arg) const{
		return cute < arg.cute;
	}
	int weight,cute;
	Type type;
};

Info info[NUM];
int dp[2][10*NUM],sum_W[2];

int main(){

	int NA,NB,W;

	scanf("%d %d %d",&NA,&NB,&W);

	for(int i = 0; i < NA; i++){

		scanf("%d %d",&info[i].weight,&info[i].cute);
		info[i].type = BOY;
	}
	for(int i = 0; i < NB; i++){

		scanf("%d %d",&info[i+NA].weight,&info[i+NA].cute);
		info[i+NA].type = GIRL;
	}

	sort(info,info+(NA+NB));



	int ans = BIG_NUM;

	for(int i = 0; i < 2; i++){
		for(int k = 0; k <= W; k++){
			dp[i][k] = -BIG_NUM;
		}
	}

	int w_diff,cute_diff,tmp;

	for(int i = 0; i <= NA+NB-1; i++){

		if(info[i].weight > W)continue;

		for(int w = W; w > info[i].weight; w--){
			dp[info[i].type][w] = max(dp[info[i].type][w],dp[info[i].type][w-info[i].weight]);
		}

		dp[info[i].type][info[i].weight] = info[i].cute;

		sum_W[BOY] = 0;
		sum_W[GIRL] = 0;

		while(sum_W[BOY] <= W && dp[BOY][sum_W[BOY]] == -BIG_NUM)sum_W[BOY]++;
		while(sum_W[GIRL] <= W && dp[GIRL][sum_W[GIRL]] == -BIG_NUM)sum_W[GIRL]++;

		if(sum_W[BOY] > W || sum_W[GIRL] > W)continue;

		while(sum_W[BOY] <= W && sum_W[GIRL] <= W){

			w_diff = abs(sum_W[BOY]-sum_W[GIRL]);
			cute_diff = info[i].cute-min(dp[BOY][sum_W[BOY]],dp[GIRL][sum_W[GIRL]]);

			ans = min(ans,max(w_diff,cute_diff));

			if(cute_diff >= w_diff){

				if(dp[BOY][sum_W[BOY]] <= dp[GIRL][sum_W[GIRL]]){

					tmp = dp[BOY][sum_W[BOY]];

					while(sum_W[BOY] <= W && dp[BOY][sum_W[BOY]] <= tmp)sum_W[BOY]++;

				}else{

					tmp = dp[GIRL][sum_W[GIRL]];

					while(sum_W[GIRL] <= W && dp[GIRL][sum_W[GIRL]] <= tmp)sum_W[GIRL]++;
				}

			}else{

				if(sum_W[BOY] >= sum_W[GIRL]){

					sum_W[GIRL]++;
					while(sum_W[GIRL] <= W && dp[GIRL][sum_W[GIRL]] == -BIG_NUM)sum_W[GIRL]++;

				}else{

					sum_W[BOY]++;
					while(sum_W[BOY] <= W && dp[BOY][sum_W[BOY]] == -BIG_NUM)sum_W[BOY]++;
				}
			}
		}
	}

	printf("%d\n",ans);

	return 0;
}



Measured memory_bytes: 3376
N, K = map(int, input().split())
S = input()

# find the largest subsequence
packet = []
packet_len = 1
direction = S[0]
seq = 1
for i in range(1, N - 1):
    if S[i] == direction:
        seq += 1
    else:
        packet.append(seq)
        seq = 1
        direction = S[i]
        packet_len += 1

if S[N - 1] == direction:
    seq += 1
    packet.append(seq)
else:
    packet.append(seq)
    seq = 1
    direction = S[N - 1]
    packet.append(seq)
    packet_len += 1

#print(packet)
#print(packet_len)

# There is no need to choose the 'most invertible' index (i.e. max_idx) !!!
# Also, there is no need to rewrite the packet

num = 2 * K + 1
if packet_len == 1 or packet_len == 2 or num >= packet_len:
    print(N - 1)
elif num < packet_len:
    rem = packet_len - num
    print(N - rem - 1)

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

typedef long long ll;

#define p_ary(ary,a,b,i) do { cout << "["; for (int (i) = (a);(i) < (b);++(i)) cout << ary[(i)] << ((b)-1 == (i) ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

int main() {
    int n,k,q;
    cin >> n >> k >> q;
    vector<int> a(n);
    for (int i = 0;i < n;++i) cin >> a[i];
    a.push_back(-1);

    int ans = 1e9;
    for (int i = 0;i < n;++i) {
        vector<int> b,c;
        for (int j = 0;j <= n;++j) {
            if (a[j] >= a[i]) c.push_back(a[j]);
            else {
                if (c.size() >= k) {
                    sort(c.begin(),c.end());
                    for (int x = 0;x < c.size()-k+1;++x) b.push_back(c[x]);
                }
                c.clear();
            }
        }
        if (b.size() >= q) {
            sort(b.begin(),b.end());
            ans = min(ans,b[q-1]-b[0]);
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int ans = c - (a - b);
  if (ans <= 0)
    cout << 0 << endl;
  else
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdint>

int const NMAX = 100000;
int n, k;
uint32_t h[NMAX];
uint32_t dp[NMAX];

void read() {
  std::cin >> n;
  std::cin >> k;
  for(int i = 0; i < n; ++i) std::cin >> h[i];
}

inline uint32_t iabs(int x) { return x<0? -x: x; }

void calc() {
  dp[0] = 0;
  dp[1] = iabs(h[1]-h[0]);
  for(int i=2; i<n; ++i) {
    dp[i] = dp[i-1]+iabs(h[i]-h[i-1]);
    for(int j = 2; j <= k && j <= i; ++j) {
      dp[i] = std::min(dp[i-j]+iabs(h[i]-h[i-j]), dp[i]);
    }
  }
}

int main() {
  read();
  calc();
  std::cout << dp[n-1] << std::endl;
  return 0;
}


Measured memory_bytes: 1024
#[allow(unused_imports)]
use std::char::*;
#[allow(unused_imports)]
use std::cmp::*;
use std::io::*;
use std::str::FromStr;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

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

#[derive(PartialEq, PartialOrd)]
pub struct Total<T>(pub T);

impl<T: PartialEq> Eq for Total<T> {}

impl<T: PartialOrd> Ord for Total<T> {
    fn cmp(&self, other: &Total<T>) -> std::cmp::Ordering {
        self.0.partial_cmp(&other.0).unwrap()
    }
}

//const MAX:usize = 100006;
//const INF:u64 = u64::max_value();

fn main() {
    let n:i32 = read();
    let m:usize = read();

    let mut vcnt: Vec<i32> = vec![0;n as usize + 1];
    for i in 0..m {
        let l:usize = read();
        let r:usize = read();

        vcnt[l-1] += 1;
        vcnt[r] -= 1;
    }
    for i in 1..n {
        let i = i as usize;
        vcnt[i] += vcnt[i-1]
    }
    //debug!(vcnt);
    println!("{}", vcnt.iter().filter(|&x| *x==m as i32).count());
}


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

#define DUMP(x) cerr << #x << "=" << x << endl
#define DUMP2(x, y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<")"<< endl
#define BINARY(x) static_cast<bitset<16> >(x)

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

#define in_range(x, y, w, h) (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()

typedef long long ll;
const int INF   = 1e9;
const ll  INFLL = 1e18;
typedef pair<int, int> PII;
int dx[4]={0, -1, 1, 0}, dy[4]={-1, 0, 0, 1};

int main()
{
    ios::sync_with_stdio(false);

    int N;
    cin >> N;

    const int MAX = 1e5 + 1;
    int sum[100010] = {};
    sum[0]++;
    sum[MAX+1]--;

    rep(i, N) {
        int A, B;
        cin >> A >> B;
        sum[A]++;
        sum[B+1]--;
    }

    rep(i, MAX+1) {
        sum[i+1] += sum[i];
    }

    int ans = 0;
    rep(i, MAX+1) {
        if (sum[i] >= i) {
            ans = i;
        }
    }

    cout << ans - 1 << endl;
}

Measured memory_bytes: 3556
# input
N, K = map(int, input().split())
A = list(map(int,input().split()))

dp = [float('inf') for i in range(N)]

# 初期化
dp[0] = 0; 

for i in range(1,N):
  lim = min(i,K);
  for k in range(lim,0,-1):
    dp[i] = min(dp[i], dp[i-k] + abs(A[i]-A[i-k]))  
print(dp[-1])



Measured memory_bytes: 56800
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <unordered_map>
#include <math.h>
using namespace std;
#define _USE_MATH_DEFINES

int main() {
	int H, W;
	while (1) {
		cin >> H >> W;
		if (H == 0 && W == 0)
			break;
		for (int i = 0; i < H; i++) {
			for (int j = 0; j < W; j++) {
				if ((i+j)%2==0)
					cout << '#';
				else
					cout << '.';
			}
			cout << endl;
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1152
let () =
  Scanf.scanf "%1d %1d %1d\n"
    (fun a b c ->
       if a = b && b = c then a*100+b*10+c
       else if a > b || (a = b && b > c) then a*100+a*10+a
       else (a+1)*100+(a+1)*10+(a+1))
  |> print_int

Measured memory_bytes: 384
#include <bits/stdc++.h>
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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define INF 1<<30
#define LINF 1LL<<62
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
const int MOD = 1000000007;
 
typedef long long ll;
typedef long double ld;
typedef vector<ll> vl;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;cin >> n;
  set<string> se;
  rep(i,n){
    string s;cin >> s;
    se.insert(s);
  }
  cout<< se.size() << endl;
}

Measured memory_bytes: 19292
#include <cstdio>
#include <iostream>
#include <string>
#include <cstring>
#include <sstream>

using namespace std;

int stoi(string str){
	int ret;
	stringstream ss;
	ss << str;
	ss >> ret;
	return ret;
}

int main(){
	string s;
	string price="",quantity="";
	int comma=0;
	int i = 0;
	int total = 0;//????£???????????¨?
	int sum=0;//?£??????°???????¨?
	int count = 0;//??\?????°
	double average = 0;
	int fraction;
	int new_ave;



	while(cin >> s){
		count++;
		i= comma = 0;
		price = quantity = "";

		while(s[i] != '\0'){
			if(comma == 0){
				price += s[i];
				i++;
				if(s[i] == ','){
					i++;
					comma = 1;
				}
			}else if(comma == 1){
				quantity += s[i];
				i++;
			}
		}
		total += stoi(price) * stoi(quantity);
		sum += stoi(quantity);

	}
	cout << total << endl;
	average = (double)sum / count;
	fraction = (int)(average * 10) % 10;
	if(fraction > 4){
		new_ave = (int)average + 1;
	}else{
		new_ave = (int)average;
	}

	cout << new_ave << endl;

}

Measured memory_bytes: 2996
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}()); 
const int mod=1000000007;
#define ll long long
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head
int _,a,b,n,k,m;
#define MAXN 10000001
map<int,int>map1;
int spf[MAXN]; 
void sieve() 
{ 
    spf[1] = 1; 
    for (int i=2; i<MAXN; i++) 
        spf[i] = i; 
    for (int i=4; i<MAXN; i+=2) 
        spf[i] = 2; 
  
    for (int i=3; i*i<MAXN; i++) 
    {
        if (spf[i] == i) 
        {
            for (int j=i*i; j<MAXN; j+=i){
                if (spf[j]==j) 
                    spf[j] = i; 
            }
        } 
    } 
}
ll  getFactorization(ll x) 
{ 
    vector<ll> ret;
    ll ans=1; 
    while (x != 1) 
    { 

    	ret.pb(spf[x]);
    	map1[spf[x]]++;
        x = x / spf[x]; 
    }
    for(auto itr=map1.begin();itr!=map1.end();itr++){
    	ll d=(itr->second)+1;
    	ans=ans*d;
    }
    map1.clear();
    return ans;
}  
int main() {
	#ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
        ll n,z=1,ans=1,sum=0,f;
        cin>>n;
        sieve(); 
        map<ll,ll>map1;
        for(ll i=1;i<=n;i++){
        	f=getFactorization(i);
        	sum+=z*f;
        	z++;
        }
        cout<<sum<<endl;

    }

Measured memory_bytes: 42684
import bisect
import os
from collections import Counter, deque
from fractions import gcd
from functools import lru_cache
from functools import reduce
import functools
import heapq
import itertools
import math
import numpy as np
import re
import sys

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")


N = int(sys.stdin.readline())
A = list(map(int, sys.stdin.readline().split()))

a = reduce(gcd, A)
print(a)


Measured memory_bytes: 24060
#include <stdio.h>
#include <math.h>
#include <cmath>

using namespace std;

int main(){
	int n;
	double x[100] = {0},y[100] = {0},p_1 = 0,p_2 = 0,p_3 = 0,p_infinity = -1;
	scanf("%d",&n);
	for(int i = 0; i < n; i++) scanf("%lf",&x[i]);
	for(int i = 0; i < n; i++) scanf("%lf",&y[i]);

	for(int i = 0; i < n; i++){
		p_1 += abs(x[i] - y[i]);
		p_2 += (x[i] - y[i])*(x[i] - y[i]);
		p_3 += abs((x[i] - y[i])*(x[i] - y[i])*(x[i] - y[i]));
		p_infinity = (p_infinity >= abs(x[i] - y[i]))? p_infinity:abs(x[i] - y[i]);
 	}
	printf("%.6lf\n",p_1);
	printf("%.6lf\n",sqrt(p_2));
	printf("%.6f\n",cbrt(p_3));
	printf("%.6lf\n",p_infinity);

}



Measured memory_bytes: 2860
# https://qiita.com/mnuma/items/22338399a86064c61f24

s = gets.split("")

ans = "" # 空を渡しておく　[]配列を渡すとおかしくなる

N = s.length

N.times do |i|
  if i % 2 == 0
    ans << s[i]  # 配列で自信の末尾に破壊的に値を追加
  end
end

puts ans

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

int main()
{
	int N, M;
	cin >> N >> M;
	if (N < M)
	{
		for (int i = 0; i < M; i++)
		{
			cout << N;
		}
		cout << endl;
		return 0;
	}
	else
	{
		for (int i = 0; i < N; i++)
		{
			cout << M;
		}
		cout << endl;
		return 0;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"  
char ch[20000010];
//std::vector<int> v, a;

int main(){
  
	#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);  
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);  
#endif
       ios_base::sync_with_stdio(false);    
       cin.tie(NULL);
       /*
int t;
cin>>t;  
while(t--){
	int n;  
	cin>>n;
	string s;
	cin>>s;
	string s1  = "";
	if(s.size() == 1){
		cout<<1<<endl;
	}
	for(int i = 1 ; i<=n; i+= 2){
		s1 += '1';
	}
	for(int i = 2 ; i <= n ; i+= 2){
		s1 += '0';
	}
	cout<<s1<<endl;  
}
}
*/
       ll n;
       cin>>n;
       ll a[n];
       for(int i = 0 ; i < n; i++){
       	cin>>a[i];
       }
       ll maxx = 0 , cnt = 0;
     for(int i = 0; i < n;i++){
     	maxx = max(maxx , a[i]);
     	cnt += (maxx - a[i]);
     }
     cout<<cnt<<endl;
 }

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

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

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

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

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

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

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

// ---- ----

// G13E_5.cpp

void mat_prod(LL a[3][3], LL b[3][3], LL c[3][3], LL MOD) { // a = b * c;
	static LL d[3][3];
	inc(i, 3) {
	inc(j, 3) {
		d[i][j] = (b[i][0]*c[0][j] + b[i][1]*c[1][j] + b[i][2]*c[2][j]) % MOD;
	}
	}
	
	inc(i, 3) {
	inc(j, 3) {
		a[i][j] = d[i][j];
	}
	}
}

void mat_exp(LL a[3][3], LL b[3][3], LL c, LL MOD) { // a = b ^ c;
	static LL t[60][3][3];
	
	LL cc = c, d = 0;
	while(cc) { cc >>= 1; d++; }
	
	inc(i, 3) {
	inc(j, 3) {
		t[0][i][j] = b[i][j];
	}
	}
	inc(i, d - 1) {
		mat_prod(t[i + 1], t[i], t[i], MOD);
	}
	
	inc(i, 3) {
	inc(j, 3) {
		a[i][j] = 0;
	}
	}
	inc(i, 3) { a[i][i] = 1; }
	inc(i, d) {
		if((c >> i) & 1) {
			mat_prod(a, a, t[i], MOD);
		}
	}
}

const LL MOD = 1000000007;
LL n, m, x[100002];

int main() {
	cin >> n >> m;
	inc1(i, m) { cin >> x[i]; }
	x[0] = 0;
	x[m + 1] = n + 1;
	
	LL a[3][3] = { { 2, 1, 1 }, { 2, 1, 0 }, { 1, 1, 1 } };
	LL b[3][3] = { { 1, 0, 0 }, { 2, 1, 0 }, { 1, 1, 1 } };
	LL c[3][3] = { { 1, 0, 0 }, { 0, 1, 0 }, { 0, 0, 1 } };
	LL d[3][3];
	
	inc(i, m + 1) {
		if(i != 0) { mat_prod(c, b, c, MOD); }
		mat_exp(d, a, x[i + 1] - x[i] - 1, MOD);
		mat_prod(c, d, c, MOD);
	}
	
	cout << c[2][0] << endl;
	
	return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <utility>
using Int = long long;
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
int main()
{
    string O, E; cin >> O >> E;
    int m = min(O.size(), E.size());
    for (int i = 0; i < m; i++) {
        cout << O[i] << E[i];
    }
    if (m < O.size()) {
        cout << O[O.size()-1];
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {

	public void doIt(){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		while(n-- > 0){
			int len = 8;
			char [] array = new char[len];
			String str = sc.next();
			for(int i=0; i < len; i++){
				array[i] = str.charAt(i);
			}
			Arrays.sort(array);
			//逆順の配列を作成
			char [] reverse = new char[len];
			for(int i=0 ; i < len / 2; i++){
				reverse[i] = array[len-i -1];
				reverse[len - i - 1] = array[i];
			}

			//連結する
			StringBuilder minstr = new StringBuilder();
			minstr.append(array);
			StringBuilder maxstr = new StringBuilder();
			maxstr.append(reverse);

			//整数型に直す
			int min = Integer.parseInt(minstr.toString());
			int max = Integer.parseInt(maxstr.toString());
			System.out.println(max - min);
		}

	}
	public static void main(String[] args) {
		Main obj = new Main();
		obj.doIt();

	}

}

Measured memory_bytes: 12000
'use strict'
const Main = (arg) => {
  let input = arg.trim().split('\n');
  let N = parseInt(input[0]);
  let stA = input[1].split(' ')[0];
  let stB = input[1].split(' ')[1];

  let newStr = '';
  for (let i = 0; i < N; i++){
    newStr = newStr + stA[i] + stB[i];
  }
  console.log(newStr);

}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 21064
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {

	public static void main(String[] args) {
		try (Scanner scanner = new Scanner(System.in)) {
			int n = scanner.nextInt(), m = scanner.nextInt();
			UnionFindTree uft = new UnionFindTree(n);
			IntStream.range(0, m).forEach(i -> {
				@SuppressWarnings("unused")
				int x = scanner.nextInt() - 1, y = scanner.nextInt() - 1, z = scanner.nextInt();
				uft.union(x, y);
			});
			System.out.println(IntStream.range(0, n).map(i -> uft.find(i)).distinct().count());
		}
	}

	/**
	 * Union Find Treeの実装
	 * 
	 * https://atcoder.jp/contests/abc040/submissions/4708654 を参考に作成
	 */
	private static class UnionFindTree {
		int[] parent;
		int[] count;

		UnionFindTree(int size) {
			parent = IntStream.range(0, size).toArray();
			count = new int[size];
			Arrays.fill(count, 1);
		}

		/**
		 * @param x
		 * @return xのroot
		 */
		int find(int x) {
			if (parent[x] == x) {
				return x;
			} else {
				int v = find(parent[x]);
				parent[x] = v;
				return v;
			}
		}

		/**
		 * @param x
		 * @param y
		 * @return xとyがつながっているかどうか
		 */
		@SuppressWarnings("unused")
		boolean same(int x, int y) {
			return find(x) == find(y);
		}

		/**
		 * xとyを結合する
		 * 
		 * @param x
		 * @param y
		 */
		void union(int x, int y) {
			int rootX = find(x);
			int rootY = find(y);
			if (rootX == rootY) {
				return;
			}
			parent[rootX] = rootY;
			parent[x] = rootY;
			count[rootY] += count[rootX];
		}

		/**
		 * @param x
		 * @return xと結ぶ都市の数
		 */
		@SuppressWarnings("unused")
		public int count(int x) {
			return count[find(x)];
		}
	}
}


Measured memory_bytes: 63748
#include<iostream>
#include<string>
int main()
{
  std::string x;
  std::string y;
  int ans[1001][1001]={0};
  int i,j;
  int min;

  std::cin>>x;
  std::cin>>y;
  for(i=0;i<=x.size();i++) ans[i][0]=i;
  for(j=0;j<=y.size();j++) ans[0][j]=j;

  for(i=1;i<=x.size();i++){
    for(j=1;j<=y.size();j++){
      if(x[i-1]==y[j-1]){
	min=ans[i-1][j-1];
	if(min>ans[i][j-1]+1){
	  min=ans[i][j-1]+1;
	}
	if(min>ans[i-1][j]+1){
	  min=ans[i-1][j]+1;
	}
	ans[i][j]=min;
      }else{
	min=ans[i-1][j-1]+1;
	if(min>ans[i][j-1]+1){
	  min=ans[i][j-1]+1;
	}
	if(min>ans[i-1][j]+1){
	  min=ans[i-1][j]+1;
	}
	ans[i][j]=min;
      }
    }
  }
  std::cout<<ans[x.size()][y.size()]<<'\n';  
  return 0;
}



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

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

int main(){
int A,B;
  cin>>A>>B;
  
  int ans=0;
  
  
  
  for(int i=A;i<=B;i++){
    int Y=0;
   
    vector<int> vec(5);
    
    for(int j=0;j<5;j++){

    if(j==0){
      vec.at(j)=i%10;
      Y=i-i%10;
    }
else if(j>=1){
  vec.at(j)=(Y/10)%10;
  Y=(Y/10)-(Y/10)%10;
}
    }

    
if(vec.at(0)==vec.at(4)&&vec.at(1)==vec.at(3)){
  ans++;
  }
  }

      cout<<ans<<endl;
    }


Measured memory_bytes: 256
d = dict.fromkeys([a for a in 'abcdefghijklmnopqrstuvwxyz'], 0)
while 1:
    try:
        for i in input().lower():
            if i in d:d[i] += 1
    except EOFError:
        break
    
for k, v in d.items():
    print(f"{k} : {v}")


Measured memory_bytes: 5576
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); ++i)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define fi first
#define se second
#define INF 1000000009
#define LLINF 1000000000000000009LL
using ll = long long;

int main(){
  int r,g;
  cin>>r>>g;
  cout<<2*g-r<<endl;
  return(0);
}

Measured memory_bytes: 3616
#include <iostream>

using namespace std;

#define MAX_N 100000
#define MAX_K 100000
#define MAX_W 10000
typedef long long llong;

int n, k;
llong T[MAX_N];

//k????????§????????????P?????????????£?????°??´§??????
int check(llong P)
{
	int i = 0;
	for (int j = 0; j < k; j++) {
		llong s = 0;
		while (s + T[i] <= P) {
			s += T[i];
			i++;
			if (i == n) return n;
		}
	}
	return i;
}

int solve()
{
	llong left = 0;
	llong right = MAX_K * MAX_W; // ?´§?????° * 1??¶?´§???????????§??????
	llong mid;
	while ((right - left) > 1) {
		mid = (left + right) / 2;
		int v = check(mid); // mid == ?£???\mid == P??¶????£?????°??´§???
		if (v >= n) right = mid;
		else left = mid;
	}
	
	return right;
}

int main()
{
	cin >> n >> k;
	for (int i = 0; i < n; i++) cin >> T[i];
	llong ans = solve();
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 3880
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;
int N;
int Y;

int main()
{
    cin>>N;
    cin>>Y;
    for (int x=0;x<=N;x++){
        for (int y=0;y<=N-x;y++){
            int z=N-y-x;
            if (x*10000+y*5000+z*1000==Y){
                cout<<x<<" "<<y<<" "<<z<<endl;
                return 0;
            }
        }
    }
    cout<<"-1 -1 -1"<<endl;
    
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int MAX_N = 200005;
const int MAX_bit = 25;
ll A[MAX_N],b[MAX_N][MAX_bit],c[MAX_bit];

int main()
{
	int N;
	cin >> N;
	rep(i,N)
	{
		cin >> A[i];
		rep(j,MAX_bit)
		{
			if (A[i] & (1ull << j)) b[i][j]++;
		}
	}
	ll ans = 0;
	int l = 0, r = 0;
	rep(i,MAX_bit)
	{
		if (b[0][i]) c[i]++;
		b[N][i] = 2;
	}
	while(l != N)
	{
		//cout << l << " " << r;
		bool flag = false;
		rep(i,MAX_bit)
		{
			if (c[i] > 1) flag = true;
		}
		if (flag)
		{
			//cout << " ng" << endl;
			ans += ll(r - l);
			rep(i,MAX_bit)
			{
				c[i] -= b[l][i];
			}
			l++;
		}
		else
		{
			//cout << " ok" << endl;
			r++;
			rep(i,MAX_bit)
			{
				c[i] += b[r][i];
			}
		}
	}
	cout << ans << endl;
	return 0;
}

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

int main(){

    int N,A,B,win = 1;
    cin>>N>>A>>B;

    int v[N+1];

    for(int i = 1;i<=N;i++){
	v[i] = i;
    }

    for(int i = 0;win == 1;i++){
	if(A < N && (A+1) != B){
	    A = A + 1;
	}else{
	    if(A > 1){
	        A = A - 1;
	    }
	}
	if((A + 1) == B && A == 1){
	    win = 0;
	    cout<<"Borys";
	}
	if(B > 1 && (B-1) != A){
	    B = B - 1;
	}else{
	    if(B < N){
	        B = B + 1;
	    }
	}
	if((B - 1) == A && B == N && win == 1){
	    win = 0;
	    cout<<"Alice";
	}
    }

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll dip(ll n,ll w[],ll v[],ll W,ll val)
{
 vector<vector<ll> >dp(n+1,vector<ll>(val+1,INT_MAX));
 ll i,j,mx=INT_MIN;
 for(i=0;i<=n;i++)
 {
 	for(j=0;j<=val;j++)
 	{
 		if(i==0||j==0)
 		{
 			if(j==0)
 			dp[i][j]=0;
		 }
		 else if(v[i-1]>j)
		 dp[i][j]=min(w[i-1],dp[i-1][j]);
		 else
		 dp[i][j]=min(dp[i-1][j],w[i-1]+dp[i-1][j-v[i-1]]);
	 }
	 
 }
 for(i=n,j=0;j<=val;j++)
 {
 	if(dp[i][j]<=W)
 	mx=max(mx,j);
 }
 return mx;
}
int main()
{
	ll n,W;
	cin>>n>>W;
	ll w[n],v[n],i,j;
	for(i=0;i<n;i++)
	cin>>w[i]>>v[i];
	ll val=0;
		for(i=0;i<n;i++)
		val+=v[i];
	cout<<dip(n,w,v,W,val);
	return 0;
}

Measured memory_bytes: 80256
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = Long.parseLong(sc.next());
		String op = sc.next();
		long b = Long.parseLong(sc.next());
		a += (op.equals("+")) ? b : -b;
		System.out.println(a);
	}
}

Measured memory_bytes: 9676
count_500 = 0
count_5 = 0
happy = 0

money = gets.to_i
money_re = 0
money_re2 = 0

money_re = money % 500
count_500 = (money - money_re) / 500

money_re2 = money_re % 5
count_5 = (money_re - money_re2) / 5

happy = (1000*count_500) + (5*count_5)
puts "#{happy}"

Measured memory_bytes: 1788
#include <bits/stdc++.h>
#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 INF (2e9)
#define EPS (1e-7)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
    int n, k;
    string s;
    cin >> n;
    cin >> s;
    cin >> k;

    char m = s[k-1];
    REP(i, n) {
        if (s[i] != m) {
            s[i] = '*';
        }
    }
    cout << s << endl;
}

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

class Node {
public:
  int p, location, l, r;
};
  
class Point {
public:
  int id;
  long x, y;

  Point() {}
  Point(int id, long x, long y) {
    this->id = id;
    this->x = x;
    this->y = y;
  }

  bool operator < (const Point &another) const {
    return id < another.id;
  }
};

const int MAX_N = 500000;

Node T[MAX_N];
Point P[MAX_N];

int N, NP = 0;
vector<Point> ANS;

bool compX(const Point &a, const Point &b) {
  return a.x < b.x;
}

bool compY(const Point &a, const Point &b) {
  return a.y < b.y;
}

int make1DTree(int l, int r, int d) {
  if (l >= r) return -1;

  int m = (l + r)/2;
  int t = NP++;

  if (d % 2 == 0) sort(P+l, P+r, compX);
  else sort(P+l, P+r, compY);

  T[t].location = m;
  T[t].l = make1DTree(l, m, d+1);
  T[t].r = make1DTree(m+1, r, d+1);

  return t;
}

void find(int v, long sx, long tx, long sy, long ty, int d) {
  long x = P[T[v].location].x;
  long y = P[T[v].location].y;

  if (sx <= x && x <= tx && sy <= y && y <= ty)
    ANS.push_back(P[T[v].location]);

  if (d % 2 == 0) {
    if (T[v].l != -1 && sx <= x) find(T[v].l, sx, tx, sy, ty, d+1);

    if (T[v].r != -1 && x <= tx) find(T[v].r, sx, tx, sy, ty, d+1);
  } else {
    if (T[v].l != -1 && sy <= y) find(T[v].l, sx, tx, sy, ty, d+1);

    if (T[v].r != -1 && y <= ty) find(T[v].r, sx, tx, sy, ty, d+1);
  }
}

int main() {
  cin >> N;

  for (int i = 0; i < N; i++) {
    long x, y; scanf("%ld %ld", &x, &y);
                //cin >> x >> y;
    Point p(i, x, y);
    P[i] = p;
    T[i].l = T[i].r = T[i].p = -1;
  }

  int root = make1DTree(0, N, 0);

  int q; cin >> q;
  for (int i = 0; i < q; i++) {
    long sx, tx, sy, ty;
    scanf("%ld %ld %ld %ld", &sx, &tx, &sy, &ty);
    //cin >> sx >> tx >> sy >> ty;
    find(root, sx, tx, sy, ty, 0);
    sort(ANS.begin(), ANS.end());
    for (int j = 0; j < ANS.size(); j++)
      printf("%d\n", ANS[j].id);
    // cout << ANS[j].id << endl;
    cout << endl;
    ANS.clear();
  }

  return 0;
}

Measured memory_bytes: 20564
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
#define rep(i,a,b) for (int i = a; i < b; i++)
#define repn(i,a,b) for (int i = a; i >=b ;i--)
#define MOD 1000000007


int main(){
ios::sync_with_stdio(0);
cin.tie(0);
    ll n;cin>>n;
    map <ll,ll> mp;
    for(ll i=2;i*i<=n;i++){
        while(n%i==0){
            mp[i]++;
            n/=i;
        }
    }
    if(n!=1)mp[n]=1;
    //for(auto x : mp)cout<<x.first<<" "<<x.second<<"\n";
    ll tmp,cnt=0,tmp2;
    for(auto x : mp){
        tmp=1;tmp2=x.second;
        while(1){
            if(tmp2>=tmp){
                tmp2-=tmp;
                tmp++;
                cnt++;
            }
            else break;

        }
    }
    cout<<cnt;
 
return 0;
}

Measured memory_bytes: 3652
//
//  main.cpp
//  A
//
//  Created by Yoshinao Itakura on 2020/07/25.
//  Copyright © 2020 Yoshinao Itakura. All rights reserved.
//

#include <iostream>
#include <cmath>
using namespace std;

int main(int argc, const char * argv[]) {
    // insert code here...
    int N,K;
    cin >> N>>K;
    int A[N];
    for(int i=0; i<N; i++) {
        cin >> A[i];
    }
 
    
    for(int i=0; i<N-K; ++i){
        if(A[i]<A[K+i]){
            cout <<"Yes"<<endl;
        }else{
            cout<<"No"<<endl;
        }
    }
    
    return 0;
}




Measured memory_bytes: 4412
/*Read the problem carefully before starting to work on it*/
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;

typedef long long ll;

//ll ncr(ll n,ll r){ll ans=1;r=min(r,n-r);for (int i=1;i<=r;i++){ans*=(n-r+i);ans/=i;}return ans;}

#define pb push_back
#define eb emplace_back
#define mp(x,y) make_pair(x,y)
#define mod 1000000007

double PI=3.1415926535897932384626;

//template<typename T> T power(T x,T y,ll m=mod){T ans=1;while(y>0){if(y&1LL) ans=(ans*x)%m;y>>=1LL;x=(x*x)%m;}return ans%m;}

//typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ost;

#define fi first
#define se second

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll a,b;
	cin>>a>>b;
	ll gg=__gcd(a,b);
	ll lcm=(a*b)/gg;
	cout<<lcm;
    return 0;
}


//252908XL

Measured memory_bytes: 256
n = gets.chomp.to_i
arr = n.times.map{gets.chomp.to_i}

count = 0
prev_num = 0 # 0 or 1
arr.each do |a|
  count += (prev_num + a) / 2
  if a == 0
    prev_num = 0
  else
    prev_num = (prev_num + a) % 2
  end
end
puts count


Measured memory_bytes: 15184
from sys  import stdin,stdout

import bisect

import math

def st():
    return list(stdin.readline().strip())

def inp():
    return int(stdin.readline())

def li():
    return list(map(int,stdin.readline().split()))

def mp():
    return map(int,stdin.readline().split())

def pr(n):
    stdout.write(str(n)+"\n")

def soe(limit):
    l=[1]*(limit+1)
    prime=[]
    for i in range(2,limit+1):
        if l[i]:
            for j in range(i*i,limit+1,i):
                l[j]=0

    for i in range(2,limit+1):
        if l[i]:
            prime.append(i)
    return prime

def segsoe(low,high):
    limit=int(high**0.5)+1
    prime=soe(limit)
    n=high-low+1
    l=[0]*(n+1)
    for i in range(len(prime)):
        lowlimit=(low//prime[i])*prime[i]
        if lowlimit<low:
            lowlimit+=prime[i]
        if lowlimit==prime[i]:
            lowlimit+=prime[i]
        for j in range(lowlimit,high+1,prime[i]):
            l[j-low]=1
    for i in range(low,high+1):
        if not l[i-low]:
            if i!=1:
                print(i)

def power(a,n):
    r=1
    while n:
        if n&1:
            r=(r*a)
        a*=a
        n=n>>1
    return r


def solve():

    a,b,c=mp()
    if c<a:
        print(a-c,b)
    else:
        print(0,end=" ")
        if b-c+a>0:
            print(b-c+a)
        else:
            print(0)



for _ in range(1):
    solve()
    


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

int main() {
	// your code goes here
	int a,b,c;
	cin >> a >> b >> c;
	if (a>=b) cout << "No";
	else if (b>=c) cout << "No";
	else if (a>=c) cout << "No";
	else cout << "Yes";
	cout << endl;
	return 0;
}

Measured memory_bytes: 3096
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.PrintWriter
import kotlin.math.min

val br = BufferedReader(InputStreamReader(System.`in`))
val out = PrintWriter(System.out)

fun main() {
    br.use { out.use {
        solve()
        out.flush()
    } }
}

fun solve() {
    val (h, w) = readIntegerList()
    val map = Array(h) { br.readLine()!! }
    val ansMap = Array(h) { IntArray(w) { Int.MAX_VALUE } }
    ansMap[0][0] = if (map[0][0] == '.') 0 else 1

    for (i in 0 until h) {
        for (j in 0 until w) {
            if (map[i][j] == '.') {
                if (i + 1 in 0 until h) {
                    if (map[i + 1][j] == '#') {
                        ansMap[i + 1][j] = min(ansMap[i + 1][j], ansMap[i][j] + 1)
                    } else {
                        ansMap[i + 1][j] = min(ansMap[i + 1][j], ansMap[i][j])
                    }
                }

                if (j + 1 in 0 until w) {
                    if (map[i][j + 1] == '#') {
                        ansMap[i][j + 1] = min(ansMap[i][j + 1], ansMap[i][j] + 1)
                    } else {
                        ansMap[i][j + 1] = min(ansMap[i][j + 1], ansMap[i][j])
                    }
                }
            } else {
                if (i + 1 in 0 until h) ansMap[i + 1][j] = min(ansMap[i + 1][j], ansMap[i][j])
                if (j + 1 in 0 until w) ansMap[i][j + 1] = min(ansMap[i][j + 1], ansMap[i][j])
            }
        }
    }

    out.println(ansMap[h - 1][w - 1])
}

fun readInteger() = Integer.parseInt(br.readLine())
fun readLong() = java.lang.Long.parseLong(br.readLine())
fun readStringList() = br.readLine()!!.split(' ')
fun readIntegerList() = readStringList().map(Integer::parseInt)
fun readLongList() = readStringList().map(java.lang.Long::parseLong)
fun readDoubleList() = readStringList().map(java.lang.Double::parseDouble)


Measured memory_bytes: 36212
#include<bits/stdc++.h>
using namespace std;
int main(void){
	int n,m;
	int sum[101];
	int hyo[101];
	int card[101];
	cin>>n>>m;
	int i,j;
	for(i=0;i<m;i++){
		cin>>hyo[i];
	}
	for(i=0;i<n;i++) sum[i]=0;
	for(i=0;i<m;i++){
		for(j=0;j<n;j++)	card[j]=0;
		for(j=0;j<n;j++){
			cin>>card[j];
		}
		for(j=0;j<n;j++){
			if(hyo[i]==card[j]){
				sum[j]++;
			}
			else{
				sum[hyo[i]-1]++;
			}
		}
	}
	for(i=0;i<n;i++){
		cout<<sum[i]<<endl;
	}
	return 0;
}


Measured memory_bytes: 3124
for i in range(int(raw_input())):
    (x1, y1, x2, y2, x3, y3, x4, y4) = map(float,raw_input().split())
    x1 -= x2
    y1 -= y2
    x3 -= x4
    y3 -= y4
    if(x1 == 0 or x3 == 0):
        if(x1 == 0 and x3 == 0):
            print 'YES'
        else:
            print 'NO'
    else:
        if(y1 / x1 == y3 / x3):
            print 'YES'
        else:
            print 'NO'

Measured memory_bytes: 23000
#include <stdio.h>


int main(void){
	int A,B,C,X;
	int count = 0;
	scanf("%d %d %d %d",&A,&B,&C,&X);

	for(int i = A; i >= 0; i--){
		for(int j = B; j >= 0; j--){
			for(int k = C; k >= 0; k--){
				if((500*i+100*j+50*k) == X) count++;
			}
		}
	}

	printf("%d",count);

	return 0;
}

Measured memory_bytes: 128
#include<stdio.h>
#include<math.h>
int main(){
  int n,t,a,h1;
  scanf("%d\n",&n);
  scanf("%d %d\n", &t,&a);
  scanf("%d",&h1);
  int flag = 1;
  double t1=t-h1*0.006;
  for (int i = 2; i <= n; i++) {
    int h;
    scanf("%d", &h);
    double t0=t-h*0.006;
    if (fabs(a-t0)<fabs(a-t1)){
      flag = i;
      t1 = t0;
    }
  }
  printf("%d\n", flag);
}


Measured memory_bytes: 128
import java.util.*;
import java.io.*;
class Main{
  static int k;
  public static final int N = 8;
  public static final int NOT_FREE = -1;
  public static final int FREE = 0;
  public static  boolean col[] = new boolean[N];
  public static int row[] = new int[N];
  public static boolean dpos[]= new boolean[2*N-1];
  public static boolean dneg[] = new boolean[2*N-1];

  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    k = sc.nextInt();
    int r,c;
    Arrays.fill(row, -1);

    for(int i = 0; i<k; i++){
      r = sc.nextInt();
      c = sc.nextInt();
      row[r] = c;
      col[c] =  dpos[r+c] = dneg[r-c+N-1] = true;
    }

    putQueen(0);
  }

  static void putQueen(int i ){

    if(i == N){
      printBoard();
      return;
    }

    if(row[i] != -1){
      putQueen(i+1);
    }
    for(int j = 0; j<N; j++){
      if(row[i] != -1 || col[j]|| dpos[i+j] || dneg[i-j+N-1]){
        continue;
      }

      //put queen (i,j);
      row[i] = j;
      col[j] = dpos[i+j] = dneg[i-j+N-1] = true;
      //next row;
      putQueen(i+1);
      //remove queen (i,j)
      row[i] = -1;
      col[j] =  dpos[i+j] = dneg[i-j+N-1] = false;
    }
  }

  static void printBoard(){
    for(int i = 0; i<N; i++){
      for(int j = 0; j<N; j++){
        if(row[i] == j)System.out.print("Q");
        else System.out.print(".");
      }
      System.out.println("");
    }
  }
}


Measured memory_bytes: 26092
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <tuple>
#include <set>
#include <assert.h>
#include <sstream>
#include <string>
//#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define SORT(x) sort(x.begin(),x.end())
#define SORTR(x) sort(x.begin(),x.end(),greater <>())
#define rn return
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
using namespace std;
using ll = long long;
typedef std::pair<int,int> P;
#include <boost/multiprecision/cpp_int.hpp>
 
using bint = boost::multiprecision::cpp_int;

int main(){
    int n;
    int s = 0;
    cin >> n;
    int tmp = n;
    while(tmp){
        s += (tmp%10);
        tmp /= 10;
    }
    cout << (n%s==0? "Yes":"No");
}

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

using namespace std;
#define all(a)a.begin(),a.end()
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod = int(1e9)+7;
using V = vector<ll>;
using P = pair<ll,ll>;

int main()
{
   ll a,b;cin >>a>>b;
   ll k;cin >>k;
   rep(i,k){
    if(i%2==0){
        if(a%2==1)a--;
        a/=2;
        b+=a;
    }
    else {
        if(b%2==1)b--;
        b/=2;
        a+=b;
    }
   }
   cout << a << " "<<b<<endl;
    return 0;
}


Measured memory_bytes: 256