akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef double db;
typedef string str;

typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<db, db> pd;

typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<db> vd;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<str> vs;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<pd> vpd;
typedef vector<vi> vii;
typedef vector<vl> vll;
typedef vector<vd> vdb;
typedef vector<vb> vbb;
typedef vector<vc> vcc;
typedef vector<vs> vss;

#define f first
#define s second	
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define part(x, n) (x).begin(), (x).begin()+n
#define rpart(x, n) (x).rbegin(), (x).rbegin()+n
#define rsz resize
#define ins insert
#define cnt count
#define fr front()
#define bk back()
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound

#define LSOne(S) ((S)&-(S))

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

const int MOD = 1e9+7;

//input
template<class A> void read(complex<A>& c);
template<class A, class B> void read(pair<A,B>& p);
template<class A> void read(vector<A>& v);
template<class A, size_t SZ> void read(array<A,SZ>& a);

template<class T> void read(T& x) { cin >> x; }
void read(db& d) { str t; read(t); d = stod(t); }
void read(ld& d) { str t; read(t); d = stold(t); }
template<class H, class... T> void read(H& h, T&... t) { read(h); read(t...); }

template<class A> void read(complex<A>& c) { A a,b; read(a,b); c = {a,b}; }
template<class A, class B> void read(pair<A,B>& p) { read(p.f,p.s); }
template<class A> void read(vector<A>& x) { trav(a,x) read(a); }
template<class A, size_t SZ> void read(array<A,SZ>& x) { trav(a,x) read(a); }

//output
template<class A> void print(A x) { cout << (x); }
template<class H, class... T> void print(const H& h, const T&... t) {
	print(h); print(t...); }
void prints() { print("\n"); } // print w/ spaces
template<class H, class... T> void prints(const H& h, const T&... t) {
	print(h); if (sizeof...(t)) print(" "); prints(t...); }

void setIn(str s) {freopen(s.c_str(), "r", stdin);}
void setOut(str s) { freopen(s.c_str(), "w", stdout);}
void unsyncIO() { ios::sync_with_stdio(0); cin.tie(0);}
void setIO(str s= ""){
	unsyncIO();
	if(sz(s)) { setIn(s+".in"), setOut(s+".out");}
}

const int mxN = 2e5;
vii adj(mxN), cc;
vb vis(mxN);
vi cur;
int n, m;

