akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) (((x) < 0)?-(x):(x))
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

using cat = long long;

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

struct fin {
	vector<int> T;
	fin(int N) : T(N+10, 0) {}

	int lastone(int x) {return x&(x^(x-1));}

	void put(int pos, int val) {
		for(int i = pos+1; i < (int)T.size(); i += lastone(i)) T[i] += val;
	}

	int get(int pos) {
		int ret = 0;
		for(int i = pos+1; i > 0; i -= lastone(i)) ret += T[i];
		return ret;
	}
};

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	int N;
	cin >> N;
	vector<int> A(N);
	for(int i = 0; i < N; i++) cin >> A[i];
	int ans_mi = 0, ans_mx = OVER9000;
	while(ans_mx-ans_mi > 1) {
		int med = (1LL*ans_mi + ans_mx) / 2;
		// number of substrings with median < med
		vector<int> sum(N+1, 0);
		for(int i = 0; i < N; i++) {
			if(A[i] < med) sum[i+1] = 1;
			else sum[i+1] = -1;
			sum[i+1] += sum[i];
		}
		fin F(2*N);
		cat cnt = 0;
		for(int i = 0; i <= N; i++) {
			cnt += F.get(sum[i]+N-1);
			F.put(sum[i]+N, 1);
		}
		if(cnt > 1LL*N*(N+1)/2-cnt) ans_mx = med;
		else ans_mi = med;
	}
	cout << ans_mi << "\n";
	return 0;
}

// look at my code
// my code is amazing


