akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define Max(a, b) a = max(a, b)
#define Min(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) { cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl; }
#define mdebug(m) { cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;} }
#define Return(ans) { cout << (ans) << endl; return 0; }
#define pb push_back
#define fi first
#define se second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p){ cout << '(' << p.first << ',' << p.second << ')'; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void Ans(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using v_bool = vector<bool>;
using v_Pii = vector<Pii>;

//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};

const int mod = 1000000007;
//const int mod = 998244353;



signed main(){

    int N, K, S, T; cin >> N >> K >> S >> T;
    vec A(N); cin >> A;

    if((S & T) != S){
        Out(0);
        return 0;
    }
    vec a;
    REP(i, N){
        if((A[i] & S) == S && (A[i] | T) == T) a.pb(A[i]);
    }
    int n = SZ(a);

    mat C(N + 1, vec(N + 1, 0));
    vec num(N + 1, 0);
    C[0][0] = 1;
    FOR(i, 1, N + 1){
        C[i][0] = 1;
        C[i][i] = 1;
        FOR(j, 1, i) C[i][j] = C[i - 1][j - 1] + C[i - 1][j];

        FOR(j, 1, K + 1) num[i] += C[i][j];
    }


    int ans = 0;
    int D = T ^ S;
    REP(mask, bit(18)) if((mask & D) == mask){
        map<int, int> cnt;
        REP(i, n) cnt[a[i] & mask] += 1;

        int t = 0;
        for(Pii q: cnt) t += num[q.se];
        if(__builtin_popcountll(mask) % 2 == 0) ans += t;
        else ans -= t;
    }
    Out(ans);

    return 0;
}


Measured memory_bytes: 3688
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
//#define cerr if(false) cerr
#ifdef DEBUG
#define show(...) cerr << #__VA_ARGS__ << " = ", debug(__VA_ARGS__);
#else
#define show(...) 42
#endif
using namespace std;
using ll = long long;
using pii = pair<int, int>;
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> a) {
    os << '(' << a.first << ',' << a.second << ')';
    return os;
}
template <typename T>
ostream &operator<<(ostream &os, vector<T> v) {
    for (auto x : v) os << x << ' ';
    return os;
}
void debug() {
    cerr << '\n';
}
template <typename H, typename... T>
void debug(H a, T... b) {
    cerr << a;
    if (sizeof...(b)) cerr << ", ";
    debug(b...);
}
struct edge{
    int to, cost;
    edge(int a = 0, int b = 0) : to(a), cost(b) {}
};
auto dijkstra(int s, vector<vector<edge>> &g){
    int n = (int)g.size();
    vector<ll> dist(3 * n, 1LL<<60);
    using ll_i = pair<ll, int>;
    queue<pii>pq;
    dist[s] = 0;
    pq.push({dist[s], s});
    while(!pq.empty()){
        auto a = pq.front();
        pq.pop();
        int v = a.second % n;
        int cnt = a.second / n;
        cnt++;
        cnt %= 3;
        if(a.first > dist[a.second])continue;
        for(auto &x : g[v]){
            if(dist[x.to+cnt*n] > dist[a.second] + x.cost){
                dist[x.to+cnt*n] = dist[a.second] + x.cost;
                pq.push({dist[x.to+cnt*n], x.to+cnt*n});
            }
        }
    }
    return dist;
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<vector<edge>>g;
    g.resize(n);
    for(int i = 0; i < m; i++){
        int a,b;
        cin >> a >> b;
        a--,b--;
        g[a].emplace_back(b,1);
    }
    int s,t;
    cin >> s >> t;
    s--,t--;
    auto dist = dijkstra(s,g);
    if(dist[t] == 1LL<<60){
        cout << -1 << endl;
    }else{
        cout << dist[t] / 3 << endl;
    }
    return 0;
}