void dfs(int u){
	vis[u] = 1;
	cur.pb(u);
	trav(v, adj[u])
		if(!vis[v])
			dfs(v);
}
int main(){
	setIO();
	read(n, m);
	int u, v;
	FOR(i, m){
		read(u, v);
		u--, v--;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	FOR(i, n)
		if(!vis[i]){
			cur.clear();
			dfs(i);
			cc.pb(cur);
		}
	int ans = 0;
	FOR(i, sz(cc))
		ans = max(sz(cc[i]), ans);
	prints(ans);
	return 0;
}



Measured memory_bytes: 28424
from sys import exit, stdin
N, K = [int(_) for _ in stdin.readline().rstrip().split()]
ans = 0
if K == 0:
    print(N*N)
    exit()
for b in range(K + 1, N + 1):
    ans += N // b * (b - K) + max(0, (N % b) - K + 1)

print(ans)

Measured memory_bytes: 3060
#include <iostream>
using namespace std;
int main(void){
    int x,y,i,j;
    while (cin >>x>>y) {
        if(x==0 && y==0) break;
        
        for (i=0; i<x; i++) {
            if(i%2==1){
                for (j=0; j<y; j++) {
                    if (j%2==0)cout<<".";
                    else cout<<"#";
                }cout<<endl;
                
            }else{
                for (j=0; j<y; j++) {
                    if (j%2==0)cout<<"#";
                    else cout<<".";
                }cout<<endl;
            }
        }cout<<endl;
    }
    
}

Measured memory_bytes: 1152
#include <stdio.h>
#define MAX 500000
#define INFTY 1000000000

int c=0,A[MAX];

void merge(int A[],int left,int mid,int right) {
  int i,j,n1,n2,k,L[MAX/2+1],R[MAX/2+1];
  n1 = mid - left;
  n2 = right - mid;
    for(i = 0 ;i < n1;i++) {
      L[i] = A[left + i];
      }
  for(i = 0;i < n2;i++){
    R[i] = A[mid + i];
  }
    L[n1] = INFTY;
    R[n2] = INFTY;
    i = 0;
    j = 0;
      
  for(k = left;k < right;k++) {
    if (L[i] <= R[j]) {
      A[k] = L[i];
      i = i + 1;
      c++;
	}
    else {
      A[k] = R[j];
      j = j + 1;
      c++;
    }
  }
}

void mergeSort(int A[],int left,int right) {
  int mid;
	if(left+1 < right) {
	  mid = (left + right)/2;
          mergeSort(A, left, mid);
	  mergeSort(A, mid, right);
	  merge(A, left, mid, right);
	}
}

int main() {
  int i,n;
  scanf("%d",&n);
  for(i=0;i<n;i++) {
    scanf("%d",&A[i]);
  }
  mergeSort(A,0,n);
  for(i=0;i<n;i++) {
    printf("%d",A[i]);
    if(i < n-1) printf(" ");
  }
  printf("\n");
  printf("%d\n",c);
  return 0;
}

Measured memory_bytes: 4504
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef pair<int,int> P;
 
const int INF = 1e9;
const int mod = 1e9+7;
const double EPS = 1e-10;
const double PI = acos(-1.0);

int main()
{
    int n;
    cin >> n;
    vector<int> l(n);
    int sum = 0;
    for(int i = 0; i < n; i++){
        cin >> l[i];
        sum += l[i];
    }
    sort(l.rbegin(),l.rend());
    cout << (l[0] < sum - l[0] ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stdlib.h>
#include <map>
#include <cmath>
#define MOD_P 1000000007
#define MOD_Q 998244353
#define PI 3.14159265358979
#define ll long long
using namespace std;



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

	if (n >= 'A' && n <= 'Z') {
		printf("A");
	} else {
		printf("a");
	}
	
	return 0;
}



Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store") // to restrict undesirable precision
#pragma GCC optimize ("-fno-defer-pop")// to pop argument of function as soon as it returns
#define all(a) a.begin(),a.end()
#define ll long long int
#define ld long double
ll power(ll a,ll b,ll m){ if(b==0) return 1; if(b==1) return a%m; ll t=power(a,b/2,m)%m; t=(t*t)%m; if(b&1) t=((t%m)*(a%m))%m; return t;}
ll modInverse(ll a, ll m) { return power(a, m-2, m); }
#define ps push_back
#define fs first
#define takeline cin.ignore();
#define sc second
#define N 3000005
#define endl "\n"
#define mod 1000000007
//((1.0l)*BIG MULTIPLY MAGIC?)
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();
//-----------------------------------------------
int main(){
	
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	
	ll i,j,k,l,n;
	cin>>n;
	for(i=1;i<=n;i++){
		k=1.08*i;
		if(k==n){
			cout<<i;
			return 0;
		}
	}
	cout<<":(";
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
using namespace std;
const int INF=2e5+5;
const int Mod=1e9+7;
long long sum[INF],n,a[INF],ans;
signed main()
{
        scanf("%lld",&n);
        for (int i=1; i<=n; i++) scanf("%lld",&a[i]);
        for (int i=n; i>=1; i--) sum[i]=(sum[i+1]+a[i])%Mod;
        for (int i=1; i<=n; i++) ans+=(a[i]*sum[i+1])%Mod,ans%=Mod;
        cout<<ans<<"\n";
        return 0;
}


Measured memory_bytes: 6760
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#define rep(i, m, n) for(int i = m;i < n;i++)
#define repr(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define INF 999999999
using namespace std;

int main(){
    int N, T;
    cin >> N >> T;
    int t[N];
    rep(i, 0, N) cin >> t[i];
    int X = 0;

    rep(i, 0, N){
        if(i != N-1){
            if(T <= t[i + 1] - t[i]) X += T;
            else X += t[i + 1] - t[i];
        }
        else X += T;
    }

    cout << X << endl;

    return 0;
}


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

#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef complex<double> point;
#define xx real()
#define yy imag()

#define REP(i, a, b) for(int i = (a); i < (int)(b); i++)
#define REPN(i, a, b) for(int i = (a); i <= (int)(b); i++)
#define FA(it, x) for(__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define SZ(x) (int)(x).size()
#define BE(x) (x).begin(), (x).end()
#define SORT(x) sort(BE(x))
#define _1 first
#define _2 second

#define x1 gray_cat_x1
#define y1 gray_cat_y1

template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

#define file "I1"

const double EPS = 1e-9;
const double PI = acos(-1.);
const int INF = 1e9;
const ll MOD = 1e9 + 7;

const int MAXN = 2e5 + 5;

vi g[2][MAXN];
int col[2][MAXN];

map<pii, vector<int> > comps;

int ind;
int cl;

int ans[MAXN];

void dfs(int s){
	col[ind][s] = cl;
	REP(i, 0, SZ(g[ind][s])){
		int to = g[ind][s][i];
		if (!col[ind][to]){
			dfs(to);
		}
	}
}

void solve(){
	int n, m[2];
	scanf("%d%d%d", &n, &m[0], &m[1]);
	REP(k, 0, 2){
		REP(i, 0, m[k]){
			int a, b;
			scanf("%d%d", &a, &b);
			g[k][a].pb(b);
			g[k][b].pb(a);
		}
	}
	REP(k, 0, 2){
		ind = k;
		cl = 0;
		REPN(i, 1, n){
			if (!col[k][i]){
				++cl;
				dfs(i);				
			}
		}
	}
	REPN(i, 1, n){
		comps[mp(col[0][i], col[1][i])].pb(i);
	}
	FA(it, comps){
		vi &tmp = it->second;
		REP(i, 0, SZ(tmp)){
			ans[tmp[i]] = SZ(tmp);
		}
	}
	REPN(i, 1, n){
		printf("%d ", ans[i]);
	}
	putchar('\n');
}   

int main(){

    //freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();    
    }
}


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

int main() {
  int n, x = 0;
  string st;
  
  cin >> n >> st;
  
  for (int i = 0; i < n; ++i) {
    if(st[i] == 'R') 
      ++ x;
    else 
      -- x;
  }
  
  if(x > 0)
    puts("Yes");
  else 
    puts("No");
  
  return 0;
}

Measured memory_bytes: 256
N = int(input())
s = input()
inv = {'S':'W','W':'S'}

prefix = ['SS','SW','WS','WW']

def check_i(i): # check0,check-1だけすれば十分
    if s[i] == 'o' and ans[i] == 'S':
        if ans[i+1] != ans[i-1]:
            return False
    if s[i] == 'x' and ans[i] == 'S':
        if ans[i+1] == ans[i-1]:
            return False
    if s[i] == 'o' and ans[i] == 'W':
        if ans[i+1] == ans[i-1]:
            return False
    if s[i] == 'x' and ans[i] == 'W':
        if ans[i+1] != ans[i-1]:
            return False
    return True


for p in prefix:
    ans = p
    for i in range(1,N-1):
        if s[i] == 'o' and ans[i] == 'S':
            ans += ans[i-1]
        if s[i] == 'x' and ans[i] == 'S':
            ans += inv[ans[i-1]]
        if s[i] == 'o' and ans[i] == 'W':
            ans += inv[ans[i-1]]
        if s[i] == 'x' and ans[i] == 'W':
            ans += ans[i-1]
    if check_i(0) and check_i(-1):
        print(ans)
        exit()
print(-1)




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

int main() {
  int N;
  cin >> N;
  int n = 1;
  int x = 0;
  for (int i = 0; i < 8; i++){
    n = N;
    for (int j = 0; j < i; j++){
      n /= 10;
    }
    x += n % 10;
  }
  if (N % x == 0)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>
#include <cstdint>



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

#define all(x) (x).begin(),(x).end()

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

typedef long long ll;

using namespace std;


int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,k;cin>>n>>k;
  if(k==1){
    cout<<0<<endl;
    return 0;
  }
  cout<<n-k<<endl;

  return 0;

}


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

int main(){
    long long N;
    cin >> N;
    vector<string> s(N);
    for(long long i=0;i<N;i++)    cin >> s.at(i);
    vector<string> m,a,r,c,h;
    for(long long i=0;i<N;i++){
        switch(s.at(i).at(0)){
            case 'M':m.push_back(s.at(i));
                break;
            case 'A':a.push_back(s.at(i));
                break;
            case 'R':r.push_back(s.at(i));
                break;
            case 'C':c.push_back(s.at(i));
                break;
            case 'H':h.push_back(s.at(i));
                break;
            default:break;
        }
    }
    long long M,A,R,C,H;
    M=m.size();
    A=a.size();
    R=r.size();
    C=c.size();
    H=h.size();
    
    cout << M*A*R + M*A*C + M*A*H + M*R*C + M*R*H + M*C*H + A*R*C + A*R*H + A*C*H + R*C*H << endl;

    
    
}


Measured memory_bytes: 11636
#include <iostream>
#include <vector>
#include <map>
using namespace std;

typedef vector <string> VS;

typedef long long ll;
const ll mod = 100000007;
bool visited[100001][10];
ll dp[100001];

typedef pair <int, int> PII;
map <PII, ll> memo;

VS cut( string s ) {
    VS answer;
    int L = s.size();
    string part = "";
    for ( int i = 0; i+1 < L; i++ ) {
        if ( s[i] != s[i+1] ) {
            part += s[i];
            answer.push_back(part);
            part = "";
        } else {
            part += s[i];
        }
    }
    part += s[L-1];
    answer.push_back(part);
    return answer;
}

ll solve( int s, int d ) {
    if ( visited[s][d] ) return memo[PII(s,d)];

    ll answer = 1;
    for ( int i = 0; i < s; i++ ) {
        dp[i] = 1;
    }
    for ( int i = 0; i < s; i++ ) {
        ll sum = 0;
        for ( int j = 1; j <= d && i-j >= 0; j++ ) {
            sum = ( sum + dp[i-j] ) % mod;
        }
        if ( sum > 0 ) dp[i] = ( dp[i] + sum ) % mod;
    }
    answer = dp[s-1];

    visited[s][d] = true;
    return memo[PII(s,d)] = answer % mod;
}

int conv( char c ) {
    if ( c == '8' || c == '0' ) return 3;
    return 5;
}

int main() {
    string input;
    while ( cin >> input ) {
        if ( input == "#" ) break;

        VS parts = cut( input );
        int L = parts.size();
        ll answer = 1;
        for ( int i = 0; i < L; i++ ) {
            answer = ( answer * solve(parts[i].size(), conv(parts[i][0])) ) % mod;
        }
        cout << answer << endl;
    }
    return 0;
}

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

int main(){
	int q;
	cin>>q;
	for(int i=0;i<q;i++){
		int ans=0;
		int c,a,n;
		cin>>c>>a>>n;
		while(c&&a&&n){
			c--;
			a--;
			n--;
			ans++;
			}
		while(c>=2&&a){
			c-=2;
			a--;
			ans++;
			}	
		ans+=(c/3);
		cout<<ans<<endl;	
		}
		return 0;
	}

Measured memory_bytes: 3096
#include <algorithm>
#include <bits/stdc++.h>
#include <cmath>
#include <cstdint>
#include <iostream>
#include <iterator>
#include <map>
#include <vector>

// lib/square.hpp
#ifndef SQUARE_HPP
#define SQUARE_HPP

/*
usage:

tools::square(5) => 25
*/

namespace tools {
  template <typename T>
  constexpr T square(const T x) {
    return x * x;
  }
}

#endif

// lib/util.hpp
#ifndef UTIL_HPP
#define UTIL_HPP


typedef std::int_fast64_t i64;
typedef std::uint_fast64_t u64;
typedef std::int_fast32_t i32;
typedef std::uint_fast32_t u32;

namespace tools {
  template <typename T>
  void read(std::vector<T>& vector, const typename std::vector<T>::size_type size) {
    vector.reserve(size);
    std::copy_n(std::istream_iterator<T>(std::cin), size, std::back_inserter(vector));
  }

  template <typename T, std::size_t N>
  void read(std::array<T, N>& array) {
    std::copy_n(std::istream_iterator<T>(std::cin), N, array.begin());
  }
}

#endif

// lib/prime_sieve.hpp
#ifndef PRIME_SIEVE_HPP
#define PRIME_SIEVE_HPP


/*
// primes are all primes less than or equal to 100
std::vector<std::int_fast64_t> primes = tools::prime_sieve<std::int_fast64_t>(100);
*/

namespace tools {
  template <typename T>
  std::vector<T> prime_sieve(const T n) {
    std::vector<bool> is_prime(n + 1, true);
    is_prime[0] = false;
    is_prime[1] = false;

    const T max = static_cast<T>(std::sqrt(n));
    for (T i = 2; i <= max; ++i) {
      if (is_prime[i]) {
        for (T j = i * 2; j <= n; j += i) {
          is_prime[j] = false;
        }
      }
    }

    std::vector<T> result;
    for (T i = 0; i <= n; ++i) {
      if (is_prime[i]) {
        result.push_back(i);
      }
    }
    return result;
  }
}

#endif

// lib/pow.hpp
#ifndef POW_H
#define POW_H


/*
usage:

tools::pow(2, 5) => 32
*/

namespace tools {
  template <typename T>
  constexpr T pow(const T base, const T exponent) {
    return exponent == 0
      ? 1
      : exponent % 2 == 0
        ? square(pow(base, exponent / 2))
        : pow(base, exponent - 1) * base;
  }
}

#endif

// lib/prime_factorization.hpp
#ifndef PRIME_FACTORIZATION_HPP
#define PRIME_FACTORIZATION_HPP


namespace tools {
  template <typename T>
  std::map<T, T> prime_factorization(T n) {
    std::map<T, T> result;
    for (const T& p : prime_sieve(static_cast<T>(std::sqrt(n)))) {
      while (n % p == static_cast<T>(0)) {
        ++result[p];
        n /= p;
      }
    }
    if (n > static_cast<T>(1)) {
      ++result[n];
    }
    return result;
  }
}

#endif

// main.cpp

int main() {
  i64 N, P;
  std::cin >> N >> P;
  const std::map<i64, i64> prime_factors = tools::prime_factorization(P);
  std::cout << std::accumulate(prime_factors.begin(), prime_factors.end(), static_cast<i64>(1), [&N](const i64 prod, const std::pair<i64, i64>& pair) {
    return prod * tools::pow(pair.first, pair.second / N);
  }) << std::endl;
  return 0;
}

Measured memory_bytes: 1528
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
//#define ll long long
//#define int  unsigned long long
#define pb push_back
#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int N = 300000;
int mod = 1e9 + 7;
int d[N], cnt[N], f[N], invf[N];
int binpow(int x, int y){
    if (y == 0) return 1;
    if (y % 2 == 1) return x * binpow(x, y - 1) % mod;
    int z = binpow(x, y / 2);
    return z * z % mod;
}
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    //freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    cout << (n - 1) / 2;
}


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

int main(){
  int n;
  ll k;
  cin>>n>>k;
  int a[n];
  rep(i,0,n){
    cin>>a[i];
    a[i]--;
  }
  int ans[n+1];
  ans[0]=0;
  rep(i,0,n){
    ans[i+1]=a[ans[i]];
  }
  if(k<=n){
    cout<<ans[k]+1<<endl;
  }
  else{
    int cur=ans[n];
    int j=n-1;
    while(ans[j]!=cur){
      j--;
    }
    cout<<ans[(k-n)%(n-j)+j]+1<<endl;
  }
}

Measured memory_bytes: 5200
n=int(input())
L=input()+'?'
S=input()
T=[]
i=0


while n-1>=i:
	if L[i]==L[i+1]:
		T.append(0)
		i+=2
	else:
		T.append(1)
		i+=1

        
def f(x,y):
	if x==0 and y==1:
		return 1
	if x==0 and y==0:
		return 3
	if x==1 and y==1:
		return 2
	if x==1 and y==0:
		return 2
if T[0]==0:
	ans=6
else:
	ans=3
mod = 10**9 + 7
for i in range(len(T)-1):
	ans=ans*f(T[i],T[i+1])
	ans=ans%mod
print(ans)


			

Measured memory_bytes: 9248
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<functional>
#include<queue>
#include <iomanip>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>

#define DBG cerr << '!' << endl;
#define REP(i,n) for(int (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(int (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(int (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int i = 0;i < (n);i++)cerr << v[i] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()

using namespace std;

typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;

bool dp[31];

int main()
{
	REP(i,28)
	{
		int a;cin >> a;
		dp[a] = true;
	}
	
	for(int i = 1;i < 31;i++)
	{
		if(!dp[i])cout << i << endl;
	}
	
	return 0;
}

Measured memory_bytes: 3096
/*
ID: espr1t
TASK: 
KEYWORDS: 
*/

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>

using namespace std;
FILE* in = stdin; FILE* out = stdout;

const int MAX = 1024;
const int INF = 1000000001;

int main(void) {
	// in = fopen("B.in", "rt");
	
	int n, t;
	fscanf(in, "%d %d", &n, &t);
	int ans = INF;
	for (int i = 0; i < n; i++) {
	    int cost, time;
	    fscanf(in, "%d %d", &cost, &time);
	    if (time <= t) {
	        ans = min(ans, cost);
        }
    }
    if (ans == INF) {
        fprintf(out, "TLE\n");
    } else {
        fprintf(out, "%d\n", ans);
    }
	
	return 0;
}

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

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

	int32_t n, m, a, b;
	std::cin >> n >> m >> a >> b;
	
	bool isReady = false;
	int32_t cntRows, cntCols;
	for(int32_t x = 0; x < n; x++) {
		for(int32_t y = 0; y < m; y++) {
			if(x * a + (n - x) * (m - a) == y * b + (m - y) * (n - b)) {
				cntRows = x;
				cntCols = y;
				isReady = true;
				break;
			}
		}
		if(isReady) {
			break;
		}
	}

	if(!isReady) {
		std::cout << -1 << '\n';
		return 0;
	}

	std::vector< int32_t > rem(m);
	for(int32_t i = 0; i < m; i++) {
		if(i < cntCols) {
			rem[i] = b;
		}
		else {
			rem[i] = n - b;
		}
	}

	for(int32_t i = 0; i < n; i++) {
		int32_t x;
		if(i < cntRows) {
			x = a;
		}
		else {
			x = m - a;
		}

		for(int32_t j = 0; j < m; j++) {
			if(x != 0 && rem[j] != 0) {
				std::cout << '1';
				x--;
				rem[j]--;
			}
			else {
				std::cout << '0';
			}
		}
		std::cout << '\n';
	}
}



