akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
using namespace std;
#define MP make_pair
#define F first
#define S second
int par[320000];
int rnk[320000];
int V, E;

struct edge { int u, v, cost; };
typedef pair<int, int>P;
vector<pair<int, pair<int, int>>> xa,ya;
edge es[334334];

bool comp(const edge&e1, const edge& e2) {
	return e1.cost < e2.cost;
}

void init(int n) {
	for (int i = 0; i < n; i++) {
		par[i] = i;
		rnk[i] = 0;
	}
}

int find(int a) {
	if (par[a] == a)return a;
	else return par[a] = find(par[a]);
}

void unite(int x, int y) {
	x = find(x);
	y = find(y);
	if (x == y)return;

	if (rnk[x] < rnk[y])par[x] = y;
	else {
		par[y] = x;
		if (rnk[x] == rnk[y])rnk[x]++;
	}
}

bool same(int x, int y) {
	return find(x) == find(y);
}

int kruskal() {
	sort(es, es + E, comp);
	init(V);
	int res = 0;
	for (int i = 0; i < E; i++) {
		edge e = es[i];
		if (!same(e.u, e.v)) {
			unite(e.u, e.v);
			res += e.cost;
		}
	}
	return res;
}

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int x, y;
		cin >> x >> y;
		xa.push_back(make_pair(x, make_pair(y, i)));
		ya.push_back(MP(y, MP(x, i)));
	}

	sort(xa.begin(), xa.end());
	sort(ya.begin(), ya.end());
	for (int i = 0; i < xa.size() - 1; i++) {
		es[i] = { xa[i].S.S,xa[i + 1].S.S,abs(xa[i].F - xa[i + 1].F) };
	}
	for (int i = 0; i < ya.size() - 1; i++) {
		int x = xa.size() - 1;
		es[x + i] = { ya[i].S.S,ya[i + 1].S.S,abs(ya[i].F - ya[i + 1].F) };
	}

	/*for (int i = 0; i < n + n-2; i++) {
		cout << es[i].u << ' ' << es[i].v << ' ' << es[i].cost << endl;
	}*/
	V = n + n - 2;
	E = n + n - 2;
	cout << kruskal() << endl;
}

Measured memory_bytes: 9004
import itertools
n = int(input())
a = [input() for _ in range(n)]
cards = ["%s %d" % (suit, rank) for suit, rank in itertools.product(['S', 'H', 'C', 'D'],range(1, 14))]
answers = [card for card in cards if card not in a]

for answer in answers:
    print(answer)



Measured memory_bytes: 5648
package main

import (
   "fmt"
)

func solution(n int, a []int) int {
   out := 0
   for i := range a {
        out += countDiv(a[i])
   }
   return out
}

func countDiv(x int) int {
   out := 0
   for x%2 == 0 && x > 0 {
        x /= 2
        out++
   }
   return out
}

func main() {
   var n int
   fmt.Scan(&n)
   a := make([]int, n)
   for i := range a {
        fmt.Scan(&a[i])
   }
   fmt.Println(solution(n, a))
}

Measured memory_bytes: 2568
#include <algorithm>
#include <climits>
#include <cstring>
#include <inttypes.h>
#include <iostream>
#include <iterator>
#include <map>
#include <utility>
#include <vector>

using namespace std;

const int cap = 1e5 + 1;
int N, M, x, y;
int dp[cap];
vector<int> G[cap];

int dfs(int i) {
    if (dp[i] == -1) {
        for (int j : G[i])
            dp[i] = max(dp[i], dfs(j) + 1);
    }
    return dp[i];
}

int main() {
    scanf("%d %d", &N, &M);
    for (int i = 1; i <= N; ++i)
        G[i].clear();
    for (int i = 0; i < M; ++i) {
        scanf(" %d %d", &x, &y);
        G[x].push_back(y);
    }

    fill(dp, dp + N + 1, -1);
    for (int i = 1; i <= N; ++i) {
        if (G[i].empty())
            dp[i] = 0;
    }

    int ans = 1;
    for (int i = 1; i <= N; ++i) {
        ans = max(ans, dfs(i));
    }

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


Measured memory_bytes: 7424
#include <iostream>
#include <algorithm>
#include <string>
#include <numeric>
#include <boost/math/common_factor_rt.hpp>
using namespace std;
#define rep(i, n) for(int i = 0;i < n;i++)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define ll long long

ll solve(ll b[], ll p [], ll N, ll X, ll sum){
  if(N==0) return sum+1;
  if(X==1) return sum;
  else if(X==b[N-1]+2) return sum + p[N-1] + 1;
  else if(X==2*b[N-1]+3) return sum + 2*p[N-1] + 1;
  else if(1<X && X<b[N-1]+2) return solve(b, p, N-1, X-1, sum);
  else return solve(b, p, N-1, X-2-b[N-1], sum+p[N-1]+1);
}

int main(){
  ll N, X;
  cin >> N >> X;
  ll b[51];
  ll p[51];
  ll sum = 0;
  
  b[0] = 1;
  p[0] = 1;
  rep(i, 50) b[i+1] = b[i]*2+3, p[i+1] = 2*p[i]+1;
  
  cout << solve(b, p, N, X, sum) << endl;
  
    
}

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

#define ll long long
#define lp(i,n) for(int i=0; i<n; i++)
#define pb push_back
const long double pi=3.141592654;
#define OSOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;


ll inv[100000],fact[100000],mod = 1e9+7;
ll fp(ll base, ll exp)
{
	if (exp == 0)
		return 1;
	ll ans = fp(base, exp / 2);
	ans = (ans * ans) % mod;
	if (exp % 2 != 0)
		ans = (ans * (base% mod)) % mod;
	return ans;
}
void calcFacAndInv(ll n)
{
	fact[0] = inv[0] = 1;
	for (ll i = 1; i <= n; i++)
	{
		fact[i] = (i * fact[i - 1]) % mod;
		inv[i] = fp(fact[i], mod - 2);
	}
}

ll ncr(ll n, ll r)
{
	return ((fact[n] * inv[r]) % mod * inv[n - r]) % mod;
}

ll npr(ll n, ll r)
{
	return (fact[n] * inv[n - r]) % mod;
}

int main()
{
	OSOS
	calcFacAndInv(9999);
	ll n ,m;
	cin>>n>>m;
	ll ans =0;
	if(n>=2)
		ans+= ncr(n,2);
	if(m>=2)
		ans+=ncr(m,2);
	cout<<ans;

}


Measured memory_bytes: 384
#include <iostream>
#include <string>

using namespace std;

int count[100000] = {0};
bool increased[100000];

int main()
{
  int n, q;
  string s;
  cin >> n >> q >> s;
  char prev = '-';
  int cur = 0;
  for (int i = 0; i < n; i++) {
    if (prev=='A' && s[i]=='C') {
      cur++;
      count[i] = cur;
      increased[i] = true;
    }
    else {
      count[i] = cur;
      increased[i] = false;
    }
    prev = s[i];
  }
  for (int i = 0; i < q; i++) {
    int l, r;
    cin >> l >> r;
    int result = count[r-1];
    if (2 <= l) {
      if (increased[l-1]) {
        result -= count[l-2]+1;
      }
      else {
        result -= count[l-2];
      }
    }
    cout << result << endl;
  }
  // cout << n << q << s;
  return 0;
}


Measured memory_bytes: 1536
// Problem : A - Multiplication 1
// Contest : AtCoder - AtCoder Beginner Contest 169
// URL : https://atcoder.jp/contests/abc169/tasks/abc169_a?lang=en
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=1;i<=(int)n;i++)
#define REP(i,n) for(int i=0;i<(int)n;i++)
#define ll long long
#define mod 1000000007
int lcm(int x,int y){
	return x/__gcd(x,y)*y;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int m,n;
    cin>>m>>n;
    cout<<m*n<<endl;
    return 0;
}