Measured memory_bytes: 1808
#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef pair<P,int> T;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
int main(){
	ll r,d,x;
	cin >> r >> d >> x;
	for(int i=1;i<=10;i++){
		x = x*r-d;
		cout << x << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <list> //???????????????????????????
#include <vector>//????????¢??????????????????
#include <climits>
#include <cmath>
using namespace std;

struct Ten{
	double X;
	double Y;

};

void solve(list<Ten>::iterator P1, list<Ten>::iterator P2, list <Ten> &list1 ,int n){
	if(n ==0){
		return;
	}
	Ten s;
	Ten u;
	Ten t;
	Ten v;
	
	v.X=(P2->X-P1->X)/3;
	v.Y=(P2->Y-P1->Y)/3;
	s.X =P1->X+v.X;
	s.Y =P1->Y+v.Y;
	u.X=s.X+(v.X*cos(60*M_PI/180)-v.Y*sin(60*M_PI/180));
	u.Y=s.Y+(v.X*sin(60*M_PI/180)+v.Y*cos(60*M_PI/180));
	t.X =P2->X-v.X;
	t.Y =P2->Y-v.Y;

	list<Ten>::iterator itr_t = list1.insert(P2, t);
	list<Ten>::iterator itr_u = list1.insert(itr_t, u);
	list<Ten>::iterator itr_s = list1.insert(itr_u,s);

	n--;
	
	
		
		solve(P1, itr_s, list1, n);
		solve(itr_s, itr_u, list1, n);
		solve(itr_u, itr_t, list1, n);
		solve(itr_t, P2, list1, n);
	
	
}



int main(void){
	int n;
	
	cin >> n;
	list <Ten> list1;

	Ten siten;
	siten.X =0;
	siten.Y =0;
	Ten syuten;
	syuten.X =100;
	syuten.Y =0;
	
	list1.push_back(siten);
	list1.push_back(syuten);
	
	solve(list1.begin() , --list1.end(), list1,n);
	
	
	
	for(list<Ten>::iterator i=list1.begin() ; i != list1.end(); i++){
		
		cout << (*i).X << " "<< (*i).Y  <<endl;
		
		
	}
	
return 0;
	
}

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

using namespace std;

int solve(int N) {
    int ans = 0;
    for (int i = 2; i <= N; ++i) {
        for (int j = 1; j <= N; ++j) {
            int sum = 0;
            for (int k = 0; k < i; ++k) {
                sum += j + k;
            }
            if (sum == N) {
                ++ans;
            }
        }
    }
    return ans;
}

int main() {
    while (1) {
        int N; cin >> N;
        if (N == 0) {
            break;
        }
        cout << solve(N) << endl;
    }
}

Measured memory_bytes: 1160
using System;
using System.Collections.Generic;
using System.Linq;

namespace B
{
	class Program
	{
		static void Main(string[] args)
		{
			// 入力
			string[] tmp = Console.ReadLine().Split(' ');
			int N = int.Parse(tmp[0]);
			int M = int.Parse(tmp[1]);

			tmp = Console.ReadLine().Split(' ');
			
			List<int> A = new List<int>();
			for (int i = 0; i < tmp.Length; i++)
			{
				A.Add(int.Parse(tmp[i]));
			}

			// 選べる人気商品の数の探索
			int ans = 0;
			for (int i = 0; i < A.Count; i++)
			{
				if (A[i] >= A.Sum() / (4.0 * M))
					ans++;
			}


			if (ans >= M)
			{
				Console.WriteLine("Yes");
			}
			else
			{
				Console.WriteLine("No");
			}
		}
	}
}


Measured memory_bytes: 13268
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 
using vs = vector<string>;
using vvs = vector<vs>; 
using vc = vector<char>;
using vvc = vector<vc>; 
using vb = vector<bool>;
using vvb = vector<vb>; 

#define rep(i,n) ;for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define f(i,a,b) for(int i=a;i<b;i++)
#define pri(a)  printf("%.14lf\n",a);
#define MOD 1000000007
bool is_int_lround(double x){
  return std::lround(x)==x;
}
ll keta(ll x){
  ll n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}

ll conbi(int n,int m){
  
  cin>>n>>m;
  vector<ll> a(100);
  a[0] =1;
  for(int i=0;i<14;i++){
    a[i+1]=a[i]*(i+1);
  }
  return a[n] /(a[m] *a[n-m]);
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;//繰り返し二乗法
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
ll kaijoMOD(ll x){
  ll z=1;
  if(x==0){
    return 1;
  }
  while(x>0){
    z *=x;
    z %=MOD;
    x--;
  }
  return z;
}
ll yakusu_num(ll n){
  vl yakusu(n+1,1);
  for(ll i=2;i*i<=n;i++){ 
    while(n%i==0){
      n /=i;
      yakusu[i]++;
    }
  }
  if(n!=1)yakusu[n]++;
  ll num=1;
  for(ll i=0;i<=n;i++){
    num*=yakusu[i];
  }
  return num;
}

int H,W;
vs s(50);
vi dv ={-1,0,1,0};vi du={0,-1,0,1};
int cnt=1;
int dfs(int u,int v){
  s[u][v]='.';
  
  rep(i,4){
   
      int nu =u +du[i],nv=v+dv[i];
      if(nu<0||nu>=H||nv<0||nv>=W)continue;
      if(s[nu][nv]=='.')continue;
      cnt ++;
      dfs(nu,nv);
    
  }
  return cnt;

}
int keta_wa(int x){
  int tot=0;
  while(x>0){
    tot +=x%10;
    x/=10;
  }
  return tot;
}

//vc alp ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
//cout<<""<<endl;
int main(){
  int n;cin>>n;vs S(n);
  rep(i,n)cin>>S[i];
  int mi=100;
  int mii=0;
  rep(i,n){
    if(mi>=S[i].size()){
     mi=S[i].size();
      mii=i;
    }
  }
  vector<map<char,int>> mp(n);
  rep(i,n){
    rep(j,S[i].size()){
      mp[i][S[i][j]]++;
    }
  }
  
  for(auto x:mp[mii]){
    
    int cnt=100;
    rep(i,n){
      cnt=min(cnt,mp[i][x.first]);
    }
    rep(i,cnt)cout<<x.first;
    
  }
  cout<<endl;
  
}
  
   





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

typedef long long ll;

main()
{
    int a, b;
    cin >> a >> b;
    if(a <= 9 && b <= 9){
        cout << a * b;
    }
    else{
        cout << -1;
    }


}





///promy_pompom
//hello world

Measured memory_bytes: 3564
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
typedef pair<ll,ll> P;
typedef pair<P,P> PP;
#define fi first
#define se second
#define all(v) (v).begin(),v.end()
set<string> c;
const ll inf=(1e18);
const ll mod=1000000007;
const ll mod2=998244353;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
//ios_base::sync_with_stdio(false);
//cin.tie(NULL);
struct edge{
    ll to,cost;
};
vector<vector<edge>> graph;
vector<P> x,y;
ll V,E;
ll prim(){
    vector<bool> used(V,false);
    priority_queue<P,vector<P>,greater<P>> pq;
    ll res=0;
    pq.push(P(0,0));
    while(!pq.empty()){
         ll cst = pq.top().fi, v = pq.top().se;
        pq.pop();
        if(used[v]) continue;
        used[v]=true;
        res += cst;
        for(int i = 0; i < graph[v].size(); i++){
            edge e=graph[v][i];
            pq.push(P(e.cost, e.to));
        }
    }
    return res;
}
int main(){
    ios_base::sync_with_stdio(false);
  cin.tie(NULL);
    cin>>V;
    x.resize(V);y.resize(V);
    for(int i=0;i<V;i++){
        cin>>x[i].fi>>y[i].fi;
        x[i].se=i;y[i].se=i;
    }
   sort(all((x)));sort(all(y));
   graph.resize(V);
  for(int i = 0; i <V-1; ++i) {
    graph[x[i].se].push_back((edge){x[i+1].se,abs(x[i].fi-x[i+1].fi)});
    graph[x[i+1].se].push_back((edge){x[i].se,abs(x[i].fi-x[i+1].fi)});
    graph[y[i].se].push_back((edge){y[i+1].se,abs(y[i].fi-y[i+1].fi)});
    graph[y[i+1].se].push_back((edge){y[i].se,abs(y[i].fi-y[i+1].fi)});
  }
cout<<prim()<<endl;
}

Measured memory_bytes: 20592
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 より
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

//

fn run() {
    input! {
        n: u64,
        a: i64,
        b: i64,
    }
    let m = n % 12;
    let mut a = a;
    let mut b = b;
    for i in 0..m {
        if i % 2 == 0 {
            a -= b;
        } else {
            b += a;
        }
    }
    println!("{} {}", a, b);
}

fn main() {
    run();
}



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

int main() {
  vector<int> a(5);
  vector<int> b(5);
  vector<int> c(5);
  for (int i=0;i<5;i++){
  cin >> a.at(i);
  b.at(i)=a.at(i)%10;
  if (b.at(i)==0){
  b.at(i)=10;
  }
  c.at(i)=a.at(i)/10;
  }
  
  sort(b.begin(),b.end());
  for (int i=1;i<5;i++){
  if (b.at(i)==10){
  b.at(i)=0;
  }
  else if(b.at(i)!=10){
  b.at(i)=10;
  }
  }
  if(b.at(0)==10){
  b.at(0)=0;
  }
  cout << b.at(0)+b.at(1)+b.at(2)+b.at(3)+b.at(4)+(c.at(0)+c.at(1)+c.at(2)+c.at(3)+c.at(4))*10 << endl; 
  
}

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

string suite = "SHCD";

bool cards[4][13];

int main(){
    int N; cin >> N;
    for(int i=0; i<N; i++){
        char s; cin >> s;
        int x; cin >> x; x--;
        cards[suite.find(s)][x] = true;
    }
    for(int i=0; i<4; i++){
        for(int j=0; j<13; j++) if(!cards[i][j]){
            cout << suite[i] << " " << j+1 << endl;
        }
    }
    
    return 0;
}

Measured memory_bytes: 3132
#!/bin/env python

def main():
    N = int(raw_input())
    T, A = map(int, raw_input().split(" "))
    H = map(int, raw_input().split(" "))
    retval = 0
    min_diff = 1000
    for i in xrange(N):
        temp = T - H[i] * 0.006
        diff = abs(A - temp)
        if diff < min_diff:
            min_diff = diff
            retval = i + 1
    print retval

if __name__ == '__main__':
    main()

Measured memory_bytes: 2692
#include<bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
typedef long long ll;
#define pb push_back
#define fi first
#define se second
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
template <class T, class U> ostream &operator<<(ostream &os, const pair<T, U> &p){os<<"("<<p.first<<","<< p.second<<")";return os;}
template <class T> ostream &operator<<(ostream &os, const vector<T> &v){os<<"{";REP(i,(int)v.size()){if(i)os<<",";os<<v[i];}os<<"}";return os;}
template <typename T, size_t S> void printArray(const T (&array)[S]){for(auto val : array)std::cout << val << ", ";std::cout << "\n";}
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}
const double PI=acos(-1);
const ll MOD = 1000000007;
using Graph = vector<vector<int>>;
template<class T>inline bool chmax(T& a, T b){if(a < b){a = b; return 1;}return 0;}
template<class T>inline bool chmin(T& a, T b){if(a > b){a = b; return 1;}return 0;}
const ll INF = 1LL<<60;
//const int dx[4] = {1, 0, -1, 0};
//const int dy[4] = {0, 1, 0, -1};
//const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
//const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

void solve(){
    ll n; cin >> n;
    string s; cin >> s;
    ll ls = 0, rs = 0;
    REP(i, s.size()){
        if(s[i] == '(') ls++;
        if(s[i] == ')') rs++;
    }
    deque<char> deq;
    REP(i, s.size()){
        if(s[i] == '(') deq.pb(s[i]);
        if(s[i] == ')'){
            if(!deq.empty()){
                if(deq.back() == '('){
                    deq.pop_back();
                    ls--; rs--;
                }
                else deq.push_back(')');
            }
            else deq.push_back(')');
        }
    }
    //cout << ls << ' ' << rs << endl;
    REP(i, ls){
        s = s + ')';
    }
    REP(i, rs){
        s = '(' + s;
    }
    cout << s << endl;
}

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

Measured memory_bytes: 3636
#include<stdio.h>
int main()
{
    long long int n,m,count;
    scanf("%lld%lld",&n,&m);
    if(n==1)
        n = 3;
    if(m==1)
        m = 3;
    count = (n-2)*(m-2);
    printf("%lld",count);
}

Measured memory_bytes: 128
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

constexpr int MOD = 1000000007;

typedef long long LL;
typedef pair<int, int> P;
typedef pair<LL, LL> PLL;

int main() {
    int N, T;
    LL a[101010];

    cin >> N >> T;
    for (int j = 0; j < N; ++j) {
        cin >> a[j];
    }

    LL maxdiff = 0;
    LL minA = a[0];
    for (int j = 1; j < N; ++j) {
        maxdiff = max(maxdiff, a[j] - minA);
        minA = min(minA, a[j]);
    }

    int count = 0;

    minA = a[0];
    for (int j = 0; j < N;++j) {
        if (a[j] - minA == maxdiff) {
            ++count;
        }
        minA = min(minA, a[j]);
    }

    cout << count << endl;

    return 0;
}


Measured memory_bytes: 1024
import java.util.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int k = sc.nextInt();
		int count = 0;
		int wari = Math.min(a, b);
		while (count < k) {
			if (a % wari == 0 && b % wari == 0) {
				count++;
			}
			wari--;
		}
		System.out.println(wari + 1);
 	}
}

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