Measured memory_bytes: 1280
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main(){

	vector<string> table;
	table.push_back("");
	table.push_back("',.!?");
	table.push_back("abcABC");
	table.push_back("defDEF");
	table.push_back("ghiGHI");
	table.push_back("jklJKL");
	table.push_back("mnoMNO");
	table.push_back("pqrsPQRS");
	table.push_back("tuvTUV");
	table.push_back("wxyzWXYZ");
	table.push_back(" ");

	string str;
	while(cin>>str){
		int prv=-1;
		int cnt=0;
		for(int i = 0; i < str.size(); i++){
			if(prv==-1){
				prv=str[i];
				cnt++;
			}
			else if(str[i]=='0'){
				if(prv>='1'&&prv<='9'){
					cout<<table[prv-'0'][(cnt-1)%table[prv-'0'].size()];
					cnt=0;
					prv='0';
				}
				else{
					cout<<" ";
					prv='0';
					cnt=0;
				}
			}
			else if(str[i]>='1'&&str[i]<='9'){
				if(prv==str[i])
					cnt++;
				else if(prv>='1'&&prv<='9'){
					cout<<table[prv-'0'][(cnt-1)%table[prv-'0'].size()];
					cnt=1;
					prv=str[i];
				}
				else{
					cnt=1;
					prv=str[i];
				}
			}
		}
		if(cnt!=0){
			cout<<table[prv-'0'][(cnt-1)%table[prv-'0'].size()];
		}
		cout<<endl;
	}

	return 0;
}

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

