akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9 + 7;
ll repeatSquaring(int n, int p)
{
  if (p == 0)
    return 1;
  if (p % 2 == 0)
  {
    ll t = repeatSquaring(n, p / 2);
    return (t * t) % MOD;
  }
  return (n * repeatSquaring(n, p - 1)) % MOD;
}

int main()
{
  int n;
  cin >> n;
  unordered_map<int, int> mp;

  for (int i = 0; i < n; ++i)
  {
    int a;
    cin >> a;
    mp[a]++;
  }
  bool flag = true;
  for (auto &e : mp)
  {
    if (n % 2 == 0)
    {
      if (e.first % 2 == 0)
      {
        flag = false;
      }
      else if (e.second != 2)
      {
        flag = false;
      }
    }
    else
    {
      if (e.first % 2 == 1)
      {
        flag = false;
      }
      else if (e.first == 0 && e.second != 1)
      {
        flag = false;
      }
      else if (e.first != 0 && e.second != 2)
      {
        flag = false;
      }
    }
  }

  cout << (flag ? repeatSquaring(2, n / 2) : 0) << endl;

  return 0;
}


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

int main(){
  int n, m, l;
  cin >> n >> m >> l;
  vector<vector<int>> A(200, vector<int>(200));
  vector<vector<int>> B(200, vector<int>(200));
  vector<vector<int>> C(200, vector<int>(200));
  for(int i = 0; i < n; i++){
    for(int j = 0; j < m; j++){
      cin >> A.at(i).at(j);
    }
  }
  for(int i = 0; i < m; i++){
    for(int j = 0; j < l; j++){
      cin >> B.at(i).at(j);
    }
  }
  long long sum;
  for(int i = 0; i < n; i++){
    for(int j = 0; j < l; j++){
      sum = 0;
      for(int k = 0; k < m; k++){
        sum += (A.at(i).at(k) * B.at(k).at(j));
      }
      if(j != l - 1) cout << sum << " ";
      else cout << sum;
    }
    cout << endl;
  }
}



Measured memory_bytes: 3504
#include<stdio.h>
int main(void)
{
    int i,a,b,c,d;
	while(1){
	scanf("%d",&a);
	if(a==0) break;
	for(i=0;i<a;i++){
	scanf("%d %d %d",&b,&c,&d);
	if(b==100||c==100||d==100){
	printf("A\n");
	}
	else if((b+c)/2>=90){
	printf("A\n");
	}
	else if((b+c+d)/3>=80){
	printf("A\n");
	}
	else if((b+c+d)/3>=70){
	printf("B\n");
	}
	else if((b+c+d)/3>=50&&b>=80||c>=80){
	printf("B\n");
	}
	else{
	printf("C\n");
	}
	}
	}
	return 0;
	}

Measured memory_bytes: 584
#include<bits/stdc++.h>
using namespace std;
using ll=long long ;
int main(){
    ll i;
    ll out;
    ll k,x;
    cin >> k >> x;
    for(i=x-k+1;i<=x+k-1;i++){
        out = i;
        cout << out << " ";
    }
    cout << endl;
    return 0;

}

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

int main()
{
	int N,K;
	cin >> N >> K;
	int stk;
	vector<int> arr(N + 1, 0);
	for (int i = 0; i < N; i++) {
		cin >> stk;
		arr[stk]++;
	}
	sort(arr.begin(), arr.end());
	int now = count_if(arr.begin(), arr.end(), [](int x) {return x > 0; });
	int ans = 0;
	int need = now - K;
	for (int i = 0; i < N +1; i++) {
		if (arr[i] > 0) {
			if (need <= 0) {
				break;
			}
			ans += arr[i];
			need--;

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

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

int main(){
    string s;
    cin >> s;
    int n=s.size();
    queue<int> p;
    char l='L',r='R';
    int cntr=0,cntl=0;
    int ans[n]={};
    for(int i=0; i<n-1; i++){
        if(s[i]==r)cntr++;
        else cntl++;
        if(s[i]==r&&s[i+1]==l)p.push(i);
        if(s[i]==l&&s[i+1]==r){
            int tmp=p.front();
            p.pop();
            ans[tmp]=cntl/2+(cntr+1)/2;
            ans[tmp+1]=cntr/2+(cntl+1)/2;
            cntr=0;
            cntl=0;
        }
    }
    if(s[n-1]==l)cntl++;
    else cntr++;
    if(!p.empty()){
        int tmp=p.front();
            p.pop();
            ans[tmp]=cntl/2+(cntr+1)/2;
            ans[tmp+1]=cntr/2+(cntl+1)/2;
            //cout << cntl << endl;
    }
    else{
        ans[n-1]=cntr;
    }
    for(int i=0; i<n; i++){
        cout << ans[i] << " ";
    }
    cout << endl;
}

Measured memory_bytes: 1024
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) (v).begin(), (v).end()

int main() {
  string s;
  cin >> s;
  for(int tmp = 0; tmp < (1 << 4); tmp++) {
    bitset<3> ss(tmp);
    int ans = 0;
    ans += s[0] - '0';
    for(int i = 0; i < 3; i++) {
      int cal;
      if(ss.test(i))
        cal = -(s[i + 1] - '0');
      else
        cal = s[i + 1] - '0';
      ans += cal;
    }
    if(ans == 7) {
      cout << s[0];
      rep(i, 3) {
        if(ss.test(i))
          cout << '-';
        else
          cout << '+';
        cout << s[i + 1];
      }
      cout << "=7" << endl;
      return 0;
    }
  }
}


Measured memory_bytes: 256
s=input()
if s[0]==s[1] and s[0]!=s[2] and s[2]==s[3]:
  print("Yes")
elif s[0]==s[2] and s[0]!=s[1] and s[1]==s[3]:
  print("Yes")
elif s[0]==s[3] and s[0]!=s[1] and s[1]==s[2]:
  print("Yes")
else:
  print("No")

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

int main()
{
    int h, r ; cin >> h >> r ;
    int s;
    if ( -h == r ) { s = 0 ; }
    else if ( -h - r > 0 ) { s = -1 ; }
    else { s = 1 ; }
    cout << s << endl ;
}


Measured memory_bytes: 3116
#include<stdio.h>
#define M 101

int main(){
  int i;
  int j;
  int G[M][M];
  int n;
  int u;
  int k;
  int v;

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

  for(i=0;i<n;i++){
    scanf("%d %d",&u,&k);
    u--;
    for(j=0;j<k;j++){
      scanf("%d",&v);
      v--;
      G[u][v] = 1;
    }
  }
    for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      printf("%d",G[i][j]);
      if(j != n-1) printf(" ");
    }
    printf("\n");
  }
  return 0;
}

  



