akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <stack>

using std::vector;
using std::printf;
using std::cout;
using std::endl;
using std::string;
using std::cin;
using std::pair;
using std::sort;

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

template<typename T>
void dump(vector<T> vec) {
    for (auto x : vec) {
        std::cout << x << " ";
    }
    std::cout << std::endl;
}

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

const i64t MOD = 1000000007;

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

    vector<int> A(N+1, 0);
    vector<int> B(N, 0);

    int tmp;
    for (int i = 1; i <= N-1; ++i) {
        cin >> tmp; B[i] = tmp;
    }

    A[1] = B[1];
    for (int i = 2; i <= N-1; ++i) {
        A[i] = (B[i-1] < B[i]) ? B[i-1] : B[i];
    }
    A[N] = B[N-1];

    int ret = 0;
    for (int i = 1; i <= N; ++i) {
        ret += A[i];
    }
 
    printf("%d\n", ret);
    
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
int main() {
    // ifstream in("data1.txt");
    // cin.rdbuf(in.rdbuf());
    bool start = true;
    while(start) {
        int x, y;
        char op;
        cin >> x;
        cin >> op;
        cin >> y;

        if(op == '?'){
            return 0;
        }

        if(op == '+'){
            cout << x + y << endl;
        }
        if(op == '-'){
            cout << x - y << endl;
        }
        if(op == '*'){
            cout << x * y << endl;
        }
        if(op == '/'){
            cout << x / y << endl;
        }
    }
}



Measured memory_bytes: 3088
#include <stdio.h>
#include <bits/stdc++.h>
#define pb push_back
#define pp pop_back
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(), x.end()
typedef long long ll;

using namespace std;

const int N = 3e5 + 111, inf = 1e9, mod = 1e9 + 7;
const ll INF = 1e18;
const double pi = acos(-1.0), eps = 1e-9;

string st;
set <int> s, t;

int main(){
	srand(time(NULL));
	cin.tie(0);
	cout.tie(0);
	ios_base::sync_with_stdio(0);
	cout << setprecision(10) << fixed;

	cin >> st;
	for(int i = 1; i <= st.size(); ++i) 
		if(st[i - 1] == 'T')
			t.insert(i);
		else s.insert(i);

	while((int)s.size() > 0 && (int)t.size() > 0){
		int pos = *s.begin();
		auto it = t.lower_bound(pos);
		if(it == t.end())
			break;
		s.erase(pos);
		t.erase(it);
	}

	cout << s.size() + t.size();
	
	return 0;
	//cout << (clock() + 0.0) / CLOCKS_PER_SEC;
}

Measured memory_bytes: 9876
#include<iostream>
#define MAX 100
#define INFTY 1<<21
#define WHITE 0
#define GRAY 1
#define BLACK 2
#define NIL -1

int M[MAX][MAX];
int d[MAX], p[MAX], color[MAX];
int n;

// プリムのアルゴリズムを用いて、最小全域木の辺の重みの総和を返す
int prim()
{
	for (int i = 0; i < n; i++)
	{
		d[i] = INFTY;
		p[i] = NIL;
		color[i] = WHITE;
	}

	d[0] = 0;
	color[0] = GRAY;

	while (true)
	{
		int u = NIL;
		int minv = INFTY;
		for (int i = 0; i < n; i++)
		{
			if (color[i] != BLACK && d[i] < minv)
			{
				u = i;
				minv = d[i];
			}
		}

		if (u == NIL) break;

		color[u] = BLACK;

		for (int v = 0; v < n; v++)
		{
			if (color[v] != BLACK && M[u][v] != INFTY)
			{
				if (M[u][v] < d[v])
				{
					d[v] = M[u][v];
					p[v] = u;
					color[v] = GRAY;
				}
			}
		}
	}

	int sum = 0;
	for (int i = 0; i < n; i++)
	{
		if (p[i] != NIL) sum += d[i];
	}

	return sum;
}

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

	int x;
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < n; j++)
		{
			std::cin >> x;
			M[i][j] = x == -1 ? INFTY : x;
		}
	}

	std::cout << prim() << std::endl;

}

/*
木とは、閉路を持たないグラフ。
全域木とは、グラフのすべての頂点を含み木である限りできるだけ多くの辺を持つグラフ。
最小全域木とは、全域木の中で辺の重みの総和が最小のグラフ。
*/




Measured memory_bytes: 3136
import kotlin.math.max

fun main() {
    val builder = StringBuilder()

    val mod = 1000000007L

    val k = readInputLine().toInt()
    val s = readInputLine().toCharArray()
    val n = k + s.size + 10

    // 1～nの階乗、逆元
    val factorial = LongArray(n + 1)
    val inverse = LongArray(n + 1)
    val factorialInverse = LongArray(n + 1)
    factorial[0] = 1L
    factorial[1] = 1L
    inverse[0] = 1L
    inverse[1] = 1L
    factorialInverse[0] = 1L
    factorialInverse[1] = 1L
    for (i in 2..n) {
        factorial[i] = (factorial[i - 1] * i.toLong() % mod)
        inverse[i] = (mod - inverse[mod.toInt() % i] * (mod / i.toLong()) % mod)
        factorialInverse[i] = (factorialInverse[i - 1] * inverse[i] % mod)
    }

    fun nCm(n: Int, m: Int): Long {
        return factorial[n] * (factorialInverse[m] * factorialInverse[n - m] % mod) % mod
    }

    fun nHm(n: Int, m: Int): Long {
        return nCm(n + m - 1, m)
    }

    val pow25 = LongArray(n)
    val pow26 = LongArray(n)

    pow25[0] = 1L
    pow26[0] = 1L

    for (i in 1 until n) {
        pow25[i] = pow25[i - 1] * 25L % mod
        pow26[i] = pow26[i - 1] * 26L % mod
    }

    var ans = 0L

    for (i in 0..k) {
        ans = (ans + pow25[i] * pow26[k - i] % mod * nHm(s.size, i) % mod) % mod
    }

    builder.appendln(ans)

    print(builder.toString())
}

fun readInputLine(): String {
    return readLine()!!
}