int main() {
    ll a, b, x;
    cin >> a >> b >> x;
    ll A = a/x;
    ll B = b/x;
    ll ans = B - A;
    if(a%x==0) ans++;
    cout << ans << endl;
    return 0;
}

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

int main() {
  int n;
  int r[200000];
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> r[i];
  }

  int maxp = -2000000000;
  int base = r[0];
  for (int i = 1; i < n; i++) {
    int diff = r[i] - base;
    if (diff > maxp) maxp = diff;
    if (base > r[i]) base = r[i];
  }
  cout << maxp << endl;
}


Measured memory_bytes: 3900
N = int(input())
S = list(input())

l = "("
r = ")"

t = 0
k = 0
ma = 0
for i in range(N):
  if S[i] == r:
    t += 1
  else:
    k += 1
  ma = max(ma, t - k)

A = [l] * ma + S + [r] * (ma + k - t)

print("".join(A))

Measured memory_bytes: 3064
from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations # (string,3) 3回
from collections import deque
from collections import defaultdict
import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
k,t = readInts()
cake = readInts()
cake = sorted(cake)
if cake[-1] <= k/2:
    print(0)
else:
    print(k - (k- cake[-1]) * 2 - 1)


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

int main() {
  string x, y;
  cin >> x >> y;
  int intx, inty;
  if(x == "A") intx = 10;
  else if(x == "B") intx = 11;
  else if(x == "C") intx = 12;
  else if(x == "D") intx = 13;
  else if(x == "E") intx = 14;
  else if(x == "F") intx = 15;
  if(y == "A") inty = 10;
  else if(y == "B") inty = 11;
  else if(y == "C") inty = 12;
  else if(y == "D") inty = 13;
  else if(y == "E") inty = 14;
  else if(y == "F") inty = 15;
  
  if(intx < inty) cout << "<" << endl;
  else if(intx > inty) cout << ">" << endl;
  else cout << "=" << endl;
  
  return 0;
}


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

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define MIN(a) *min_element(all(a))
#define MAX(a) *max_element(all(a))
#define SUM(a) accumulate(all(a), 0LL)
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define FOR(i, m, n) for(int (i)=(m); (i)<(n); i++)
#define FORR(i, m, n) for(int (i)=(n)-1; (i)>=(m); i--)
#define debug(x) cerr << #x << " = " << x << endl
//#define int long long