Measured memory_bytes: 2112
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

typedef long long ll;
typedef uint64_t ull;
typedef pair<int, int> P;
constexpr double PI = 3.1415926535897932;   // acos(-1)
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)

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

    int n;
    cin >> n;
    int ans = 0;
    for(int i = 0; i < n; ++i){
        int a;
        cin >> a;
        ans += --a;
    }
    cout << ans << endl;
}

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


int main(){
	string s,s2;
	cin >> s >> s2;
	for(int i=0;i<s.size();i++){
		if(s[i]!=s2[i]){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 3568
//#include <bits/stdc++.h>
#include<iostream>
#include<stdio.h>
#include<vector>
#include<stack>
#include<queue>
//#include <bits/stdc++.h>
#include<map>
using namespace std;
 
int main() {
int n,m;

cin>>n>>m;

if(n==m)cout<<"Yes"<<endl;
else{
    cout<<"No"<<endl;
}




}


Measured memory_bytes: 256
INF = float('inf')
dp = [INF] * (10**5 + 10)
dp[0] = 0
h = [0] * (10 ** 4)
N, K = map(int, input().split())
h = list(map(int, input().split())) + h
for i in range(N):
    for k in range(1, K+1):
        if i + k < N:
            dp[i+k] = min(dp[i+k], dp[i] + abs(h[i] - h[i+k]))
        else:
            break
print(dp[N-1])

Measured memory_bytes: 56228
#include <iostream>

using namespace std;

int main() {

	const int num=3;
	int a, b;

	while(cin >> a >> b) {

		int sum = a + b;
		int keta = 1;
		while (1) {
			if (sum >= 10) {
				keta++;
				sum /= 10;
			}
			else {
				break;
			}
		}

		cout << keta << endl;

	}

	return 0;

}

Measured memory_bytes: 3064
A, B = map(int, input().split())
L = [["."] * 99 + ["#"] if i%2 == 0 else ["."] + ["#"] * 99 for i in range(100)]
for i in range(B-1):
    L[1 + i%50 * 2][2 + i//50 * 2] = "."
for i in range(A-1):
    L[-2 - i%50 * 2][-3 - i//50 * 2] = "#"
print("100 100")
for s in L:
    print("".join(s))


Measured memory_bytes: 3060
#include <iostream>
using namespace std;
int main(void){
    int A,B,ans=0;
    cin >> A >> B;
    if (A>=B){
        ans += A;
        A--;
    }else {
        ans += B;
        B--;
    }
    if (A>=B){
        ans += A;
        A--;
    }else {
        ans += B;
        B--;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		FastScanner scan = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int n = scan.nextInt();
		int[][] a = new int[2][n];
		a[0] = scan.nextIntArray(n);
		a[1] = scan.nextIntArray(n);
		int[][] dp = new int[2][n];
		dp[0][0] = a[0][0];
		for(int i = 1; i < n; i++) dp[0][i] = dp[0][i-1]+a[0][i];
		for(int i = 0; i < n; i++) dp[1][i] = Math.max(dp[0][i]+a[1][i], i>0?dp[1][i-1]+a[1][i]:0);
		out.println(dp[1][n-1]);
		out.close();
	}
	
	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner() {
			try	{
				br = new BufferedReader(new InputStreamReader(System.in));
				st = new StringTokenizer(br.readLine());
			} catch (Exception e){e.printStackTrace();}
		}

		public String next() {
			if (st.hasMoreTokens())	return st.nextToken();
			try {st = new StringTokenizer(br.readLine());}
			catch (Exception e) {e.printStackTrace();}
			return st.nextToken();
		}

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

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

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

		public String nextLine() {
			String line = "";
			if(st.hasMoreTokens()) line = st.nextToken();
			else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
			while(st.hasMoreTokens()) line += " "+st.nextToken();
			return line;
		}

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

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

		public double[] nextDoubleArray(int n){
			double[] a = new double[n];
			for(int i = 0; i < n; i++) a[i] = nextDouble();
			return a;
		}

		public char[][] nextGrid(int n, int m){
			char[][] grid = new char[n][m];
			for(int i = 0; i < n; i++) grid[i] = next().toCharArray();
			return grid;
		}
	}

}

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

#define rep(i, n) for (int i = 0; i < n; ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
#define SZ(x) ((int)(x).size())
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 55;
const int mod = 1000000007;
//const int mod = 998244353;

template <class T>inline bool chmin(T &a, const T b)
{
  if (a > b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline bool chmax(T &a, const T b)
{
  if (a < b)
  {
    a = b;
    return true;
  }
  return false;
}
template <class T>inline void line_out(const vector<T> vec) {
  int n = SZ(vec);
  rep(i, n) {
    cout << vec[i];
    if(i < n-1) cout << " ";
  }
  cout << endl;
  return;
}

struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  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++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  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;
  }
};


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

  vector<ll> a(n), dp(n, INF64);
  rep(i, n) cin >> a[i];
  reverse(ALL(a));
  rep(i, n) *upper_bound(ALL(dp), a[i]) = a[i];
  cout << distance(dp.begin(), lower_bound(ALL(dp), INF64)) << endl;
}

Measured memory_bytes: 4788
#include<stdio.h>
int main()
{
   int a,b,c=0,i;
   scanf("%d",&a);
   for(i=0;i<3;i++){
    b=a%10;
    if(b==1){
        c++;
    }
    a/=10;
}
printf("%d\n",c);
return 0;
}



Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using static System.Console;
using static System.Math;

namespace CP
{
    class Atria
    {
        static void Main(string[] args)
        {
            int a = int.Parse(ReadLine());
            int b = int.Parse(ReadLine());
            WriteLine(6-(a+b));
        }
    }
}

Measured memory_bytes: 11092
import java.util.*;
public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String a = sc.next();
		String b = sc.next();
		String c = sc.next();
		char ans = 'a';
		
		int inta = 0;
		int intb = 0;
		int intc = 0;
		
		while(ans == 'a' && inta < a.length() || ans == 'b' && intb < b.length() || ans == 'c' && intc < c.length()) {
			switch(ans) {
				case 'a':
					ans = a.charAt(inta);
					inta++;
					break;
				case 'b':
					ans = b.charAt(intb);
					intb++;
					break;
				case 'c':
					ans = c.charAt(intc);
					intc++;
					break;
 			}
		}
		System.out.println(Character.toUpperCase(ans));
	}
}


Measured memory_bytes: 23124
import sys
input = sys.stdin.readline
import random
import time
import copy
time0=time.time()

D=int(input())
C=[0]+list(map(int,input().split()))
S=[0]+[[0]+list(map(int,input().split())) for i in range(D)]

ANS=0
T=[0]
LAST=[0]*27
for day in range(1,D+1):
    SCORE=[-1<<30]*27
    for j in range(1,27):
        SC=0
        SC+=S[day][j]

        for k in range(1,27):
            if j==k:
                continue
            SC-=C[k]*(day-LAST[k])
        SCORE[j]=SC

    choose=SCORE.index(max(SCORE))
    T.append(choose)
    LAST[choose]=day

ANS=0
LAST=[[0]*27 for i in range(D+1)]
for day in range(1,D+1):
    for j in range(1,27):
        LAST[day][j]=LAST[day-1][j]
    t=T[day]
    ANS+=S[day][t]
    LAST[day][t]=day

    for j in range(1,27):
        ANS-=C[j]*(day-LAST[day][j])

MAX=ANS
MAXT=copy.deepcopy(T)
d=0
after_t=0

while time.time()-time0<1.77:
    BT=copy.deepcopy(T)
    BLAST=copy.deepcopy(LAST)
    BANS=ANS
    
    d=d%D+1
    after_t=after_t%26+1

    before_t=T[d]

    ANS+=S[d][after_t]-S[d][before_t]

    T[d]=after_t

    for day in range(d,D+1):
        if T[day]!=before_t:
            ANS+=C[before_t]*(day-LAST[day][before_t])
            LAST[day][before_t]=LAST[day-1][before_t]
            ANS-=C[before_t]*(day-LAST[day][before_t])
        else:
            break

    ANS+=C[after_t]*(d-LAST[d][after_t])
    LAST[d][after_t]=d

    for day in range(d+1,D+1):    
        if T[day]!=after_t:
            ANS+=C[after_t]*(day-LAST[day][after_t])
            LAST[day][after_t]=LAST[day-1][after_t]
            ANS-=C[after_t]*(day-LAST[day][after_t])

    if ANS*1000<MAX*995:
        T=BT
        LAST=BLAST
        ANS=BANS
    elif ANS>MAX:
        MAX=ANS
        MAXT=copy.deepcopy(T)

print(*MAXT[1:])


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

using namespace std;

long long dp[100001][2];
long long A[100001];

int main()
{
  int N;
  
  scanf("%d", &N);
  
  dp[0][1] = -1000000000000ll;
  for (int i = 1; i <= N; i++) {
    scanf("%lld", A + i);
    if (i == 1) continue;
    
    if (i == 2) {
      dp[i][0] = A[i] + A[i - 1];
      dp[i][1] = -dp[i][0];
    }
    else {
      dp[i][0] = max(dp[i - 1][0], dp[i - 1][1]) + A[i];
      dp[i][1] = max(-A[i] + -2 * A[i - 1] + dp[i - 1][0], -A[i] + 2 * A[i - 1] + dp[i - 1][1]);
    }
  }
  
  printf("%lld\n", max(dp[N][0], dp[N][1]));
  return 0;
}

Measured memory_bytes: 2560
def gcd(a, b):
    a, b = max(a, b), min(a, b)
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    return a * b // gcd(a, b)


def main():
    N = int(input())
    ans = 1
    for _ in range(N):
        t = int(input())
        ans = lcm(ans, t)
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 38256
#include <iostream>
#include <stdio.h>

using namespace std;
typedef long long int lint;

void swap(int& a, int& b)
{
	int tmp = a;
	a = b;
	b = tmp;
}

void answer()
{
	int a, b, c;
	cin >> a >> b >> c;
	if (a > b) swap(a, b);
	if (b > c) swap(b, c);
	if (a > b) swap(a, b);
	printf("%d %d %d\n", a, b, c);
}

int main()
{
	answer();
	return 0;
}

Measured memory_bytes: 1148
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)

