akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

typedef int itn;
typedef long long ll;
typedef unsigned long long ull;

using namespace std;

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

    int h, w;
    cin >> h >> w;
    string s[h];
    for (int i = 0; i < h; ++i) cin >> s[i];
    for (int i = 0; i < h; ++i)
    {
        for (int j = 0; j < w; ++j)
        {
            char sij = s[i][j];
            if(sij == '.') continue;
            int x,y;
            x = i; y = j-1;
            bool f = true;
            if ((x >= 0) && (y >= 0) && (x < h) && (y < w)) {
                if (sij != s[x][y]) {
                    f = false;
                }
                else {
                    f = true; 
                    continue;
                }
            }
            x = i; y = j+1;
            if ((x >= 0) && (y >= 0) && (x < h) && (y < w)) {
                if (sij != s[x][y]) {
                    f = false;
                }
                else {
                    f = true; 
                    continue;
                }
            }
            x = i-1; y = j;
            if ((x >= 0) && (y >= 0) && (x < h) && (y < w)) {
                if (sij != s[x][y]) {
                    f = false;
                }
                else {
                    f = true; 
                    continue;
                }
            }
            x = i+1; y = j;
            if ((x >= 0) && (y >= 0) && (x < h) && (y < w)) {
                if (sij != s[x][y]) {
                    f = false;
                }
                else {
                    f = true; 
                    continue;
                }
            }
            if (!f){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	static final int NONE = 0;
	static final int BLACK = 1;
	static final int WHITE = 2;

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		while(true){
			String[] tmpArray = br.readLine().split(" ");

			int n = Integer.parseInt(tmpArray[0]);
			int m = Integer.parseInt(tmpArray[1]);
			int p = Integer.parseInt(tmpArray[2]);

			if(n == 0){
				break;
			}

			int input[][] = new int[p][2];
			for(int i = 0; i < p; i++){
				tmpArray = br.readLine().split(" ");

				int x = Integer.parseInt(tmpArray[0]);
				int y = Integer.parseInt(tmpArray[1]);

				input[i][0] = x;
				input[i][1] = y;
			}

			//少し大きめに作るときっと探索しやすい
			int space[][][] = new int[n + 2][n + 2][n + 2];

			for(int i = 0; i < p; i++){
				int player;
				if(i % 2 == 0){
					player = BLACK;
				}
				else {
					player = WHITE;
				}
				int len = put(space, input[i][0], input[i][1], player);
//				System.out.println("turn "+(i + 1) + " len "+ len);

				if(len >= m){
					if(player == BLACK){
						System.out.print("Black ");
					}
					else {
						System.out.print("White ");
					}
					System.out.println(i + 1);

					break;
				}
				else if(i == p - 1){
					System.out.println("Draw");
				}
			}
		}
	}

	//探索用ベクトル
	static int vecX[] = {1,0,0,   1, 1, 0, 0, 1, 1,    1, 1, 1, 1};
	static int vecY[] = {0,1,0,   1,-1, 1, 1, 0, 0,    1, 1,-1,-1};
	static int vecZ[] = {0,0,1,   0, 0, 1,-1, 1,-1,    1,-1, 1,-1};

	static int put(int[][][] space, int x, int y, int player){
		int result = 0;
		//置ける高さを探す
		for(int i = 1; i < space.length; i++){
			if(space[x][y][i] == NONE){
				space[x][y][i] = player;
//				System.out.println("put at "+x+" "+ y+" "+i);

				//各方向にいくつ連続しているかを調べる
				for(int j = 0; j < vecX.length; j++){
//					System.out.println("checking pattern:" + j);
					int tmpLen = 1;

					//順方向
					int k = 1;
					while(space[x + k*vecX[j]][y + k*vecY[j]][i + k*vecZ[j]] == player){
//						System.out.println("look at " + (x + vecX[j])+" "+(y + vecY[j])+" "+ (i + vecZ[j]) );
						tmpLen++;
						k++;
					}
					//逆方向
					k = 1;
					while(space[x - k*vecX[j]][y - k*vecY[j]][i - k*vecZ[j]] == player){
//						System.out.println("look at " + (x - vecX[j])+" "+(y - vecY[j])+" "+ (i - vecZ[j]) );
						tmpLen++;
						k++;
					}
					result = Math.max(result, tmpLen);
				}

				break;
			}
		}

		return result;
	}
}



Measured memory_bytes: 40708
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        A solver = new A();
        solver.solve(1, in, out);
        out.close();
    }

    static class A {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int k = in.nextInt();
            int a = in.nextInt();
            int b = in.nextInt();

            int ans = b / k * k;
            if (ans >= a) {
                out.println("OK");
            } else {
                out.println("NG");
            }


        }

    }
}



Measured memory_bytes: 35700
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int inf = 1000000000; 

int main(){
  ll n,k;
  cin >> n >> k;
  bool boo = true;
  ll a;
  ll b;
  if(n-k > k){
    b = (n-k)/k;
    n = n-b*k;
  }
  
 
  while(boo){
    a = n;
    n = abs(n-k);
    if(n >= a){
      boo = false;
    }
  }
  cout << a << endl;
}

Measured memory_bytes: 256
// Aizu 0361: Wire
// 2017.9.19 bal4u@uu
#include <stdio.h>

int gcd(int a, int b)
{
	int r;
	while (b != 0) r = a % b, a = b, b = r;
	return a;
}

int main()
{
	int x, y;
	scanf("%d%d", &x, &y);
	printf("%d\n", 1+x+y-gcd(x,y));
	return 0;
}

Measured memory_bytes: 1836
n = int(input())
sraw = dict()

for nn in range(n):
    i = "".join(sorted(input()))
    if i in sraw:
        sraw[i] += 1
    else:
        sraw[i] = 1