Measured memory_bytes: 119448
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <queue>
#include <cassert>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ALL(a) (a).begin(), (a).end()
#define rALL(a) (a).rbegin(), (a).rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int iINF = 1001001001;
const long long llINF = 1LL << 60;
vector<string> ans;
void rec(int n, int num, string str, int mx)
{
    if (n == num) {
        //cout << n << ", " << num << ", " << str << endl;
        ans.push_back(str);
        return;
    }
    rep(i, num + 1) {
        if (num != 0) {
            if (1 < i - mx) break;
        }
        rec(n, num + 1, str + char('a' + i), max(mx, i));
    }
    return;
}
int main()
{
    // パナソニックプログラミングコンテスト2020-D, 1113, 
    int n; cin >> n;
    rec(n, 0, "", 0);
    for (string s : ans) cout << s << endl;
    return 0;
}

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

int main() {

	int n, m; cin >> n >> m;
	vector<int> p(m);
	vector<string> s(m);
	vector<bool> isACExist(n, false);
	vector<int> ACIndex(n, -1);

	for (int i = 0; i < m; i++) {
		cin >> p[i] >> s[i];
		p[i]--;
		if (!isACExist[p[i]]) {
			if (s[i] == "AC") {
				isACExist[p[i]] = true;
				ACIndex[p[i]] = i;
			}
		}
	}
	int ansAC = 0;
	int ansWA = 0;
	for (int i = 0; i < m; i++) {
		if (s[i] == "WA" && isACExist[p[i]] && i < ACIndex[p[i]]) {
			ansWA++;
		}
		if (s[i] == "AC" && i == ACIndex[p[i]]) {
			ansAC++;
		}

	}	
	cout << ansAC << " " << ansWA << endl;
    return 0;
}

Measured memory_bytes: 7220
#include <iostream>
#include <algorithm>

using namespace std;

int main(){
  int a[100]={0},i,j,kaisu=0,num,mini;

  cin >>num;
  for(i=0;i<num;i++){
    cin >>a[i];
  }



  for(i=0 ; i<num-1;i++){
    mini=i;
    for(j=i+1;j<num;j++){//num-1
      
      if(a[j]<a[mini]){ mini=j;
      }
    
    

    }
    if(mini!=i){
    swap(a[i],a[mini]);
    kaisu++;
    }

  }
  





      for(i=0;i<num;i++){
	cout <<a[i];
	if(i<num-1){cout <<" ";
	}
      }


      cout<<endl;
      cout<<kaisu<<endl;
      
      return 0;
}

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

#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s); i<(long long)(n);i++)
#define mod 1000000007

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

    vector<int>a(4);
    rep(i,s.size()){
        if(s[i]=='N'){
            a[0]++;
        }
        if(s[i]=='S'){
            a[1]++;
        }
        if(s[i]=='E'){
            a[2]++;
        }
        if(s[i]=='W'){
            a[3]++;
        }
    }

    if(a[0]>0&&a[1]>0||a[0]==0&&a[1]==0){
        if(a[2]>0&&a[3]>0||a[2]==0&&a[3]==0){
            cout<<"Yes"<<endl;
        }
        else {
            cout<<"No"<<endl;
        }

    }
    else {
        cout<<"No"<<endl;
    }
}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>

using namespace std;
typedef long long llong;

#define MAX
const llong mod = 1000000000 + 7;

int main()
{
  double R;
  scanf("%lf", &R);

  printf("%lf", 2.0 * M_PI * R);

  return 0;
}