/* REPmacro */
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORR(i, a, b) for(int i = (a); i >= (b); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOREACH(x, a) for(auto x : a)

/* exchange */
#define CHMIN(a, b) (a) = min((ll)(a), (ll)(b))
#define CHMAX(a, b) (a) = max((ll)(a), (ll)(b))

/* function */
#define IN(x) cin >> x
#define DEBUG(x) cerr << (x) << " "
#define LN() cerr << "\n"
#define PRINT(x) cout << (x) << endl
#define BR cout << endl

/* const */
const int ARRAY = 1000005;
const int INF = 1001001001; // 10^9
const ll LINF = 1001001001001001001; // 10^18
const int MOD = 1e9 + 7;

ll N = 0;
ll X, Y;
ll t;
ll ret = 1;
ll fact[ARRAY];
ll inv_fact[ARRAY];
ll inv[ARRAY];

void input() {
  IN(X);
  IN(Y);
}

void combiInit() {
  fact[0] = fact[1] = 1;
  inv_fact[0] = inv_fact[1] = 1;
  inv[1] = 1;
  FOR(i, 2, ARRAY) {
    fact[i] = fact[i-1] * i % MOD;
    inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
    inv_fact[i] = inv_fact[i-1] * inv[i] % MOD;
  }
}

ll combi(ll n, ll r) {
  if (n < r) return 0;
  if (n < 0 || r < 0) return 0;
  return fact[n] * (inv_fact[r] * inv_fact[n-r] % MOD) % MOD;
}

void solve() {
  if ((2*X-Y)%3 != 0 || (2*Y-X)%3 != 0) {
    PRINT(0);
    return;
  } else {
    ll mx = (2*X-Y)/3;
    ll my = (2*Y-X)/3;
    if (my > mx) swap(mx, my);

    combiInit();
    ret = combi(mx+my, mx);

    PRINT(ret);

  }

}

int main(void){
  input();
  solve();
}


Measured memory_bytes: 23680
<?php 
while ($line = fgets(STDIN)) {
   $tmp[] = trim($line);
}

// 配列の各要素をさらに分解します
foreach ($tmp as $key => $value) {
  $array[] = explode(" ", $value);
}

$string = $array[1][0];
$number_of_words = $array[0][0];
$count = 0;
$t = 0;
while ($t < $number_of_words) {
    $start = strpos($string, 'ABC',$t);
    if ($start !== false) {
        $count++;
        $t = $start + 2;
    } else {
        break;
    }
}
echo $count;

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

#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
typedef long long ll ;
typedef unsigned long long ull ;
typedef long double ld ;

const ll MOD = 1E9 + 7, INF = 2E18 + 5 ;
const double PI = 2 * acos(0.0) ;
const long double EPS = 1.0E-14 ;

ll arr[200005] ;

ll big_mod(ll base, ll power, ll mod)
{
    if(power == 0)  return 1;
    else if(power % 2 == 1) {
      ll p1 = base % mod;
      ll p2 = (big_mod(base, power-1, mod) ) % mod;
      return (p1 * p2) % mod;
    }
    else if(power % 2 == 0) {
      ll p1 = (big_mod(base, power/2, mod) ) % mod;
      return (p1 * p1) % mod;
    }
}

int main()
{
    ll n, sum1 = 0, sum2 = 0, ans ,val ;
    cin >> n ;

    for (int i = 0; i < n; i++) {
        cin >> arr[i] ;
        sum1 += arr[i] ;
        sum1 %= MOD ;
        sum2 = ((sum2 % MOD) + (arr[i] * arr[i]) % MOD) % MOD ;
    }
    sum1 = (sum1 * sum1) % MOD ;
    val = (sum1 - sum2 + MOD) % MOD ;
    ans = (val * big_mod(2, MOD - 2, MOD)) % MOD ;
    cout << ans ;

    return 0 ;
}


Measured memory_bytes: 5192
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.next();
        int L = Integer.parseInt(str.substring(0,2));
        int R = Integer.parseInt(str.substring(2,4));
        if (L >= 1 && L <= 12) {
            if (R >= 1 && R <= 12) {
                System.out.println("AMBIGUOUS");
            } else {
                System.out.println("MMYY");
            }
        } else {
            if (R >= 1 && R <= 12) {
                System.out.println("YYMM");
            } else {
                System.out.println("NA");
            }
        }
    }
}

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