ans = 0

for ss in sraw:
    ans += round(sraw[ss]*(sraw[ss]-1)/2)

print(ans)


Measured memory_bytes: 17852
#include "bits/stdc++.h"
using namespace std;

// GNU C Compiler
//template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }

// type
using ll = int_fast64_t;
using ull = uint_fast64_t;
using LL = long long;
using ULL = unsigned long long;
using PII = pair<int, int>;
//using pair<T1, T2> = p12;

//container
#define PB emplace_back
#define MP make_pair 
#define SZ(a) int((a).size())
#define ALL(v) v.begin(),v.end()

//repetition
#define REP(n) for(int i=0; i<(n); i++)
#define REPj(n) for(int j=0; j<(n); j++)
#define REPinit(i,a,n) for(int i=(a); i<(n); i++)
#define REPinitj(j,a,n) for(int j=(a); j<(n); j++)

//algorithm
//#define SORT(c) sort((c).begin(),(c).end())

//constant

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//Optimizer
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

/*
    add utility Algorithm
*/


int costChar(char& a, char& b) {
    if (a == b) return 0;
    else return 1;
}

int main(int argc, char const* argv[])
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    string S, T;
    cin >> S >> T;

    int ans = 0;

    REPinit(i, 0, S.size()) {
        ans += costChar(S.at(i), T.at(i));
    }

    cout << ans << endl;
    

    return 0;
}


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

int main(){
  ll s;
  cin>>s;
  ll a=1e9,b=1,c,d;
  if(s%a==0){
    d=s/a; c=0;
  }else{
    d=s/a+1; c=1e9-s%a;
  }
  cout<<0<<" "<<0<<" "<<a<<" "<<b<<" "<<c<<" "<<d<<endl;
}

Measured memory_bytes: 3636
import java.util.*;
public class Main {
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
int A=sc.nextInt();
int B=sc.nextInt();

if( A <= 8 && B <= 8) {
	System.out.println("Yay!");
} else {
	System.out.println(":(");
}



}
}

Measured memory_bytes: 21716
/*  -*- coding: utf-8 -*-
 *
 * d.cc: D - Xor Sum 4
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int BN = 60;
const int MOD = 1000000007;

/* typedef */

typedef long long ll;

/* global variables */

int bcs[BN];

/* subroutines */

/* main */

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

  for (int i = 0; i < n; i++) {
    ll ai;
    scanf("%lld", &ai);

    for (int j = 0; j < BN; j++)
      if ((ai & (1LL << j)) != 0) bcs[j]++;
  }

  int sum = 0;
  for (int i = 0; i < BN; i++) {
    int d = (1LL << i) % MOD * bcs[i] % MOD * (n - bcs[i]) % MOD;
    sum = (sum + d) % MOD;
  }

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


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

int N, K;
long long a[5010];
bool dp1[5010][5010], dp2[5010][5010];
vector<int> acc[5010];