Measured memory_bytes: 3612
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
struct P {
    int x;
    int y;
    char color;
};

int main (void) {
    int n;
    cin >> n;
    int a, b;
    vector<P> point;
    rep(i, n) {
        cin >> a >> b;
        P p = {a, b, 'r'};
        point.push_back(p);
    }
    rep(i, n) {
        cin >> a >> b;
        P p = {a, b, 'b'};
        point.push_back(p);
    }
    sort(point.begin(), point.end(), [](const P& p1, const P& p2) {return p1.x < p2.x;});
    // for (auto p: point) cout << p.y << endl;

    vector<int> q;
    int c = 0;
    for (auto p: point) {
        if (p.color == 'r') {
            q.push_back(p.y);
        }
        else {
            int ma = -1, pos;
            rep(i, q.size()){
                int yi = q[i];
                if (yi < p.y and ma < yi) {
                    ma = yi;
                    pos = i;
                }
            }
            if (ma != -1) {
                q.erase(q.begin() + pos);
                c++;
            }
        } 
    }
    cout << c << endl;
}



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

int main() {
  int r;   
  cin >> r;
  
  if (r < 1200)
    cout << "ABC" << endl;
  else if (r < 2800)
    cout << "ARC" << endl;
  else
    cout << "AGC" << endl;
}


Measured memory_bytes: 256
import sys
import math
n = int(input())
a = math.floor(math.sqrt(n))
if n == a * a:
    print(a * 2 - 2)
    sys.exit()
for i in range(a, 0, -1):
    if n % i == 0:
        j = n // i
        print(i + j - 2)
        break


Measured memory_bytes: 2940
#include <stdio.h>

using namespace std;

int main() {

    int A, B, C;
    scanf("%d %d %d", &A, &B, &C);

    if (A == B) {
        printf("%d\n", C);
    } else {
        if (A == C) {
            printf("%d\n", B);
        } else {
            printf("%d\n", A);
        }
    }

    return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<vector>
#include<stdio.h>
#include<complex>
using namespace std;

int main(){
  while(true){
    int h,w; 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 == 0 || i == h-1 || j == 0 || j == w-1){
          cout << '#';
        }else{
          cout << '.';
        }
      }
      cout << endl;
    }
    cout << endl;
  }
  return 0;
}



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

#define     F       first
#define     S       second
typedef pair<int, int>  pi;
typedef long long       ll;

const int MAX=2e5+9;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int x;
    cin >> x;
    ll ans=ll(x/500)*1000;
    x%=500;

    ans+=(x/5)*5;
    cout << ans;

    return 0;
}


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

int main() {
  long x,y,z,k;
  cin >> x >> y >> z >> k;
  vector<long> a(x);
  vector<long> b(y);
  vector<long> c(z);
  vector<long> ans;
  for(long i=0;i<x;i++) cin >> a[i];
  for(long i=0;i<y;i++) cin >> b[i];
  for(long i=0;i<z;i++) cin >> c[i];

  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  sort(c.begin(),c.end());
  for(long d=x-1;d>=0&&x-d-1<k;d--) {
    for(long e=y-1;e>=0&&(x-d)*(y-e)-1<k;e--) {
      for(long f=z-1;f>=0&&(x-d)*(y-e)*(z-f)-1<k;f--) {
        ans.push_back(0-a[d]-b[e]-c[f]);
      }
    }
  }
  sort(ans.begin(),ans.end());
  for(long i=0;i<k;i++) cout << 0-ans[i] << endl;
}