int main() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    for(int i=0;i<N;i++) cin >> A.at(i);
    
    ll pre_val = A[0];
    for(int i=1;i<N;i++){
        if(pre_val > A[i]){
            cout << "No" << endl;
            return 0;
        }

        if(pre_val == A.at(i)){
            pre_val = A.at(i);
        }
        else {
            pre_val = A.at(i)-1;
        }
    }
    cout << "Yes" << endl;

    return 0;
}


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

typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = 1e9;

int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> l(n, k - q);
  for (int i = 0; i < q; i++) {
    int a;
    cin >> a;
    a--;
    l[a]++;
  }
  for (int i = 0; i < n; i++) {
    if (l[i] <= 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 1024
package main

import (
	"fmt"
	"log"
	"math"
)

func main() {
	log.SetFlags(log.Lshortfile)
	var a, b int
	fmt.Scan(&a, &b)
	fmt.Println(max(0, a-2*b))
}

var dy = []int{0, 1, 0, -1}
var dx = []int{1, 0, -1, 0}
var inf = int(1e9)

func pow(a, b int) int {
	return int(math.Pow(float64(a), float64(b)))
}

func lcm(a, b int) int {
	return a * b / gcd(a, b)
}
func gcd(a, b int) int {
	if a < b {
		a, b = b, a
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}
func max(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r < a[i] {
			r = a[i]
		}
	}
	return r
}
func min(a ...int) int {
	r := a[0]
	for i := 0; i < len(a); i++ {
		if r > a[i] {
			r = a[i]
		}
	}
	return r
}
func sum(a []int) (r int) {
	for i := range a {
		r += a[i]
	}
	return r
}
func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

type pair struct {
	a, b int
}

type pairs []pair

func (p pairs) Len() int {
	return len(p)
}
func (p pairs) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func (p pairs) Less(i, j int) bool {
	if p[i].a == p[j].a {
		return p[i].b < p[j].b
	}
	return p[i].a < p[j].a
}


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

#define PI 3.141592653
#define rep(i,a,n) for(int i=a;i<(int)n;++i)
#define SZ(x) ((int)(x).size())	//size() unsigned -> int
#define descSort(a) sort(a.begin(),a.end(),std::greater<int>())
using namespace std;
typedef long long ll;
const ll INF = 1e9 + 7;
ll gcd(ll x,ll y){
    if(x%y==0)return y;
    return gcd(y,x%y);
}

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

Measured memory_bytes: 4036
n,m=gets.split.map(&:to_i)
l=[]
n.times do
  l << []
end
m.times do |i|
  p,y=gets.split.map(&:to_i)
  l[p-1] << [y,i]
end
a=[]
n.times do |i|
  j=1
  l[i].sort.each do |y,k|
    a[k]=format("%06d",i+1)+format("%06d",j)
    j+=1
  end
end
puts a


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

#ifdef LOCAL
#include "dump.hpp"
#else
#define dump(...)
#define dumpv(...)
#endif

#define rep(i, n) for (int i = 0; i < (n); i++)
#define mins(x, y) (x = min(x, y))
#define maxs(x, y) (x = max(x, y))
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
using P = pair<int, int>;
const int MOD = 1e9 + 7;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;

struct mint {
  ll v;
  mint(ll v = 0) : v((v % MOD + MOD) % MOD) {}
  mint pow(ll t) const;
  mint inv() const;
};
mint& operator+=(mint& a, mint b) { return a = a.v + b.v; }
mint& operator-=(mint& a, mint b) { return a = a.v - b.v; }
mint& operator*=(mint& a, mint b) { return a = a.v * b.v; }
mint operator+(mint a, mint b) { return a += b; }
mint operator-(mint a, mint b) { return a -= b; }
mint operator*(mint a, mint b) { return a *= b; }
mint operator-(mint a) { return (mint)0 - a; }
mint& operator/=(mint& a, mint b) { return a *= b.inv(); }
mint operator/(mint a, mint b) { return a /= b; }
mint mint::pow(ll t) const {
  if (!t) return 1;
  mint a = pow(t >> 1);
  a *= a;
  if (t & 1) a *= *this;
  return a;
}
mint mint::inv() const { return pow(MOD - 2); }
bool operator==(mint a, mint b) { return a.v == b.v; }
bool operator!=(mint a, mint b) { return a.v != b.v; }
istream& operator>>(istream& os, mint& a) { return (os >> a.v); }
ostream& operator<<(ostream& os, const mint& a) { return (os << a.v); }

mint mfact(int n, bool inv = false) {
  static vector<mint> fact(1, 1), ifact(1, 1);
  int pn = fact.size();
  if (pn < n + 1) {
    fact.resize(n + 1);
    ifact.resize(n + 1);
    for (int i = pn; i <= n; i++) fact[i] = fact[i - 1] * i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= pn; --i) ifact[i - 1] = ifact[i] * i;
  }
  return inv ? ifact[n] : fact[n];
}
mint nPk(int n, int k) {
  if (n < 0 || k < 0 || n < k) return 0;
  if (k == 0) return 1;
  return mfact(n) * mfact(n - k, true);
}
mint nCk(int n, int k) {
  if (n < 0 || k < 0 || n < k) return 0;
  if (k == 0) return 1;
  return mfact(n) * mfact(k, true) * mfact(n - k, true);
}

void solve() {
  int n;
  cin >> n;
  vi a(n);
  vi b(n);
  string s;
  cin >> s;
  rep(i, n) a[i] = (int)(s[i] - '1');
  rep(i, n) b[i] = a[i] & 1;
  dump(a);
  dump(b);
  bool flag = false;
  rep(i, n) if (b[i]) flag = true;
  if (!flag) rep(i, n) b[i] = a[i] == 2 ? 1 : 0;
  dump(flag);
  int ans = 0;
  rep(i, n) {
    if (b[i]) {
      // if (nCk(n - 1, i).v & 1) {
      if (((n - 1) & i) == i) {
        ans ^= 1;
      }
    }
  }
  if (!flag) ans *= 2;
  cout << ans << endl;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  // freopen("temp.1", "r", stdin);
  solve();
  return 0;
}

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

int main() {
    ll a, b, ans1 = 0, ans2 = 0;
    cin >> a >> b;
    a--;
    for(ll i = a - a % 4; i <= a; ++i)
        ans1 ^= i;
    for(ll i = b - b % 4; i <= b; ++i)
        ans2 ^= i;
    ans1 ^= ans2;
    cout << ans1 << endl;
    return 0;
}


Measured memory_bytes: 256
int main(){
	int n,m;
	int a[100][100];
	int b[100];
	int i, j;



	scanf("%d %d", &n, &m);

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

	for (i = 0; i < m; i++){
		int in;
		scanf("%d", &in);
		b[i] = in;
	}

	for (i = 0; i < n; i++){
		int out = 0;
		for (j = 0; j < m; j++){
			out += a[i][j] * b[j];
		}
		printf("%d\n", out);
	}

	return 0;
}

Measured memory_bytes: 636
import java.util.*;
import java.io.*;
import java.nio.charset.StandardCharsets;

public class Main {
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		int N = Integer.parseInt(in.readLine());
		long[] A = new long[N];
		String[] tokens = in.readLine().split(" ");
		for (int i = 0; i < N; ++i) {
			A[i] = Long.parseLong(tokens[i]);
		}
		long[] sums = new long[N];
		sums[0] = A[0];
		for (int i = 1; i < N; ++i) {
			sums[i] = A[i] + sums[i - 1];
		}
		long totalLength = sums[N - 1];
		long halfLength = totalLength / 2;
		int index = Arrays.binarySearch(sums, halfLength);
		if (index >= 0) {
			if (totalLength % 2 == 0) {
				// なにもやる必要がない
				System.out.println("0");
			} else {
				// どちらかを1つ延ばす必要がある
				System.out.println("1");
			}
		} else {
			index = -1 * index - 1;
			long result = calc(sums[index], halfLength, totalLength);
			if (index > 0) {
				result = Math.min(result, calc(sums[index - 1], halfLength, totalLength));
			}
			if (index < N - 1) {
				result = Math.min(result, calc(sums[index + 1], halfLength, totalLength));
			}
			System.out.println(result);
		}
	}

	static long calc(long target, long halfLength, long totalLength) {
		return Math.abs(target - halfLength) + Math.abs(totalLength - halfLength - target);
	}

}