int main() {
    cin.tie(0); ios::sync_with_stdio(false);
    cin >> N >> K;
    rep(i, N) cin >> a[i];
    
    dp1[0][0] = true;
    rep(i, N) rep(j, K) {
        dp1[i+1][j] |= dp1[i][j];
        if (j+a[i]<K) dp1[i+1][j+a[i]] |= dp1[i][j];
    }
    dp2[0][0] = true;
    rep(i, N) rep(j, K) {
        dp2[i+1][j] |= dp2[i][j];
        if (j+a[N-1-i]<K) dp2[i+1][j+a[N-1-i]] |= dp2[i][j];
    }
    
    rep(i, N) {
        acc[i].pb(0);
        rep(j, K) acc[i].pb(acc[i].back()+dp2[i][j]);
    }
    int ans = 0;
    rep(i, N) {
        bool need = false;
        rep(j, K) {
            if (dp1[i][j]==0) continue;
            int l = max(0ll, K-a[i]-j);
            int h = K-j;
            if (acc[N-i-1][h]-acc[N-i-1][l]>0) need = true;
        }
        if (!need) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 170044
#include <bits/stdc++.h>
typedef unsigned long long ull;
typedef long long ll;
#define __TRUE "Yes"
#define __FALSE "No"
#define cout(x) cout << (x) << endl
#define MAX 100001
using namespace std;

int main() {
  ll N,M,ans;
  cin >> N >> M;
  if( (N-2)*(M-2)>=0) ans = (N-2)*(M-2);
  else if(N==1 && M!=1) ans = M-2;
  else if(N!=1 && M==1) ans = N-2;
  else ans = 1;
  cout << ans << endl;
}

Measured memory_bytes: 256
// by adiforluls
#pragma GCC optimize ("-O2")
#include<bits/stdc++.h>
using namespace std;
#define FAST   ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define ll          long long
#define ld          long double
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define mii         map<int,int>
#define vi          vector<int>
#define vll         vector<long long>
#define all(a)      (a).begin(),(a).end()
#define clz(a)      __builtin_clz(a) // count leading zeroes
#define ctz(a)      __builtin_ctz(a) // count trailing zeroes
#define popc(a)     __builtin_popcount(a) // count set bits (for ints only diff for ll)
#define lul         1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define SIZE        1000005
#define F           first
#define S           second
#define debug(x)    cerr << #x << " = " << x << endl;
#define mod         998244353

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    std::cerr << name << " = " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " = " << arg1<<" |";__f(comma+1, args...);
}
#else
#define trace(...)
#endif

#define endl        '\n'
const ld PI = acos(-1.0);
const int INF = 0x3f3f3f3f;

void solve()
{
   string s; cin>>s;
   int w; cin>>w;
   int n=s.size();
   for(int i=0; i<n; i+=w)
   {
     cout<<s[i];
   }  
} 
int main()
{   
   FAST;
   //  #ifndef ONLINE_JUDGE
     // freopen("input.txt", "r", stdin);
     // freopen("output.txt", "w", stdout);
   //  #endif
    int t; t=1;
    while(t--){
       solve();
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " " << (x) << endl
using namespace std;

const int N = 2005, M = 40;

template <class T>
void read (T &x) {
	int sgn = 1;
	char ch;
	x = 0;
	for (ch = getchar(); (ch < '0' || ch > '9') && ch != '-'; ch = getchar()) ;
	if (ch == '-') ch = getchar(), sgn = -1;
	for (; '0' <= ch && ch <= '9'; ch = getchar()) x = x * 10 + ch - '0';
	x *= sgn;
}
template <class T>
void write (T x) {
	if (x < 0) putchar('-'), write(-x);
	else if (x < 10) putchar(x + '0');
	else write(x / 10), putchar(x % 10 + '0');
}

int n;
long long mod, fac[N * 3], inv[N * 3], f[N * 3][N * 4 + N / 2]; 

int main () {
	read(n), read(mod);

	fac[0] = 1ll;
	for (int i = 1; i <= n * 3; i++) fac[i] = fac[i - 1] * i % mod;

	inv[1] = 1ll;
	for (int i = 2; i <= n * 3; i++) inv[i] = (mod / i) * (mod - inv[mod % i]) % mod;


	for (int i = 0; i <= n * 6; i++) f[0][i] = 0ll;
	f[0][n * 3] = 1ll;
	
	for (int i = 1; i <= n * 3; i++) {
		for (int j = -i; j <= i / 2; j++) {
			f[i][j + n * 3] = 0ll;
			for (int k = 1; k <= 3; k++) {
				if (i < k) continue;
				int j_ = j;
				if (k == 1) j_++;
				if (k == 2) j_--;
				f[i][j + n * 3] = (f[i][j + n * 3] + f[i - k][j_ + n * 3]) % mod;
			}
			f[i][j + n * 3] = f[i][j + n * 3] * inv[i] % mod;
		}
	}

	long long ans = 0ll;
	for (int i = 0; i <= n * 3; i++) ans = (ans + f[n * 3][i]) % mod;
	write(ans * fac[n * 3] % mod), putchar('\n');
	return 0;
}

Measured memory_bytes: 422400
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<unordered_map>
#include<random>
#include<array>
#include<cassert>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define uniq(v) v.erase(unique(all(v)),v.end())


int h, w;
string s[2000];


int hoge[2000][2000];
int fuga[2000][2000];

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

	cin >> h >> w;
	rep(i,h) {
		cin >> s[i];
	}

	rep(y, h) {
		int len = 0;
		rep(x,w) {
			if (s[y][x] == '#') {
				len = 0;
			}
			else {
				len++;
			}
			hoge[y][x] = len;
		}
		for (int x = w - 1; x >= 0; x--) {
			if (hoge[y][x] == 0) {
				len = 0;
			}
			else {
				if (len == 0)len = hoge[y][x];
			}
			hoge[y][x] = len;
		}
	}

	rep(x, w) {
		int len = 0;
		rep(y, h) {
			if (s[y][x] == '#') {
				len = 0;
			}
			else {
				len++;
			}
			fuga[y][x] = len;
		}
		for (int y = h - 1; y >= 0; y--) {
			if (fuga[y][x] == 0) {
				len = 0;
			}
			else {
				if (len == 0)len = fuga[y][x];
			}
			fuga[y][x] = len;
		}
	}

	int ans = 0;
	rep(y,h)rep(x,w) {
		ans = max(ans, hoge[y][x] + fuga[y][x] - 1);
	}

	cout << ans << endl;

	return 0;
}

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

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)

using ll = long long;
using ld = long double;
ll INF = LLONG_MAX;

using vi = vector<int>;
using vll = vector<ll>;
using pii = pair<int, int>;

namespace output {
	void pr(int x) { cout << x; }
	void pr(long x) { cout << x; }
	void pr(ll x) { cout << x; }
	void pr(unsigned x) { cout << x; }
	void pr(unsigned long x) { cout << x; }
	void pr(unsigned long long x) { cout << x; }
	void pr(float x) { cout << x; }
	void pr(double x) { cout << x; }
	void pr(ld x) { cout << x; }
	void pr(char x) { cout << x; }
	void pr(const char* x) { cout << x; }
	void pr(const string& x) { cout << x; }
	void pr(bool x) { pr(x ? "true" : "false"); }
	template<class T> void pr(const complex<T>& x) { cout << x; }
	
	template<class T1, class T2> void pr(const pair<T1,T2>& x);
	template<class T> void pr(const T& x);
	
	template<class T, class... Ts> void pr(const T& t, const Ts&... ts) { 
		pr(t); pr(ts...); 
	}
	template<class T1, class T2> void pr(const pair<T1,T2>& x) { 
		pr("{",x.f,", ",x.s,"}"); 
	}
	template<class T> void pr(const T& x) { 
		pr("{"); // const iterator needed for vector<bool>
		bool fst = 1; for (const auto& a: x) pr(!fst?", ":"",a), fst = 0; 
		pr("}");
	}
	
	void print() { pr("\n"); } // print w/ spaces
	template<class T, class... Ts> void print(const T& t, const Ts&... ts) { 
		pr(t); if (sizeof...(ts)) pr(" "); print(ts...); 
	}
}

using namespace output;

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int X, Y, Z; cin >> X >> Y >> Z;
	swap(X, Y);
	swap(X, Z);
	print(X, Y, Z);
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<utility>
#include<cmath>
#include<string>
#include<cstring>
#include<map>
#include<queue>
#include<set>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define prin(arg) cout<<arg<<"\n"
#define prin2(arg1,arg2) cout<<arg1<<" "<<arg2<<"\n"
#define fill(arg,n) memset(arg,n,sizeof(arg))
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef set<int> si;
typedef string str;
const int INF=1e+9;
const ll INFLL=1e+17;
const ll MOD=1e+9+7;
int L,R;
const int mod=2019;
int main(){
  cin>>L>>R;
  if(R-L>=2018) prin(0);
  else{
    int m=INF;
    for(int i=L;i<R;i++){
      for(int j=i+1;j<=R;j++){
	int temp=(i%mod)*(j%mod)%mod;
	m=min(m,temp);
      }
    }
    prin(m);
  }
  return 0;
}


Measured memory_bytes: 256
from collections import Counter

def resolve():
    N = int(input())
    c = Counter()
    for _ in range(N):
        c.update([input().strip()])

    ans = []
    commons = c.most_common()
    N = commons[0][1]
    for s,c in commons:
        if N != c:
            break
        ans += [s]
    print('\n'.join(sorted(ans)))

resolve()

Measured memory_bytes: 120024
N ,X, Y = map(int, input().split())

X -= 1
Y -= 1
k = [0]*N

for i in range(N-1):
    for j in range(i+1, N):
        a = j-i
        b = abs(i-X)+1+abs(Y-j)
        c = abs(j-X)+1+abs(Y-i)
        m =  min(a, b, c)
        k[m] += 1

for i in range(1, N):
    print(k[i])

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

int main(){
    int n;
    cin >> n;
    int a[n];
    for(int i=0;i<n;i++) cin >> a[i];
    int res=0;
    for(int i=0;i<n;i++){
        while(i+1<n&&a[i]==a[i+1]) i++;
        if(i+1<n&&a[i]<a[i+1]){
            while(i+1<n&&a[i]<=a[i+1]) i++;
        }
        else if(i+1<n&&a[i]>a[i+1]){
            while(i+1<n&&a[i]>=a[i+1]) i++;
        }
        res++;
    }
    cout << res << endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<cstring>
using namespace std;
int a[102][102],b[102][102],w,h;
int dy[]={0,1,1,0,-1,-1},od[]={1,1,0,-1,0,1},ev[]={1,0,-1,-1,-1,0};
void fn(int x,int y){
  int i;
  if(x<0||x>w+1||y<0||y>h+1||a[x][y]||b[x][y])
    return;
  b[x][y]=1;
  if(y&1){
    for(i=0;i<6;++i)
      fn(x+od[i],y+dy[i]);
  }else{
    for(i=0;i<6;++i)
      fn(x+ev[i],y+dy[i]);
  }
}
int main(){
  int i,j,k;
  cin>>w>>h;
  memset(a,0,sizeof(a));
  for(i=1;i<=h;++i)
    for(j=1;j<=w;++j)
      cin>>a[j][i];
  memset(b,0,sizeof(b));
  fn(0,0);
  int ct=0;
  for(i=1;i<=h;++i){
    for(j=1;j<=w;++j){
      if(!a[j][i])
	continue;
      if(i&1){
	for(k=0;k<6;++k)
	  ct+=b[j+od[k]][i+dy[k]];
      }else{
	for(k=0;k<6;++k)
	  ct+=b[j+ev[k]][i+dy[k]];
      }
    }
  }
  cout<<ct<<endl;
  return 0;
}

Measured memory_bytes: 0
import java.util.*;
import java.io.*;

public class Main {
	static class FS {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer("");

		String next() {
			while (!st.hasMoreTokens())
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		int[] readArray(int n) {
			int[] a = new int[n];
			for (int i = 0; i < n; i++)
				a[i] = nextInt();
			return a;
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		public long[] readLongArray(int n) {
			long[] a = new long[n];
			for (int i = 0; i < n; i++)
				a[i] = nextLong();
			return a;
		}
	}

	static final FS sc = new FS();
	static final PrintWriter out = new PrintWriter(System.out);
	static final int mod = 1000000007;

	public static void main(String[] args) {
		solve();
		out.close();
	}

	static void solve() {
		long n = sc.nextInt();
		while(true) {
		if (n % 2 == 0) {
			out.println(n);
			break;
		} else {
			n = n * 2;
			
		}
		}

	}

}


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

int main(void)
{
	int num;
	cin >> num;
	int rou, sq;
	for (sq = 1; sq*sq <= num; sq++) {
		
	}
	if(sq!=1)
		sq--;
	cout << sq * sq << endl;
	
}

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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
//#define int ll
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef vector< vvi > vvvi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<string> vst;
typedef vector<vst> vvst;
typedef pair<ld, ld> pld;
typedef complex<double> base;

#define inmin(a, b) a = min(a, (b))
#define inmax(a, b) a = max(a, (b))
#define mp(a,b) make_pair(a,b)
#define modsum(a, b) ((a) + (b) >= M ? (a) + (b) - M : (a) + (b))
#define modsubtract(a, b) ((a) - (b) < 0 ? (a) - (b) + M : (a) - (b))
#define modmultiply(a, b) (((a) * (b)) % M)
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define sqr(x) ((x) * (x))
#define fori(i, n) for(int i = 0; i < int(n); ++i)
#define cint const int &
#define SZ(a) ((int)((a).size()))
#define watch(x) cout << (#x) << " = " << (x) << endl;

const double PI = 2 * acos(0.0);

const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";


inline void transpose(vector<string> &a) {

    int n = a.size();
    if (n == 0) return;
    int m = a[0].size();
    vector<string> b(m, string(n, ' '));
    fori (i, n) fori (j, m) b[j][i] = a[i][j];
    a = b;
}


template<class T>
inline ostream & operator << (ostream &out, vector<T> &a) {
    out << "{";
    fori (i, SZ(a))
        out << a[i] << vector<string>{", ", "}"}[i + 1 == SZ(a)];
    return out;
}

void smain();

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


#ifdef MAX_HOME
    freopen("input.txt", "r", stdin);
    clock_t start = clock();
#define cerr cout
#endif
    cout << setprecision(12) << fixed;
    smain();
#ifdef MAX_HOME
    cout << "\n\n\n\n";
    cout << "TOTAL EXECUTION TIME: " << float( clock () - start ) /  CLOCKS_PER_SEC << endl;
#endif
}


const int N = 21;
const int M = 1e9 + 7;
int dp[1 << N][N + 1];
int a[N][N];

void smain() {

    int n;
    cin >> n;
    fori (i, n) fori (j, n) cin >> a[i][j];

    dp[0][0] = 1;
    for (int i = 0; i < n; ++i) {
        for (int mask = 0; mask < (1 << n); ++mask) if (dp[mask][i]) {
            for (int j = 0; j < n; ++j) if (!((mask >> j) & 1) && a[i][j]) {
                int new_mask = mask | (1 << j);
                dp[new_mask][i + 1] = (dp[new_mask][i + 1] + dp[mask][i]) % M;
            }
//            cerr << "[" << mask << "][" << i << "]" << endl;
        }
    }
    cout << dp[(1 << n) - 1][n];
}

Measured memory_bytes: 180480
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace atcoder_Calc1
{
    class Program
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            double b = a + Math.Pow(a, 2) + Math.Pow(a, 3);

            Console.WriteLine((int)b);

            return;

        }
    }
}


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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for(int i = a; i < (int)b; ++i)
#define rrep(i, n) for(int i = ((int)n - 1); i >= 0; --i)

using ll = long long;
using ld = long double;

const ll INF = 1e18;
const int Inf = 1e9;
const double EPS = 1e-9;
const ll MOD = 1e9 + 7;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(0);
	int h, a;
	cin >> h >> a;
	cout << (h + a - 1) / a << endl;
    
    return 0;
}



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

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

  if (!(N % 500)) {
    cout << "Yes" << endl;
  } 
  else if ((N % 500) <= A) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

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