Measured memory_bytes: 1404
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
const int inf = 1e9 + 7;
const ll INF = 1e18;
const int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<typename T> T pow(T a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { for (auto &vi: vec) os << vi << " "; return os; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<typename T >inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T> inline void add(T &a, int b) { a += b; if (a >= mod) a -= mod; }


void solve();

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

    int T;
    // cin >> T;
    T = 1;

    while (T--) {
        solve();
    }
}


const int N = 81;
const int M = N * N * 2;
int dp[N][N][2][M]; // ギリギリ...
int a[N][N], b[N][N];

random_device rnd;
mt19937 mt(rnd());
uniform_int_distribution<> rand100(0, 80);
#define rm rand100(mt)

void solve() {
  clock_t ST, ED;
  ST = clock();
  int h, w;
  // h = 80, w = 80;
  cin >> h >> w;

  rep(i, h) rep(j, w) cin >> a[i][j]; // a[i][j] = rm;
  rep(i, h) rep(j, w) {
    cin >> b[i][j]; // b[i][j] = rm;
    a[i][j] -= b[i][j];
  }

  int st = M / 2;
  dp[0][0][0][st + a[0][0]] = 1;
  dp[0][0][1][st - a[0][0]] = 1;

  // 配る
  // chmin で破滅, 最終的に 0 付近にしたい
  rep(i, h + 1) rep(j, w + 1) rep(k, 2) rep(l, M) {
    if (dp[i][j][k][l] == 0) continue;

    if (i + 1 < h) {
      dp[i + 1][j][0][l + a[i + 1][j]] = 1;
      dp[i + 1][j][1][l - a[i + 1][j]] = 1;
    }

    if (j + 1 < w) {
      dp[i][j + 1][0][l + a[i][j + 1]] = 1;
      dp[i][j + 1][1][l - a[i][j + 1]] = 1;
    }
  }

  int ans = inf;
  rep(k, 2) rep(l, M) {
    if (dp[h - 1][w - 1][k][l]) chmin(ans, abs(l - st));
  }
  cout << ans << endl;
  ED = clock();
  // cout << 1.0 * (ED - ST) / CLOCKS_PER_SEC << endl;
}


Measured memory_bytes: 664320
#include<iostream>
#include<string>
#include<vector>
#include<iomanip>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define ll long long
int main(){
    int a,b;
    cin >> a >> b;
    int m=max(a,b);
    if(a==b)cout << 2*m;else cout << 2*m-1;
    return 0;
}
	

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

using namespace std;
typedef long long int ll;

ll calc_attack_num(ll h) {
    if (h == 1) return 1;
    else {
        ll ans = 1 + 2 * calc_attack_num(floor(h / 2));
        return ans;
    }
}

int main()
{
    ll H;
    cin >> H;

    ll ans = calc_attack_num(H);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <functional>
#include <utility>
#include <tuple>
#include <cctype>
#include <bitset>
#include <complex>
#include <cmath>
#include <array>
#include <numeric>
using namespace std;
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3fLL
//#define mod 998244353
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pint;
typedef pair<ll,ll> pll;
typedef tuple<int,int,int> tint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<pint> vpint;
int dx[8]={0,0,-1,1,1,1,-1,-1};
int dy[8]={-1,1,0,0,1,-1,1,-1};
const int SIZE=100050;
//templete
int main() {
	string S;
	cin>>S;
	int N=S.length();
	for(int i=0;i<N;i++){
		for(int j=0;j<N;j++){
			if(i>j)
				continue;
			string T=S.substr(0,i)+S.substr(j,N-1);
			if(T=="keyence"){
				cout<<"YES"<<endl;
				return 0;
			}
		}
	}
	cout<<"NO"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <deque>
#include <iomanip>
#include <iostream>
#include <queue>
#include <stack>
#include <utility>
#include <vector>
using std::cerr;
using std::cin;
using std::cout;
using std::endl;

void OutputError(std::string s) {
  cerr << "\033[93m" << s << "\033[m" << endl;
  return;
}

int main(void) {
  cout << std::fixed << std::setprecision(10);
  cin.tie(0);
  std::ios::sync_with_stdio(false);
  int n, k;
  cin >> n >> k;
  std::vector<int> h(n, 0);
  std::vector<int> c(n, std::pow(10, 9) + 7);
  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }
  c[0] = 0;
  for (int i = 1; i < n; i++) {
    for (int j = 1; j <= k; j++) {
      if (i - j >= 0) {
        c[i] = std::min(c[i], c[i - j] + std::abs(h[i] - h[i - j]));
      } else {
        break;
      }
    }
  }
  cout << c[n - 1] << endl;

  return 0;
}


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

int main() {
    int n;
    cin >> n;
    priority_queue<double, vector<double>, greater<double>> q;
    rep(i,n) {
        double a;
        cin >> a;
        q.push(a);
    }

    double ans = 0;
    rep(i,n-1) {
        double q1 = q.top(); q.pop();
        double q2 = q.top(); q.pop();
        double q_mean = (q1 + q2) / 2;
        ans += q_mean;
        q.push(q_mean);
    }

    printf("%.10f",q.top());
    return 0;
}

Measured memory_bytes: 256
N,K=map(int,input().split())
A=list(map(int,input().split()))
a=[0]*(N+1)
for i in range(N):
    a[i+1]=a[i]+A[i]
from itertools import combinations
S=[a[r]-a[l] for l,r in combinations(range(N+1),2)]
x,y=0,1<<39
for i in range(40):
    n=0
    for s in S:
        if (x+y)&s==x+y:
            n+=1
    if n>=K:
        x+=y
    y>>=1
print(x)

Measured memory_bytes: 58840
S = input()
ok = True
for i, s in enumerate(S):
    index = i+1
    if index % 2 == 0 and s == "R":
        ok = False
        break
    if index % 2 == 1 and s == "L":
        ok = False
        break

if ok:
    print("Yes")
else:
    print("No")

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

vector<ll> divisors(ll n){
	vector<ll> factors={1};
	for(ll i=2; i<=sqrt(n); i++){
		if(n%i==0)
			factors.push_back(i);
	}
	return factors;
}

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

	ll n;
	cin >> n;
	vector<ll> v = divisors(n);
	ll a = v.back(); ll b = n/a;
	cout << a+b-2;
	return 0;
}

Measured memory_bytes: 3728
#include "bits/stdc++.h"

// Begin {{{
using namespace std;

#define all(x) x.begin(), x.end()
#define rep(i, n) for (i64 i = 0; i < (n); ++i)
#define reps(i, b, e) for (i64 i = (b); i <= (e); ++i)
#define repr(i, b, e) for (i64 i = (b); i >= (e); --i)
#define var(Type, ...) Type __VA_ARGS__; input(__VA_ARGS__)

#ifdef DEBUG
#define dump(...) dump_(#__VA_ARGS__, __VA_ARGS__);
#else
#define dump(...)
#endif

using i64 = int_fast64_t;
using pii = pair<i64, i64>;

template <class A, class B>
inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }

template <class A, class B>
inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;

// input
void input() {}
template <class Head, class... Tail>
void input(Head&& head, Tail&&... tail) {
  cin >> head;
  input(forward<Tail>(tail)...);
}

// outs
void outs() {}
template <class Head, class... Tail>
void outs(Head&& head, Tail&&... tail) {
  cout << head << " \n"[sizeof...(tail)==0];
  outs(forward<Tail>(tail)...);
}

template <class T>
void outs(vector<T> &vec) { for (auto &e : vec) cout << e << " \n"[&e==&vec.back()]; }

template <class T>
void outs(vector<vector<T>> &df) { for (auto &vec : df) OUTS(vec); }

// outl
void outl() {}
template <class Head, class... Tail>
void outl(Head&& head, Tail&&... tail) {
  cout << head << "\n";
  outl(forward<Tail>(tail)...);
}

template <class T>
void outl(vector<T> &vec) { for (auto &e : vec) cout << e << "\n"; }

// outn
void outn() {}
template <class Head, class... Tail>
void outn(Head&& head, Tail&&... tail) {
  cout << head;
  outn(forward<Tail>(tail)...);
}

template <class T>
void outn(vector<T> &vec) { for (auto &e : vec) cout << e; }

// dump
template <class T>
void dump_(const char *s, T&& x) {
  clog << '{';
  while(*s != '\0') clog << *(s++);
  clog << ": " << x << '}' << "\n";
}

template <class Head, class... Tail>
void dump_(const char *s, Head&& head, Tail&&... tail) {
  clog << '{';
  while(*s != ',') clog << *(s++);
  clog << ": " << head << "}, ";
  for (++s; !isgraph(*s); ++s);
  dump_(s, forward<Tail>(tail)...);
}
// }}} End

const int MIN = -1000000;
const int MAX = 1000000;

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

  var(int, k, x);

  vector<i64> vec;
  for (int i = max(MIN, x - k + 1); i <= min(x + k - 1, MAX); ++i) {
    vec.push_back(i);
  }

  outs(vec);

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    string s;
    cin >> s;
    string ss = s.substr(0, 3);
    cout << ss << endl;
    return 0;
}