Measured memory_bytes: 1724
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
const long long INF=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long,long>> vpll;
typedef vector<pair<int,int>> vpii;
int main() {
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	ini(n);
	ini(n1);
	int a[20];
	memset(a,-1,sizeof(a));
	FOR(i,0,n1){
		ini(x);
		x--;
		ini(x1);
		if(a[x]!= -1 and x1 != a[x]){out(-1);return 0;}
		a[x] = x1;
	}
	if(n==1){
		if(a[0] == -1)out(0);
		else out(a[0]);
	}
	else{
		if(a[0] == 0){out(-1);return 0;}
		if (a[0] == -1) { a[0] = 1; }
		FOR(i,0,n){
			if(a[i] == -1)cout<<0;
			else cout<<a[i];
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll; 
typedef pair<int, int> pii; 
typedef pair<ll, ll> pll; 
typedef pair<string, string> pss; 
typedef vector<int> vi; 
typedef vector<vi> vvi; 
typedef vector<pii> vii; 
typedef vector<int, pii> viii; 
typedef vector<pll> vll; 
typedef vector<ll> vl; 
typedef vector<vl> vvl; 
typedef vector<vector<vl>> vvvl; 
ll mod=1e9+7;
int main() {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout); 
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL) ; cout.tie(NULL);
    ll i,j,n,sum=0;
    cin>>n;
    vl a(n);
    for(i=0;i<n;i++){cin>>a[i];sum=(sum+a[i])%mod;}
    ll ans=0,curr=0;
    for(i=0;i<n;i++){
        curr=(curr+a[i])%mod;
        ans=(ans+(((sum-curr+mod)%mod)*a[i])%mod)%mod;
    }
    cout<<ans<<endl;
    return 0;
}


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

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

    int64_t ans = 0;
    for (auto a = 1; a <= k; a++) {
        for (auto b = 1; b <= k; b++) {
            for (auto c = 1; c <= k; c++) {
                ans += gcd(gcd(a, b), c);
            }
        }
    }

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

Measured memory_bytes: 3624
/**
 * author: BueVonHun
 * More Info: https://github.com/Bue-von-hon
**/
#include <iostream>
#include <algorithm>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <cstring>

using namespace std;
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define endl '\n'
int main(void) {
    fast_cin();

    int a,b,c,k;
    cin >> a >> b >> c;
    cin >> k;
    int num = k;
    if (a >= b) { // !a<b
        for ( int i = 0; i <= num; i++) {
            if (k<=0) {
                cout << "No" << endl;
                return 0;
            }
            k--;
            b*=2;
            if (a<b)
                break;

        }
        if (b >= c) { // b > c
            num = k;
            for ( int i = 0; i <= num; i++) {
                if (k<=0) {
                    cout << "No" << endl;
                    return 0;
                }
                k--;
                c*=2;
                if (b<c) {
                    cout << "Yes" << endl;
                    return 0;
                }
            }

        } else { // b < c
            cout << "Yes" << endl;
            return 0;
        }
    } else { // a<b
        if (b >= c) {
            for ( int i = 0; i <= num; i++) {
                if (k<=0) {
                    cout << "No" << endl;
                    return 0;
                }
                k--;
                c*=2;
                if (b<c) {
                    cout << "Yes" << endl;
                    return 0;
                }
            }

        } else { // b < c
            cout << "Yes" << endl;
            return 0;
        }
    }
    if (a>=b || b>=c)
        cout << "No" << endl;
    else
        cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()

int N,M,D;

int cnt(vector<vector<int>> f,int n,int m){
  int res = 0;
  rep(i,0,n - 1){
    int c = 0;
    rep(j,0,m - 1){
      if(f[i][j] == 0){
        c++;
      }
      else{
        c =0;
      }
      if(c >= D){
        res++;
      }
    }
  }
  return res;
}

int main(){
  cin >> N >> M >> D;
  vector<vector<int>> f(N,vector<int>(M)),f2(M,vector<int>(N));

  rep(i,0,N - 1){
    string s;
    cin >> s;
    rep(j,0,M - 1){
      f[i][j] = s[j] == '#';
      f2[j][i] = s[j] == '#';
    }
  }

  cout << cnt(f,N,M) + cnt(f2,M,N) << endl;
}



Measured memory_bytes: 3272
import sys
s = input("")

count_c = 0

if(s[0] == "A"):
    for i in range(1, len(s)):

        if(s[i]=="C" and i >= 2 and i <= len(s)-2):
            count_c += 1
        elif(s[i].isupper()):
            print("WA")
            sys.exit()
            
        
    if(count_c != 1):
        print("WA")
    else:
        print("AC")
else:
    print("WA")

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  float x;
  int c=0;
  for(int i=1;i<=n;i++)
  {
    i++;
    c++;
  }
  x=float(c)/n;
  cout<<x<<endl;
}
  

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

const int maxn = 3e5 + 3;
int n, p[maxn], d[maxn], fd[maxn], la[maxn], fa[maxn];
char vis[maxn], fv[maxn];
std::vector<int> pre[maxn], fp[maxn];

int mex(std::vector<int> &v) {
	std::sort(v.begin(), v.end());
	if(v.empty() || v.front() > 0)
		return 0;
	for(int i = 0; i + 1 < v.size(); ++i)
	if(v[i + 1] - v[i] > 1)
		return v[i] + 1;
	return v.back() + 1;
}

bool dfs(int u) {
	vis[u] = 1;
	la[u] = mex(pre[u]);
	pre[p[u]].push_back(la[u]);
	if(!--d[p[u]] && !vis[p[u]])
		dfs(p[u]);
}

bool check() {
	for(int i = 1; i <= n; ++i)
	if(la[i] == la[p[i]])
		return false;
	for(int i = 1; i <= n; ++i)
	if(la[i] != mex(pre[i]))
		return false;
	return true;
}

int main() {
	scanf("%d", &n);
	for(int i = 1; i <= n; ++i) {
		scanf("%d", p + i);
		++d[p[i]];
	}
	for(int i = 1; i <= n; ++i)
	if(!d[i] && !vis[i])
		dfs(i);
	memcpy(fd, d, sizeof(fd));
	memcpy(fv, vis, sizeof(fv));
	memcpy(fa, la, sizeof(fa));
	for(int i = 1; i <= n; ++i)
		fp[i] = pre[i];
	int u;
	for(u = 1; u <= n; ++u)
	if(!vis[u])
		break;
	dfs(p[u]);
	if(check()) {
		puts("POSSIBLE");
		return 0;
	} else {
		memcpy(d, fd, sizeof(fd));
		memcpy(vis, fv, sizeof(fv));
		memcpy(la, fa, sizeof(fa));
		for(int i = 1; i <= n; ++i)
			pre[i] = fp[i];
		int l = mex(pre[p[u]]);
		pre[p[u]].push_back(l);
		dfs(p[u]);
		if(la[u] == l && check()) {
			puts("POSSIBLE");
			return 0;
		}
	}
	puts("IMPOSSIBLE");
	return 0;
}


Measured memory_bytes: 26880
#include<bits/stdc++.h>
using namespace std;
# define mod 1000000007


int main()
{
    int h,w;
    cin>>h>>w;
    int dp[h+1][w+1];
    char a[h+1][w+1];
    
    memset(dp,0,sizeof dp);
    for(int i=0;i<h;i++)
    {
        for(int j=0;j<w;j++)
        {
            cin>>a[i][j];
            if (a[i][j]=='#')
                dp[i][j]=-1;
        }
    }
    for(int i=0;i<w;i++)
    {
        if(dp[0][i]==-1)
            break;
        dp[0][i]=1;
    }
    
    for(int i=0;i<h;i++)
    {
        if(dp[i][0]==-1)
            break;
        dp[i][0]=1;
    }
    
    for(int i=1;i<h;i++)
    {
        for(int j=1;j<w;j++)
        {
            if(dp[i][j]==-1)
                continue;
            dp[i][j]=0;
            if(dp[i][j-1]!=-1)
                dp[i][j]=dp[i][j-1]%mod;
            if(dp[i-1][j]!=-1)
                dp[i][j]=(dp[i][j]+dp[i-1][j])%mod;
        }
    }
   
    
    cout<<dp[h-1][w-1];
    return 0;
}

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

//flagを用いたバブルソート
int bubbleSort(int A[], int N) {
    int sw = 0;
    bool flag = 1;
    for ( int i = 0 ; flag; i++){
        flag = 0;
        for(int j = N-1; j >= i + 1; j--) {
            if( A[j] < A[j - 1] ) {
                swap(A[j], A[j - 1]);
                flag = 1;
                sw++;
            }
        }
    }
    return sw;
}

int main() {
    int A[100], N, sw;
    cin >> N;
    for (int i = 0; i < N; i++ ) cin >> A[i];
    
    sw = bubbleSort(A,N);
    
    for ( int i = 0; i < N; i++) {
        if (i) cout << " ";
        cout << A[i];
    }
    cout << endl;
    cout << sw << endl;
    
    return 0;
}


Measured memory_bytes: 3116
#include<stdio.h>
int main()
{
    //freopen("in.txt","r",stdin);
    float a,b,c,d,e,f;
    float x,y;
    int xx,yy;
    while(scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f)!=EOF)
    {
        x=c/a-(b/a)*(a*f-d*c)/(a*e-b*d);
        y=(a*f-d*c)/(a*e-b*d);
        x=x+0.0001;
        y=y+0.0001;
        xx=x*10000;
        yy=y*10000;
        if(xx%10>=5)
            x=(xx+10)/10/1000.0;
        if(yy%10>=5)
            y=(yy+10)/10/1000.0;
        printf("%.3f %.3f\n",x,y);
    }
    return 0;
}