#define ll       long long
#define ull      unsigned ll
#define pii      pair<int, int>
#define pll      pair<ll, ll>
#define mp       make_pair
#define ff       first
#define ss       second
#define sz(x)    (int) x.size()
#define all(v)   v.begin(), v.end()

template <typename T> inline void smin(T &a, T b) {a = a < b ? a : b;}
template <typename T> inline void smax(T &a, T b) {a = a > b ? a : b;}

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {cout << endl;}
template<typename T, typename... Args> void err(istream_iterator<string> it, T a, Args... args) {
    cerr << *it << " = " << a << ", ";
    err(++it, args...);
}

template <typename T> inline void Int(T &n) {
    n = 0; int f = 1; register int ch = getchar();
    for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
    for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
    n = n * f;
}

template <typename T, typename TT> inline void Int(T &n, TT &m) { Int(n); Int(m); }
template <typename T, typename TT, typename TTT> inline void Int(T &n, TT &m, TTT &l) { Int(n, m); Int(l); }

const int mod = (int) 1e9 + 7;

inline int add(int a, int b) {a += b; return a >= mod ? a - mod : a;}
inline int sub(int a, int b) {a -= b; return a < 0 ? a + mod : a;}
inline int mul(int a, int b) {return (ll) a * b % mod;}