typedef long long ll;
//ll const MOD = 998244353;
ll const MOD = 1e9+7;
int const inf = 1e9;
ll const INF = 1e18;

inline void ios_(){cin.tie(0); ios::sync_with_stdio(false);}
template<typename T> int size(const T& a){return (int)a.size();}
template<typename T> T Div(T a, T b){return (a + b - 1) / b;}
template<typename T> bool chmin(T& a, const T& b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, const T& b){if(a < b){a = b; return true;} return false;}



signed main(){
    ll n, k, q;
    cin >> n >> k >> q;
    vector<ll> v(n, k - q);

    REP(i, q){
        int a;
        cin >> a;
        v[a-1]++;
    }

    REP(i, n){
        cout << (v[i] > 0 ? "Yes" : "No") << '\n';
    }


    return 0;
}


Measured memory_bytes: 1408
using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR((I),0,(N))
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
#define IN2(P1,P2) cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) REP((I),(N)) cin>>(V[I])
#define INS2(I,N,V1,V2) REP((I),(N)) cin>>(V1[I])>>(V2[I]);
#define INS3(I,N,V1,V2,V3) REP((I),(N)) cin>>(V1[I])>>(V2[I])>>(V3[I]);
#define OUT(P) cout<<(P)<<endl
#define OUT2(P1,P2) cout<<(P1)<<" "<<(P2)<<endl
#define OUT3(P1,P2,P3) cout<<(P1)<<" "<<(P2)<<" "<<(P3)<<endl
#define OUTS(I,N,V) REP((I),(N)) cout<<(V[i])<<endl
#define ALL(C) (C).begin(),(C).end()
#define RALL(C) (C).rbegin(),(C).rend()
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
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;}

int N,A,B,cnt,i,sum,ans,t;
inline void solve(){
  IN3(N,A,B);
  UP(i,1,N){
    t=i;
    sum=0;
    while(t){
      sum+=t%10;
      t/=10;
    }
    if(sum>=A&&sum<=B)ans+=i;
  }
  OUT(ans);
}

int main(int argc,char**argv){
  BEGIN
  solve();
  END
}


Measured memory_bytes: 256
/**
 * File    : B.cpp
 * Author  : Kazune Takahashi
 * Created : 11/19/2018, 9:07:27 AM
 * Powered by Visual Studio Code
 */

#include <iostream>
#include <iomanip>   // << fixed << setprecision(xxx)
#include <algorithm> // do { } while ( next_permutation(A, A+xxx) ) ;
#include <vector>
#include <string> // to_string(nnn) // substr(m, n) // stoi(nnn)
#include <complex>
#include <tuple>
#include <queue>
#include <stack>
#include <map> // if (M.find(key) != M.end()) { }
#include <set>
#include <functional>
#include <random> // auto rd = bind(uniform_int_distribution<int>(0, 9), mt19937(19920725));
#include <chrono> // std::chrono::system_clock::time_point start_time, end_time;
// start = std::chrono::system_clock::now();
// double elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end_time-start_time).count();
#include <cctype>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
using namespace std;

#define DEBUG 0 // change 0 -> 1 if we need debug.

typedef long long ll;

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

// const int C = 1e6+10;
// const ll M = 1000000007;

int main()
{
  string S;
  cin >> S;
  for (auto i = 0; i < (int)S.size(); i++)
  {
    if (i % 2 == 0)
    {
      cout << S[i];
    }
  }
  cout << endl;
}

Measured memory_bytes: 512
#include<stdio.h>