#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define debug(x) cerr << #x << ": " << x << endl

using namespace std;

typedef long long ll;
typedef pair<ll, ll> Pll;
typedef pair<int, int> Pii;

const int matches[10] = {1<<30, 2, 5, 5, 4, 5, 6, 3, 7, 6};

vector<int> a(9);
int n, m;
vector<string> dp(10001, "");

string chmax(string s, string t) {
    if(s.length() < t.length()) {
        return t;
    } else if(s.length() > t.length()) {
        return s;
    } else {
        for(int j=0;j<t.length();++j) {
            if(s[j] < t[j]) {
                return t;
            } else if(s[j] > t[j]) {
                return s;
            }
        }
        return s;
    }
}

int main() {
    std::ios::sync_with_stdio(0); cin.tie(0);
    cin >> n >> m;
    a.resize(m);
    for(int i=0;i<m;++i) cin >> a[i];

    for(int i=0;i<m;++i) {
        for(int j=0;j<=n-matches[a[i]];++j) {
            if(j && dp[j].empty()) continue;
            dp[j+matches[a[i]]] = chmax(
                dp[j+matches[a[i]]], 
                chmax(dp[j] + char('0'+a[i]), char('0'+a[i]) + dp[j])
            );
            // cerr << j+matches[a[i]] << ": " << dp[j+matches[a[i]]] << endl;
        }
    }
    cout << dp[n] << "\n";
}