const int inf = (int) 2e9 + 5;
const ll  Inf = (ll) 2e18 + 5;
const int N   = (int) 2e5 + 5;

ll call(int i) {
    return 1LL * i * i * i * i * i ;
}

int solve() {
    std::vector<pll> v;
    for(int i = -1000; i <= 1000; i++) {
        v.push_back({call(i), 1LL * i});
    }
    ll x ; Int(x);
    for(int i = 0; i < sz(v); i++) {
        for(int j = 0; j < sz(v); j++) {
            //if(i == j) continue;
            if(v[i].ff - v[j].ff == x) return !printf("%lld %lld\n", v[i].ss, v[j].ss); 
        }
    }
    return 0;
}

int main() {
    //ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int test = 1, tc = 0;
    //Int(test);
    //cin >> test;
    while (test--) {
        //printf("Case %d: ", ++tc);
        solve();
    }
    return 0;
}


Measured memory_bytes: 3784
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = ((int)(s)); i < (int)(n); i++)
int main(){
    int card_blue, card_red, count, point_max = 0;
    cin >> card_blue;
    vector<string> string_blue(card_blue);
    rep(i, 0, card_blue){
        cin >> string_blue.at(i);
    }
    cin >> card_red;
    vector<string> string_red(card_red);
    rep(i, 0, card_red){
        cin >> string_red.at(i);
    }
    
    rep(i, 0, card_blue){
        count = 0;
        rep(j, 0, card_blue){
            if(string_blue.at(i) == string_blue.at(j)){
                count += 1;
            }
        }
        rep(k, 0, card_red){
            if(string_blue.at(i) == string_red.at(k)){
                count -= 1;
            }
        }
        point_max = max(point_max, count);
    }
    cout << point_max << endl;
}

Measured memory_bytes: 256
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

#define mp make_pair
#define pb push_back
#define sz(s) ((int) ((s).size()))

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

typedef long long ll;
typedef long double ld;

const int inf = (int) 1.01e9;
const ld eps = 1e-11;
const ld pi = acos(-1.0L);

mt19937 mrand(random_device{} ());
int rnd(int x) {
  return mrand() % x;
}

const int mod = (int) 1e9 + 7;