main(){
  char data[4][4];
  int i,j,o,x;


  while(1){
    if(scanf("%c", &data[0][0])==EOF) break;

    for(i=0;i<3;i++){
      for(j=0;j<3;j++){
	if(i==0 && j==0) continue;
	scanf("%c", &data[i][j]);
      }
    }
    getchar();

    
    o=x=0;

    for(i=0;i<3;i++){
      if(data[i][0]=='o' && data[i][1]=='o' && data[i][2]=='o') o=1;
      if(data[i][0]=='x' && data[i][1]=='x' && data[i][2]=='x') x=1;
      if(data[0][i]=='o' && data[1][i]=='o' && data[2][i]=='o') o=1;
      if(data[0][i]=='x' && data[1][i]=='x' && data[2][i]=='x') x=1;
    }
    if(data[0][0]=='o' && data[1][1]=='o' && data[2][2]=='o') o=1;
    if(data[0][0]=='x' && data[1][1]=='x' && data[2][2]=='x') x=1;
    if(data[0][2]=='o' && data[1][1]=='o' && data[2][0]=='o') o=1;
    if(data[0][2]=='x' && data[1][1]=='x' && data[2][0]=='x') x=1;
    

    if(o==1) printf("o\n");
    else if(x==1) printf("x\n");
    else printf("d\n");
  }
  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define LL long long
#define INF 0x3f3f3f3f
using namespace std;

template<class T> inline
void read(T& x) {
	int f = 1; x = 0;
	char ch = getchar();
	while (ch < '0' || ch > '9')   {if (ch == '-') f = -1; ch = getchar();}
	while (ch >= '0' && ch <= '9') {x = x * 10 + ch - '0'; ch = getchar();}
	x *= f;
}

/*============ Header Template ============*/

const int N = 300000 + 5;

int n;
LL a[N];

int main() {
	read(n);
	for (int i = 1; i <= 3 * n; i++) read(a[i]);
	sort(a + 1, a + 3 * n  + 1);
	LL ans = 0, t = 3 * n - 1;
	for (int i = 1; i <= n; i++) ans += a[t], t -= 2;
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define po pop_back
#define mp make_pair
#define fi first
#define se second
#define hello ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MOD 1000000007  
using namespace std;
bool comp(ll a,ll b){if(a>b)return true;else return false;}
int isP(ll n){if(n==1)return 0;if(n==2 || n==3)return 1;for(ll i=2;i<=sqrt(n);i++){if(n%i==0)return 0;}return 1;}
ll power(ll a,ll b){if(b==0)return 1;if(b==1) return a;ll t=power(a,b/2);if(b%2==1) return t*t*a;else return t*t;}
ll powMOD(ll x,ll y){if(y==0)return 1;if(y==1)return x;ll t=powMOD(x,y/2);if(y%2==1)return t*t%MOD*x%MOD;else return t*t%MOD;}
bool cmp(pair<ll,ll> p1,pair<ll,ll> p2){if(p1.fi>p2.fi) return true;if(p1.fi==p2.fi && p1.se>p2.se) return true;return false;}
 
 
int main()
{
    hello;
    
    ll t; 
//    cin>>t;
	t=1;
	while(t--){
		ll d,t,s;
		cin>>d>>t>>s;
		if(s*t<d) cout<<"No\n";
		else cout<<"Yes\n"; 
	}
    
    return 0;  
} 

Measured memory_bytes: 3692
// practice with kaiboy
import java.io.*;
import java.util.*;

public class Main extends PrintWriter {
	Main() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		Main o = new Main(); o.main(); o.flush();
	}

	int[] ft;
	void update(int i, int n, int x) {
		while (i < n) {
			ft[i] = Math.max(ft[i], x);
			i |= i + 1;
		}
	}
	int query(int i) {
		int x = 0;
		while (i >= 0) {
			x = Math.max(x, ft[i]);
			i &= i + 1; i--;
		}
		return x;
	}
	void main() {
		int n = sc.nextInt();
		int[] aa = new int[n];
		Integer[] ii = new Integer[n];
		for (int i = 0; i < n; i++) {
			aa[i] = sc.nextInt();
			ii[i] = i;
		}
		Arrays.sort(ii, (i, j) -> aa[i] != aa[j] ? aa[j] - aa[i] : i - j);
		ft = new int[n];
		int ans = 0;
		for (int h = 0; h < n; h++) {
			int i = ii[h];
			int k = query(i) + 1;
			ans = Math.max(ans, k);
			update(i, n, k);
		}
		println(ans);
	}
}


Measured memory_bytes: 62572
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define x first
#define y second
#define mod 1e9+7
#define f(i,a,b) for(ll i=a;i<b;i++)
#define rof(i,a,b) for(ll i=a;i>b;i--)

//int a[1001][1001] //aise global me hi

ll lcm(ll a, ll b){
    return a / __gcd(a, b) * b;
}
//memset can initialize to 0 or -1 ONLY
// memset(a,0,sizeof(a[0][0])*n*n); //2D array
//memset(a, 0, sizeof(a));  //1D array
//memset(str, 't', sizeof(str)); // string
void solve()
{
    int n,m;cin>>n>>m;
    int a[n];int ans=0;
    f(i,0,n) {cin>>a[i];ans+=a[i];}
    
    int cnt=0;int val;
   if(ans%(4*m)==0) val=(ans/(4*m));
    else val=(ans/(4*m))+1;
    	f(i,0,n)
    {
    	if(a[i]>=val)
    		{cnt++;}
    }
if(cnt>=m)
    cout<<"Yes";
    else cout<<"No";
}


int main()
{

ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll t=1;
   // cin>>t;
    while(t--)
    {
    
    solve();
    
    }

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 998244353
#define pb push_back
#define ll int
#define con 1000000007
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll i,j,m,n,k;
    ll t;
    cin>>n;
    vector<ll> a;
    unordered_map<ll,ll> m1;
    for(i=0;i<n;i++)
    {  
        cin>>m;
        a.pb(m);
        m1[a[i]]++;
    }
    if(m1[1]>0)
    {
        if(m1[1]==1)
            cout<<1;
        else
            cout<<0;
        return 0;
    }
    ll ans=0;
    for(i=0;i<n;i++)
    { if(m1[a[i]]>1)
        continue;
      j=a[i];
      for(k=2;k<=sqrt(j);k++)
      {
          if(j%k==0)
          {
              if(m1[k]>0)
                  break;
              if(m1[j/k]>0)
                  break;
          }
      }
       // cout<<k<<" "<<sqrt(j)<<"\n";
        if(k==(ll)sqrt(j)+1)
            ans++;
    }
    cout<<ans;
}


Measured memory_bytes: 32484
import java.util.Scanner;
 
public class Main {
 
    public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();//なんの倍数
      	int n =0;
      	int count=0;
      	boolean next=true;
      

      while(next=true){

        n=(n%k)*10+7;
      	count+=1;
        if((n%k)==0){//割り切れたら終了
          break;
        }
        if(count>=k){//余りが0にならない
          count=0;
          break;
        }
      }
     if(count==0) {
     	System.out.println(-1); 
     }else{
        System.out.println(count); 
     }
    } 
}










Measured memory_bytes: 35608
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <string>
#include <sstream>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <stack>
#include <cstdio>
#include <climits>
#include <tuple>
#include <ctime>
#include <cstring>
#define FOR(i,a,n) for (int i = a; i < n; i++)
#define IFOR(i,n,a) for (int i = n; i >= a; i--)
#define mp make_pair
#define full(a) a.begin(), a.end()
#define sz(x) ((int)(x).size())
#define pii pair<int, int>
#define trav(a,x) for (auto& a : x)
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
using namespace std;
const int mod = 1e9 + 7;