Measured memory_bytes: 35584
#include <bits/stdc++.h>
#define int long long
const int INF = 1e18L + 5;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using namespace std;

signed main() {

    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(8);

    int n; cin >> n;
    double sum = 0.00000000;
    double a;
    rep(i,n) {
        cin >> a;
        sum += 1/a;
    }
    cout << (double)1/sum << endl;
    return 0;
}

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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int N, K;
  cin >> N >> K;
  double res = 0;
  for (int i = 1; i <= N; i++) {
    double tmp = 1.0 / N;
    int now = i;
    while (now < K) {
      now *= 2;
      tmp /= 2;
    }
    res += tmp;
  }
  cout << fixed << setprecision(10) << res << '\n';
  return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	
	int n;
	cin>>n;
	string x;
	cin>>x;
	
	for(auto it: x)
	{
		int temp=it-'A';
		temp+=n;
		temp%=26;
		
		cout<<(char)('A'+temp);
	}
					                                				
	cerr<<"\nTime elapsed: " << 1000.0 * clock() / CLOCKS_PER_SEC << " ms\n";
	
	return 0;
}

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

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

//==================================

int main() {
#ifdef FASTIO
    cin.tie(0), cout.tie(0);
    ios::sync_with_stdio(false);
#endif
#ifdef FILEINPUT
    ifstream ifs("./in_out/input.txt");
    cin.rdbuf(ifs.rdbuf());
#endif

    string S, T;
    cin >> S >> T;
    int N = (int)S.size();

    Vi ch1(26), ch2(26);
    for (int i = 0; i < N; i++) {
        ++ch1[S[i] - 'a'];
        ++ch2[T[i] - 'a'];
    }
    sort(ch1.begin(), ch1.end());
    sort(ch2.begin(), ch2.end());

    bool ok = true;
    for (int i = 0; i < 26; i++) {
        if (ch1[i] != ch2[i]) {
            ok = false;
        }
        if (!ok) {
            break;
        }
    }

    cout << (ok ? "Yes\n" : "No\n");

    return 0;
}

Measured memory_bytes: 916
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
using namespace std;
int main()
{
	int a[55];
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=n;i++)cin>>a[i];
	int ans=0;
	sort(a+1,a+1+n);
	for(int i=n;n-i+1<=m;i--){
		ans+=a[i];
	}
	cout<<ans<<endl;
	return 0;
}

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

#define rep2(x,fr,to) for(int x=(fr);x<(to);x++)
#define rep(x,to) for(int x=0;x<(to);x++)
#define repr(x,fr,to) for(int x=(fr);x>=(to);x--)
#define all(c) c.begin(),c.end()
#define sz(v) (int)v.size()
#define TST(H) (#H);

using namespace std;
typedef long long  ll; typedef vector<int> VI; typedef pair<int,int> pii; typedef vector<ll> VL; const int MD = 1e9 + 7;
void dbg(){cerr<<"\n";} template <class F,class ...S> void dbg(const F& f, const S&...s){cerr <<f <<": "; dbg(s...);}

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


	ll ans =1;
	if(s=="RRR" ) ans =3;
	else if(s=="RRS" || s=="SRR") ans =2;
	else if(s=="SSS") ans=0;
	
	cout <<ans <<"\n";
	return 0;
}