Measured memory_bytes: 75840
from itertools import product
 
def solve():
	N = int(input())
	S = [0 if i == 'o' else 1 for i in input()]
 
	for i, j in product(range(2), repeat=2):
		pattern = [i, j] + [0] * (N - 2) 
		for k in range(2, N):
			pattern[k] = (pattern[k - 1] + pattern[k - 2] + S[k-1] ) % 2
		if S[-1] != (pattern[-2] + pattern[-1] + pattern[0]) % 2 : 
			continue
		if S[0] != (pattern[-1] + pattern[0] + pattern[1]) % 2 :
			continue 	
		answer = [ 'S' if pattern[k] == 0 else 'W' for k in range(N)]
		print(''.join(answer))
		return None
	print(-1)
 
if __name__ == '__main__':
	solve()

Measured memory_bytes: 6268
#include "bits/stdc++.h"
using namespace std;
const int N = 1e5 + 5;
int n , c , k;
int arr[N];
int ans;
int main(){
    scanf("%d %d %d" , &n , &c , &k);
    for(int i = 1 ; i <= n ; ++i){
        scanf("%d" , arr + i);
    }
    ans = 0;
    sort(arr + 1 , arr + 1 + n);
    int cur = -1;
    int cnt = 0;
    for(int i = 1 ; i <= n ; ++i){
        if(cur < arr[i]){
            cur = arr[i] + k;
            cnt = 1;
            ++ans;
        }
        else{
            if(cnt == c){
                cur = arr[i] + k;
                cnt = 1;
                ++ans;
            }
            else{
                ++cnt;
            }
        }
    }
    printf("%d\n" , ans);
}