Measured memory_bytes: 652
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
typedef long long ll;
using namespace std;
int main(void){
    double n,k;cin>>n>>k;
    double res=0;
    if(n>=k){
        res+=(n-k+1.0)/n;
    }
    for(double i=1;i<=n&&i<k;i++){
        double b=1;
        while(k>i*b)b*=2;
        res+=1.0/b/n;
    }
    cout<<fixed<<setprecision(13);
    cout<<res<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
const ll MOD = 1000000007;
const ll INF = 10000000000000000;
vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> y4 = {1, 0, -1, 0}, y8 = {1, 1, 0, -1, -1, -1, 0, 1};
template<class T> struct edge { int from, to; T cost;};
template<class T> inline bool chmin(T& a, T b){if (a>b){a = b; return true;}return false;}
template<class T> inline bool chmax(T& a, T b){if (a<b){a = b; return true;}return false;}
template<class T> inline T powerM(T a,T b){if (b==0) return 1;
T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }
template<class T> inline T power(T a,T b,T m){ if (b==0) return 1;
  T tmp = power(a,b/2,m); if (b%2==0) return tmp*tmp%m; else return tmp*tmp%m*a%m; }
template<class T> inline T gcd(T a, T b){if (b==0) return a; return gcd(b, a%b);}
template<class T> inline T lcm(T a, T b){return a / gcd(a,b) * b;}
// ax+by=gcd(a,b)を解く
template<class T> inline T extgcd(T a,T b,T &x,T &y){if (b==0){x=1; y=0; return a;} T d=extgcd(b,a%b,y,x); y -= a/b*x; return d;}
void hey(){ cout <<"hey" <<endl; }


int main() {
  int n; cin >>n;
  set<int> s;
  rep(i, n){ int x; cin >>x; s.insert(x); }
  int res = 0;
  int q; cin >>q;
  rep(i, q){ int x; cin >>x; if (s.count(x)) res++; }
  cout <<res <<endl;
}


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

using namespace std;

#define REP(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REPO(i,n) for(int (i)=1; (i)<=(int)(n); (i)++)
#define SZ(v) ((int)(v).size())
#define ALL(v) (v).begin(),(v).end()
#define one first
#define two second
typedef long long ll;
typedef pair<int, int> pi;
const int INF = 0x3f2f1f0f;
const ll LINF = 1ll * INF * INF;

int main() {
	int X; cin >> X;
	int now = 0;
	for(int i=1; ; i++) {
		now += i;
		if(now >= X) {
			printf("%d\n", i);
			return 0;
		}
	}
	while(1);
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<string>
#define rep(i,n,m) for(int i=(n);i<(int)(m);i++)
#define reps(i,n,m) for(int i=(n);i<=(int)(m);i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define lb lower_bound
#define ub upper_bound
#define LB(a,x) lb(all(a), x) - a.begin()
#define UB(a,x) ub(all(a), x) - a.begin()
#define printfdouble(x) printf("%.12f\n",(x))
#define chartoint(c) (int)((c) - '0')
#define chartoll(c) (long long)((c) - '0')
#define MOD 1000000007
#define itn int
#define enld endl
#define ednl endl
#define icn cin
#define stirng string
using namespace std;
typedef long long ll;
const double pi = 3.141592653589793;
using Graph = vector<vector<int>>;
template<class T> bool chmax(T &a, const T &b){if(a<b){a=b; return 1;} return 0;}
template<class T> bool chmin(T &a, const T &b){if(b<a){a=b; return 1;} return 0;}
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    string s; cin >> s;
    int num[100100];
    Fill(num,1);
    int tmp;
    rep(i,0,SZ(s)-2){
        if(s[i] == 'R' && s[i+1] == 'R'){
            num[i+2] += num[i];
            num[i] = 0;
        }
    }
    for(int i=SZ(s)-1;i>1;i--){
        if(s[i] == 'L' && s[i-1] == 'L'){
            num[i-2] += num[i];
            num[i] = 0;
        }
    }

    rep(i,0,SZ(s)){
        if(i != 0){
            cout << " ";
        }
        cout << num[i];
    }
    cout << endl;
    return 0;
}

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

using namespace std;

using ll = long long;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int H, W;
    cin >> H >> W;
    vector< vector<int> > a(H, vector<int>(W)), b(H, vector<int>(W));
    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            cin >> a[i][j];
        }
    }
    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            cin >> b[i][j];
        }
    }

    vector< bitset<30001> > dp(W);
    constexpr int geta = 15000;
    dp[0].set(abs(a[0][0] - b[0][0]) + geta);
    dp[0].set(-abs(a[0][0] - b[0][0]) + geta);

    for (int i = 0; i < H; ++i) {
        for (int j = 0; j < W; ++j) {
            if (i > 0) {
                dp[j] = ((dp[j] << abs(a[i][j] - b[i][j])) | (dp[j] >> abs(a[i][j] - b[i][j])));
            }
            if (j > 0) {
                dp[j] |= (dp[j - 1] << abs(a[i][j] - b[i][j]));
                dp[j] |= (dp[j - 1] >> abs(a[i][j] - b[i][j]));
            }
        }
    }
    
    int ans = geta;
    for (int i = -geta; i <= geta; ++i) {
        if (dp[W - 1][i + geta]) {
            ans = min(ans, abs(i));
        }
    }
    cout << ans << endl;
    return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<int64_t> L(87);
  L.at(0) = 2LL;
  L.at(1) = 1LL;
  for (int i = 2; i <= N; i++) {
    L.at(i) = L.at(i - 1) + L.at(i - 2);
  }
  cout << L.at(N) << endl;
}


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

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

	int X = int(N / 1.08);
	double Y = (double)N / 1.08 - (double)X;
	if (Y > 0) {
		X += 1;
	}

	int dum = int(X * 1.08);

	if (N == dum) {
		cout << X << endl;
	}
	else {
		cout << ":(" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>

int main() {
    long n;
    std::vector<long> input;

    std::cin >> n;
    long tmp;
    for (int i = 0; i < n; i++) {
        std::cin >> tmp;
        input.push_back(tmp);
    }

    int min_index = 0;
    long max_dif = input[1] - input[0];

    for (int i = 1; i < n; i++) {
        if (input[i] < input[min_index]) {
            min_index = i;
        } else if (max_dif < input[i] - input[min_index]) {
            max_dif = input[i] - input[min_index];
        }
    }

    std::cout << max_dif <<std::endl;

    return 0;
}


Measured memory_bytes: 4936
/*OJ:
  ProblemID:
  Date:
*/
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <cctype>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <complex>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cwchar>
#include <cwctype>
#include <exception>
#include <locale>
#include <numeric>
#include <new>
#include <stdexcept>
#include <limits>
#include <valarray>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <list>
#include <utility>
#include <bitset>
#include <algorithm>
#include <functional>
#define mp make_pair
#define pb push_back
#define all(n) (n).begin,(n).end
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<pair<int,int>,int> piii;
const int INF=1e9+7;
/*_____main part_____*/
string s;
int K;
int main()
{
	cin>>s>>K;
	vector<string> v;
	for (int i=0;i<s.size();i++)
	{
		for (int j=i;j<min((int)s.size(),i+6);j++) 
		v.push_back(s.substr(i,j-i+1));
	}
	sort(v.begin(),v.end());
	v.erase(unique(v.begin(),v.end()),v.end());
	cout<<v[K-1]<<endl;
	return 0;
}

Measured memory_bytes: 1916
#include<bits/stdc++.h>
#define ll long long int
#define F first
#define S second
#define loop(i,a,b) for(ll i=a;i<b;i++)
using namespace std;
int main()
{
    ll n,w;
    cin>>n>>w;
    pair<ll,ll> value[n];
    loop(i,0,n) cin>>value[i].F>>value[i].S;
    sort(value,value+n);
    ll mat[w+1][n+1] = {0};
    loop(i,1,w+1)
    {
        loop(j,1,n+1)
        {
            if(value[j-1].F<=i)
                mat[i][j] = max(mat[i][j-1],value[j-1].S+mat[i-value[j-1].F][j-1]);
            else
                mat[i][j] = mat[i][j-1];
        }
    }
    cout<<mat[w][n];
    return 0;
}

Measured memory_bytes: 79104
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) FOR(i, 0, (n))
#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define LAR(a, b) ((a)=max((a),(b)))
#define SML(a, b) ((a)=min((a),(b)))
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vl = vector<ll>;
using pii = pair<int, int>;
using vpii = vector<pair<int, int>>;
template<typename T>
using pque = priority_queue<T, vector<T>, greater<T>>;
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define ALL(a) (a).begin(), (a).end()
#ifdef LOCAL_DEBUG
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