void add(int & x, int y) {
  if ((x += y) >= mod) {
    x -= mod;
  }
}

int sum(int x, int y) {
  add(x, y);
  return x;
}

int mult(int x, int y) {
  return (ll) x * y % mod;
}

int power(int x, ll p) {
  int res = 1;
  while (p) {
    if (p & 1) {
      res = mult(res, x);
    }
    x = mult(x, x);
    p >>= 1;
  }
  return res;
}

void precalc() {
}

const int maxn = 1e5 + 100;
int n;
vector<vector<int> > tree;
int a[maxn];
bool ok;

bool read() {
  if (scanf("%d", &n) < 1) {
    return false;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
  }
  tree = vector<vector<int> > (n);
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    u--, v--;
    tree[u].pb(v);
    tree[v].pb(u);
  }
  return true;
}

ll dfs(int v, int p = -1) {
  if (sz(tree[v]) == 1) {
    return a[v];
  }
  ll up = 0;
  ll mx = 0;
  for (int i = 0; i < sz(tree[v]); i++) {
    int to = tree[v][i];
    if (to == p) {
      continue;
    }
    ll cur = dfs(to, v);
    up += cur;
    mx = max(mx, cur);
  }
  if (up < a[v]) {
    ok = false;
  }
  ll inside = up - a[v];
  if (inside > up - mx) {
    ok = false;
  }
  if (inside * 2 > up) {
    ok = false;
  }
  return up - inside * 2;
}

void solve() {
  if (n == 2) {
    if (a[0] != a[1]) {
      printf("NO\n");
    } else {
      printf("YES\n");
    }
    return;
  }
  ok = true;
  for (int i = 0; i < n; i++) {
    if (sz(tree[i]) > 1) {
      if (dfs(i)) {
        ok = false;
      }
      break;
    }
  }
  if (ok) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen("text.in", "r", stdin));
  assert(freopen("text.out", "w", stdout));