Measured memory_bytes: 640
int main()
{
  int a,b,i,j;
  while(1)
       {
  scanf("%d%d",&a,&b);
  if(a==0&&b==0){break;}
 
  for(i=1;i<=a;i++)
    {
      for(j=1;j<=b;j++)
    {
      if(j%2==1)
        {
          if(i%2==1)printf("#");
          else printf(".");
        }
      else
        {
              if(i%2==1)printf(".");
          else printf("#");
        }
    }
      printf("\n");
    }
  printf("\n");
     
       }
  return 0;
}


Measured memory_bytes: 2104
#include <stdio.h>
#include <stdlib.h>
int main(void)
{
  int n;
  scanf("%d",&n);
  
  int *b = (int*)malloc(sizeof(int)*n);
  int a;
  for (int i = 0; i < n; ++i) b[i] = 0;
  for (int i = 0; i < n-1; ++i) {
    scanf("%d",&a);
    b[a-1]++;
  }
  for (int i = 0; i < n; ++i) {
    printf("%d\n",b[i]);
  }
  return 0;
}

Measured memory_bytes: 2516
#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define pb push_back
#define mp make_pair
#define F .first
#define S .second 
using ll=long long;
using ld=long double;
const ll INF = 1LL<<60;
const ll mod=1e9+7;
using namespace std;
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
map<ll,ll> p;
int main(){
    ll n;
    cin>>n;
    ll k=2,ans=0;
    ll c=n;
    while (c>=k*k) {
        if(c%k==0){
        c/=k;
        p[k]++;
      } else {
        k++;
      }
    }
    if(c>1)p[c]++;
    ll mm=0;
    for(auto i:p){
        mm=i.second;
        ll cnt=0,pos=1;
        while(mm>=cnt){
            cnt+=pos;
            pos++;
        }
        //cout<<pos<<endl;
        ans+=pos-2;
    }
    cout<<ans;
}

   



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