void no(){
	printf("No\n");
	exit(0);
}

constexpr int N = 1<<20;
char s[N];
vi a[N], b[N];
int f(vi a[N]){
	int z = 0;
	for(int i = 0; i <= z; i++){
		DEBUG("i = %d\n", i);
		for(int j : a[i]){
			z += j;
			// DEBUG("   %d\n", j);
		}
	}
	FOR(i, z+1, N) if(a[i].size()) no();
	return z;
}

int main(){
	int n; scanf("%d", &n);
	int r = 0;
	REP(i, n){
		scanf("%s", s);
		int m = strlen(s);
		int p = 0, q = 0;
		REP(i, m){
			q += s[i] == '(' ? +1 : -1;
			SML(p, q);
		}
		DEBUG("(%d, %d)\n", p, q);
		if(q > 0) a[-p].EB(q);
		else if(q < 0) b[q-p].EB(-q);
		else LAR(r, -p);
	}
	int x = f(a), y = f(b);
	if(x != y) no();
	if(x < r) no();
	printf("Yes\n");
}






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

using namespace std;
#define rep(i,n) for(int i=1;i<n+1;i++)
#define ll long long int
#define INF 1000000007
// cin.eof() 入力個数の問題
int main(){
int n;
cin>>n;
for(int i=n;i>0;i--){
    for(int bit=64;bit>1;bit>>=1){
        if(i==bit){
            cout<<i<<endl;
            return 0;
        }
        //cout<<"bit=="<<bit<<endl;
    }
}
cout<<1<<endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int N,M;
int A[10001];

int main(){
	cin>>N>>M;
	int now=0;
	REP(i,N){
		cin>>A[i];
		now+=A[i];
	}
	int ans=0;
	REP(i,N){
		if(now<=A[i]*4*M)ans++;
	}
	if(ans>=M){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
}

Measured memory_bytes: 256
W,H,N=map(int,input().split())
xya=[list(map(int,input().split())) for i in range(N)]

first=[0,0]
last=[W,H]

for i in range(N):
    if first[0]<xya[i][0] and xya[i][2]==1:
        first[0]=xya[i][0]
    if last[0]>xya[i][0] and xya[i][2]==2:
        last[0]=xya[i][0]
    if first[1]<xya[i][1] and xya[i][2]==3:
        first[1]=xya[i][1]
    if last[1]>xya[i][1] and xya[i][2]==4:
        last[1]=xya[i][1]

area=0
if last[0]<=first[0] or last[1]<=first[1]:
    pass
else:
    area=(last[0]-first[0])*(last[1]-first[1])

print(area)


Measured memory_bytes: 9236
#include<bits/stdc++.h>
#define max(a,b) (((a)>(b))?a:b)
#define min(a,b) (((a)<(b))?a:b)
#define int long long
using namespace std;
template<typename T>void read(T &x){
	x=0;int f=1;
	char c=getchar();
	for(;!isdigit(c);c=getchar()) if (c=='-') f=-1;
	for(;isdigit(c);c=getchar()) x=x*10+c-48;
	x*=f;
}
int n,fa[100010],sz[100010];
struct ha{int d,id;}a[100010];
bool cmp(ha x,ha y){
	return x.d>y.d;	
}
int dis;
vector<int>e[100010];
void dfs(int x,int d){
	dis+=d;
	int si=e[x].size();
	for(int i=0;i<si;++i)
		dfs(e[x][i],d+1);
}
signed main(){
	read(n);
	for(int i=1;i<=n;++i)
		read(a[i].d),a[i].id=i;
	sort(a+1,a+1+n,cmp);
	for(int i=1;i<=n;++i)
		sz[i]=1;
	for(int i=1;i<n;++i){
		int xx=a[i].d-(n-sz[a[i].id])+sz[a[i].id];
		int l=i+1,r=n;
		while(l<=r){
			int mid=(l+r)/2;
			if(a[mid].d==xx) {fa[a[i].id]=a[mid].id;sz[a[mid].id]+=sz[a[i].id];e[a[mid].id].push_back(a[i].id);break;}
			else if(a[mid].d<xx) r=mid-1;
			else l=mid+1;
		}
		if(!fa[a[i].id]) {puts("-1");return 0;}
	}
	dfs(a[n].id,0);
	if(dis!=a[n].d) {puts("-1");return 0;}
	for(int i=1;i<=n;++i)
		if(fa[i]) printf("%d %d\n",i,fa[i]);
	return 0;
}


Measured memory_bytes: 12288
program main
    implicit none
    integer i, n
    integer(selected_int_kind(r=15)) :: total = 0
    read *, n
    do i=1, n
        if ( mod(i, 3) /= 0 .and. mod(i, 5) /= 0) then
            total = total + i
        endif
    enddo
    print *, total
end program main


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define DEBUG_ARR(v,n) cout<<#v<<":";REP(i,n)cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    string s,t;
    cin>>s>>t;
    t = t.substr(0,t.size()-1);
    string ans = (s==t) ? "Yes":"No";
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3656
from collections import Counter
N=int(input())
W=[input() for i in range(N)]
flag=True
a=Counter(W)
b=a.most_common()
if b[0][1]>1:
    flag=False
for i in range(len(W)-1):
    if W[i][-1]!=W[i+1][0]:
        flag=False
if flag:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define Int long long
#define pb push_back
using namespace std;

Int N,K,T;
Int ceilS(Int A,Int B){
    return (A+B-1)/B;
}
int main()
{
   int t;t=1;
   while(t--){
       string S;cin>>S;
       Int ans=0;
       for(auto x:S){
           ans+=(x-'0');
       }
       cout<<(ans%9 ? "No\n":"Yes\n");
   }
}

Measured memory_bytes: 3688
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine());
        var l = Console.ReadLine().Split().Select(int.Parse).OrderBy(x => x).ToArray();
        int res = 0;
        for (int i = 0; i < l.Length; i++)
        {
            for (int j = i + 1; j < l.Length; j++)
            {
                var target = l[i] + l[j];
                var valid = -1;
                var invalid = n;
                while (invalid - valid > 1)
                {
                    var mid = (invalid + valid) / 2;
                    if (l[mid] < target) valid = mid;
                    else invalid = mid;
                }
                res += Max(0, valid - j);
            }
        }
        Console.WriteLine(res);
    }
}