int main()
{
    ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int k; cin >> k;
    if (k % 2 == 0 || k % 5 == 0)
    {
        cout << -1;
        return 0;
    }
    ull a = 0;
    FOR(i, 0, k)
    {
        a *= 10;
        a += 7;
        if (a % k == 0)
        {
            cout << i + 1;
            return 0;
        }
        a %= k;
    }
    cout << -1;
    return 0;
}

Measured memory_bytes: 3624
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
use std::collections::HashSet;
fn main() {
    input! {
        n: usize,
        x: i64,
        ms: [i64; n],
    }
    let remain: i64 = x - ms.iter().sum::<i64>();
    let mmin = ms.iter().min().unwrap();

    println!("{}", n as i64 + remain / mmin);
}


Measured memory_bytes: 4352
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		try(Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			while(n-->0) {
				String s1 = sc.next();
				String s2 = sc.next();
				int len1 = s1.length();
				int len2 = s2.length();
				int[][] dp = new int[len1+1][len2+1];
				for(int i=0; i<len1; i++) {
					for(int j=0; j<len2; j++) {
						dp[i][j] = 0;
					}
				}
				for(int i=0; i<len1; i++) {
					dp[i][0] = 0;
				}
				for(int j=0; j<len2; j++) {
					dp[0][j] = 0;
				}
				for(int i=1; i<=len1; i++) {
					for(int j=1; j<=len2; j++) {
						if(s1.charAt(i-1) == s2.charAt(j-1))
							dp[i][j] = dp[i-1][j-1]+1;
						else
							dp[i][j] = Math.max(dp[i][j-1], dp[i-1][j]);
					}
				}
				System.out.println(dp[len1][len2]);
			}
		}
	}

}




Measured memory_bytes: 67020
package main

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

const mod = 2 << 60
const facNum = 300001
const INF = 2 << 60

func main() {
	sc := newScanner(os.Stdin)
	N := sc.i()
	n := N - 1
	// answer [n-1, n]の分
	ans := 2
	if N == 2 {
		fmt.Println(1)
		return
	}

	for i := 2; i*i <= n; i++ {
		if n%i == 0 {
			ans += 2
		}
		if i*i == n {
			ans--
		}
	}

	mod1 := func(x int) bool {
		t := N
		for t%x == 0 {
			t /= x
		}
		if t%x == 1 {
			return true
		}
		return false
	}

	for i := 2; i*i <= N; i++ {
		if N%i == 0 {
			a := i
			b := N / i
			if mod1(a) {
				ans++
			}
			if a != b && mod1(b) {
				ans++
			}
		}
	}
	fmt.Println(ans)

}

func Pow(a, n int) int {
	ans := 1
	for n > 0 {
		if (n & 1) == 1 {
			ans = ans * a % mod
		}
		a = a * a % mod
		n = n >> 1
	}
	return ans
}

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

// I/O
type scanner struct {
	sc *bufio.Scanner
}

func newScanner(input io.Reader) *scanner {
	sc := bufio.NewScanner(input)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &scanner{sc}
}

func (s *scanner) s() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *scanner) i() int {
	i, e := strconv.Atoi(s.s())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *scanner) f() float64 {
	f, e := strconv.ParseFloat(s.s(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *scanner) bs() []byte {
	return []byte(s.s())
}

func (s *scanner) is(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.i()
	}
	return res
}

func (s *scanner) fs(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.f()
	}
	return res
}

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


Measured memory_bytes: 1788
#D
from collections import deque
n, m = map(int, input().split())
ans = [0] * (n+1)
g = [[] for _ in range(n + 1)]
for i in range(m):
    a, b = map(int, input().split())
    g[a].append(b)
    g[b].append(a)
#BPS幅優先探索を行う -> 前の座標を記入
nque = deque([1])
while nque:
    now_cave = nque.popleft()
    for next_cave in g[now_cave]:
        if ans[next_cave] == 0:
            ans[next_cave] = now_cave
            nque.append(next_cave)
#         print(nque)
# print(ans)
print("Yes")
for i in range(2, n + 1):
    print(ans[i])


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

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

int H,W,N;
vector<string> maze;
int bfs(int sx,int sy,int gx,int gy){
	int visited[1001][1001];
	int dist[1001][1001];
	memset(visited,0,sizeof(visited));
	memset(dist,0,sizeof(dist));
	
	queue<int> qx,qy;
	qx.push(sx);qy.push(sy);

	dist[sy][sx] = 0;
	visited[sy][sx] = 1;

	while(!qx.empty()){
		int x = qx.front();qx.pop();
		int y = qy.front();qy.pop();
		for(int i=0;i<4;i++){
			int nx = x + dx[i];
			int ny = y + dy[i];
			if( nx < 0 || ny < 0 || ny >= H || nx >= W )continue;
			if( maze[ny][nx] != '.')continue;
			if( visited[ny][nx] )continue;

			qx.push(nx);
			qy.push(ny);
			dist[ny][nx] = dist[y][x] + 1;
			visited[ny][nx] = 1;

			if(ny == gy && nx == gx)return dist[ny][nx];
		}
	}
	return -1;
}

int main(void){
	
	cin >> H >> W >> N;

	maze = vector<string>(H);
	vector<int> gxs(N+1),gys(N+1);
	for(int i=0;i<H;i++){
		cin >> maze[i];
		for(int j=0;j<W;j++){
			char c = maze[i][j];
			if( c != '.' && c != 'X' ){
				if( c == 'S' ){
					gys[0] = i;
					gxs[0] = j;
				}else{
					gys[c - '0'] = i;
					gxs[c - '0'] = j;
				}
				maze[i][j] = '.';
			}
		}
	}

	int ret = 0;
	for(int i=0;i<N;i++){
		ret += bfs( gxs[i], gys[i], gxs[i+1], gys[i+1] );
	}
	cout << ret << endl;

	return 0;
}

Measured memory_bytes: 11808
using System;
using System.Collections;
using CompLib.Util;