int main() {
  int a,b,c;
  cin>>a>>b>>c;
  if(a==b&&a!=c){
    cout<<"Yes"<<endl;
  }
  else if(a==c&&a!=b){
    cout<<"Yes"<<endl;
  }
  else if(b==c&&a!=b){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define fill(a,val) memset(a, (val), sizeof a)
#define pb push_back
#define lli long long int
#define scantype int
#define endl "\n"
#define unique(x) x.erase(unique(x.begin(),x.end()), x.end())
#define sort_f(x)  sort(x.begin(),x.end());
#define sort_r(x)  sort(x.rbegin(),x.rend());
 
lli MOD  = 1000000007;
lli inf = 1e15;
 
void scan(scantype &x);
lli powermod(lli _a,lli _b,lli _m){lli _r=1;while(_b){if(_b%2==1)_r=(_r*_a)%_m;_b/=2;_a=(_a*_a)%_m;}return _r;}
lli string_to_number(string s){lli x=0; stringstream convert(s); convert>>x; return x;}
lli add(lli a,lli b){lli x = (a+b)%MOD; return x; }
lli mul(lli a,lli b){lli x = (a*b)%MOD; return x; }
lli sub(lli a,lli b){lli x = (a-b+MOD)%MOD; return x; }
lli divi(lli a,lli b){lli x = a;lli y = powermod(b,MOD-2,MOD);lli res = (x*y)%MOD;return res;}
 
#define N 200003
 
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli a,b;
    cin>>a>>b;
    lli ans=a*b;
    if(ans%2==1)
    {
        cout<<"Odd";
    }
    else
    {
        cout<<"Even";
    }
        
        
    
    return 0;
}    

Measured memory_bytes: 256
#define _USE_NATH_DEFINES
#include<cstdio>
#include <iostream>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<complex>
#include <string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<numeric>
#include<limits>
#include<climits>
#include<cfloat>
#include<functional>
#include<iterator>
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
using namespace std;

bool used[1010101];

int main() {
	int n;
	cin >> n;
	int ans = 1;
	while (!used[n]) {
		used[n] = true;
		if (n % 2 == 0) n /= 2;
		else n = 3 * n + 1;
		++ans;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
"use strict";

function Main(input) {
  input = parseInt(input.split(" ").join(""));
  const num = Math.sqrt(input);
  if (num - Math.floor(num) == 0) {
    console.log("Yes");
  } else {
    console.log("No");
  }
}

Main(require("fs").readFileSync("/dev/stdin", "utf-8"));


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

using namespace std;

int main(){
    vector<int> segundos;
    int n, m, aux, p, x;
    long long total=0;

    cin>>n;

    while(n--){
        cin>>aux;
        total+=aux;
        segundos.push_back(aux);
    }

    cin>>m;

    while(m--){
        cin>>p>>x;
        cout<<total-segundos[p-1]+x<<endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pt complex<double>
#define x real()
#define y imag()
#define bb begin()
#define ee end()
#define ff first
#define ss second
#define pb push_back
#define vll vector<ll>
#define vvl vector<vll>
#define pll pair<ll, ll>
#define vpl vector<pll>
#define sll set<ll>
#define msl multiset<ll>
#define mll map<ll, ll>
#define uml unordered_map<ll, ll>
#define mml multimap<ll, ll>
#define qll queue<ll>
#define pql priority_queue<ll>
#define pqg priority_queue<ll, vll, greater<ll>>
#define TC ll t; cin >> t; while (t--)
#define mp(a, b) make_pair(a, b)
#define MODF(x) ((x) % MOD)
#define ALL(container) container.bb, container.ee
#define FOR(a, n, i) for(ll i = a; i < n; i++)
#define FORR(a, n, i) for(ll i = n - 1; i >= a; i--)
#define FORIT(a, n, it) for (auto it = a; it != n; it++)
#define FORRIT(a, n, it) for (auto it = n; it-- != a;)
#define FORE(e, container) for (auto e : container)
#define FORIN(v, n) FOR(0, n, i) cin >> v[i];
#define FOROUT(v) FORE(e, v) cout << e << " ";
#define ios ios::sync_with_stdio(false), cin.tie(0)

using namespace std;

const ll inf = numeric_limits<ll>::max(), MAX = 1e6, MOD = 1e9 + 7;

int main() {
	ios;
	ll n, m; cin >> n >> m;
	for (ll i = m/n; i >= 1; --i) {
		if (m%i == 0) {
			cout << i << endl;
			break;
		}
	}
	return 0;
}

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

int main()
{
	vector<int> abc(3);
	cin >> abc[0] >> abc[1] >> abc[2];
	int k;
	cin >> k;

	sort(abc.begin(), abc.end());

	for (int i = 0; i < k; ++i) {
		abc[2] *= 2;
	}

	cout << abc[0] + abc[1] + abc[2] << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mem(x,v) memset(x,v,sizeof(x)) 
#define go(i,a,b)  for (int i = a; i <= b; i++)
#define og(i,a,b)  for (int i = a; i >= b; i--)
#define MID(a,b) (a + b) >> 1
#define lson now << 1
#define rson now << 1 | 1
#define low(x) (x & (-x))
using namespace std;
typedef long long LL;
const double EPS = 1e-10;
const int INF = 1e9+100;
const int N = 1e6+10;
int a[N],b[N],c[N];
LL f[N];
int n,tt;
void Add(int x){
	while(x <= 3*n){
		f[x] += 1;
		x += low(x);
	}
}
int Query(int x){
	int ans = 0;
	while(x > 0) ans += f[x], x -= low(x);
	return ans; 
}
bool find(int k){
	mem(f,0);
	LL Ans = 0;	b[0] = 0;
	go(i,1,n) if (a[i] >= c[k]) b[i] = b[i-1] + 1; else b[i] = b[i-1];
	go(i,0,n) {
		b[i] = 2*b[i] - i + n + 1;
		Ans += Query(b[i]);
		Add(b[i]);
	}
	LL t = (1LL * n * (n + 1)) / 2;
	if (Ans >= (t+1)/2) return 1; 
	return 0;
}

int main(){
	scanf("%d",&n);
	int l = 1, r = n;
	go(i,1,n){
		scanf("%d",&a[i]);
		c[i] = a[i];
	}
	sort(c+1,c+n+1);
	int ans = 0;
	while(l <= r){
		int mid = MID(l,r);
		if (find(mid)) l = mid+1,ans = c[mid]; else r = mid - 1;
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 14592
#include<bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define int long long
#define vec(a,n) vector<int> (a)((n));
#define Vec(a,n) vector<string> (a)((n));
#define twovec(a,n,m) vector<vector<int>> a(n,vector<int>(m,0));
#define Twovec(a,n,m) vector<vector<double>> a(n,vector<double>(m,0));
#define P pair<int,int>
#define All(a) (a).begin(),(a).end()
#define Sort(a) sort(All(a));
#define Reverse(a) reverse(All(a));
#define PQ(n) priority_queue<P,vector<P>,greater<P>> (n)
#define pq(n) priority_queue<int> (n)
#define print(a) cout << (a) << endl;
#define printD(a) cout << setprecision(15) << (a) << endl;
using namespace std;
int max_int = 1000000007;
void Debug(auto a);
int nibul(auto a,auto b);
int nibuu(auto a,auto b);
void input(vector<int>& a,int n);

int n;



signed main(){
    int k,q;
    cin >> n >> k >> q;
    vec(a,n);
    REP(i,q){
        int t;
        cin >> t;
        t--;
        a[t]++;
    }
    REP(i,n){
        int t = q - a[i];
        if(k-t>0){
            print("Yes");
        }
        else{
            print("No");
        }
    }
    return 0;
}

void Debug(auto a){
    cout << "{ ";
    for(auto b: a){
        cout << b << " ";
    }
    cout << "}" << endl;
}
int nibul(auto a,auto b){
    int x = lower_bound(All(a),b) - a.begin();
    //key以上の初めてのitr
    return x;
}
int nibuu(auto a,auto b){
    int x = upper_bound(All(a),b) - a.begin();
    //key以下の最後のitr
    return x-1;
}

void input(vector<int>& a,int n){
    REP(i,n){
        cin >> a[i];
    }
}





Measured memory_bytes: 1408
#!/usr/bin/env python3
N = int(input())

is_even = N % 2
li = [] if is_even == 0 else [[N]]
for i in range(N // 2):
    li.append([i + 1, N - i - is_even])

ans = []
for i, a in enumerate(li):
    for j, b in enumerate(li):
        if i >= j:
            continue
        if len(a) == 1:
            ans.append([a[0], b[0]])
            ans.append([a[0], b[1]])
        elif len(b) == 1:
            continue
            # ans.append([a[0], b[0]])
            # ans.append([a[1], b[0]])
        else:
            ans.append([a[0], b[0]])
            ans.append([a[1], b[0]])
            ans.append([a[0], b[1]])
            ans.append([a[1], b[1]])

print(len(ans))
for x in ans:
    print(x[0], x[1])


Measured memory_bytes: 4132
import fractions

n,X=map(int,input().split())
x=list(map(int,input().split()))
x.append(X)
x2=sorted(x)
a=x2[1]-x2[0]
if len(x2)==2:
    print(a)
else:
    #print(x2)
    for i in range(1,n):
        b=x2[i+1]-x2[i]
        ans=fractions.gcd(a,b)
        a=ans
    print(ans)

Measured memory_bytes: 16240
import java.util.Scanner;

public class Main {
    public static Scanner sc;
    public static void main(String[] args) throws Exception {
        sc = new Scanner(System.in);
        int w = sc.nextInt();
        int h = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        int r = sc.nextInt();
        
        if (r <= x && x <= w - r && r <= y && y <= h - r) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

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

int main(){
    int n ;
    cin >> n ;
    vector<int> A(n) ;
    rep(i,n) cin >> A[i] ;
    sort(A.begin(),A.end(),greater<int>()) ;
    ll alice = 0 ;
    ll bob = 0 ;
    rep(i,n){
        if( i%2 == 0 ) alice += A[i] ;
        else bob += A[i] ;
    }
    cout << alice - bob << endl;
}

Measured memory_bytes: 3596
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <queue>
#include <map>
#include <set>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
const int INF = 1<<29;

int n;
int m[20];
int memo[8193][20];
bool solve(int now, int pos) {
  if (memo[now][pos]>=0) return memo[now][pos];
  if (now == 1) return pos%2;
  if (m[pos] >= now - 1) return !(pos%2);
  for (int i=1; i<=m[pos]; ++i) {
    if (pos%2 ^ solve(now-i, (pos+1)%(2*n)))
      return memo[now][pos] = !(pos%2);
  }
  return memo[now][pos] = pos%2;
}

int main() {
  while(cin >> n, n) {
    int s;
    cin >> s;
    REP(i,2*n) {
      cin >> m[i];
    }
    memset(memo,-1,sizeof(memo));
    cout << solve(s, 0) << endl;
  }
  
}

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

using namespace std;

typedef long long ll;

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n; cin >> n;
  int a[n];
  for(int i=0;i<n;i++) cin >> a[i];
  int color = a[0];
  int cnt = 0;
  for(int i=1;i<n;i++){
    if(a[i] == color){
      cnt++;
      color = 1000+cnt;
    }else{
      color = a[i];
    }
  }
  cout << cnt << endl;
}

Measured memory_bytes: 256
def resolve():
  n = int(input())
  a = list(map(int, input().split()))
  b = list(map(int, input().split()))
  c = list(map(int, input().split()))

  ans = 0
  prev = -2
  for x in a:
    x -= 1
    ans += b[x]
    if prev + 1 == x:
      ans += c[prev]
    prev = x
  print(ans)
  return

if __name__ == "__main__":
  resolve()


Measured memory_bytes: 3064
#include <iostream>
#include<string>
using namespace std;
int main(void){
    // Your code here!
    int a,b,c;
    
    int sums=0;
    int& sum=sums;
    
    cin>>a>>b>>c;
    
    sum=c-b;
    if(sum<=0) cout<<"delicious"<<endl;
    else if(a>=sum) cout<<"safe"<<endl;
    else if(a<sum) cout <<"dangerous"<<endl;
  

}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
using namespace std;
     
int main(){
  int n,id=1,nv,ch,index,syuryo=1;
       
  scanf("%d\n",&n);
   
  int *A = new int[100040];
  bool *B = new bool[100040];
  int *C = new int[100040];
  string *D = new string[100040];
  int st,ed;
  for(int i=0;i<=100040;i++){
    A[i]=0; // hukasa
    C[i]=-1; // oya
    B[i]=false; //false nara ko wo motte inai
  }
  for(int i=0;i<n;i++){
    scanf("%d",&id);
      
    getline(cin,D[id]);
   
    syuryo=1;
    for(int r=1;r<=D[id].length();r++){
      if(D[id][r] == ' '){
    syuryo = r-1; // String no iti gime
    break;
      }
    }
     
    index = atoi(D[id].substr(1,syuryo).c_str());
  
    if(index != 0)B[id]=true;
         
  
    if(index != 0){
      st = syuryo+2;  
      for(int d = syuryo+2;d<=D[id].length();d++){
    if(D[id][d] == ' ' || d == D[id].length()){
      A[atoi(D[id].substr(st,d-st).c_str())]=A[id]+1;
      C[atoi(D[id].substr(st,d-st).c_str())]=id;
      if(B[atoi(D[id].substr(st,d-st).c_str())]){
        int st2=3;
          
        for(int j = syuryo+2;j<=D[atoi(D[id].substr(st,d-st).c_str())].length();j++){
            
          if(D[atoi(D[id].substr(st,d-st).c_str())][j] == ' ' || j == D[atoi(D[id].substr(st,d-st).c_str())].length()){
        A[atoi(D[atoi(D[id].substr(st,d-st).c_str())].substr(st2,j-st2).c_str())]=A[atoi(D[id].substr(st,d-st).c_str())]+1;
        st2=j+1;
          }
        }
      }
      st = d+1;
    }
      }
        
    }
      
  }
       
   
       
  for(int i=0;i<n;i++){
    printf("node %d: parent = %d, depth = %d, ",i,C[i],A[i]);
    int cou=0;
    if(C[i] == -1){printf("root, [");}
    else if(!B[i])printf("leaf, [");
    else printf("internal node, [");
      
  
    syuryo=1;
    for(int r=1;r<=D[i].length();r++){
      if(D[i][r] == ' '){
    syuryo = r-1;
    break;
      }
    }
    index = atoi(D[i].substr(1,syuryo).c_str());
      
    st=syuryo+2;
    if(index != 0){    
      for(int j=syuryo+2;j<=D[i].length();j++){
    if(D[i][j] == ' ' || D[i].length() == j ){
      printf("%d",atoi(D[i].substr(st,j-st).c_str()));
      if(j != D[i].length())printf(", ");
      st=j+1;
    }
      }
    }
    printf("]\n");
  }
       
  delete [] A;
  delete [] B;
  delete [] C;
  delete [] D;
  return 0;
}

Measured memory_bytes: 5212
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n; cin >> n;
  string a,b,c; cin >> a >> b >> c;
  int ans = 0;
  for(int i = 0; i < n; ++i){
    ans += set<char>({a[i],b[i],c[i]}).size() - 1;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3572
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <queue>
#include <vector>

using namespace std;

int n, m;
vector<int> g[200100];
int value[200100];

int main() {
	scanf("%d %d", &n, &m);
	for (int i = 0; i < m; i++) {
		int a, b;
		scanf("%d %d", &a, &b);
		g[a].push_back(b);
		g[b].push_back(a);
	}
	queue<int> q;
	q.push(1);
	value[1] = 1;
	while (!q.empty()) {
		int from = q.front();
		q.pop();
		for (int i = 0; i < g[from].size(); i++) {
			int to = g[from][i];
			if (value[to] == 0) {
				value[to] = value[from] + 1;
				q.push(to);
			}
		}
	}
	if (value[n] == 3) {
		printf("POSSIBLE");
		return 0;
	}
	printf("IMPOSSIBLE");
	return 0;
}

Measured memory_bytes: 13168
#include <iostream>  // cin,cout
#include <stdio.h>   // printf,scanf (standard input/output)
#include <cmath>     // abs(x),pow(x,2)
#include <string>
#include <string.h>  // strlen, strcmp
#include <algorithm> // min,max, sort(v.begin(),v.end())
#include <vector>
#include <time.h>
using namespace std;



int Func(){
    int x = 0;
    return x;
}

int main(){
    int N, T;
    
    int c[100];
    int t[100];
    
    cin >> N >> T;
    for (int i=0;i<N;i++) {
        cin >> c[i] >> t[i];
    }
    
    int min_cost = 10000;
    for (int i=0;i<N;i++) {
        if (t[i]<=T) {
            min_cost = min(min_cost,c[i]);
        }
    }
    
    if (min_cost==10000) cout << "TLE" << endl;
    else cout << min_cost << endl;
    
    return 0;
}


Measured memory_bytes: 764