#endif

  while (read()) {
    solve();
#ifdef DEBUG
    eprintf("Time: %.3f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}



Measured memory_bytes: 12800
def incre(num,char_obj):
    pos=0
    posmax=pos
    for n in range(num):
        if char_obj[n]=="I":
            pos=pos+1
            if pos>posmax:
                posmax=pos
        else:
            pos=pos-1
    return posmax

num=int(input())
char_obj=input()

print(incre(num,char_obj))

Measured memory_bytes: 3060
#include <algorithm>
#include <climits>
#include <cmath>
#include <iostream>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <vector>

const int mod = 1e9 + 7;
const int kmax = 510000;

long long fact[kmax], fact_inv[kmax], inv[kmax];

int gcd(int a, int b)
{
    if (!b) {
        return a;
    }

    return gcd(b, a % b);
}

void init_comb()
{
    fact[0] = fact[1] = 1;
    fact_inv[0] = fact_inv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < kmax; i++) {
        fact[i] = fact[i - 1] * i % mod;
        inv[i] = mod - inv[mod % i] * (mod / i) % mod;
        fact_inv[i] = fact_inv[i - 1] * inv[i] % mod;
    }
}

long long comb(int n, int r)
{
    if (n < r) {
        return 0;
    }

    if (n < 0 || r < 0) {
        return 0;
    }

    return fact[n] * (fact_inv[r] * fact_inv[n - r] % mod) % mod;
}

int main()
{
    int h, w, a, b;
    std::cin >> h >> w >> a >> b;

    long long ans = 0;
    init_comb();
    for (int i = b; i < w; i++) {
        ans += comb(i + (h - 1 - a), i) * comb(w - 1 - i + a - 1, a - 1) % mod;
        ans %= mod;
    }

    std::cout << ans << std::endl;
}


Measured memory_bytes: 12160
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;

class Solver {
    Scanner sc = new Scanner();

    struct Pair {
        public int A { get; set; }
        public int B { get; set; }
    }

    public void Solve() {
        var N = sc.nextInt();
        var pair = new Pair[N];
        for (int i = 0; i < N; i++) {
            pair[i] = new Pair {
                A = sc.nextInt(),
                B = sc.nextInt()
            };
        }

        pair = pair.OrderBy(p => p.B).ToArray();
        long time = 0;
        for (int i = 0; i < N; i++) {
            time += pair[i].A;
            if (time > pair[i].B) {
                WriteLine("No");
                return;
            }
        }
        WriteLine("Yes");
    }
}

class Combination {
    static int mod = 1000000007;

    public static long Calc(int a, int b) {
        if (b > a - b) return Calc(a, a - b);

        long ansMul = 1;
        long ansDiv = 1;
        for (int i = 0; i < b; i++) {
            ansMul *= (a - i);
            ansDiv *= (i + 1);
            ansMul %= mod;
            ansDiv %= mod;
        }
        return ansMul * ModPow(ansDiv, mod - 2) % mod;
    }

    private static long ModPow(long a, int p) {
        if (p == 0) return 1;
        if (p % 2 == 0) {
            long half = ModPow(a, p / 2);
            return half * half % mod;
        } else {
            return a * ModPow(a, p - 1) % mod;
        }
    }
}

class Scanner {
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner() {
        s = new string[0];
        i = 0;
    }

    public string next() {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt() {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0) {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong() {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0) {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble() {
        return double.Parse(next());
    }

    public double[] ArrayDouble(int N, double add = 0) {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

class Program {
    static void Main(string[] args) {
        Solver s = new Solver();
        s.Solve();
    }
}


Measured memory_bytes: 27188
//http://arc059.contest.atcoder.jp/tasks/arc059_d


#include <bits/stdc++.h>
using namespace std;
#define wl(n) while(n--)
#define fr(i,a,b) for(i=a;i<b;i++)
#define rev(i,a,b) for(i=b-1;i>=a;i--)
#define bitcnt(x) __builtin_popcount(x)
#define mem(a,i) memset(a,i,sizeof(a))
typedef pair<int,int> ii;
#define mp make_pair
#define ll long long
#define MOD 1000000007
#define pb push_back
#define psh push
#define nl printf("\n")
#define INF (1LL<<52)
int n,len;
string S;
int dp[5005][5005];

ll pow1(ll x,ll y,ll M)
{
    if(y==0)
    return 1;
    ll temp= pow1(x,y/2,M)%M;
    if(y%2==0)
    return (temp*temp)%M;
    else
    return (((temp*temp)%M)*x)%M;
}

ll modInverse(ll A,ll M)
{
	return pow1(A,M-2,M);
}

int fun(int move,int l)
{
	if(move == 0)
	{
		if(l == len)
			return 1;
		return 0;
	}
	if(dp[move][l] != -1)
		return dp[move][l];
	int ans = (2*fun(move-1,l+1))%MOD;
	
	ans = (ans + fun(move-1,max(l-1,0))%MOD)%MOD;
  return dp[move][l] = ans%MOD;
}

int main()
{
	int i;
	cin>>n>>S;
    len = S.length();
    mem(dp,-1);
    ll x = fun(n,0);
    //cout<<"x :"<<x<<endl;

    ll y = 1;
    fr(i,0,S.length())
    {
    	y = (y%MOD * 2)%MOD;
    }
	cout<<(modInverse(y,MOD)%MOD * x%MOD)%MOD;nl;
	return 0;
}



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

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

    if(a > 12) {
        cout << b << endl;
    } else if(a <= 5) {
        cout << 0 << endl;
    } else {
        cout << b / 2 << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i,n) for (int i = 0; i < n; i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fi first
#define se second
#define pb push_back
#define mp make_pair
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 1<<30;
const ll LINF = 1LL<<58;
const ll mod = 1000000007;

int main(){
    int n, p = 0;
    cin >> n;
    vector<int> A(n), B(n), C(n-1);
    rep(i,n){
        cin >> A[i];
        A[i]--;
    }
    rep(i,n)cin >> B[i];
    rep(i,n-1)cin >> C[i];
    for (int i = 0; i < n; i++)
    {
        p += B[A[i]];
        if(i == n-1) continue;
        if(A[i] + 1 == A[i+1]) p += C[A[i]];
    }
    cout << p << endl;
    return 0;
}


Measured memory_bytes: 256
N = int(input())

List=list(map(int,input().split()))
cnt = 1
ck = 0

for i in range(N):
  if List[i] == cnt:
    cnt = cnt + 1
    ck = 1

if ck == 0:
  print(-1)
else:
  print(N - cnt + 1)

Measured memory_bytes: 24744
//g++ -std=c++14 test.cpp -o test.out
//問題URL
//https://atcoder.jp/contests/abc104/tasks/abc104_d

//参考：
//https://drken1215.hatenablog.com/entry/2018/08/05/224100_1

//ポイント：
//「どこまで構成できたか」をDPのキーにする

#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <stack>
#include <map> 
#include <unordered_map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (1LL<<60);
const int INF_INT = 2147483647-1e6-1;
const LL mod = 1000000007ll;
const int mod_int = 1000000007;

//https://github.com/atcoder-live/library/blob/master/mint.cpp
struct mint {
  LL x; 
  mint(LL x=0):x((x%mod+mod)%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(LL t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

string S;

mint ans = 0;

void solve(){
	int N = S.size();
	//dp[i][j]:
	//i文字目まで見た時
	//dp[i][0]:まだ何もカウントしていない状態の数
	//dp[i][1]:Aまでカウント済みの状態の数
	//dp[i][2]:Bまでカウント済みの状態の数
	//dp[i][3]:Cまでカウント済みの状態の数
	vector<vector<mint>> dp(N+1,vector<mint>(4,0));
	dp[0][0] = 1;
	for(int i=0;i<N;i++){
		if(S[i]=='?'){
			for(int j=0;j<=3;j++) dp[i+1][j] += dp[i][j]*3;
			for(int j=0;j<=3;j++){
				if(j+1<=3) dp[i+1][j+1] += dp[i][j];
			}
		}else{
			for(int j=0;j<=3;j++) dp[i+1][j] += dp[i][j];
			if(S[i]=='A') dp[i+1][1] += dp[i][0];
			if(S[i]=='B') dp[i+1][2] += dp[i][1];
			if(S[i]=='C') dp[i+1][3] += dp[i][2];
		}
	}
	// for(int j=0;j<=3;j++){
	// 	cout << j << ":";
	// 	for(int i=0;i<=N;i++){
	// 		cout << dp[i][j].x << " ";
	// 	}
	// 	cout << endl;
	// }
	ans = dp[N][3];
}

int main(){
    cin >> S;

    solve();

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

Measured memory_bytes: 10080
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <utility>
#include <numeric>
#include <limits>
#include <type_traits>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
ll gcd(ll a, ll b){if (a%b == 0)  return(b);else  return(gcd(b, a%b));}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}
/* map<string,int> */
/* 大文字を小文字に変換 tolower*/
/* 小文字を大文字に変換 toupper*/
/* 辞書順 next_permutation(a.begin(),a.end()) */
 
int main () {
    ll n,k,q;
    cin >> n >>k >>q;
    vector <int> a(q);
    for (ll i =1;i<=q;i++) {
        cin >> a[i];
    }
    vector <int > b(n,k-q);
    for(ll i =1;i<=q;i++) {
        b[a[i]-1] ++;
    }
    for (ll i=0;i<n;i++) {
        if (b[i] >0) {
            yes
        } else {
            no
        }
    }
}

Measured memory_bytes: 1408
//#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
const int INF = (1LL<<30);
const ll LLINF = (1LL<<60);
const double PI = 3.14159265359;
const double EPS = 1e-12;
const int MOD = 1000000007;
//#define int ll

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }

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

#define MAX_V 10000
struct edge { int to, cap, cost, rev; };

int V;
vector<edge> G[MAX_V];
int h[MAX_V];
int dist[MAX_V];
int prevv[MAX_V], preve[MAX_V];

void add_edge(int from, int to, int cap, int cost) {
  G[from].PB({to, cap, cost, (int)G[to].size()});
  G[to].PB({from, 0, -cost, (int)G[from].size()-1});
}

// s??????t????????????f???????°??????¨???
int min_cost_flow(int s, int t, int f) {
  int res = 0;
  fill(h, h+V, 0);
  while(f > 0) {
    priority_queue<PII, vector<PII>, greater<PII>> que;
    fill(dist, dist+V, INF);
    dist[s] = 0;
    que.push({0, s});
    while(que.size()) {
      PII p = que.top(); que.pop();
      int v = p.second;
      if(dist[v] < p.first) continue;
      for(int i=0; i<(int)G[v].size(); ++i) {
        edge &e = G[v][i];
        if(e.cap > 0 && dist[e.to] > dist[v] + e.cost + h[v] - h[e.to]) {
          dist[e.to] = dist[v] + e.cost + h[v] - h[e.to];
          prevv[e.to] = v;
          preve[e.to] = i;
          que.push({dist[e.to], e.to});
        }
      }
    }
    // ????????\???????????????
    if(dist[t] == INF) return -1;
    REP(v, V) h[v] += dist[v];

    int d = f;
    for(int v = t; v != s; v = prevv[v]) {
      d = min(d, G[prevv[v]][preve[v]].cap);
    }
    f -= d;
    res += d * h[t];
    for(int v = t; v != s; v = prevv[v]) {
      edge &e = G[prevv[v]][preve[v]];
      e.cap -= d;
      G[v][e.rev].cap += d;
    }
  }
  return res;
}

signed main(void)
{
  int e, f;
  cin >> V >> e >> f;
  REP(i, e) {
    int u, v, c, d;
    cin >> u >> v >> c >> d;
    add_edge(u, v, c, d);
  }

  cout << min_cost_flow(0, V-1, f) << endl;

  return 0;
}

Measured memory_bytes: 3472
#include<iostream>
#include<bits/stdc++.h>
#include<string>
using namespace std;
int main()
{
  int a,b ;
  cin >> a >> b  ;
  
  if(a<=9 && b <=9){
    cout << a*b << endl ;
  }else{
    cout << -1 << endl ;
  }
  return 0 ;
}







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

using ll = long long;

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

    ll ans = 0;
    map<pair<string, string>, ll> m;
    for(int S = 0; S < (1 << n); ++S) {
        string s1, s2;
        for(int i = 0; i < n; ++i) {
            if(S & (1 << i)) s1 += s[i];
            else             s2 += s[i];
        }
        m[make_pair(s1, s2)] += 1;
    }
    for(int S = 0; S < (1 << n); ++S) {
        string s1, s2;
        for(int i = 0; i < n; ++i) {
            if(S & (1 << i)) s1 += s[i + n];
            else             s2 += s[i + n];
        }
        reverse(begin(s1), end(s1));
        reverse(begin(s2), end(s2));
        ans += m[make_pair(s1, s2)];
    }
    cout << ans << endl;
}

Measured memory_bytes: 87040
//06
#include<iostream>

using namespace std;

int main(){
  int n;
  cin>>n;
  while(n--){
    int s,t;
    cin>>s>>t;
    if(s<=5){
      int d=((t>s)?1:-1);
      for(;;){
	cout<<s<<((s==t)?'\n':' ');
	if(s==t)break;
	s+=d;
      }
    }else if(0&&t>=5){
      for(;;){
	cout<<s<<((s==t)?'\n':' ');
	if(s==t)break;
	s=((s-5)+1)%5+5;
      }
    }else{
      int d=1;
      for(;;){
	cout<<s<<((s==t)?'\n':' ');
	if(s==t)break;
	s+=d;
	if(s==10){
	  s=5;
	  d=-1;
	}else if(s==-1){
	  s=1;
	  d=1;
	}
      }
    }
  }
  return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <iomanip>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

const int INF = 1001001001;

int main() {
    ll n, k;
    cin >> n >> k;
    ll a = n % k;
    ll ans = min(a, k-a);
    cout << ans << endl;
    return 0;
}

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

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  ll sumXor = 0;
  rep(i,n) {
    cin >> a[i];
    sumXor ^= a[i];
  }
  ll ans;
  rep(i,n) {
    ans = sumXor ^ a[i];
    cout << ans << ' ';
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 4736
#include<stdio.h>
int main()
{
int a,b,c,d,e,f;
scanf("%d%d%d%d",&a,&b,&c,&d);
if(a>=1 && a<=100 && b>=1 && b<=100 && c>=1 && c<=100 && d>=1 && d<=100 )   
{e=c;
 f=a;
while(e>0 && f>0)
{e=e-b;
 f=f-d;}                     
if(e<=0)        
{printf("Yes\n");}                
else if(f<=0)                                  
{printf("No\n");}                            
}   
return 0;   
}

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

int main()
{
   int N;
   cin >> N;
   if(N%10==2||N%10==4||N%10==5||N%10==7||N%10==9){
      cout << "hon" << endl;
   }
   if(N%10==0||N%10==1||N%10==6||N%10==8){
      cout << "pon" << endl;
   }
   if(N%10==3){
      cout << "bon" << endl;
   }
}


Measured memory_bytes: 3672