public class Program
{
    public void Solve()
    {
        var sc = new Scanner();
        int x = sc.NextInt();

        var dp = new BitArray(x + 1);
        dp[0] = true;
        for (int i = 100; i <= 105; i++)
        {
            for (int j = 0; j + i <= x; j++)
            {
                if (dp[j]) dp[j + i] = true;
            }
        }

        Console.WriteLine(dp[x] ? 1 : 0);
    }

    public static void Main(string[] args) => new Program().Solve();
}

namespace CompLib.Util
{
    using System;
    using System.Linq;

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            if (_index >= _line.Length)
            {
                string s;
                do
                {
                    s = Console.ReadLine();
                } while (s.Length == 0);

                _line = s.Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public string ReadLine()
        {
            _index = _line.Length;
            return Console.ReadLine();
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            string s = Console.ReadLine();
            _line = s.Length == 0 ? new string[0] : s.Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

Measured memory_bytes: 27824
N,K = gets.chomp.split.map(&:to_i)
d = [0] * (K + 1)
a = []

(1..K).each do |i|
  d[i] = gets.to_i
  a = a.push(gets.chomp.split.map(&:to_i))
  a = a.flatten!
end

puts N - a.uniq.size

Measured memory_bytes: 19888
#include<bits/stdc++.h>
    #include <ext/pb_ds/tree_policy.hpp> 
    #include <functional> // for less 
    using namespace __gnu_pbds; 
    using namespace std;
    //typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;    
    #define ll            long long
    #define pb            push_back
    #define ppb           pop_back
    #define si            set <ll>
    #define endl          '\n'
    #define fr            first
    #define sc            second
    #define mii           map<ll ,ll >
    #define msi           map<string,ll >
    #define mis           map<ll , string>
    #define rep(i,a,b)    for(ll  i=a;i<b;i++)
    #define all(v)        v.begin(),v.end()
    #define sort(v)       sort(all(v))
    #define pii           pair<ll ,ll >
    #define vi            vector<ll >
    #define vii           vector<pair<ll , ll >>
    #define vs            vector<string>
    #define sz(x)         (ll)x.size()
    #define M             1000000007
    #define bs            binary_search
    #define rev(a)        reverse(all(a));
    #define sp(n)         setprecision(n)
    #define spl           " "
    #define arr(a,n)      rep(i,0,n) cin>>a[i]
    #define mod           998244353
    #define show(a,n)     for(ll i=0;i<n;i++) cout<<a[i]<<" "; cout<<endl;
    #define N             100000000
    #define debug(x)      cout << #x << " is " << x << endl;
    #define time          cout << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
    #define INF           1ll<<31
    using namespace std;
    ll min(ll a,ll b)
    {
        return a>b?b:a;
    }
    ll max(ll a,ll b)
    {
        return a>b?a:b;
    }
    const ll maxn=2e5+500;
    void solve()
    {
      ll n;
      cin>>n;
      if(n%10 ==7){cout<<"Yes"<<endl;return;}
      n/=10;
      if(n%10 ==7){cout<<"Yes"<<endl;return;}
      n/=10;
      if(n%10 ==7){cout<<"Yes"<<endl;return;}
      cout<<"No"<<endl;
    }
    signed main()
    {
        ios_base::sync_with_stdio(false);
        cin.tie(0);
        cout.tie(0);
        //#ifndef ONLINE_JUDGE
       //freopen("input.txt","r",stdin);
       //freopen("output.txt","w",stdout);
        //#endif
        ll t=1;
        //cin>>t;
        while(t--) solve();
    }
    
/*
5 1
2 4 8 2 4
*/
   


Measured memory_bytes: 3644
N,Q = map(int,input().split())
 
S = input()
list1 = [0] * (N + 1)
 
for i in range(N):
        list1[i + 1] = list1[i] + (1 if S[i:i+2] == 'AC' else 0)
for i in range(Q):
    l,r = map(int,input().split())
    print(list1[r-1]-list1[l-1])

Measured memory_bytes: 8904
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
    int n,m;
    cin>>n>>m;
    map<pair<int,int>,bool>x;
    rep(i,m){
        int a,b;
        cin>>a>>b;
        x[(make_pair(a,b))]=true;
    }
    bool ans=false;
    for(int i=2; i<n; ++i){
        if(x[make_pair(1,i)]==true&&x[make_pair(i,n)]==true)ans=true;
    }
    cout<<(ans==true?"POSSIBLE":"IMPOSSIBLE")<<endl;
}

Measured memory_bytes: 25216
A, B = map(int, input().split())

#a,bの最大公約数
def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

# 最小公倍数
#a,bの最小公倍数
def lcm(a, b):
    return a * b // gcd (a, b)

print(lcm(A, B))

Measured memory_bytes: 38256
#include <bits/stdc++.h>
using namespace std;
int n,m,k,a[109];
long long dp[109][100009],s[109][100009];
long long mod = 1000000007;
int main()
{
    cin>>n>>k;
    for(int i=1;i<=n;i++)cin>>a[i];
    for(int i=0;i<=k;i++) s[0][i] = 1;
    for(int i=1;i<=n;i++)
    {
        dp[i][0]=1;
        s[i][0]=1;
        for(int j=1;j<=k;j++)
        {
            dp[i][j]=(s[i-1][j]%mod);
            if(j-a[i]>0)dp[i][j]=((dp[i][j])%mod-(s[i-1][j-a[i]-1])%mod+mod)%mod;
            s[i][j]=((dp[i][j])%mod+(s[i][j-1])%mod)%mod;
            dp[i][j]%=mod;
            s[i][j]%=mod;
        }
    }
    cout<<dp[n][k]%mod<<"\n";
    /*for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=k;j++)cout<<dp[i][j]<<" ";
        cout<<"\n";
    }
    cout<<"_________\n";
    for(int i=0;i<=n;i++)
    {
        for(int j=0;j<=k;j++)cout<<s[i][j]<<" ";
        cout<<"\n";
    }*/
}


Measured memory_bytes: 162048
import sys
import math


def main():
    t = 0
    pos = 0, 0

    N = int(input())
    for i in range(N):
        ti, xi, yi = [int(v) for v in input().split()]

        dx = xi - pos[0]
        dy = yi - pos[1]

        td = ti - t
        dd = abs(dx + dy)

        if dd > td:
            print("No")
            sys.exit()

        if td % 2 != dd % 2:
            print("No")
            sys.exit()

        t = ti
        pos = xi, yi

    print("Yes")


if __name__ == "__main__":
    main()


Measured memory_bytes: 3064
#include<iostream>
#include<sstream>
#include<fstream>
#include<cstring>/*The header <string> and
<string.h> does not contain the useful
function 'memset' and 'memcpy'.*/
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<utility>
#include<algorithm>
#include<functional>
#include<ctime>
#include<cmath>
#include<cstdlib>
#include<cstdio>
using namespace std;
vector<int> r[2020],c[2020];
string S[2020];
int main()
{
	int H,W,ans=0;
	cin>>H>>W;
	for(int i=0;i<W;i++)
		c[i].push_back(-1);
	for(int i=0;i<H;i++)
	{
		r[i].push_back(-1);
		cin>>S[i];
		for(int j=0;j<W;j++)
			if(S[i][j]=='#')
				r[i].push_back(j),
				c[j].push_back(i);
		r[i].push_back(W);
	}
	for(int i=0;i<W;i++)
		c[i].push_back(H);
	for(int i=0;i<H;i++)
		for(int j=0;j<W;j++)
			if(S[i][j]=='.')
			{
				int pr=lower_bound(r[i].begin(),r[i].end(),j)-r[i].begin();
				int pc=lower_bound(c[j].begin(),c[j].end(),i)-c[j].begin();
				ans=max(ans,(r[i][pr]-r[i][pr-1]-1)+(c[j][pc]-c[j][pc-1]-1)-1);
			}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 40448
def main():
    import sys
    input = sys.stdin.readline
    from bisect import bisect_right

    W, H = map(int, input().split())
    P = [int(input()) for _ in range(W)]
    P.sort()
    P_count = [0] * (W + 2)

    Q = [int(input()) for _ in range(H)]
    Q.sort()

    ans = 0
    for q in Q:
        tmp = bisect_right(P, q)
        P_count[tmp] += 1
        ans += q * (1 + W - tmp)

    for i in range(W, - 1, -1):
        P_count[i] += P_count[i + 1]

    for index, p in enumerate(P):
        ans += p * (P_count[index + 1] + 1)

    print (ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 15584
n, k = gets.chomp.split.map(&:to_i)
r, s, p = gets.chomp.split.map(&:to_i)
t = gets.chomp

score = { "r" => p,
          "s" => r,
          "p" => s }

res = 0
0.step(k - 1) do |i|
  c = ""
  i.step(n - 1, k) do |j|
    if j == i || c != t[j]
      c = t[j]
      res += score[t[j]]
    else
      c = ""
    end
  end
end
puts res

Measured memory_bytes: 14588
# import bisect
# import copy
# import fractions
# import math
# import numpy as np
# from collections import Counter, deque
# from itertools import accumulate,permutations, combinations,combinations_with_replacement,product

def resolve():
    N,K,Q=map(int,input().split())
    A=[int(input()) for i in range(Q)]

    S=[0]*N
    for i in A:
        S[i-1]+=1

    for i in S:
        if K-(Q-i)<=0:
            print('No')
        else:
            print('Yes')


resolve()

Measured memory_bytes: 56152
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(2e5 + 5);
const double EPS = 1e-8;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define ALL(v) (v).begin(), (v).end()

int main() {
    int n, m, p[105]{}, ans = 0;
    cin >> n >> m;
    REP(i,m){
        int a, b;
        cin >> a >> b;
        a--;
        p[a] = max(p[a],b);
    }
    int r = 0, ma = 0;
    REP(i,r+1){
        ma = max(ma, p[i]);
        if(i==r){
            r = max(r,ma);
            ans++;
            if(ma==n)break;
        }
    }
    if(r==n){
        cout << ans << endl;
    }
    else{
        cout << "Impossible" << endl;
    }
    return 0;
}   



Measured memory_bytes: 3104
#include <algorithm>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long ll;
// const int INF = (1 << 30) - 1;
// const ll LL_INF = (1LL << 62) - 1;
// const ll MOD = 1e9 + 7;

ll N;
string S;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> N >> S;
  vector<ll> r, g;
  set<ll> b;
  for (int i = 0; i < S.size(); i++) {
    switch (S[i]) {
    case 'R':
      r.push_back(i);
      break;
    case 'G':
      g.push_back(i);
      break;
    default:
      b.insert(i);
      break;
    }
  }

  ll ans = 0;
  for (int i = 0; i < r.size(); i++) {
    for (int j = 0; j < g.size(); j++) {
      ans += b.size();
      if (r[i] < g[j]) {
        ll d = g[j] - r[i];
        if (b.find(r[i] - d) != b.end()) {
          ans--;
        }
        if (b.find(g[j] + d) != b.end()) {
          ans--;
        }
        if (d % 2 == 0 && b.find(r[i] + d / 2) != b.end()) {
          ans--;
        }
      } else {
        ll d = r[i] - g[j];
        if (b.find(g[j] - d) != b.end()) {
          ans--;
        }
        if (b.find(r[i] + d) != b.end()) {
          ans--;
        }
        if (d % 2 == 0 && b.find(g[j] + d / 2) != b.end()) {
          ans--;
        }
      }
    }
  }

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

Measured memory_bytes: 3240