Measured memory_bytes: 3612
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
dd = [(0,-1),(1,0),(0,1),(-1,0)]
ddn = [(0,-1),(1,-1),(1,0),(1,1),(0,1),(-1,-1),(-1,0),(-1,1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


s = S()
k = I()
n = len(s)
res = []

for i in range(n):
    for j in range(i,n)[0:5]:
        s1 = s[i:j+1]
        if s1 not in res:
            for m in range(len(res)):
                if s1 < res[m]:
                    res.insert(m, s1)
                    break
            res.append(s1)
        res = res[0:k]
print(res[-1])



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

int main() {
    int H,W;
    cin >> H >> W;
    string A;

    for(int i = 0; i < W + 2; i++){
        cout << "#";
    }
    cout << endl;
    
    for(int i = 0; i < H; i++){
        cin >> A;
        cout << "#" << A << "#" << endl;
    }
    
    for(int i = 0; i < W + 2; i++){
        cout << "#";
    }
    cout << endl;


}


Measured memory_bytes: 3616
#include<stdio.h>
#include<string.h>
int main(){
	char s[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
	char m[26]={'D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','A','B','C'};
	char bm[1024],bs[1024];
	int i,j;
	scanf("%s",bm);
	strcpy(bs,bm);
	for(i=0;i<strlen(bm);i++){
		for(j=0;j<26;j++){
			if(m[j]==bm[i]){
				bs[i]=s[j];
				break;
			}
		}
	}
	printf("%s\n",bs);
	return 0;
}

Measured memory_bytes: 2572
def solve(a, b, c, x, y):
    flag = None
    if x < y:
        flag = True
    else:
        flag = False
    if c < (a / 2) and c < (b / 2):
        return c * max(x, y) * 2
    c_many = min(x, y)
    c_total = c * c_many * 2
    return min([
        (y - c_many) * b + c_total if flag else (x - c_many) * a + c_total, 
        a * x + b * y,
        max(x, y) * 2 * c,
    ])
   
if __name__ == '__main__':
    a, b, c, x, y = map(lambda x: int(x), input().split())

    print(solve(a, b, c, x, y))


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

int main(int argc, char const *argv[]) {
    int n, l;
    cin >> n >> l;

    int ans = 0;
    if (l + n - 1 < 0) {
        for (int i = 0; i < n-1; i++) ans += l + i;
    } else if (l < 0) {
        for (int i = 0; i < n; i++) ans += l + i;
    } else {
        for (int i = 1; i < n; i++) ans += l + i;
    }

    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3568
#include<bits/stdc++.h>
using namespace std;
bool odd(int a,int b)
{
	int ans=a*b;
	if(ans%2==1)return true;
	else return false;
}
int main()
{
	int a,b;
	cin>>a>>b;
	if(odd(a,b))puts("Yes");
	else puts("No");
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	long long x,k,d;
	cin >> x >> k >> d;
	x = abs(x);
	long long t = min(k,x / d);
	x -= t * d;
	long long ans = x;
	if((k - t) & 1)	ans -= d;
	cout << abs(ans) << endl;
	return 0;
}


Measured memory_bytes: 3648
r,c=map(int,input().split())
table=list()
for i in range(r):
    table.append(list(map(int,input().split())))
for i in range(r):
    for j in range(c):
        print(table[i][j],"",end="")
    print(sum(table[i]),sep="")
bottom=list()
for i in range(c):
    tmp=0
    for j in range(r):
        tmp+=table[j][i]
    bottom.append(tmp)
for i in bottom:
    print(i,"",end="")
print(sum(bottom))



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

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

	string op;

	if( a == b ) {
		op = "==";
	}
	else if( a < b ) {
		op = "<";
	}
	else {
		op = ">";
	}

	cout << "a " << op << " b" << endl;
}



Measured memory_bytes: 3168
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(ll i=(n)-1;i>=0;i--)
#define range(i,a,n) for(ll i=(a);i<(n);i++)
#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI (3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S sum(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>void tf(bool b,S t,T f){if(b)puta(t);else puta(f);}
void YN(bool b){tf(b,"YES","NO");}
void Yn(bool b){tf(b,"Yes","No");}
void yn(bool b){tf(b,"yes","no");}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1;for(auto s:t){os<<(a?"":" ")<<s;a=0;}return os;}
template<class S>auto&operator>>(istream&is,vector<S>&t){for(S&a:t)cin>>a;return is;}

/*他のライブラリを入れる場所*/

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,Q;
    cin>>n>>Q;
    vvl edge(n);
    rep(i,n-1){
        ll a,b; cin>>a>>b;
        a--;b--;
        edge[a].push_back(b);
        edge[b].push_back(a);
    }
    vb v(n,false);
    vl tour;
    stack<int> q;
    q.push(0);
    while(!q.empty()){
        ll p = q.top();
        tour.push_back(p);
        if(v[p]){
            q.pop();
            continue;
        }
        for(auto&nxt:edge[p]){
            if(!v[nxt])q.push(nxt);
        }
        v[p]=true;
    }
    tour.push_back(-1);
    vl l(n,-1),r(n,-1);
    rep(i,tour.size()){
        if(tour[i]==-1)continue;
        if(l[tour[i]]==-1) l[tour[i]]=i;
    }
    rrep(i,tour.size()){
        if(tour[i]==-1)continue;
        if(r[tour[i]]==-1) r[tour[i]]=i;
    }
    vl ans(tour.size(),0);
    rep(i,Q){
        ll a,b;cin>>a>>b;
        a--;
        ans[l[a]]+=b;
        ans[r[a]+1]-=b;
    }
    partial_sum(all(ans),ans.begin());
    vl x;
    rep(i,n)x.push_back(ans[l[i]]);
    puta(x);


    return 0;
}

Measured memory_bytes: 28388
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
typedef long long ll;

using namespace std;

int main()
{
	string s;
	int ans=0;
	
	cin>>s;
	for(int i=0;i<3;i++)
	{
		if(s[i]=='1')
		{
			ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int INF = 1000000;
int main(){
	int N;
	cin >> N;
	P red[N], blue[N];
	int x, y;
	for(int i=0;i<N;i++){
		cin >> x >> y;
		red[i] = make_pair(x, y);
	}
	for(int i=0;i<N;i++){
		cin >> x >> y;
		blue[i] = make_pair(x, y);
	}

	sort(red, red+N);
	sort(blue, blue+N);

	bool connected[N];
	for(int i=0;i<N;i++) connected[i] = false;

	int ans = 0;
	int candi;

	for(int i=0;i<N;i++){
		bool flag = false;
		for(int k=0;k<N;k++){
			if(red[k].first < blue[i].first && red[k].second < blue[i].second 
				&& !connected[k]){
				candi = k;
				flag = true;
				break;
			}
		}
		if(flag){
			int k = 0;
			while(k<N){
				if(red[k].first < blue[i].first && red[k].second < blue[i].second 
					&& red[candi].second < red[k].second && !connected[k]){
					candi = k;
				}
				k++;
			}
			ans++;
			connected[candi] = true;
		}		
	}
	cout << ans <<endl;
  	return 0;
}








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

int N,maxn;string S;

int solve(string A,string B){
	int d[26],e[26];for(int i=0;i<26;i++){d[i]=0;e[i]=0;}
	for(int i=0;i<A.size();i++) d[A[i]-'a']++;
	for(int i=0;i<B.size();i++) e[B[i]-'a']++;
	int cnt=0;
	for(int i=0;i<26;i++){if(d[i]>=1 && e[i]>=1) cnt++;}
	return cnt;
}

int main(){
	cin>>N>>S;
	for(int i=1;i<=(int)S.size()-1;i++){
		string V1=S.substr(0,i),V2=S.substr(i,S.size()-i);
		maxn=max(maxn,solve(V1,V2));
	}
	cout<<maxn<<endl;
	return 0;
}


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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  __MAKE_TIME__  Problem: __PROBLEM__ / Link: __CONTEST_URL__  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */

LL ans = 0LL;

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

	string s, t; cin >> s >> t;
	SORT(s), RSORT(t);
	if (s < t) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}


Measured memory_bytes: 256
a = input()

if 0 < int(a[:2]) and int(a[:2]) <= 12:
    if 0 < int(a[2:]) and int(a[2:]) <= 12:
        print("AMBIGUOUS")
    else:
        print("MMYY")

elif 0 < int(a[2:]) and int(a[2:]) <= 12:
    if 0 < int(a[:2]) and int(a[:2]) <= 12:
        print("AMBIGUOUS")
    else:
        print("YYMM")
else:
    print("NA")


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define RFOR(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define REP(i,n) FOR(i,0,(n))
#define REPS(i,n) FOR(i,1,(n)+1)
#define RREP(i,n) RFOR(i,0,(n))
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define DEBUG(x)  cout << #x << " = " << (x) << endl;
#define SORT(x) sort(ALL(x));
#define RSORT(x) sort(RALL(x));
#define SUM(x) accumulate(ALL(x),0);
#define FI first
#define SE second
#define PB push_back
#define EB emplace_back
#define SZ(x) (int)(x).size()
#define BN(x) ((1<<x)-1)
#define DUP(x,y) (((x)+(y)-1)/(y))
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const ll mod = 1e9+7;
const int INF = (1<<30)-1;
const ll INFLL = (1LL<<62)-1;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//cout << fixed << setprecision(10);

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

ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int cnt_div2(int a) {
  int cnt = 0;
  while (a%2 == 0) {
    a /= 2;
    cnt++;
  }
  return cnt;
}

int main () {
  int N; cin >> N;
  vi a(N); REP(i,N) scanf("%d",&a[i]);

  int cnt_2 = 0;
  int cnt_4 = 0;
  REP(i,N) {
    if (cnt_div2(a[i]) == 1) {
      cnt_2++;
    }
    else if (cnt_div2(a[i]) >= 2) {
      cnt_4++;
    }
  }

  cout << (cnt_4 >= (N-max(0,cnt_2-1))/2 ? "Yes" : "No") << endl;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
using ll = long long;

int main(void){
    double w,h;
    double x,y;
    cin >> w >> h >> x >> y;

    printf("%.10f ", w*(h/2.0));
    cout << (w/2.0==x && h/2.0==y) << endl;
}

Measured memory_bytes: 256
from fractions import gcd
from collections import Counter

a, b = map(int, input().split())

gcd_ab = gcd(a, b)


def prime_factorize(n):
    res = 0
    d = Counter()
    m = 2
    while m*m <= n:
        while n%m == 0:
            n //= m
            d[m] += 1
        m = m+1 if m == 2 else m+2
    if n>1:
        d[n] += 1
    return d


if gcd_ab == 1:  # コーナーケース
    print(1)
    exit()

# (素因数分解の素因数の個数)+1が答え
prime_d = prime_factorize(gcd_ab)
print(len(prime_d)+1)

Measured memory_bytes: 65516
//{
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double lf;
typedef pair<ll,ll> ii;
#define REP(i,n) for(ll i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define FILL(i,n) memset(i,n,sizeof i)
#define X first
#define Y second
#define SZ(_a) (int)_a.size()
#define ALL(_a) _a.begin(),_a.end()
#define pb push_back
#ifdef brian
#define debug(...) do{\
    fprintf(stderr,"%s - %d (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
    _do(__VA_ARGS__);\
}while(0)
template<typename T>void _do(T &&_x){cerr<<_x<<endl;}
template<typename T,typename ...S> void _do(T &&_x,S &&..._t){cerr<<_x<<" ,";_do(_t...);}
template<typename _a,typename _b> ostream& operator << (ostream &_s,const pair<_a,_b> &_p){return _s<<"("<<_p.X<<","<<_p.Y<<")";}
template<typename It> ostream& _OUTC(ostream &_s,It _ita,It _itb)
{
    _s<<"{";
    for(It _it=_ita;_it!=_itb;_it++)
    {
        _s<<(_it==_ita?"":",")<<*_it;
    }
    _s<<"}";
    return _s;
}
template<typename _a> ostream &operator << (ostream &_s,vector<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a> ostream &operator << (ostream &_s,set<_a> &_c){return _OUTC(_s,ALL(_c));}
template<typename _a,typename _b> ostream &operator << (ostream &_s,map<_a,_b> &_c){return _OUTC(_s,ALL(_c));}
template<typename _t> void pary(_t _a,_t _b){_OUTC(cerr,_a,_b);cerr<<endl;}
#define IOS()
#else
#define debug(...)
#define pary(...)
#define endl '\n'
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#endif // brian
//}


const ll MAXn=1e5+5,MAXlg=__lg(MAXn)+2;
const ll MOD=1000000007;
const ll INF=ll(1e15);

int main()
{
    IOS();
    ll x,y;
    cin>>x>>y;
    if(x % y != 0)cout<<x<<endl;
    else cout<<-1<<endl;
}


Measured memory_bytes: 256
<?php
  
fscanf(STDIN,"%d %d %d %d %d",$A,$B,$C,$X,$Y);

$cost = 0;

if($C*2<=$A+$B){
  $add=min($X,$Y);
  $cost+=$C*2*$add;
  $rest=max($X,$Y)-$add;
  if($X<=$Y){
    if($B<=$C*2){
      $cost+= $rest*$B;
    }else{
      $cost+= $rest*$C*2;
    }
  }else{
    if($A<=$C*2){
     $cost+= $rest*$A;
    }else{
     $cost+= $rest*$C*2;
    }
  }
}else{
  $cost = $A*$X+$B*$Y;
}

echo $cost;



Measured memory_bytes: 3828
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <string>
#include <cmath>
using namespace std;
#define MOD 1000000007
#define MAX 510000
#define INF 1<<30
#define LINF (ll)1<<62
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(ll i=(a); i<(b); i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll, ll> P;
typedef vector<pair<ll, ll>> vpl;

int main(){
    ll n,m; cin >> n >> m;
    vvl G(n);
    vl indeg(n,0);
    rep(i,m){
        ll x,y; cin >> x >> y;
        x--; y--;
        G[x].push_back(y);
        indeg[y]++;
    }
    vl d(n,0);
    queue<ll> q;
    rep(i,n) if(indeg[i] == 0) q.push(i);
    while(!q.empty()){
        ll u = q.front(); q.pop();
        for(auto v : G[u]){
            indeg[v]--;
            if(indeg[v] == 0){
                q.push(v);
                d[v] = d[u] + 1;
            }
        }
    }
    ll mx = 0;
    rep(i,n) mx = max(mx, d[i]);
    //rep(i,n) cout << d[i] << " ";
    cout << mx << endl;
}

Measured memory_bytes: 7296
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> P;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)

const lint MOD = pow(10, 9) + 7;

/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
vector<char>NUM(10);
	NUM = { '0','1','2' ,'3' ,'4' ,'5' ,'6' ,'7' ,'8' ,'9' };
*/


int main() {
	string S;
	cin >> S;
	int Z = S.size();
	if (Z == 3) {
		reverse(S);
	}
	cout << S << endl;
}


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

long long N, K, A[1 << 18];

int main() {
cin >> N >> K;
for (int i = 1; i <= N; i++) cin >> A[i];
for (int i = K + 1; i <= N; i++) {
if (A[i - K] < A[i]) cout << "Yes" << endl;
else cout << "No" << endl;
}
return 0;
}

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


int main() {
	
	int a, b, c, x, y;
	cin >> a >> b >> c >> x >> y;
	
	int sum = a*x + b*y;
	for(int i=0; i<=2*max(x,y); i+=2){
		sum = min( i*c + max(0, a*(x-i/2)) + max(0, b*(y-i/2)) , sum);
	}
	cout << sum <<endl;
	
	
	return 0;
}

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

#ifdef LOCAL
#include "contest.h"
#else
#define error(args...) 
#endif

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
inline bool valid(int x, int w) { return 0 <= x && x < w; }

void iostream_init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.setf(ios::fixed);
    cout.precision(12);
}
//}}}

int main(){
    iostream_init();
    LL x;
    cin >> x;
    LL t = x / 11;
    x -= t * 11;
    if(x == 0) {
        t = t * 2;
    } else if(x <= 6) {
        t = t * 2 + 1;
    } else {
        t = t * 2 + 2;
    }
    cout << t << endl;
    return 0;
}



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

using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
#define REP(i,n) for(ll i = 0;i < (ll)n;i++)
#define REPD(i,n) for(ll i = (ll)n - 1;i >= 0;i--)
#define ALL(x) (x).begin(),(x).end()
#define FILLl(n,first_dimension_size,value) fill((ll*)n,(ll*)(n+first_dimension_size),value)
#define FILL(n,first_dimension_size,value) fill((int*)n,(int*)(n+first_dimension_size),value)
#define INF (1 << 29)
#define MOD 1000000007
//int dx[4] = {1,0,0,-1};
//int dy[4] = {0,1,-1,0};


int main(){
  
  int n;
  cin >> n;
  vector<int> a,b,c;
  REP(i,n){
    int x,y,z;cin >> x >> y >>  z;
    a.push_back(x);
    b.push_back(y);
    c.push_back(z);
  }
  int dp[3][n+1];
  FILL(dp,3,-1);
  REP(i,3)dp[i][0] = 0;
  for(int i = 1;i <= n;i++){
    dp[0][i] = max(dp[1][i-1],dp[2][i-1])+a[i-1];
    dp[1][i] = max(dp[0][i-1],dp[2][i-1])+b[i-1];
    dp[2][i] = max(dp[0][i-1],dp[1][i-1])+c[i-1];
  }

  cout << max({dp[0][n],dp[1][n],dp[2][n]}) << endl;



  
  


  return 0;
}


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

int main(){

  string str;
  cin >> str;
  for(int i=0;i<str.size();i++){
    if(str[i] == 'A') cout << "X";
    else if(str[i] == 'B') cout << "Y";
    else if(str[i] == 'C') cout << "Z";
    else printf("%c",str[i]-3);
  }
  cout << endl;
}

Measured memory_bytes: 1180
s = list(input())
word = []
for i in range(len(s)):
    if s[i] == "B":
        if len(word) != 0:
            del word[len(word)-1]
    else:
        word.append(s[i])
Ans = ""
for i in range(len(word)):
    Ans += word[i]
print(Ans)

Measured memory_bytes: 9056
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>

#define int long long
#define MOD7 1000000007
#define MOD9 1000000009

#define rep(i, n) for (int i = 0; i < (n); i++)
#define itrep(i, a) for (auto i = (a).begin(); i != (a).end(); i++)
#define REP(i, a, n) for (int i = (a); i <= (n); i++)
#define all(a) (a).begin(), (a).end()
#define mp(a, b) make_pair((a), (b))

using namespace std;

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

template<class T> void inputVector(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < v.size(); i++) cin >> v[i];
}

int dp[1010][1010];

signed main() {
    int H, W;
    cin >> H >> W;

    vector<string> board(H);
    rep(i, H) cin >> board[i];

    dp[0][0] = 1;
    rep(y, H) rep(x, W) {
        if (board[y][x] == '#') continue;
        if (x > 0) {
            dp[y][x] += dp[y][x - 1];
            dp[y][x] %= MOD7;
        }
        if (y > 0) {
            dp[y][x] += dp[y - 1][x];
            dp[y][x] %= MOD7;
        }
    }

    cout << dp[H - 1][W - 1] << endl;
}



Measured memory_bytes: 9216
import math
import fractions
import bisect
import collections
import itertools
import heapq
import string
import sys
import copy
from collections import deque
sys.setrecursionlimit(10**7)
MOD = 10**9+7
def gcd(a,b):return fractions.gcd(a,b) #最大公約数
def lcm(a,b):return (a*b) // fractions.gcd(a,b) #最小公倍数
def iin(): return int(input()) #整数読み込み
def ifn(): return float(input()) #浮動小数点読み込み
def isn(): return input().split() #文字列読み込み
def imn(): return map(int, input().split()) #整数map取得
def fmn(): return map(float, input().split()) #浮動小数点map取得
def iln(): return list(map(int, input().split())) #整数リスト取得
def iln_s(): return sorted(iln()) # 昇順の整数リスト取得
def iln_r(): return sorted(iln(), reverse=True) # 降順の整数リスト取得
def fln(): return list(map(float, input().split())) # 浮動小数点リスト取得
def join(l, s=''): return s.join(l) #リストを文字列に変換
def perm(l, n): return itertools.permutations(l, n) # 順列取得
def perm_count(n, r): return math.factorial(n) // math.factorial(n-r) # 順列の総数
def comb(l, n): return itertools.combinations(l, n) # 組み合わせ取得
def comb_count(n, r): return math.factorial(n) // (math.factorial(n-r) * math.factorial(r)) #組み合わせの総数
def two_distance(a, b, c, d): return ((c-a)**2 + (d-b)**2)**.5 # 2点間の距離
def m_add(a,b): return (a+b) % MOD

N,K = imn()
H = iln_r()

ans = 0
for i in range(N):

    if K > 0:
        K -= 1
    else:
        ans += H[i]
print(ans)


Measured memory_bytes: 28164
// inputに入力データ全体が入る
function Main(input) {
	input = input.split("\n");
  　input.shift();
    P = input
    var max = 0;
    var x;
    var sum = 0;
    for(i of P){
      if(max < i){
        x = Number(i) / 2
        max = Number(i);
      }
      sum += Number(i)
    }
    sum -= x   
    console.log(sum)
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

typedef unsigned uint;

bool is_exist_bin_search(uint v, std::vector<uint> s){
  uint min = 0, max = s.size();
  while(min < max){
    uint mid = (min + max) / 2;
    uint v_mid = s[mid];
    if(v_mid == v) return true;

    if(v_mid >= v) max = mid;
    else min = mid+1;
  }
  return false;
}

unsigned count(std::vector<uint> s, std::vector<uint> t){
  uint n = 0;
  for(uint i = 0; i < t.size(); i++){
    if(is_exist_bin_search(t[i],s)) n++;
  }
  return n;
}

int main(){
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(0);
  std::vector<uint> s,t;

  {
    uint n,buf;
    std::cin >> n;
    for(; n; n--){
      std::cin >> buf;
      s.push_back(buf);
    }
  }

  {
    uint q,buf;
    std::cin >> q;
    for(; q; q--){
      std::cin >> buf;
      t.push_back(buf);
    }
  }

  std::cout << count(s,t) << '\n';
}

Measured memory_bytes: 2660
#!/usr/bin/env python

from collections import deque
import itertools as ite
import sys
import math

sys.setrecursionlimit(1000000)

INF = 10 ** 18
MOD = 10 ** 9 + 7

N = input()
ls = []
for loop in range(N):
	x, y = map(int, raw_input().split())
	ls += [(x, y)]
ans = 0
for i in range(N):
	for j in range(i + 1, N):
		dx = ls[i][0] - ls[j][0]
		dy = ls[i][1] - ls[j][1]
		cnt = 0
		for k in range(N):
			for l in range(N):
				if ls[k][0] - ls[l][0] == dx and ls[k][1] - ls[l][1] == dy:
					cnt += 1
		ans = max(cnt, ans)
print N - ans

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

using namespace std;

ll x[100005];

int main()
{
    int n, K;
    cin >> n >> K;
    rep(i,n){
        cin >> x[i];
    }
    ll ans = (1LL << 60);
    rep(i,n-K+1){
        if(x[i+K-1] <= 0){
            ans = min(ans, -x[i]);
        }else if(x[i] <= 0){
            ans = min(ans, x[i+K-1] - x[i] + min(x[i+K-1], -x[i]));
        }else{
            ans = min(ans, x[i+K-1]);
        }
    }
    cout << ans << "\n";
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long K = sc.nextLong();
		long[] A = new long[N];
		String[] a = new String[N];
		int max = 42;
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextLong();
			// 二進数を42桁で左側を0で埋める
			a[i] = String.format("%42s", Long.toBinaryString(A[i])).replace(" ", "0");
		}
		sc.close();
		String k = String.format("%42s", Long.toBinaryString(K)).replace(" ", "0");

		long[] c = new long[max];
		int[] b = new int[max];
		for(int i = 0; i < max; i++) {
			if(k.charAt(i) == '1') {
				b[i]++;;
			}
		}
		for(String s : a) {
			for(int i = 0; i < max; i++) {
				if(s.charAt(i) == '1') {
					c[i]++;
				}
			}
		}
		long[][] dp = new long[max + 1][2];
		for(int i = 0; i <= max; i++) {
			dp[i][0] = -1;
			dp[i][1] = -1;
		}
		dp[0][0] = 0;
		for(int i = 0; i < max; i++) {
			long t = (long)Math.pow(2, max - 1 - i);
			long v0 = t * c[i];			// i桁目を0としたときの報酬
			long v1 = t * (N - c[i]);	// i桁目を1としたときの報酬
			if(dp[i][1] != -1) {
				dp[i + 1][1] = Math.max(dp[i + 1][1], dp[i][1] + Math.max(v0, v1));
			}

			if(dp[i][0] != -1) {
				if(b[i] == 1) {
					dp[i + 1][1] = Math.max(dp[i + 1][1], dp[i][0] + v0);
					dp[i + 1][0] = Math.max(dp[i + 1][0], dp[i][0] + v1);
				}else {
					dp[i + 1][0] = Math.max(dp[i + 1][0], dp[i][0] + v0);
				}
			}
		}
		long ans = Math.max(dp[max][0], dp[max][1]);
		System.out.println(ans);
		//System.out.println(dp[max][0]);
	}
	static void disp(long[] a) {
		for(long i : a) {
			System.out.printf("%d ", i);
		}
		System.out.println();
	}
	static void disp(int[] a) {
		for(long i : a) {
			System.out.printf("%d ", i);
		}
		System.out.println();
	}
}

Measured memory_bytes: 168656