Measured memory_bytes: 3648
#include<stdio.h>
#include<string.h>
int main(){
    char str[20]; 
    int i; 
    
    scanf("%s",str); 
    
    i=strlen(str)-1;
    
    for(;i>=0;i--){
        printf("%c",str[i]);
    } 
    
    printf("\n");
    
    return 0; 
    
} 


Measured memory_bytes: 2044
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
inline int read(){
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9'){
		if(c=='-')f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=(x<<1)+(x<<3)+c-'0';
		c=getchar();
	}
	return x*f;
}
string s;
int main(){
	cin>>s;
	putchar(s[0]),putchar(s[1]),putchar(s[2]);
	return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define FASTIO ios::sync_with_stdio(false);cin.tie(0);
#define ADD +
#define SUBTRACT -
#define MULTIPLY *
#define DIVIDE /
#define MOD %
#define INCREMENT(x) ++x
#define DECREMENT(x) --x
#define in(a,b) cin>>a>>b;
#define out(a,b) cout<<a<<endl<<b<<endl;
#define scan(a) scanf("%d",&a);
#define print(a) printf("%d\n",a);
#define scanii(a,b) scanf("%d %d",&a,&b);
#define printii(a,b) printf("%d\n%d\n",a,b);
#define scaniii(a,b,c) scanf("%d %d %d",&a,&b,&c);
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define ll long long
#define ull unsigned long long
#define sll signed long long
#define pi acos(-1)
#define mod 1000000007
#define TRUE 1
#define FALSE 0
#define ZERO 0
#define MP make_pair
#define F first
#define S second
#define f1(i,a) for(int i=0;i<a;++i)
#define f2(i,a) for(int i=a-1;i>=0;--i)
#define en puts("");
#define elif else if
typedef ll int lli;
typedef sll int slli;
typedef ull int ulli;
const int sz=10000;
using namespace std;

int clue();
int result();
void show();
bool check();


bool cmp(pair<int,int>p,pair<int,int>q) {
    // return p.first>q.first;//descending by first
    // return p.first<q.first;//ascending by first
    // return p.second>q.second;//descending by second
    return p.second<q.second;//ascending by second
}

// bool cmp(int p,int q) {
    // return p>q;//descending
    // return p<q;//ascending
// }


int main() {

    int t;
    // cin>>t;
    t=1;
    while(t-->0) {
        clue();
    }

    return 0;
}
int clue() {

    int n;
    set<int>s;
    cin>>n;
    int x;
    // int a[n];
    f1(i,n) {
        // cin>>a[n];
        cin>>x;
        s.insert(x);
    }
    
    int k=s.size();

    (k==n)?cout<<"YES"<<endl:cout<<"NO"<<endl;
    
    return 0;
}

Measured memory_bytes: 12932
let get_line () =
    read_line ()
    |> Stream.of_string

let rec play a b c turn =
    let table = function
        | 'a' -> a
        | 'b' -> b
        | 'c' -> c
    in
    let line = table turn in
    match Stream.peek line with
    | Some x -> 
        Stream.junk line;
        play a b c x
    | None ->
        Char.uppercase turn

let () =
    let a = get_line () in
    let b = get_line () in
    let c = get_line () in
    play a b c 'a'
    |> print_char
    |> print_newline


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

int main() {
  string s;
  cin >> s;
  int ans =0;
  
  for(int i=0;i<s.size();i++){
    if(s[i]=='T'||s[i]=='G'||s[i]=='C')
      s[i] = 'A';
  }
  
  for(int i=0;i<s.size();i++){
    if(s[i]=='A'){
      for(int j=i;j<s.size();j++){
        if(s[j]=='A')
          ans = max(j-i+1,ans);
        else
          break;
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
x = int(input())
li = list(map(int, input().split()))

for i in range(x):
    v = li[i]
    j = i - 1
    while j >= 0 and li[j] > v:
        li[j+1] = li[j]
        j -= 1
    li[j+1] = v
    for j in range(x):
        if j != x-1:
            print(li[j], end=" ")
        elif j == x-1:
            print(li[j], end="\n")


Measured memory_bytes: 5984
#include <iostream>
#include <string.h>
using namespace std;

int main () {
  int n;
  cin >> n;
  string h;
  cin >> h;
  int ans = 0;
  for (int i = 0; i <= 999; i++) {
    string sub = to_string(i);
    while (sub.size() < 3) {
      sub = "0" + sub;
    }
    int itr = 0;
    for (int j = 0; j < h.size(); j++) {
      if (h[j] == sub[itr]) {
        itr++;
        if (itr >= 3) {
          ans++;
          break;
        }
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>

// Acknowledgement: Special thanks to kyomukyomupurin, who developed this
// template.
template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  int n = 0;
  for (auto e : vec) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& st) {
  int n = 0;
  for (auto e : st) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) {
  int n = 0;
  for (auto e : mp) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
  for (T& e : vec) is >> e;
  return is;
}

#ifdef LOCAL
#define debug(...) \
  std::cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}
using namespace std;
using int64 = long long;

int main() {
  int H, W, N;
  cin >> H >> W >> N;
  vector<int> a(N);
  cin >> a;
  vector<int> ans(H * W);
  int last = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < a[i]; j++) {
      ans[last] = i + 1;
      last++;
    }
  }
  debug(ans);
  bool reverse = 0;
  for (int i = 0; i < H; i++) {
    if (reverse) {
      for (int j = 0; j < W; j++) {
        cout << ans[(i + 1) * W - j - 1] << ' ';
      }
    } else {
      for (int j = 0; j < W; j++) {
        cout << ans[i * W + j] << ' ';
      }
    }
    cout << endl;
    reverse = !reverse;
  }
  return 0;
}

Measured memory_bytes: 3636
import sys
input = sys.stdin.readline
def main():
    N, K = map(int, input().split())
    A = list(map(int, input().split()))
    visited = {i:0 for i in range(N)}
    visited[0] = 1
    count = 0
    pre_count = 0
    cicle_idx = 0
    is_cicle = False
    idx = 0
    ans = -1
    while not is_cicle:
        count += 1
        if count == K:
            ans = A[idx]
        idx = A[idx]-1
        if visited[idx] == 1:
            visited[idx] = 2
            is_cicle = True
            cicle_idx = idx
            break
        visited[idx] = 1
    if ans == -1:
        cicle = []
        will_push = False
        while True:
            idx = A[idx]-1
            if idx == cicle_idx:will_push = True
            if len(cicle) > 0 and visited[idx] == 2:break
            if will_push:
                cicle.append(idx)
        pre_count = count - len(cicle)
        ans_idx = (K - pre_count) % len(cicle)
        print(cicle[ans_idx]+1)
    else:
        print(ans)
if __name__ == "__main__":
    main()

Measured memory_bytes: 119500
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,f1,f2,f3;
void solve(){
	int x;
	cin >> n;
	for(int i = 1;i <= n;i ++){
		scanf("%d",&x);
		if(x % 4 == 0) f1 ++;
		else if(x % 2 == 0) f2 ++;
		else f3 ++;
	}
	if(!f2 && f3 == f1 + 1) cout << "Yes" << "\n";
	else if(f1 >= f3) cout << "Yes" << endl;
	else cout << "No" << endl;
}

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

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int h, w;
	scanf("%d %d", &h, &w);
	int i, j;
	char a[102][102];
	for (i = 0; i < h; i++)
		scanf("%s", a[i]);
	int count[30];
	for (i = 0; i < 30; i++)
		count[i] = 0;
	for (i = 0; i < h; i++)
		for (j = 0; j < w; j++)
			count[a[i][j] - 'a']++;
	int c = 0;
	for (i = 0; i < 30; i++)
		if (count[i] % 2 > 0)
			c++;
	int d = 0;
	for (i = 0; i < 30; i++)
		if (count[i] % 4 > 1)
			d++;
	if (h % 2 == 0 && w % 2 == 0)
	{
		if (c == 0 && d == 0)
			printf("Yes\n");
		else
			printf("No\n");
	}
	else if (h % 2 == 0 && w % 2 == 1)
	{
		if (c == 0 && 2 * d <= h)
			printf("Yes\n");
		else
			printf("No\n");
	}
	else if (h % 2 == 1 && w % 2 == 0)
	{
		if (c == 0 && 2 * d <= w)
			printf("Yes\n");
		else
			printf("No\n");
	}
	else
	{
		if (c == 1 && 2 * d <= h + w - 2)
			printf("Yes\n");
		else
			printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
inline int read(){
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}
	return x*f;
}
#define MN 305
int N,ans;
char mp[MN][MN];
int a[MN][MN*2];
int main(){
	N=read();
	for(int i=0;i<N;i++)scanf("%s",mp[i]);
	for(int i=0;i<N;i++)for(int j=0;j<N;j++)a[i][j]=a[i][j+N]=mp[i][j]-'a';
	for(int i=0;i<N;i++){
		bool f=1;
		for(int j=0;j<N;j++)for(int k=0;k<=j;k++){
			if(!f) break;
			if(a[j][i+k]!=a[k][i+j]){f=0;break;}
		}
		if(f) ans+=N;
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 1024
//author:luckYrat(twitter:@luckYrat_)
//#include <bits/stdc++.h>

//def
#include <iostream>

#include <cmath>
#include <algorithm>
#include <iomanip>

//array
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <utility>
#include <climits>



using namespace std;

using ll = long long;
using P = pair<ll,ll>;

#define anyfill(n,s) setw(n) << setfill(s)
#define loop(s) for(int i = 0; s > i; i++)
#define rep(i,q) for(int i = 0; (q) > i; i++)
#define repp(i,n,q) for(int i = n; (q) > i; i++)
#define dep(i,q) for(int i = (q); 0 < i; i--)


#define MAX 1000000000
const int mod = 1000000007;
#define EPS (1e-10)

#define pb push_back
#define fir first
#define scn second
#define ednl endl

#define YesNo(a) (a?"Yes":"No")
#define YESNO(a) (a?"YES":"NO")
#define yesno(a) (a?"yes":"no")


P ar4[4] = {{0,1},{0,-1},{1,0},{-1,0}};
P ar8[8] = {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
/*
確認ポイント
cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる
vector.unique()は隣接した同じ要素を削除するので先にソートをする

計算量は変わらないが楽できるシリーズ
C++11以降でmin({a,b,c...})で複数個のmic,maxを処理できる
min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる
count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる

*/
__attribute__((constructor))
void initial() {
 cin.tie(0);
 ios::sync_with_stdio(false);
}



int main(){
  int a,b,c;cin>>a>>b>>c;
  cout << min(c,b/a) << endl;
}


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

const long long INF = 1LL << 60;

int main() {
  long long N,K,Q;
  cin >> N >> K >> Q;
  long long A[Q+10],B[N+10];
  
  rep(i,N+5){
    B[i] = 0;
  }
  
  rep(i,Q){
    cin >> A[i];
    B[A[i]]++;
  }
  
  for(int i=1;i<=N;i++){
    if(K-Q+B[i] > 0)
      cout << "Yes" << endl; 
    else
      cout << "No" << endl;
  }
  
}

Measured memory_bytes: 2176
#include <stdio.h>

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))

int main(){
    int a,b,c,d;

    scanf("%d %d %d %d",&a,&b,&c,&d);
    printf("%d\n",MAX(MIN(b,d)-MAX(a,c),0));
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
template <class T> void cumulative_sum( T array, size_t N );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;

int main( void ){
	int N,X;
	cin >> N >> X;
	int d = 0;
	int cnt = 1;
	rep(i,0,N){
		int l;
		cin >> l;
		d+=l;
		if (d <= X){
			cnt ++;
		}
	}
	cout << cnt << endl;
}

int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
template <class T> void cumulative_sum( T array, size_t N ) {
	rep( i, 1, N + 1 ){
		array[ i ] += array[ i - 1 ];
	}
}
template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF    	((ll)1ll<<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007ll)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI			(3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s; a=0;} return os;}
template<class T> void chmax(T &a, const T &b){if(a<b)a=b;}
template<class T> void chmin(T &a, const T &b){if(a>b)a=b;}
void YN(bool b){cout<<(b?"YES":"NO")<<endl;}
void Yn(bool b){cout<<(b?"Yes":"No")<<endl;}
void yn(bool b){cout<<(b?"yes":"no")<<endl;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n,ans=0;
	cin>>n;
	vl v(n+1);
	rep(i,n)cin>>v[i+1];
	range(i,1,n+1){
		ans+=max(0ll,v[i]-v[i-1]);
	}
	cout<<ans<<endl;
}	


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

using ll = long long;

int main() {
    int N;
    std::cin >> N;
    for (int i = 0; i * 7 <= N; i++) {
        if ((N - (i * 7)) % 4 == 0) {
            std::cout << "Yes" << std::endl;
            return 0;
        }
    }

    std::cout << "No" << std::endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int n = in.nextInt();
    int[] a = new int[n];
    for (int i = 0; i < n; i++) {
      a[i] = in.nextInt();
    }
    Arrays.sort(a);
    int sum = 0;
    int sign = 1;
    for (int i = n-1; i >= 0; i--) {
      sum += sign * a[i];
      sign *= -1;
    }
    System.out.println(sum);
  }
}


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

namespace AtCoder.AtCoder_Begginer_Contest_161
{
    class C
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            long N = long.Parse(input[0]);
            long K = long.Parse(input[1]);

            long previous = N % K;
            while(true)
            {
                long current = Math.Abs(previous - K);
                if(current < previous)
                {
                    previous = current;
                } else
                {
                    break;
                }
            }

            Console.WriteLine(previous);
            //Console.ReadKey();
        }
    }
}


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

int main(void)
{
  double height[100];
  double diff;
  int i = 0;

  while(cin >> height[i])
    {
      i++;
    }
  sort(height, height + i);

  diff = height[i-1] - height[0];

  cout << diff << endl;
  return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
int main()
{
  
ll n,k;
cin>>n>>k;
ll a[n];
for(ll i=0;i<n;i++)
cin>>a[i];
sort(a,a+n);
ll sum=0;
for(ll i=0;i<n-k;i++)
{
    sum=sum+a[i];
    //cout<<a[i]<<endl;
}
if(k>=n)
sum=0;
cout<<sum<<endl;
return 0;
}


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

#define NMAX 3005
using namespace std;

double dp[NMAX][NMAX], he[NMAX], te[NMAX];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    int n;
    cin >> n;

    for(int i = 1; i <= n; ++i)
    {
        cin >> he[i];
        te[i] = 1 - he[i];
    }

    dp[0][0] = 1.0;
    for(int i = 1; i <= n; ++i)
        for(int j = 0; j <= i; ++j)
            if(j == 0)
                dp[i][j] = dp[i - 1][j] * te[i];
            else dp[i][j] = dp[i - 1][j - 1] * he[i] + dp[i - 1][j] * te[i];

    double rez = 0;
    for(int j = (n + 1) / 2; j <= n; ++j)
        rez += dp[n][j];
    cout << setprecision(20) << rez << '\n';
    return 0;
}


Measured memory_bytes: 69120
#include<bits/stdc++.h>
using namespace std;
const long long INF=(1LL<<31)-1;
vector<int> val;
int N;
void update(int i,int x){
  i+=N-1;
  val[i]=x;
  while(i){
    i=(i-1)/2;
    val[i]=min(val[i*2+1],val[i*2+2]);
  }
}
int query(int a,int b,int k,int l,int r){
  if(r<=a||b<=l){
    return INF;
  }
  if(a<=l&&r<=b){
    return val[k];
  }
  int u=query(a,b,2*k+1,l,(l+r)/2);
  int v=query(a,b,2*k+2,(l+r)/2,r);
  return min(u,v);
}
int main(){
  int n,q;cin >> n >> q;
  N=1;
  while(N<n){
    N*=2;
  }
  val=vector<int> (2*N-1,INF);
  for(int i=0;i<q;i++){
    int c,x,y;cin >> c >> x >> y;
    if(c){
      cout << query(x,y+1,0,0,N) << endl;
    }
    else{
      update(x,y);
    }
  }
}


Measured memory_bytes: 3844
#include <bits/stdc++.h>
using namespace std;
#define ll long long
void chmax(ll& a, ll b) {
  if (a < b) a = b;
}

int main() {
  ll N, M, K;
  cin >> N >> M >> K;
  
  ll ans = 0;
  
  vector<ll> A(N+1, 0), B(M+1, 0);
  for (int i = 0; i < N; i++) {
    int x;
    cin >> x;
    A[i+1] = A[i] + x;
  }
  
  for (int i = 0; i < M; i++) {
    int x;
    cin >> x;
    B[i+1] = B[i] + x;
  }
  
  for (int i = 0; i <= N; i++) {
    if (A[i] > K) {
      break;
    }
    
    for (int j = M; j >= 0; j--) {
      if (A[i] + B[j] > K) {
        continue;
      } else {
        chmax(ans, i + j);
        M = j;
        break;
      }
    }
    
  }
  
  cout << ans << endl;
  
  
  
}

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

int main() {
  int n;
  string ans;
  cin >> n;
  switch (n % 10) {
    case 0:
    case 1:
    case 6:
    case 8:
      ans = "pon";
      break;
    case 3:
      ans = "bon";
      break;
    default:
      ans = "hon";
      break;
  }
  cout << ans << endl;
}

Measured memory_bytes: 3560