Measured memory_bytes: 8064
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.bigint, std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static File _f;
void file_io(string fn) { _f = File(fn, "r"); }
static string[] s_rd;
T _RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
T _RD(T = long)(File f) { while(!s_rd.length) s_rd = f.readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
T[] _RDA(T = long)(T fix = 0) { auto r = readln.chomp.split.to!(T[]); r[] += fix; return r; }
T[] _RDA(T = long)(File f, T fix = 0) { auto r = f.readln.chomp.split.to!(T[]); r[] += fix; return r; }
T RD(T = long)() { if (_f.isOpen) return _RD!T(_f); else return _RD!T; }
T[] RDA(T = long)(T fix = 0) { if (_f.isOpen)  return _RDA!T(_f, fix); else return _RDA!T(fix); }

size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

void chmin(T)(ref T x, T y) { x = min(x, y); } void chmax(T)(ref T x, T y) { x = max(x, y); }
bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
T lcm(T)(T x, T y) { return x * (y / gcd(x, y)); }

long mod = 10^^9 + 7;
//long mod = 998244353;
//long mod = 1_000_003;
void moda(T)(ref T x, T y) { x = (x + y) % mod; }
void mods(T)(ref T x, T y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(T)(ref T x, T y) { x = (x * y) % mod; }
void modpow(T)(ref T x, T y) { if (!y) { x = 1; return; } auto t = x; x.modpow(y>>1); x.modm(x); if (y&1) x.modm(t); }
void modd(T)(ref T x, T y) { x.modm(y.modpow(mod - 2)); }

void main()
{
	auto N = RD;
	auto A = RD;
	auto B = RD;
	auto ans = N / (A+B) * A;
	ans += min(A, N % (A+B));

	writeln(ans);
	stdout.flush;
	debug readln;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define P pair<int,int>
#define PP pair<P,int>
#define F first
#define S second
#define f(i,n) for(int i=0;i<(n);i++)
#define INF LLONG_MAX/3
#define eps LDBL_EPSILON
#define mod (int)(1000000007)
#define pie 3.141592653589793238462643383279
#define Bpri priority_queue
#define Spri priority_queue<P,vector<P>,greater<P>>
using namespace std;
signed main(){
	int a,x1,y1,z1,x2=0,y2=0,z2=0;
	cin>>a;
	f(i,a){
		cin>>x1>>y1>>z1;
		if((abs(x1-x2)%2!=abs(y1-y2+z1-z2)%2)||(abs(x1-x2)<abs(y1-y2)+abs(z1-z2))){
			puts("No");
			return 0;
		}
		x2=x1,y2=y1,z2=z1;
	}
	puts("Yes");
	return 0;
}


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

#define ll long long
int main(){
    ll n; cin>> n;
    ll ans = 0;
    ll a = n/3;
    ans -= 3ll*(a*(a+1))/2;
    a = n/5;
    ans -= 5ll*(a*(a+1))/2;
    a = n/15;
    ans += 15ll*(a*(a+1))/2;
    ans += n*(n+1)/2;
    cout << ans << endl;


}


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

#define int long long

const int MOD = 1e9+7;

string L;
int N;
int dp[100010][2];

int dfs(int n, int f) {
  if ( dp[n][f] >= 0 ) return dp[n][f];
  if ( n == N ) return 1;

  int ret = 0;
  if ( f ) {
    ret += 3*dfs(n+1, f);    
  } else {
    if ( L[n] == '0' ) ret += dfs(n+1, f);
    else ret += 2*dfs(n+1, f) + dfs(n+1, 1);    
  }

  return dp[n][f] = ret%MOD;  
}

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  fill_n(*dp, 100010*2, -1);
  cin >> L;
  N = L.size();

  cout << dfs(0, 0) << endl;
  
  return 0;
}


Measured memory_bytes: 6736
#include<bits/stdc++.h>
#define pii pair<int, int>
#define F first
#define S second
#define pb push_back
const int N=3e5+5, INF=1e9+9, T=19;
using namespace std;
int n, arr[1<<T], best=0;
pii mx1[1<<T], mx2[1<<T], best1, best2;
signed main()
{
    cin >> n;
    int l = 1<<n;
    for(int i = 0; i < l; i++)
    {
        cin >> arr[i];
    }
    mx1[0]={arr[0], 0};
    mx2[0]={-INF, -1};
    for(int i = 1; i < l; i++)
    {
        mx1[i]={arr[i], i};
        mx2[i]={-INF, -1};
        for(int j = 0; j < T; j++)
        {
            if(i & (1<<j))
            {
                int newi = i ^ (1<<j);
                if(mx1[newi].F > mx1[i].F)
                {
                    mx2[i] = mx1[i];
                    mx1[i]=mx1[newi];
                }
                if(mx1[newi] != mx1[i])
                {
                    if(mx1[newi].F > mx2[i].F)
                    {
                        mx2[i] = mx1[newi];
                    }
                }
                if(mx2[newi].F > mx2[i].F)
                {
                    mx2[i] = mx2[newi];
                }
            }
        }
        /*if(mx1[i].F > best1.F)
        {
            best2 = best1;
            best1=mx1[i];
        }
        if(mx1[i] != best1)
        {
            if(mx1[i].F > best2.F)
            {
                mx2[i] = mx1[newi];
            }
        }
        if(mx2[newi].F > mx2[i].F)
        {
            mx2[i] = mx2[newi];
        }*/
        best=max(best, mx1[i].F + mx2[i].F);
        cout << best << " ";
    }

}

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

int main(){
  int x;
  int y;
  cin >> x >> y;
  if(y%2 == 0 && y>=x*2 && y<= x*4){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 3608
package main

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

type Edge struct {
	a int
	b int
}

type Node struct {
	id     int
	parent int
	size   int
}

type UnionFind struct {
	nodes []Node
}

func (u *UnionFind) init(n int) {
	nodes := make([]Node, n)
	for i := range nodes {
		nodes[i] = Node{
			id:     i,
			parent: -1,
			size:   1,
		}
	}
	u.nodes = nodes
}

func (u *UnionFind) findRoot(i int) Node {
	parent := u.nodes[i].parent
	if parent == -1 {
		return u.nodes[i]
	}

	root := u.findRoot(u.nodes[parent].id)
	u.nodes[i].parent = root.id

	return root
}

func (u *UnionFind) unite(root, child Node) {
	if root.size < child.size {
		root, child = child, root
	}

	u.nodes[root.id].size += child.size
	u.nodes[child.id].parent = root.id
}

func main() {
	n, m := readInt(), readInt()

	edges := make([]Edge, m)
	for i := range edges {
		a, b := readInt()-1, readInt()-1
		edges[i] = Edge{a, b}
	}

	uf := &UnionFind{}
	uf.init(n)

	ans := make([]int, m)
	ans[m-1] = n * (n - 1) / 2

	for i := m - 1; i > 0; i-- {
		root1 := uf.findRoot(edges[i].a)
		root2 := uf.findRoot(edges[i].b)

		if root1.id == root2.id {
			ans[i-1] = ans[i]
			continue
		}
		ans[i-1] = ans[i] - root1.size*root2.size

		uf.unite(root1, root2)
	}

	for i := range ans {
		fmt.Println(ans[i])
	}
}

// sort ------------------------------------------------------------

type xxx struct {
	x int
}

type sortArray []xxx

func (s sortArray) Len() int           { return len(s) }
func (s sortArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }

// -----------------------------------------------------------------

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcd(m, n int) int {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcm(m, n int) int {
	return m / gcd(m, n) * n
}


Measured memory_bytes: 8448
N = int(input())
rates = list(map(int, input().split()))

colors = [0]*9

for rate in rates:
    if rate < 3200:
        colors[rate // 400] += 1
    else:
        colors[8] += 1

zeros = colors[0:8].count(0)
nonzeros = 8 - zeros

M = nonzeros + colors[8]

if nonzeros == 0:
    m = 1
else:
    m = nonzeros

print(m, M)


Measured memory_bytes: 3060
#include<stdio.h>
#include<math.h>
using namespace std;
#define MAX 10
static const double Min = 0.000001;

int N, D;
int count;
int X[MAX][MAX];

int main() {
    scanf("%d %d", &N, &D);

    for (int i=0; i<N; i++) {
        for (int j=0; j<D; j++) {
            scanf("%d", &X[i][j]);
        }
    }

    count = 0;
    for (int i=0; i<N; i++) {
        for (int j=i+1; j<N; j++) {
            int sum = 0;
            for (int k=0; k<D; k++) {
                sum += (X[i][k]-X[j][k])*(X[i][k]-X[j][k]);
            }
            double sum_sqrt = sqrt(sum);
            int intsum = sum_sqrt;
            if (sum_sqrt-Min<=intsum && intsum<=sum_sqrt+Min) count++;
        }
    }

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

    return 0;
}

Measured memory_bytes: 128
#include<stdio.h>

int main(void){
  
  long long int N, M;
  scanf("%lld %lld", &N, &M);
  if (N == 1 && M == 1) printf("%lld", 1);
  else if (N == 1 || M == 1) printf("%lld", N*M-2);
  else if (N == 2 || M == 2) printf("%lld", 0);
  else printf("%lld", M*N-2*M-2*N+4);
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
 
int main(){
	int n,a,b;
	string s;
	cin>>n>>a>>b>>s;

	int b_rank=1,pass=0;
	for (int i = 0; i < n; i++){
		if(s[i]=='c')
			cout<<"No"<<endl;
		else if(a+b>pass&&s[i]=='a'){
			pass++;
			cout<<"Yes"<<endl;
		}
		else if(a+b>pass&&s[i]=='b'&&b_rank<=b){
			pass++;
			b_rank++;
			cout<<"Yes"<<endl;
		}else
			cout<<"No"<<endl;
	}

}

Measured memory_bytes: 896
#include<iostream>
#include<iomanip>
//#include<cstdio>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;
ll A, B, C, D;

ll gcd(ll x, ll y){
	if(y==0) return x;
	return gcd(y, x%y);
}

int main(){
	cin >> A >> B >> C >> D;

	ll g = C*D/gcd(C, D);

	cout << B-A+1 - (B/C - (A-1)/C) - (B/D - (A-1)/D) + (B/g - (A-1)/g) << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <map>
#include <algorithm>
#include <queue>
#include <tuple>
#include <functional>

#define PI 3.14159265359
#define INF 100100100100100100
#define rep(i,n) for(int i = 0; i < n; i++)
#define rep2(i,a,n) for(int i = a; i < n; i++)
#define in(a) cin >> a
#define out(a) cout << a << endl

using namespace std;

typedef long long ll;
typedef pair<ll, ll> PLL;

int main() 
{
    int ans = 0;
    int n; cin >> n;
    vector<ll> a;
   
    rep(i,n) {  
        ll tmp;
        cin >> tmp;
        if(tmp % 2 == 0) { a.push_back(tmp); }
    }
    
    for(int i = 0; i < a.size(); i++) {
        while(a[i] % 2 == 0) {
            a[i] /= 2;
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}




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

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef pair<ii, int> ri3;
#define mp make_pair
#define pb push_back
#define fi first
#define sc second
#define SZ(x) (int)(x).size()
#define ALL(x) begin(x), end(x) 
#define REP(i, n) for (int i = 0; i < n; ++i) 
#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define RFOR(i, a, b) for (int i = a; i >= b; --i)

const int MX_N = 1e5+5;

int N;
vector<ii> al[MX_N];
int sub[MX_N], p[MX_N];

int dfs(int u) {
    int x = u;
    sub[u] = 1;
    for (ii v : al[u]) if (v.fi != p[u]) {
        p[v.fi] = u;
        int y = dfs(v.fi);
        sub[u] += sub[v.fi];
        if (sub[v.fi]*2 >= N) x = y;
    }
    return x;
}

int main() {
    //freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin >> N;
    FOR(i,1,N-1){
        int A,B,C; cin >> A >> B >> C;
        al[A].emplace_back(B,C);
        al[B].emplace_back(A,C);
    }

    int c = dfs(1);
    ll ans = 0;
    FOR(i,1,N){
        for (auto& e : al[i]) {
            if (i > e.fi) continue;
            int u = (i == p[e.fi] ? e.fi : i);
            ans += 2LL * e.sc * min(sub[u],N-sub[u]);
        }
    }

    if (c == 1 || N != 2*sub[c]) { // one
        int mini = 1e9;
        for (auto& e : al[c]) { mini = min(mini,e.sc); }
        ans -= mini;
    } else {
        for (auto& e : al[p[c]]) if (e.fi == c) { ans -= e.sc; break; }
    }
    cout << ans;
}



Measured memory_bytes: 11904
#include <iostream>
using namespace std;
#define rep(i,s,n)for(int i = s;i<n;i++)
#define repe(i,s,n)for(int i = s;i<=n;i++)

int main() {
	int N; cin >> N;
	int sum = 0;

	int t = N;
	while (1) {
		sum += t % 10;
		if ((t /= 10) == 0) {
			break;
		}
	}

	cout << ((N % sum == 0) ? "Yes" : "No") << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <fstream>
#include <queue>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <sstream>

#define For(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  For(i,0,n)

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
#define SORT(c) sort((c).begin(),(c).end())
#define vi(m,a) vector<int> m(a)
#define vti(m,a,i) vector<vector<int>> m(a,vector<int>(i))
#define ALL(it,a) for(auto it = a.begin(); it!=a.end(); it++)
#define Fe(it,a) for(auto &it : a)
#define all(a) begin(a),end(a)

using namespace std;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, ll> pll;
#define WARU 1000000007;

int dx[] = { 1,0,-1,0 };
int dy[] = { 0,1,0,-1 };
void printhoge(set<int> v) {
	ALL(it, v) {
		cout << *it << " ";
	}
	cout << endl;

}
int main() {
	int n; cin >> n;
	int dp[105];
	dp[4] = 1;
	dp[7] = 1;
	rep(i, 102) {
		if (i > 7)
			dp[i] = dp[i - 4] == 1 ? 1 : dp[i-7];
	}
	if (n < 4)
		cout << "No" << endl;
	else {
		if (dp[n] == 1)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;

	}

}



Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using ll=long long;
using vi=vector<int>;
using pii=pair<int,int>;
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)
#define ITR(i,b,e) for(auto i=(b);i!=(e);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define SZ(c) ((int)c.size())
#define CONTAIN(c,x) (c.find(x)!=end(c))
#define INSEG(l,x,r) ((l)<=(x)&&(x)<(r))
#define dump(...)
#define pb push_back
#define _ 0
const signed INF_=1001001001; const long long INF=1001001001001001001LL;
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    ITR(i,begin(v),end(v))os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    ITR(i,begin(v),end(v)) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a,const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a,const U &b){return a>b?a=b,1:0;}
template <class T> void PSUM(T& c) {partial_sum(begin(c), end(c), begin(c));}
template<class T> using heap=priority_queue<T,vector<T>,greater<T>>;
struct before_main_function {
    before_main_function() {
        cin.tie(0); ios::sync_with_stdio(false);
        cout << setprecision(15) << fixed;
        #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

signed main() {
    int N, M;
    cin >> N >> M;
    vector<string> ans(M);

    vector<vector<int>> t(N);
    vector<vector<int>> c(M);
    REP(i, M) {
        int p, y;
        cin >> p >> y;
        c[i] = {y, p, i};
    }
    sort(ALL(c));

    REP(i, M) {
        int p = c[i][1];
        int idx = c[i][2];
        t[p - 1].pb(idx);
    }

    REP(i, N) {
        REP(j, SZ(t[i])) {
            int idx = t[i][j];
            stringstream ss;
            ss << setw(6) << setfill('0') << i + 1 << setw(6) << setfill('0') << j + 1;
            ans[idx] = ss.str();
        }
    }

    REP(i, M) cout << ans[i] << endl;
    return (0^_^0);
}



Measured memory_bytes: 17920
#include <bits/stdc++.h>
#include <cmath>
using namespace std;
typedef long long ll;

int N, M, K;

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

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

    cout << (f ? "Yes" : "No") << 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;
using P = pair<int,int>;

int main() {
  int n;
  cin >> n;
  int MIN = 1e9;
  int ans = MIN;
  rep(i, n) {
    int a;
    cin >> a;
    int cnt = 0;
    while(a % 2 == 0) {
      a /= 2;
      cnt++;
    }
    ans = min(ans, cnt);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3588
from math import ceil,floor
H,W=map(int,input().split())
a=float("inf")
b=0
c=-float("inf")
mi=float("inf")
if W>2:                             #縦のみ
    if W%3==0:
        a=(H*W)//3
        b=(H*W)//3
        c=(H*W)//3
    elif W%3==1:
        a=H*(W//3)
        b=H*(W//3)
        c=H*((W//3)+1)
    else:
        a=H*(W//3)
        b=H*((W//3)+1)
        c=H*((W//3)+1)
    mi=min(mi,max(a,b,c)-min(a,b,c))
if H>2:                             #横のみ
    if H%3==0:
        a=(H*W)//3
        b=(H*W)//3
        c=(H*W)//3
    elif H%3==1:
        a=W*(H//3)
        b=W*(H//3)
        c=W*((H//3)+1)
    else:
        a=W*(H//3)
        b=W*((H//3)+1)
        c=W*((H//3)+1)
    mi=min(mi,max(a,b,c)-min(a,b,c))

for i in range(1,H,1):#1ぽんの横線引く場所
    a = float("inf")
    b = W*i
    c = -float("inf")
    H1=ceil((H-i)/2)
    H2=floor((H-i)/2)
    W1=ceil(W/2)
    W2=floor(W/2)
    mi=min(mi,max(W*H1,b,W*H2)-min(W*H1,b,W*H2),max((H-i)*W1,b,(H-i)*W2)-min((H-i)*W1,b,(H-i)*W2))

for i in range(1,W,1):#1ぽんの縦線引く場所
    a = float("inf")
    b = H*i
    c = -float("inf")
    W1=ceil((W-i)/2)
    W2=floor((W-i)/2)
    H1=ceil(H/2)
    H2=floor(H/2)
    mi=min(mi,max((W-i)*H1,b,(W-i)*H2)-min((W-i)*H1,b,(W-i)*H2),max(W1*H,b,W2*H)-min(W1*H,b,W2*H))
print(mi)

Measured memory_bytes: 45144
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define cvector vector<char>
#define svector vector<string>
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll>
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define rep(i,n) for(ll i=0; i<n; ++i)
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,cnt=0;cin>>n;
  lvector ans;
  bool is_prime;
  for(ll i=2;i<=55555;i++) {
    if(i%5!=1) continue;
    is_prime=true;
    for(ll div=2;div*div<=i;++div) 
      if(i%div==0) {is_prime=false;break;}
    if(is_prime) {ans.emplace_back(i);cnt++;}
    if(cnt==n) break;
  }
  rep(i,n-1) cout<<ans[i]<<' ';print(ans[n-1]);
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define repp(i, m, n) for(int i = m, i##_len = (n); i < i##_len; ++i)
#define reprev(i, n) for(int i = (n-1LL); i >= 0; --i)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef bitset<1000> B;
typedef pair <int, B > D;
typedef long double ld;

const int INF = 2000000;
int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    B bs;
    vector<vector<D> > mat(n, vector<D>(n, make_pair(INF, bs)));
    rep (i, n) {
        mat[i][i] = make_pair(0, bs);
    }
    rep (i, m) {
        int a, b, c;
        cin >> a >> b >> c;
        a--; b--;
        B tmp;
        tmp.set(i);
        mat[a][b] = mat[b][a] = make_pair(c, tmp);
    }
    rep (k, n) {
        rep (i, n) {
            rep (j, n) {
                if (mat[i][k].first == INF || mat[k][j].first == INF) continue;
                if (chmin(mat[i][j].first, mat[i][k].first + mat[k][j].first)) {
                    mat[i][j].second = mat[i][k].second | mat[k][j].second;
                }
            }
        }
    }
    rep (i, n) {
        rep (j, n) {
            bs |= mat[i][j].second;
        }
    }
    cout << m - bs.count() << "\n";
    return 0;
}

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

int main() {
	int ax, ay, bx, by;
	cin >> ax >> ay >> bx >> by;
	int x = bx - ax;
	int y = by - ay;
	for(int i = 0;i < y;i++){
		cout << "U";
	}
	for(int i = 0;i < x;i++){
		cout << "R";
	}
	for(int i = 0;i < y;i++){
		cout << "D";
	}
	for(int i = 0;i < x;i++){
		cout << "L";
	}
	cout << "L" << "U";
	for(int i = 0;i < y;i++){
		cout << "U";
	}
	cout << "R";
	for(int i = 0;i < x;i++){
		cout << "R";
	}
	cout << "D" << "R" << "D";
	for(int i = 0;i < y;i++){
		cout << "D";
	}
	cout << "L";
	for(int i = 0;i < x;i++){
		cout << "L";
	}
	cout << "U" << endl;
}

Measured memory_bytes: 256
n=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
ans=sum(B)
for i in range(n-1):
  if(A[i]==A[i+1]-1):
    ans+=C[A[i]-1]

print(ans)

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		long x = sc.nextInt();
		sc.close();

		long ans = x / 500 * 1000;
		x %= 500;
		ans += x / 5 * 5;
		System.out.println(ans);
	}
}


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

//string型文字列をint型整数にして返す
int str_to_num(string s) {return atoi(s.c_str());}
//約数の総数を返す
int count_divisor(int n){int c[n/2] = {1}; int n_half = n/2; for(int i=2;i<n_half;i++){if(n%i==0){n /= i;c[i]+=1;i--;if(n>1) continue;else break;}  }int r = 1;for(int i=2;i<n_half;i++){r *= c[i];}return r;}
//各桁の数の和を返す
int dig_num(int n){return (n<10) ? n: dig_num(n/10) + n%10;}

int dig_ord(int n){return (n<10) ? 1: dig_ord(n/10) + 1;}

int main(){
  int N; cin >> N;
  int P; cin >> P;
  int count_odd = 0;
  int count_eve = 0;
  int a;
  REP(i,N){
    cin >> a;
    if(a%2==1){count_odd++;}
    else{count_eve++;}
  }
  
  long long r;
  if(P==1 && count_odd==0){
    r = 0;
  }
  else{
	long long a = pow(2,count_eve);
    long long b = pow(2,count_odd)/2;
    if(b==0) b=1;
    r = a*b;
  }
  cout << r << "\n";
}

Measured memory_bytes: 256
import java.io.*;

public class Main {
	public static void main(String[] args) throws Exception {
		String[] dow={"Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"};
		int[] len={2,31,29,31,30,31,30,31,31,30,31,30,31};
		BufferedReader bf =new BufferedReader(new InputStreamReader(System.in));
		String t;
		int m,d;
		for(int i=0;i<12;i++)len[i+1]+=len[i];
		while((t=bf.readLine())!=null){
			m=Integer.parseInt(t.split(" ")[0]);
			d=Integer.parseInt(t.split(" ")[1]);
			if(m==0)break;
			System.out.println(dow[(len[m-1]+d)%7]);
		}
	}
}

Measured memory_bytes: 9332
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <queue>

#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main() {
  int N;
  vector<int> w;
  vector<int> sum;
  cin >> N;
  rep(i, N) {
      int tmp;
      cin >> tmp;
      w.push_back(tmp);
      if(i>0) sum.push_back(sum[i-1]+tmp); // 累積和
      else sum.push_back(tmp);
  }
  int tmp_def = 100000;
  rep(i, N) {
      int a = sum[i];
      int b = sum[N-1]-a;
      int def =  abs(a-b);
      if(tmp_def>def) {
          tmp_def = def;
      }
  }

  cout << tmp_def << endl;
  return 0;
}



Measured memory_bytes: 256
n = str(input())

if int(n[0]) > int(n[1]):
	out = n[0]*3
elif int(n[0]) == int(n[1]):
  if int(n[1]) >= int(n[2]):
    out = n[0]*3
  else:
    out = str(int(n[0])+1)*3
else:
  out = str(int(n[0])+1)*3
    
print(out)

Measured memory_bytes: 3064
def overlap(a, b, c, d):
    if d <= a:  return False
    if b <= c:  return False
    return True

a, b = map(int, input().split())
res = 0
for i in range(int(input())):
    s, t = map(int, input().split())
    if overlap(a, b, s, t): res = 1
print(res)



Measured memory_bytes: 5600
#include <bits/stdc++.h>
using namespace std;
string n;int ans,k;
int g(int a,int b){
  int res=6;
  while(b--)res*=(a-b)*9,res/=b+1;
  return res/6;
}
int f(int i,int a){
  int rem=n.size()-i;
  return (rem<a?0:!a?1:n[i]=='0'?f(i+1,a):f(i+1,a-1)+(n[i]-'1')*g(rem-1,a-1)+g(rem-1,a));
}

int main(){
  cin>>n>>k;
  cout<<f(0,k)<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <numeric>
#include <complex>
#include <iomanip>
#include <cassert>
#include <random>
#include <cstring>


int main() {
    int k; std::cin >> k;
    std::deque<std::string> que;
    for (int i = 1; i < 10; i++) que.emplace_back(1, i + '0');
    int cnt = 0;
    while (!que.empty()) {
        auto s = move(que.front());
        que.pop_front();
        cnt++;
        if (cnt == k) {
            std::cout << s << std::endl;
            return 0;
        }
        for (char c = std::max('0', char(s.back() - 1));
             c <= std::min('9', char(s.back() + 1)); c++) {

            que.push_back(s + c);
        }
    }
    return 0;
}

Measured memory_bytes: 9648
#include<bits/stdc++.h>
using namespace std;
int n;
vector<vector<int> >g;
vector<int>vec, tree, dp, t;
vector<pair<int, int> >a;
void update(int node, int start, int end, int idx, int val){
    if(start == end){
        t[idx] = val;
        tree[node] = val;
    }
    else{
        int mid = (start + end)/2;
        if(idx <= mid){
            update(2 * node, start, mid, idx, val);
        }
        else{
            update(2 * node + 1, mid + 1, end, idx, val);
        }
        tree[node] = max(tree[2 * node], tree[2 * node + 1]);
    }
}
int query(int node, int left, int right, int l, int r){
    if(r < left || l > right){
        return 0;
    }
    else if(l <= left && r >= right){
        return tree[node];
    }
    int mid = (left + right)/2;
    int p1 = query(2 * node, left, mid, l, r);
    int p2 = query(2 * node + 1, mid + 1, right, l, r);
    int result = max(p1, p2);
    return result;
}
void dfs(int u, int p){
    int x = t[vec[u]];
    int y = query(1, 1, n, 1, vec[u] - 1) + 1;
    update(1, 1, n, vec[u], y);
    dp[u] = query(1, 1, n, 1, n);
    for(int i = 0; i < g[u].size(); i++){
        int v = g[u][i];
        if(v != p){
            dfs(v, u);
        }
    }
    update(1, 1, n, vec[u], x);
}
int main(){
    cin >> n;
    g = vector<vector<int> >(n + 3);
    vec = vector<int>(n + 3);
    tree = vector<int>(4 * n + 3, 0);
    a = vector<pair<int, int> >(n + 3);
    dp = vector<int>(n + 3);
    t = vector<int>(n + 3, 0);
    for(int i = 1; i <= n; i++){
        int x;
        cin >> x;
        a[i] = make_pair(x, i);
    }
    sort(a.begin() + 1, a.begin() + n + 1);
    a[0] = make_pair(0, 0);
    for(int i = 1; i <= n; i++){
        //cout << a[i].second << ' ' << a[i].first << '\n';
        if(a[i].first == a[i - 1].first){
            vec[a[i].second] = vec[a[i - 1].second];
        }
        else{
            vec[a[i].second] = i;
        }
    }
    for(int i = 1; i < n; i++){
        int u, v;
        cin >> u >> v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    dfs(1, 0);
    for(int i = 1; i <= n; i++){
        cout << dp[i] << '\n';
    }
    return 0;
}

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

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		PrintWriter out=new PrintWriter(System.out);
		Set<Integer> S=new HashSet<>();
		int q=Integer.parseInt(in.next());
		for(int i=0;i<q;i++) {
			int odr=Integer.parseInt(in.next());
			if(odr==0) {
				int x=Integer.parseInt(in.next());
				S.add(x);
				out.println(S.size());
			}
			else {
				int x=Integer.parseInt(in.next());
				out.println((S.contains(x))? 1 : 0);
			}
		}
		out.flush();
	}

}



Measured memory_bytes: 114232
#include <iostream>
#include <string>
using namespace std;
int main() {
	int n;
	cin >> n;
	int ts = 0, hs = 0;
	for (int i = 0; i < n; i++) {
		string t, h;
		cin >> t >> h;
		if (t == h) {
			ts += 1;
			hs += 1;
		}
		if (t > h) {
			ts += 3;
		}
		if (t < h) {
			hs += 3;
		}
	}
	cout << ts << " " << hs << endl;
	return 0;
}


Measured memory_bytes: 3168
#include <stdio.h>

int main() {
  int n;
  scanf("%d",&n);
  int a[n],i,j;
  for(i=0; i<n; i++) scanf("%d",&a[i]);

  for(i=0; i<n; i++) {
    for(j=i-1; j>=0; j--) {
      if(a[j]>a[j+1]) {
	int tmp=a[j];
	a[j]=a[j+1];
	a[j+1]=tmp;
      } else break;
    }
    for(j=0; j<n; j++) {
      if(j) printf(" ");
      printf("%d",a[j]);
    }
    printf("\n");
  }
  return 0;
}


Measured memory_bytes: 2072
#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 ALL(v) v.begin(), v.end()
#define downque(que)  priority_queue<ll> que;
#define upque(que) priority_queue<ll, vector<int>, greater<int>> que;
typedef long long ll;
typedef vector<vector<int> > Matrix;
const int MOD = 1e9+7;
const int INF =1000000;


int main(){
int n; cin>>n;
int flag=1;

vector<int> v(n);
REP(i,n)cin>>v[i];

int count=0;
REP(i,n){
   if(v[i]!=flag)count++;
   else flag++;
}
if(count==n)cout<<"-1"<<endl;
else cout<<count<<endl;
}

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)     (a).begin(),(a).end()
#define MOD 1000000007

typedef long long int ll;

const ll INF=(ll)1e19;
//const int INF=(1<<30);


int main(){
  int a,b;
  cin >> a >> b;
  int ans=0;
  FOR(i,a,b+1){
    string s = to_string(i);
    string t = to_string(i);

    reverse(ALL(t));

    if(s==t)ans++;
  }
  cout << ans << endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define arep(i,x,n) for(long long i=int(x);i<(int)(n);i++)
#define rep(i,n) for(long long i = 0;i < n;++i)
#define rrep(i,n) for(long long i=int(n);i>0;i--)
#define fs first
#define sc second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9+5  
using ll = long long; 
using P=pair<int,int>;
using lP=pair<ll,ll>;
using fP=pair<double,double>;
using PPI=pair<P,int>;
//ll const mod=998244353;
ll const mod=1e9+7;
const ll MAX=1000005;
using vi=vector<int>;
using vl=vector<ll>;
using vc=vector<char>;
using vd=vector<double>;
using vs=vector<string>;
using vp=vector<P>;
using vb=vector<bool>;
using vvi =vector<vector<int>>;
using vvl =vector<vector<ll>>;
using vvd=vector<vector<double>>;
using vvc=vector<vector<char>>;
using vvp =vector<vector<P>>;
using vvb=vector<vector<bool>>;
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}


int main(){
    int a,b;
    cin>>a>>b;
    if(a>>0&1&&b>>0&1)cout<<"Odd"<<endl;
    else cout<<"Even"<<endl;
    return 0;
}

Measured memory_bytes: 3552
import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    List<String> words;
    words=new ArrayList<>(Arrays.asList("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"));
    int num = Integer.parseInt(sc.next());
    String line = sc.next();
    for(int i = 0; i < line.length(); i++){
      String word = line.substring(i,i+1);
      if(words.indexOf(word)+num > 25){
        System.out.print(words.get(words.indexOf(word)+num-26));
      }else{
        System.out.print(words.get(words.indexOf(word)+num));
      }
    }
    System.out.println();
  }
}

Measured memory_bytes: 25760
#include<iostream>
#include<string>
#include<set>
#include<algorithm>
#include<vector>

using namespace std;

typedef vector<int> vi;
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)

typedef pair<int, int> pi;
#define mp make_pair
#define f  first
#define s  second

typedef long long ll;
typedef long double ld;

/*
const int MOD = 1e9+7;
const int MX =  2e5+5;
const ll  INF = 1e18;
const ld  PI = acos((ld)-1);
*/

template <class array>
inline void array_input(array a[], size_t  n){
  for(size_t i = 0; i < n; i++)
    cin >> a[i];
}

template <class array>
inline void array_init(array a[], array value, size_t n){
  for(size_t i = 0; i < n; i++)
    a[i] = value;
}


int main(){/*
  int t;

  cin >> t;
 
  while(t--)*//*for(int m = 1; m <= t; m++)*/{
    /* input for each test case */
    int n, k;
    cin >> n >> k;
    int a[n];
    array_input(a, n);
    
    /* calcultion for each test case */
    for(int i = k; i < n; i++){
      if(a[i] > a[i-k]) cout << "Yes\n";
      else cout << "No\n";
    }
    
    /* output of each test */
    
    
  }

  return 0;
}



Measured memory_bytes: 4392
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <tuple>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
#define dump(val) cerr << __LINE__ << ":\t" << #val << " = " << (val) << endl

using namespace std;

typedef long long int lli;
typedef tuple<int, int, int> tp;

int dp[100][100][100] = {0};

int main() {
    int A, B, C;
    cin >> A >> B >> C;
    queue<tp> q;
    q.emplace(A, B, C);
    const int inf = 1 << 30;
    REP(i, 0, 100) {
        REP(j, 0, 100) {
            REP(k, 0, 100) {
                dp[i][j][k] = inf;
            }
        }
    }
    dp[A][B][C] = 0;
    while (q.size()) {
        int a, b, c;
        tie(a, b, c) = q.front();
        q.pop();
        if (a >= 90 || b >= 90 || c >= 90) continue;
        int cost = dp[a][b][c];
        int da[] = {2, 0, 0, 1, 1, 0};
        int db[] = {0, 2, 0, 1, 0, 1};
        int dc[] = {0, 0, 2, 0, 1, 1};
        REP(k, 0, 6) {
            if (cost + 1 < dp[a + da[k]][b + db[k]][c + dc[k]]) {
                dp[a + da[k]][b + db[k]][c + dc[k]] = cost + 1;
                q.emplace(a + da[k], b + db[k], c + dc[k]);
            }
        }
    }
    int ans = inf;
    REP(i, 0, 100) {
        ans = min(ans, dp[i][i][i]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4224
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Threading;
using System.IO.Pipes;
using System.ComponentModel;
using System.Drawing;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            String S = Console.ReadLine();

            int ans = 0;
            int flag = 0;

            if (S[0] == 'R') 
            {
                ans = 1;
                flag = 1;
            }

            if (S[1] == 'R')
            {
                if (flag == 0)
                {
                    ans = 1;
                    flag = 1;
                }
                else               {
                    ans++;
                    flag = 1;
                }
            }
            else 
            {
                flag = 0;
            }

            if (S[2] == 'R')
            {
                if (flag == 0)
                {
                    ans = 1;
                }else
                {
                    ans++;
                    flag = 1;
                }
            }


            Console.WriteLine(ans);

        }

    }
}


Measured memory_bytes: 25860
import java.util.*;

public class Main {
    static private Scanner sc = new Scanner(System.in);
    static int n = 0;
    static ArrayList<Integer> a = new ArrayList<>(20000);
    static ArrayList<Integer> b = new ArrayList<>(20000);
    
    public static void main(String[] args) {
        n = sc.nextInt();
        for(int i = 1; i <= n; ++i) {
            a.add(sc.nextInt());
            b.add(a.get(i - 1) - i);
        }
        
        Collections.sort(b);
        
        long median = (n % 2 == 1) ? b.get(n / 2) : b.get(n / 2) + (b.get(n / 2 - 1) - b.get(n / 2)) / 2;
        long ans = 0;
        for(int i = 0; i < n; ++i) {
            ans += Math.abs(b.get(i) - median);
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 98268
(arg => {
  const N = arg|0;
  switch( N % 10 ) {
    case 2:
    case 4:
    case 5:
    case 7:
    case 9: return console.log('hon');
    case 0:
    case 1:
    case 6:
    case 8: return console.log('pon');
    case 3: return console.log('bon');
  }
})(require('fs').readFileSync('/dev/stdin', 'utf8'))

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

int mn[100010];

int main() {
	int K;
	cin >> K;
	deque<int> dq{1};
	for(int i=0; i<K; ++i) mn[i]=1e6;
	mn[1]=1;
	while(1){
		int s=dq[0];
		dq.pop_front();
		if(s==0) break;
		if(mn[s]+1<mn[(s+1)%K]){
			dq.push_back((s+1)%K);
			mn[(s+1)%K]=mn[s]+1;
		}
		if(mn[s]<mn[(s*10)%K]){
			dq.push_front((s*10)%K);
			mn[(s*10)%K]=mn[s];
		}
	}
	cout << mn[0] << endl;
	return 0;
}

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

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    for(int i=0; i<N; ++i) cin >> A[i];

    if(N == 1) {
        cout << 1 << endl;
        return 0;
    }

    int res = 1;
    int inc = 0;
    if(A[0] < A[1]) inc = 1;
    else if(A[0] > A[1]) inc = -1;
    for(int i=1; i+1<N; ++i) {
        if(A[i] < A[i+1]) {
            if(inc == 1) continue;
            else if(inc == 0) inc = 1;
            else {inc = 0; ++res;}
        }
        if(A[i] > A[i+1]) {
            if(inc == 1) {inc = 0; ++res;}
            else if(inc == 0) inc = -1;
            else continue;
        } 
    }
    cout << res << endl;
}

Measured memory_bytes: 640
#include<stdio.h>

int n, A[50];

int solve (int i, int m) {
    if ( m == 0 ) return 1;
    if ( i >= n ) return 0;
    int res = solve(i + 1, m) || solve(i + 1, m - A[i]);
    return res;
}
int main() {
    int q, M, i;
    
    scanf("%d", &n);
    for ( i = 0; i < n; i++ ) scanf("%d", &A[i]);
    scanf("%d", &q);
    for ( i = 0; i < q; i++ ) {
        scanf("%d", &M);
        if ( solve(0, M) ) printf("yes\n");
        else printf("no\n");
    }
    
    return 0;
}


Measured memory_bytes: 2692
#include <cstdio>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

long long getLen(long long n)
{
    long long ret = 0;

    long long a = 1;
    long long b = 9;
    long long len = 1;
    while(a <= n){
        b = min(b, n);
        long long fizzbuzz = b / 15 - (a - 1) / 15;
        long long fizz = b / 3 - (a - 1) / 3 - fizzbuzz;
        long long buzz = b / 5 - (a - 1) / 5 - fizzbuzz;

        ret += fizzbuzz * 8 + fizz * 4 + buzz * 4;
        ret += (b - a + 1 - fizzbuzz - fizz - buzz) * len;

        a *= 10;
        b = (b * 10) + 9;
        ++ len;
    }

    return ret;
}

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

    long long a = 0;
    long long b = 100000000000000000LL;
    while(a < b){
        long long c = (a + b + 1) / 2;
        if(getLen(c) < n)
            a = c;
        else
            b = c - 1;
    }

    ostringstream oss;
    while(oss.str().size() < 100){
        ++ a;
        if(a % 3 ==  0 || a % 5 == 0){
            if(a % 3 == 0)
                oss << "Fizz";
            if(a % 5 == 0)
                oss << "Buzz";
        }else{
            oss << a;
        }
    }

    string s = oss.str();
    cout << s.substr(n - getLen(b) - 1, 20) << endl;

    return 0;
}

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

using namespace std;

#define fore(i, s, e) for(int i = s; i < e; i++)
#define SZ(a) ((int)a.size())
#define ALL(a) a.begin(), a.end()
#define pb push_back
#define fst first
#define snd second
#define FIN ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'

typedef long long ll;

const int N = 1e5 + 10;

int res[N];
vector<int> g[N];

void bfs() {
  memset(res, -1, sizeof res);
  res[0] = 0;
  queue<pair<int, int>> q;
  for(auto v : g[0]) q.push({v, 0});
  while(!q.empty()) {
    int v = q.front().fst;
    int p = q.front().snd;
    q.pop();
    if(res[v] != -1) continue;
    res[v] = p;
    for(auto x : g[v]) if(res[x] == -1) q.push({x, v});
  }
}

int main() {
  int n, m; cin >> n >> m;
  fore(i, 0, m) {
    int a, b; cin >> a >> b; a--, b--;
    g[a].pb(b);
    g[b].pb(a);
  }

  bfs();
  cout << "Yes" << endl;
  fore(i, 1, n) cout << res[i] + 1 << endl;

}

Measured memory_bytes: 10932