Measured memory_bytes: 13408
#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for(long long i=0;i<n;i++)
#define REP1(i,n) for(long long i=1;i<=n;i++)
#define REPB(i,n) for(long long i=((n)-1);i>=0;i--)
#define REPB1(i,n) for(long long i=(n);i>0;i--)
#define ITE(arr) for(auto ite=(arr).begin();ite!=(arr).end();ite++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define YNPRT(b) cout<<((b)?"Yes":"No")<<endl
#define REV(arr) reverse(ALL(arr))
typedef long long ll;
typedef pair<int,int> pii;
//---------------------
#define MAXN 100000
//---------------------

ll a[MAXN],n;

int main(){
	cin>>n;
	REP(i,n) cin>>a[i];
	sort(a,a+n);
	reverse(a,a+n);
	ll w=-1,h=-1,id=0;
	while(1){
	  	if(h>0 || id>=n) break;
	  		
	  	ll num=upper_bound(a+id,a+n,a[id],greater<ll>())-lower_bound(a+id,a+n,a[id],greater<ll>());
	  	
	  	if(num>1){
	  		if(w<0) w=a[id];
	  		else h=a[id];
	  		id+=2;
	  	}
		else id+=num;
	}
	if(h<0) cout<<0<<endl;
	else cout<<w*h<<endl;
	
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
const int INF = 1e9;
using LL = long long;
const LL LINF = 1e18;
const double EPS = 1e-10;
using namespace std;

#define SCIN(n) string(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) <<endl

#define ALL(obj) (obj).begin(),(obj).end()

#define rt return
#define ENDL cout<<endl
#define s second
#define f first

typedef string::const_iterator State;
class PalseError {};
class Edge{
public:
    LL from,to,value;
    Edge(LL a,LL b,LL c){
        from = a;
        to = b;
        value = c;
    }
    Edge(LL a,LL b){
        from = a;
        to = b;
    }
};
const int MOD = 1e9+7;
int main(){
    int N,M;cin >> N >> M;
    if(N < M)swap(N,M);
    if(N - M >= 2){
        cout<<0<<endl;
        return 0;
    }
    auto kaizyou = [&](LL i){
        LL ans = 1;
        for(int a = 1;a <= i;a++){
            ans *= a;ans %= MOD;
           // cout<<ans<<endl;
        }
        //cout<<ans<<endl;
        return ans%MOD;
    };
    //cout<<"A"<<endl;
    if(N == M){
        cout<<1LL*kaizyou(N)*kaizyou(N)*2%MOD<<endl;
    }else{
        cout<<1LL*kaizyou(N)*kaizyou(M)%MOD<<endl;
    }
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**7)

n=int(input())

graph = [[] for _ in range(n)]
for _ in range(n-1):
    u, v, w = map(int, input().split())
    graph[u-1].append((v-1, w))
    graph[v-1].append((u-1, w))

q,k=map(int, input().split())
k-=1

dist=[-1]*n

def dfs(now, parent, d):
    dist[now]=d
    for i in graph[now]:
        if i[0]==parent:
            continue
        else:
            dfs(i[0], now, d+i[1])

dfs(k, -1, 0)

for _ in range(q):
    x,y=map(int, input().split())
    x-=1
    y-=1
    print(dist[x]+dist[y])



Measured memory_bytes: 136144
import numpy as np
n, m = [int(i) for i in input().split()]
a = np.array([int(i) for i in input().split()])
aa = a/(np.sum(a))
aa -= 1/(4*m)
flag = 0
aa = np.sort(aa)[::-1]

for i in range(n):
    if aa[i] < 0:
        flag += 0
    elif aa[i] >= 0:
        flag += 1

if flag >= m:
    print('Yes')
else:
    print('No')
        


Measured memory_bytes: 27292
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	int a1=a%2,b1=b%2,c1=c%2;
	if(a1==b1&&b1==c1)
	{
		int mx=max(a,max(b,c));
		cout<<(mx-a)/2+(mx-b)/2+(mx-c)/2<<endl;
		return 0;
	}
	else
	{
		if(a1!=b1&&a1!=c1)
		{
			b++;
			c++;
			int mx=max(a,max(b,c));
			cout<<1+(mx-a)/2+(mx-b)/2+(mx-c)/2<<endl;
		}
		if(b1!=a1&&b1!=c1)
		{
			a++;
			c++;
			int mx=max(a,max(b,c));
			cout<<1+(mx-a)/2+(mx-b)/2+(mx-c)/2<<endl;
		}
		if(c1!=a1&&c1!=b1)
		{
			a++;
			b++;
			int mx=max(a,max(b,c));
			cout<<1+(mx-a)/2+(mx-b)/2+(mx-c)/2<<endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<string.h>
 
typedef long long int ll;
#define all(x) (x).begin(), (x).end()
 
using namespace std;

int nxt() {
    int x;
    cin >> x;
    return x;
}

ll nxtl(){
    ll x;
    cin>>x;
    return x;
}
 
void SieveOfEratosthenes(int n,vector <int> &primes) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          primes.push_back(p);
} 
 
ll max(ll a,ll b)
{
    if(a>b)
        return a;
    return b;
}
 
ll power(ll x, ll y,ll mod) 
{ 
    ll temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2,mod); 
    if (y%2 == 0) 
        return (temp*temp)%mod; 
    else
        return (((x*temp)%mod)*temp)%mod; 
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n=nxt(),k=nxt(),q=nxt();
    vector <int> v(n);
    for(int i=0;i<n;i++)
        v[i]=k-q;
    while(q--){
        int x=nxt();
        v[x-1]++;
    }
    for(int i=0;i<n;i++)
        if(v[i]>0)
            cout<<"Yes\n";
        else
            cout<<"No\n";
        
    
    
    return 0;   
}


 
 


Measured memory_bytes: 1024
/*input
999983
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int K;cin>>K;
	set<int> st;
	int ans =1;

	int mod = 7%K;
	st.insert(mod);
	int pos=1;
	
	while(mod!=0 && pos==1)
	{
		mod = (10*mod+7)%K;
		// cout<<mod<<"\n";
		if(st.find(mod)!=st.end()) pos=0;
		else {
			ans++;
			st.insert(mod);
		}
	}

	if(!pos) ans=-1;
	cout<<ans<<"\n";
	return 0;
}


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

int main() {
  int N, K;
  cin >> N >> K;
  int x[100010];
  for (int i = 0; i < N; i++) cin >> x[i];

  int ans = 1000000010;
  for (int i = 0; i + K <= N; i++) {
    int left = x[i], right = x[i + K - 1];
    int time = 0;
    if (left < 0 && right >= 0) {
      time += abs(left) + right + min(abs(left), right);
    } else {
      time += max(abs(left), abs(right));
    }
    ans = min(ans, time);
  }

  cout << ans << endl;
}

Measured memory_bytes: 640
a, b, c = map(int, input().split())

if (a >= 1 and a <= 10000) and (b >= 1 and b <= 10000) and (c >= 1 and c <= 10000):
    listed = []
    listed.append(a)
    listed.append(b)
    listed.append(c)

    sorted = listed.sort()

    print(str(listed[0]) + " " + str(listed[1]) + " " + str(listed[2]))

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

using i32 = std::int_fast32_t;
using i64 = std::int_fast64_t;
template <typename T> constexpr T inf = numeric_limits<T>::has_infinity ? numeric_limits<T>::infinity() : numeric_limits<T>::max() / 4;

#define REP(i, stop) FOR(i, 0, stop)
#define FOR(i, start, stop) for (int i = start, i##_len = stop; i < i##_len; ++i)
#define COMP(key) [](const auto& a, const auto& b) { return a.key < b.key; }

struct InitCpp { InitCpp() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(10); } } initCpp;

class RollingHash { private: using ull = unsigned long long; const ull mod = (1ULL << 61) - 1; std::vector<ull> hashed, power; inline ull add(ull a, ull b) const { ull ret = a + b; if (ret >= mod) ret -= mod; return ret; } inline ull sub(ull a, ull b) const { ull ret = a + mod - b; if (ret >= mod) ret -= mod; return ret; } inline ull mul(ull a, ull b) const { ull ah = a >> 31, al = a & ((1ULL << 31) - 1), bh = b >> 31, bl = b & ((1ULL << 31) - 1), m = ah * bl + al * bh, v = (ah * bh << 1) + (m >> 30) + ((m & ((1ULL << 30) - 1)) << 31) + al * bl; v = (v & ((1ULL << 61) - 1)) + (v >> 61); v = (v & ((1ULL << 61) - 1)) + (v >> 61); return v; } public: RollingHash(const std::string &s, unsigned base = 10007) { size_t sz = s.size(); hashed.assign(sz + 1, 0); power.assign(sz + 1, 0); power[0] = 1; for (int i = 0; i < sz; i++) { power[i + 1] = mul(power[i], base); hashed[i + 1] = add(mul(hashed[i], base), s[i]); } } ull get(size_t l, size_t r) const { return sub(hashed[r], mul(hashed[l], power[r - l])); } ull connect(ull h1, int h2, size_t h2len) const { return add(mul(h1, power[h2len]), h2); } int LCP(const RollingHash &b, size_t l1, size_t r1, size_t l2, size_t r2) { int len = std::min(r1 - l1, r2 - l2); int low = -1, high = len + 1; while (high - low > 1) { int mid = (low + high) >> 1; if (get(l1, l1 + mid) == b.get(l2, l2 + mid)) low = mid; else high = mid; } return low; } };

signed main() {
  string T, P;
  cin >> T;
  cin >> P;
  RollingHash rh1(T), rh2(P);
  REP(i, T.size() - P.size() + 1) {
    if (rh1.get(i, i + P.size()) == rh2.get(0, P.size())) {
      cout << i << endl;
    }
  }
}



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

typedef long long ll;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define ANS(n) cout << (n) << endl

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORR(i,a,b) for(int i=(a);i>=(b);i--)

#define ALL(obj) (obj).begin(),(obj).end()

#define pii pair<int,int>

#define pb(a) push_back(a)
#define mp make_pair

vector<string> patterns;

void makePatterns(string s, int n)
{
    if(n == 0){
        patterns.pb(s);
    }else{
        makePatterns(s + '0', n-1);
        makePatterns(s + '1', n-1);
        makePatterns(s + '2', n-1);
        makePatterns(s + '3', n-1);
    }
}

int main()
{
	int n,a,b,c;
	cin >> n >> a >> b >> c;
	int l[n];
	FOR(i,0,n)cin >> l[i];
	makePatterns("", n);
	int ans = INF;
	FOR(i,0,(int)patterns.size()){
	    vector<int> madeBamboos(3);
	    vector<int> bambooUses(3);
	    FOR(j,0,3){
	        madeBamboos[j] = 0;
	        bambooUses[j] = 0;
	    }
    	FOR(j,0,n){
	        if(patterns[i][j] == '0'){
	            madeBamboos[0] += l[j];
	            bambooUses[0]++;
	        }
	        if(patterns[i][j] == '1'){
	            madeBamboos[1] += l[j];
	            bambooUses[1]++;
	        }
	        if(patterns[i][j] == '2'){
	            madeBamboos[2] += l[j];
	            bambooUses[2]++;
	        }
    	}
    	sort(ALL(madeBamboos));
    	int mpNeeded = abs(a - madeBamboos[2]) + abs(b - madeBamboos[1]) + abs(c - madeBamboos[0]);
    	bool able = true;
    	FOR(j,0,3){
    	    if(bambooUses[j] > 0){
        	    mpNeeded += (bambooUses[j] - 1) * 10;
    	    }else{
    	        able = false;
    	    }
    	}
    	if(able)ans = min(ans, mpNeeded);
	}
	ANS(ans);
	return 0;
}


Measured memory_bytes: 3832
include Math
require 'prime'

n = gets.to_i
root_prime = Prime.each(10000).to_a
c = 0

n.times {
  catch(:next) do
    x = gets.to_i
    if (x <= 10000)
      c += 1 if (root_prime.index(x) != nil)
      throw :next
    end
    xs = sqrt(x).floor
    root_prime.each{ |rp|
      break if (rp > xs)
      throw :next if (x % rp == 0)
    }
    c += 1
  end
}
puts c

Measured memory_bytes: 9056
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <math.h>
#include <iomanip>
#include <bitset>
#include <cstring>
#include <stdlib.h>
#include <utility>
#include <set>
#include <map>
#include <string.h>
#include <cstring>
#include <queue>
 

using namespace std;

int main() {
    int x[5];
    for(int i=1; i<=5; i++){
        cin >> x[i];
        if(x[i]==0){
            cout << i << endl;
            return 0;
        }
    }
    return 0;
 }


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

int main() {
    int A, B, Q;
    cin >> A >> B >> Q;
    vector<long long> s(A), t(B);
    for (int i = 0; i < A; ++i) {
        cin >> s[i];
    }
    for (int i = 0; i < B; ++i) {
        cin >> t[i];
    }

    sort(s.begin(), s.end());
    sort(t.begin(), t.end());
    while (Q--) {
        long long x;
        cin >> x;
        int sd = lower_bound(s.begin(), s.end(), x) - s.begin();
        int td = lower_bound(t.begin(), t.end(), x) - t.begin();
        vector<long long> ns, nt;
        if (sd != 0) ns.push_back(s[sd - 1]);
        if (sd != s.size()) ns.push_back(s[sd]);
        if (td != 0) nt.push_back(t[td - 1]);
        if (td != t.size()) nt.push_back(t[td]);

        // デバッグ
        /*
        cout << "ns: ";
        for (auto x : ns) cout << x << " ";
        cout << endl;
        cout << "nt: ";
        for (auto x : nt) cout << x << " ";
        cout << endl;
        */
        long long res = 10000000000000LL;
        for (auto ps : ns) {
            for (auto pt : nt) {
                // psとptが同じ側だったら、dist = max(abs(ps-x),abs(pt-x))
                // psとptが違う側だったら、dist = min(2*abs(ps-x) + abs(pt-x), abs(ps-x) + 2*abs(pt-x))
                if ((ps - x > 0) ^ (pt - x > 0)) {
                    res = min(res, min(2 * abs(ps - x) + abs(pt - x), 2 * abs(pt - x) + abs(ps - x)));
                } else {
                    res = min(res, max(abs(ps - x), abs(pt - x)));
                }
            }
        }
        cout << res << endl;
    }

    return 0;
}

Measured memory_bytes: 2944
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define it ::iterator
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double ESP=1e-10;
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int>in(n);
  int a,b;
  cin>>a>>b;
  int pizza;
  cin>>pizza;
  rep(i,n)cin>>in[i];
  //テ」ツ?禿」ツ?禿」ツ?セテ」ツ?ァテ・ツ?・テ・ツ環?
  sort(all(in));
  int out=pizza/a;
  int cost=a;
  for(int i=n-1;i>=0;i--){
    cost+=b;
    pizza+=in[i];
    out=max(out,pizza/cost);
  }
  cout<<out<<endl;
}

Measured memory_bytes: 1216
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		sc.close();

		char n1 = N.charAt(0);
		char n2 = N.charAt(1);
		char n3 = N.charAt(2);
		
		String ans = "No";
		if(n1=='7' || n2=='7' || n3=='7'){
			ans = "Yes";
		}
		
		System.out.printf("%s\n", ans);
	}
}

Measured memory_bytes: 27100