akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }

int main()
{
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  
  string s;cin>>s;
  string ans="";
  rep(i,s.size()){
    if(i%2==0){
      ans+=s.substr(i,1);
    }
  }
  cout(ans);
  return 0;
}

Measured memory_bytes: 592
#include<bits/stdc++.h>
#define mp make_pair
#define fi first
#define se second
#define VAL 100000
#define ll long long
#define INF 10000000000000000LL
#define pll pair<long long , long long>
const int MAX=1e4+10;
const int MOD=1e9+7;
const int TOT_PRIMES=19;
const int MAX_A=70;
using namespace std;
int main() 
{ 
	//ios_base::sync_with_stdio(false);
  //  cin.tie(NULL);	
//	#ifndef ONLINE_JUDGE
//	freopen("inp.txt" ,"r", stdin );
//	freopen("out.txt", "w", stdout);
//endif
	int n ,k;
	cin>>n>>k;
	ll arr[n+1];
	ll dp[n+1];
	for(int i=1;i<=n;i++)
		cin>>arr[i];
	memset(dp , -1 , sizeof(dp));
	dp[1]=0;
	for(int i=2;i<=n;i++){
		for(int j=1;j<=k;j++){
			if(i-j>=1){
				if(dp[i]<0)
					dp[i]=dp[i-j]+abs(arr[i]-arr[i-j]);
				else
					dp[i]=min(dp[i-j]+abs(arr[i]-arr[i-j]) , dp[i]);
			}
		}
	}
	cout<<dp[n];
}

Measured memory_bytes: 1792
using System;

namespace B___Sumo
{
    class Program
    {
        static void Main (string[] args)
        {
            var s = Console.ReadLine ();
            var count = 0;
            foreach (var p in s)
            {
                if (p == 'o')
                    count++;
            }
            if (count + 15 - s.Length >= 8)
                Console.WriteLine ("YES");

            else
                Console.WriteLine ("NO");
        }
    }
}

Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vll vector<ll>
#define umap unordered_map
#define uset unordered_set
#define frw(i, a, b) for(int i = a; i < b; i++)
#define bck(i, a, b) for(int i = a; i > b; i--)
#define fi first
#define se second
#define pub push_back
#define in insert
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define sz(a) int(a.size())
#define pii pair<int, int>
#define pll pair<ll, ll>
#define plll pair<ll, pll>
#define vpll vector<pll>
#define vpii vector<pii>

const int N = 1e5 + 5;

int n;
vector<vll> a, dp;

ll rec(int n, int prev){
	if(n == 0)	return 0;
	ll &aux = dp[n][prev];
	if(aux != -1)	return aux;
	aux = 0;
	frw(i, 0, 3)	if(prev != i)	aux = max(aux, a[n][i] + rec(n - 1, i));
	return aux;
}

int main(){
	ios::sync_with_stdio(0);
	cin >> n;
	dp.assign(n + 1, vll (3, -1));
	a.assign(n + 1, vll (3, 0));
	frw(i, 1, n + 1)	frw(j, 0, 3)	cin >> a[i][j];
	ll ans = a[n][0] + rec(n - 1, 0);
	ans = max(ans, a[n][1] + rec(n - 1, 1));
	ans = max(ans, a[n][2] + rec(n - 1, 2));
	cout << ans;
}

Measured memory_bytes: 17408
import sys
import math
from collections import deque
from collections import defaultdict

def factorization(n):
    arr = {}
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr[i] = cnt

    if temp!=1:
        arr[temp] = 1

    if arr==[]:
        arr[n] = 1

    return arr

def main():
    n = int(sys.stdin.readline())
    base = factorization(n)
    ans = 0
    for x in list(base.keys()):
        i = 1
        while(base[x] >= i):
            base[x] -= i
            ans += 1
            i += 1
    print(ans)
    return 0

if __name__ == "__main__":
    main()

Measured memory_bytes: 9744
import Control.Applicative ((<$>), (<*>))
import Control.Monad
import Data.List
import Data.List.Split (splitOn, splitOneOf)
import Data.Char (ord, chr, isDigit, isUpper, isLower, digitToInt, intToDigit)
import Test.HUnit

main :: IO ()
-- main = runTestTT tests >> return ()
main = do
  xs <- getc $ solve . splitOneOf "+="
  mapM_ printAnswer xs
  
solve :: [String] -> Maybe Int
solve [s1,s2,s3]
  | null rs = Nothing
  | otherwise = Just $ head rs
  where
    ls = if (f s1) || (f s2) || (f s3) then [1..9] else [0..9]
    f s = length s /= 1 && head s == 'X'
    rs = filter (isCorrect s1 s2 s3) ls
    
toNum :: String -> Int -> String
toNum ss i = map (\c -> if c == 'X' then (intToDigit i) else c) ss

isCorrect :: String -> String -> String -> Int -> Bool
isCorrect s1 s2 s3 n = i1 + i2 == i3
  where
    i1 = toInt $ toNum s1 n
    i2 = toInt $ toNum s2 n
    i3 = toInt $ toNum s3 n

printAnswer :: Maybe Int -> IO ()
printAnswer Nothing = putStrLn "NA"
printAnswer (Just x) = print x

toInt :: String -> Int
toInt s = read s

getc :: (String -> a) -> IO [a]
getc f = map f . lines <$> getContents

Measured memory_bytes: 4328
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <map>
#include <set>
#include <functional>
#include <stack>
#include <cmath>
#include <string>
#define MOD 1000000007

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;

int dp[2][2][2][2];

int main()
{
	ll N;
	scanf("%lld",&N);
	int pos=0;
	memset(dp,0,sizeof(dp));
	dp[pos][0][0][0]=1;
	for(int i=0;i<100;i++)
	{
		pos^=1;
		memset(dp[pos],0,sizeof(dp[pos]));
		int d=(int) (N%2);
		N/=2;
		for(int j=0;j<2;j++)
		{
			for(int k=0;k<2;k++)
			{
				for(int r=0;r<2;r++)
				{
					for(int s=0;s<2;s++)
					{
						for(int t=0;t<2;t++)
						{
							if(s==1&&t==0) continue;
							int a=s^t;
							int b=r+s+t;
							int x=a>d?1:a<d?0:j;
							int y=(b%2)>d?1:(b%2)<d?0:k;
							int z=b/2;
							dp[pos][x][y][z]+=dp[pos^1][j][k][r];
							if(dp[pos][x][y][z]>=MOD) dp[pos][x][y][z]-=MOD;
						}
					}
				}
			}
		}
	}
	printf("%d\n",dp[pos][0][0][0]);
	return 0;
}


Measured memory_bytes: 128
// Created by Bingoo on 7/8/2020.
#include"bits/stdc++.h"
using namespace std ;
#define ll  long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

template <class ...Args>
auto &see(const Args &...args) {return ((cerr << " " << args), ...) << '\n';}
#define bug(...)  cerr << "[ "#__VA_ARGS__" ] = "; see(__VA_ARGS__) << '\n';
//C++17
template<typename... Args>
void read(Args&... args){((cin >> args), ...);}
template<typename... Args>
void write(Args... args){((cout << args << " "), ...);}

ll mod = 1e6 +3 ;
ll power(ll a, ll b)	//a is base, b is exponent
{
    if (b == 0)
        return 1;
    if (b == 1)
        return a;
    if (b % 2 == 1)
        return (power(a, b - 1) * a) % mod;
    ll q = power(a, b / 2);
    return (q * q) % mod;
}

bool comp(pair<int,int>&a ,pair<int,int>&b)
{
    return a.second > b.second ;
}

string s;
int k ,n ;

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

   s[k-1]=tolower(s[k-1]);

   cout << s << endl;


}




Measured memory_bytes: 3588
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>

using namespace std;
using ll = long long;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T> &p){ cout << "[" << p.first << ", " << p.second << "]"; return os; }

#define Sq(x) (x)*(x)
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Unique(a) a.erase(unique(Range(a)), a.end())
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) { for(const auto &e : xs) cout << e << " "; cout << "\n"; }
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")
#define Return(expr) { Cout(expr); return 0; }
#define vc vector
#define Mini(a, x) a = min(a, x)
#define Maxi(a, x) a = max(a, x)

// constexpr int MOD = 1e9+7;

double d(int x1, int y1, int x2, int y2){
  return sqrt(Sq(x1-x2) + Sq(y1-y2));
}
int fact(int n){
  return (n <= 1) ? 1 : n * fact(n-1);
}

int main(void){
    Cin(int, n);
  	Cins2(int, n, x, y);
    double ans = 0;
  	For(i, n) For(j, n){
      ans += fact(n-1) * d(x[i], y[i], x[j], y[j]);
    }
  	printf("%.15f\n", ans / fact(n));
}

Measured memory_bytes: 256
//____________________________________________________________________
  //________________________________NAMAN_______________________________
 //________________________________TALAYCHA______________________________
//__________________________________________________________________________

#include <bits/stdc++.h>
#define ll              long long
#define int             long long
#define pmin            priority_queue < ll, vector<ll>, greater<ll> >
#define pmax            priority_queue <ll>
#define endl            '\n'
#define mii             map<ll , ll >
#define pii             pair< ll, ll >
#define vi              vector<ll>
#define all(a)          (a).begin(), (a).end()
#define DEBUG           cerr<<"/n>>>I'm Here<<</n"<<endl;
#define rep(i, a, b )   for (ll i = a; i < b; i++)
#define rrep(i, a, b)   for (ll i = a; i >= b; i--)
#define bs              binary_search
#define present(c, x)   ((c).find(x) != (c).end())
#define cpresent(c, x)  (find(all(c), x) != (c).end())
#define p1(i)           cout<<i<<endl;
#define p2(i,j)         cout<<i<<" "<<j<<endl;
#define line            cout<<endl;
#define prt(s,b,n)      rep(i,(b),(n)) { cout<<(s)[i]<<" ";} line
#define lower(u)        transform(u.begin(), u.end(), u.begin(), ::tolower);  //convert string u to lowercase;
#define upper(u)        transform(u.begin(), u.end(), u.begin(), ::toupper);
#define tr(container, it) \
for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define hell 1e6+3
#define mod 998244353

  using namespace std;

//_________________________________________________________________________________________________________
//__________________________________________START____________________________________________________________

//................EVERY COIN HAS TWO SIDES...............................................................................................................

void solve()
{
  ll n,k; 
  //ll m=0 , mx=0 , mn=0 , k=0 , ans=0 , flag=0 , res=0 ;
  cin>>n>>k;
  //for(ll i=0;i<n;i++)
  //string s;  cin>>s;
 vi a(n); rep(i,0,n){ cin>>a[i];}
  ll d[n+1];
  rep(i,0,n+1) d[i]=INT_MAX;
  d[0]=0;
  d[1]=0;
  d[2]=abs(a[0]-a[1]);
  rep(i,3,n+1)
  {  rep(j,1,k+1)
     {
      if((i-1-j)>=0)
        d[i]=min( d[i], d[i-j]+ abs(a[i-1]-a[i-1-j]) );
      }
  }
  //prt(d,1,n+1)
  cout<<d[n]<<endl;
  return;
}

//__________________________________________________________________________________________________________
//__________________________________________END______________________________________________________________

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

  #ifndef ONLINE_JUDGE 
  freopen("input.txt" , "r", stdin);
  freopen("out12.txt" , "w", stdout);
  #endif  
//sieve();
  ll TESTS = 1;
  //cin>>TESTS;
  while (TESTS--) 
  {
    solve();
  }
  return 0;
}


Measured memory_bytes: 4720
n = int(input())
max_n = 10 ** 5

dp = [int(i) for i in range(max_n + 1)]

for i in (6,9):
    v = i
    while v < max_n:
        for j in range(len(dp)):
            if j + v < max_n+1:
                dp[j+v] = min(dp[j+v],dp[j]+1)
        v *= i
        
print(dp[n])

Measured memory_bytes: 7064
#include <stdio.h>
int main(void)
{
    int w,h,x,y,r;
    scanf("%d%d%d%d%d",&w,&h,&x,&y,&r);
    if(w>=x+r&&0<=x-r&&h>=y+r&&0<=y-r)
    {
        printf("Yes\n");
    }
    else printf("No\n");
    return 0;
}


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

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

  cin >> a >> b >> c;

  if ((a == 5 || a == 7) && (b == 5 || b == 7) && (c == 5 || c == 7) && (a + b + c) == 17){
    cout << "YES" << endl;
  }
  else cout << "NO" << endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <iomanip>
#include <functional>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
typedef long long ll;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};

struct BipartiteMatching{
    int L,R;
    vector<vector<int> > adj;
    BipartiteMatching(int L,int R):L(L),R(R),adj(L+R){}
    void add_edge(int u,int v){
        adj[u].push_back(v+L);
        adj[v+L].push_back(u);
    }
    int maximum_matching(){
        vector<int> visited(L),mate(L+R,-1);
        function<bool(int)> augment = [&](int u){
            if(visited[u])return false;
            visited[u]=true;
            for(int w:adj[u]){
                int v = mate[w];
                if(v<0||augment(v)){
                    mate[u]=w;
                    mate[w]=u;
                    return true;
                }
            }
            return false;
        };
        int match = 0;
        for(int u=0;u<L;++u){
            fill(visited.begin(),visited.end(),0);
            if(augment(u))++match;
        } 
        return match;
    }
};

int main(){
    int n,a[101],b[101],c[101],d[101];
    cin >> n;
    for(int i=0;i<n;i++) cin >> a[i] >> b[i];
    for(int i=0;i<n;i++) cin >> c[i] >> d[i];
    BipartiteMatching bm(n,n);

    for(int i=0;i<n;i++){
        for(int j=0;j<n;j++){
            if(a[i]<c[j]&&b[i]<d[j]){
                bm.add_edge(i,j);
            }
        }
    }
    cout << bm.maximum_matching()<< endl;
    return 0;
}

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

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

    string rotate = s;
    for(long long i = 0; i < s.size(); i++){
        rotate = rotate[rotate.size()-1] + rotate.substr(0, rotate.size()-1);
        if(rotate == t){
            printf("Yes\n");
            return 0;
        }
    }
    printf("No\n");
    return 0;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rapido ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

void solve()
{
    string s;cin>>s;
    int ans=0;
    for(int i=0;i<3;i++)
    {
        int c=0;
        for(int j=i;j<3;j++)
        {
            if(s[j]=='R')
            c++;
            else
            break;
        }
        ans=max(ans,c);
    }
    cout<<ans<<endl;
}
int32_t main()
{
    rapido;
    int t;
    //cin>>t;
    t=1;
    while(t--)
    solve();
}


Measured memory_bytes: 3636
#include <stdio.h>

int main() {
    int a, b, i;
    scanf("%d %d", &a, &b);

    if (a<b){
        for(i=0; i<b; i++)
            printf("%d", a);
    } else {
        for(i=0; i<a; i++)
            printf("%d", b);
    }
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n); i++)
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using pii = pair<int, int>;

//const ll INF = 1e18L + 5;
//const int INF = 1e9 + 5;
//const double pi = 3.14159265358979323846;

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

	int n;
	cin >> n;
	vector<vector<vector<int>>> building(4, vector<vector<int>>(3, vector<int>(10)));
	while (n--) {
		int b, f, r, v;
		cin >> b >> f >> r >> v;
		building[b - 1][f - 1][r - 1] += v;
	}
	rep(b, 4) {
		rep(f, 3) {
			rep(r, 10) {
				cout << " " << building[b][f][r];
			}
			cout << endl;
		}
		if (b != 3)
			cout << "####################\n";
	}
}


Measured memory_bytes: 3176
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>
#include <iomanip>
using namespace std;
struct P{
  double x,y,z,r;
  P(double x,double y,double z,double r):x(x),y(y),z(z),r(r){}
};

double G[101][101];
double dist(const P& a,const P& b){
  double dx=a.x-b.x;
  double dy=a.y-b.y;
  double dz=a.z-b.z;
  double d = sqrt(dx*dx+dy*dy+dz*dz);
  return max(0.0,d-a.r-b.r);
}
int n;
const double INF = 1000000000;

double prim(){
  double ret = 0;
  double dst[150];
  bool used[150];
  memset(used,0,sizeof(used));
  for(int i=0;i<n;++i) dst[i]=INF;
  dst[0]=0;
  while(true){
    double mindst = INF;
    int id = -1;
    for(int i=0;i<n;++i){
      if(!used[i] && mindst > dst[i]){
	mindst = dst[i];
	id = i;
      }
    }
    if(id==-1) break;
    used[id]=true;
    ret+=mindst;
    for(int i=0;i<n;++i)
      dst[i]=min(dst[i],G[id][i]);
  }
  return ret;
}

int main(){
  while(cin>>n,n){
    memset(G,0,sizeof(G));
    vector<P> cell;
    for(int i=0;i<n;++i){
      double a,b,c,d;
      cin >> a >> b >> c >> d;
      cell.push_back(P(a,b,c,d));
    }
    for(int i=0;i<n;++i)
      for(int j=i+1;j<n;++j)
	G[i][j]=G[j][i]=dist(cell[i],cell[j]);
    cout << fixed << setprecision(3) << prim() << endl;
  }
  return 0;
}

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

bool is_palindrome(string S) {

    int num = S.length()/2;


    bool ans = true;
    for (int i = 0; i < num; i++) {
        if (S.at(i) != S.at(S.length()-1 - i)) {
            ans = false;
        }
    }

    return ans;    
}


int main() {
    string S;

    cin >> S;

    string ans = "Yes";
    if(!is_palindrome(S)) ans = "No";
    if(!is_palindrome(S.substr(0, (S.length()-1)/2))) ans = "No";
    if(!is_palindrome(S.substr((S.length()+1)/2, (S.length()-1)/2))) ans = "No";
    


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

Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<string>
#include<utility>
#include<vector>

#define rep(i, a, n)  for(int i=a; i<n; i++)
#define per(i, a, n)  for(int i=n-1; i>=a; i--)
#define all(x)  (x).begin(), (x).end()
#define MAX 100000
using namespace std;

int main(){
  int n, k; cin >> n >> k;
  int ans=1;
  while(n!=0){
    ans *= 2;
    n--;
    if(ans >= k){
      break;
    }
  }
  while(n!=0){
    ans += k;
    n--;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long n,k,q;
	cin>>n>>k>>q;
	int a[n+1];
	for(int i=1;i<=n;i++)
	a[i]=0;
	for(int i=1;i<=q;i++)
	{
		int o;
		cin>>o;
		a[o]++;
	}
	long long s=q;
	for(int i=1;i<=n;i++)
	{
		if((s-a[i])<k)
		{
			cout<<"Yes"<<endl;
		}
		else
		cout<<"No"<<endl;
	}
 } 

Measured memory_bytes: 3948
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void _main()
{
    string O, E;
    cin >> O >> E;
    rep(i, 0, O.size())
    {
        cout << O[i];
        if (i < E.size()) cout << E[i];
    }
    cout << endl;
}


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

#define rep(i,n) for(int i=0; i<n; i++)
typedef long long ll;
typedef pair<int,int> pii;
typedef vector< vector<int> > vvi;

int n, m;
int b[15];
int p[15];
int pb[15];

int solve() {
	int res = 0;
	rep(i, n) {
		if(b[i] != pb[i]) {
			for(int j=i+1; j<n; j++) {
				if( b[j] == pb[i] ) {
					res += j - i;
					b[j] = 1 - b[j];
					b[i] = 1 - b[i];
					break;
				}
			}
		}
	}
	return res;
}

void create_pb(int num) {
	int k = 0;
	rep(i, m) {
		rep(j, p[i]) {
			pb[k] = num;
			k++;
		}
		num = 1 - num;
	}
}

int main() {
	cin >> n >> m;
	rep(i, n) cin >> b[i];
	rep(i, m) cin >> p[i];
	int odd=0, even=0, cnt0=0, cnt1=0;
	rep(i, n) {
		if(b[i]) cnt1++;
		else cnt0++;
	}
	rep(i, m) {
		if(i%2) odd += p[i];
		else    even += p[i];
	}
	int mini = 10000;
	if(odd==cnt0 && even==cnt1) {
		create_pb(1);
		int tmp[15];
		rep(i,n) tmp[i] = b[i];
		mini = min(mini, solve());
		rep(i,n) b[i] = tmp[i];
	}
	if(even==cnt0 && odd==cnt1) {
		create_pb(0);
		mini = min(mini, solve());
	}
	cout << mini << endl;
	return 0;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
using namespace std;
int main()
{
 long long yn,a,b,c;
 cin>>yn;
 long long hp=0;
 a=yn/500;
  b=yn-a*500;
  c=b/5;
  hp=a*1000+c*5;
  cout<<hp;
return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long li;

const li mod = 1e9 + 7;

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

    li n;
    string s;
    cin >> n >> s;
    map<char, li> hist;
    for (auto &&c  : s) {
        hist[c] += 1;
    }

    li ans = 1;
    for (auto &&e  : hist) {
        ans *= e.second + 1;
        ans %= mod;
    }
    ans += mod - 1;
    ans %= mod;
    cout << ans << endl;
    return 0;
}

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

using namespace std;
typedef long long ll;
#define rep(i,j,n) for (int i = j; i < (n); i++)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
typedef pair<int,int>P;
const ll mod=1e9+7;
const ll INF = 1e9;

int h[100010];

int main(){

  int n;cin>>n;
  rep(i,0,n)cin>>h[i];

  int count=0;int ma=0;
  rep(i,1,n){
    if(h[i-1]>=h[i])count++;
    else {ma=max(ma,count);count=0;}
  }
  ma=max(ma,count);
  out(ma);



  return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <sstream>
#include <iterator>
#include <algorithm>
#include <vector>
 
using namespace std;
 
int main(){
  int N,A,B,C;
  cin>>N;
  if(1<=N&&N<=9){
    cout<<N<<endl;
  }else if(10<=N&&N<=99){
    cout<<9<<endl;
  }else if(100<=N&&N<=999){
    cout<<9+N-100+1<<endl;
  }else if(1000<=N&&N<=9999){
    cout<<9+999-100+1<<endl;
  }else if(10000<=N&&N<=99999){
    cout<<9+999-100+1+N-10000+1<<endl;
  }else if(N==100000){
    cout<<9+999-100+1+99999-10000+1<<endl;
  }
  return 0;
}

Measured memory_bytes: 256
use std::fs;
use std::io::{stdin, Read};

macro_rules! parse {
    ($it: ident) => {
        $it.next().unwrap().parse().unwrap()
    };
    ($it: ident,2) => {
        (parse!($it), parse!($it))
    };
    ($it: ident,3) => {
        (parse!($it), parse!($it), parse!($it))
    };
    ($it: ident,4) => {
        (parse!($it), parse!($it), parse!($it), parse!($it))
    };
    ($it: ident, $n: expr) => {
        (&mut $it).take($n).map(|e| e.parse().unwrap()).collect();
    };
}

fn solve(s: &str) {
    let mut it = s.split_whitespace();
    let (n, k): (isize, isize) = parse!(it, 2);
    let v: Vec<isize> = parse!(it, n as usize);
    let mut ret = 0;
    for l in 0..(n + 1) {
        for r in l..(n + 1) {
            let rest = k - (n - r + l);
            if rest < 0 {
                continue;
            }
            let all = [&v[..(l as usize)], &v[(r as usize)..]].concat();
            let mut neg: Vec<isize> = all.iter().filter(|&&x| x < 0).map(|&x| x).collect();
            neg.sort();
            let nback = std::cmp::min(rest as usize, neg.len());
            let sback: isize = neg[..nback].iter().sum();
            let y = all.iter().sum::<isize>() - sback;
            ret = std::cmp::max(ret, y);
        }
    }
    println!("{}", ret);
}

fn test() {
    let mut f = fs::File::open("foo.txt").unwrap();
    let mut s = String::new();
    f.read_to_string(&mut s).unwrap();
    solve(&s);
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    solve(&s);
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_main() {
        test();
    }
    #[test]
    fn test_input() {
        let s = "
        ";
        solve(s);
    }
}


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


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


    int n = S.size();
    int ans = INT_MAX;
    for( int i = 0; i < n-1; ++i ){
        if( S[i] != S[i+1] ){
            int tmp = max( i+1, n-i-1 );
            ans = min( ans, tmp );
        }
    }
    if( ans == INT_MAX ) cout <<  n  << endl;  // 文字列が全て同じとき
    else                 cout << ans << endl;

    return 0;
}

Measured memory_bytes: 512
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(long long i=0;i<n;++i)
#define REPR(i,n) for(long long i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(long long i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define SUR 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(v) {for(long long sitr=0;sitr<v.size();++sitr){cin>>v[sitr];}}

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

using namespace std;

typedef pair<int,int> pii;

int main(){

  int w, h, n;
  scanf("%d %d %d", &w, &h, &n);

  int x, y, a;
  int x1 = 0, x2 = w, y1 = 0, y2 = h;
  REP(i,n){
    scanf("%d %d %d", &x, &y, &a);
    if(a == 1){
      x1 = max(x1, x);
    }else if(a == 2){
      x2 = min(x2, x);
    }else if(a == 3){
      y1 = max(y1, y);
    }else{
      y2 = min(y2, y);
    }
  }
  if(x2-x1 < 0 || y2-y1 < 0){
    printf("0\n");
  }else{
    printf("%d\n", (x2-x1) * (y2-y1));
  }
  return 0;
}



Measured memory_bytes: 256
N,A,B = input().split()
n_sum = 0
A_int = int(A)
B_int = int(B)
ans = 0
for n in range(int(N)+1):
    for n_char in str(n):
        n_sum += int(n_char)

    if (A_int <= n_sum) and (B_int >= n_sum):
        ans += n
    n_sum = 0
    
print(ans)

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

int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	int n = max(a, b);
	int m = max(n, c);
	int r = (m - a) % 2 + (m - b) % 2 + (m - c) % 2;
	int s = (m - a) / 2 + (m - b) / 2 + (m - c) / 2;
	if (r == 0) {
		cout << s << endl;
	}
	else if (r == 1) {
		cout << s + 2 << endl;
	}
	else {
		cout << s + 1 << endl;
	}
}

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

int main() {
  int a,b;
  cin >> a >> b;
  if ((a%2 == 0) || (b%2 == 0)){
    cout << "Even" << endl;
  }
  else{
    cout << "Odd" << endl;
  }
  
}


Measured memory_bytes: 256
N = int(input())
if N % 2 == 1:
    print(0)
    exit()

ans = 0
ans += N//10

i = 50
while i <= N:
    ans += N//i
    # if i*2 <= N:
    #     ans -= N//(i*2)
    i *= 5


print(ans)


Measured memory_bytes: 38256
N,A,B = map(int,input().split())
dis_Start = A-1
dis_End = N-B
# print(dis_Start,dis_End)
if A%2 == B%2:
    # print("A")
    print((B-A)//2)
elif dis_Start <= dis_End:
    # print("B")
    print(A+((B-A)//2))
else:
    # print("C")
    print((N-B+1)+((B-A)//2))


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

#define reps(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   reps(i,0,n)
#define all(x) (x).begin(),(x).end()
#define INF (1000000000)
#define MOD (1000000007)
#define PI (acos(-1))

struct edge { int to; ll cost; };

ll N,D[100010];
vector<edge> tree[100010];

void bfs(int src){
  queue<int> Q;
  Q.push(src);

  rep(i,100010){//初期化
    D[i] = 1e18;
  }

  D[src] = 0;//スタート地点は距離0
  
  while(!Q.empty()){
    int cur = Q.front();
    Q.pop();
    rep(i,tree[cur].size()){
      edge e = tree[cur].at(i);
      if(D[e.to] > D[cur]+e.cost){
        D[e.to] = D[cur]+e.cost;
        Q.push(e.to);
      }
    }
  }
}

int main() {
  cin >> N;
  for (int i=0; i<N-1; ++i) {
      int a, b, c;
      cin >> a >> b >> c;
      tree[a].push_back(edge{b,c});
      tree[b].push_back(edge{a,c});
  }
  int Q,K;
  cin >> Q >> K;
  bfs(K);
  for (int i=0; i<Q; ++i){
    int x,y;
    cin >> x >> y;
    cout << D[x]+D[y] << endl;
  }
}

Measured memory_bytes: 9984
import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");

//const [n, m] = input[0].split(" ").map((x: string): number => +x);
//const a = input[1].split(" ").map((x: string): number => +x);

const [s, t] = input[0].split(' ');
console.log(t+s);


Measured memory_bytes: 9420
#include <stdio.h>
#include <stdlib.h>
#define H 2000001
#define K -2000000001

int left(int i){ return i*2; }

int right(int i){ return i*2 + 1; }

int parent(int i){ return i/2; }

void swap(int *x, int *y){
  int tmp;
  tmp = *x;
  *x = *y;
  *y = tmp;
}

int n;

void maxHeapify(int *arr, int i){
  int largest;
  int l = left(i), r = right(i);

  // choice largest key in this and parents
  if(l <= n && arr[l] > arr[i]) largest = l;
  else largest = i;
  if(r <= n && arr[r] > arr[largest]) largest = r;

  if(largest != i){ // if arr[i]'s parent key larger than arr[i]'s key
    swap(&arr[i], &arr[largest]);
    maxHeapify(arr, largest);
  }
}

int extractMax(int *heap){
  if(n<1) printf("heap under flow\n");

  int max = heap[1];
  heap[1] = heap[n];
  n--;
  maxHeapify(heap,1);
  return max;
}

void increseKey(int *arr, int i, int key){
  if(key<arr[i]) printf("New key less than actual key\n");
  arr[i] = key;
  while(i>1 && arr[parent(i)]<arr[i]){
    swap(&arr[i],&arr[parent(i)]);
    i = parent(i);
  }
}

void heapInsert(int *heap, int key){
  n++;
  heap[n] = K;
  increseKey(heap,n,key);
}

int main(void){
  int k;
  int heap[H];
  char inst[10];

  while(1){
    scanf("%s", inst);
    if(inst[0] == 'e'){
      if(inst[1] == 'n') break;
      else printf("%d\n", extractMax(heap));
    }
    if(inst[0] == 'i'){
      scanf("%d", &k);
      heapInsert(heap, k);
    }
  }
  return 0;
}

Measured memory_bytes: 6412
#include <bits/stdc++.h>
#define maxn 200005
#define MOD 998244353
#define INF 10000000000

using namespace std;

#define ll long long
#define pii pair<ll, ll>
#define piii pair<ll, pii>
#define ft first
#define sd second

void fast(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
}

ll a,  b, c, d;
ll x, y, X1, Y1, X2, Y2;

bool check(ll X, ll Y){
    if(X>= X1 && X <= X2 && Y >= Y1 && Y <= Y2) return true;
    return false;
}

void solve(){

    ll n, m;
    cin >>  n >> m;

    ll dis[n];
    memset(dis, -1, sizeof(dis));
    ll f = 0;
    for(ll i = 0; i < m; i++){
        ll s, c;
        cin >> s >> c;
        s--;
        if(dis[s] != -1 && dis[s] != c) f = 1;
        else if(s == 0 && c == 0 && n!=1) f = 1;
        else dis[s] = c;
    }
    if(f) cout << "-1";
    else{
        for(ll i = 0; i  <n; i++){
            if(dis[i] == -1) {
                if(i == 0 && n > 1) dis[i] = 1;
                else dis[i] = 0;
            }
            cout << dis[i];
        }
    }

}

int main()
{
    fast();
    int t= 1; //cin >> t;
    while(t--){
        solve();
    }
}


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

int main()
{
    int cities, road;
    cin >> cities >> road;

    map <int, int> mapper;
    for (int i = 0; i<road*2; i++) {
        int city;
        cin >> city;
        mapper[city]++;
    }

    for (int i = 1; i<=cities; i++)
        cout << mapper[i] << endl;
    
    return 0;
}


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

typedef long long ll;
typedef long double ld;
#define size(a) int((a).size())
#define present(c, x) (c.find(x) != c.end()) 
#define printArray(arr) for (int i = 0; i<size(arr); i++) cout << arr[i] << " ";cout << '\n'
#define printVerdict(verdict) cout << (verdict ? "YES": "NO") << '\n'
#define printDecimal(d) printf("%.9f\n", d)
#define inrange(val, start, end) (val >= start && val <= end)

const ll inf = 0x3f3f3f3f;

template <class T1, class T2, class T3> 
void printTuple(tuple<T1, T2, T3> t) {cout << get<0>(t) << " " << get<1>(t) << " " << get<2>(t) << '\n';}
template <class T1, class T2>
void printPair(pair<T1, T2> p) {cout << p.first << " " << p.second << '\n';}

int main() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(0);
	int x; cin >> x;
	vector<int> kyu{400, 600, 800, 1000, 1200, 1400, 1600, 1800};
	int ret = 9 - (upper_bound(kyu.begin(), kyu.end(), x) - kyu.begin());
	cout << ret << '\n';
}



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

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i,n) for (ll i = 0; i < n; ++i)
#define REPR(i,n) for (ll i = n-1; i >= 0; --i)
#define FOR(i,m,n) for (ll i = m; i < n; ++i)
#define FORR(i,m,n) for (ll i = n-1; i >= m; --i)
#define FORE(x,xs) for (const auto& x : xs)
#define ALL(v) v.begin(), v.end()
#define CHMIN(x,y) x = min(x, y)
#define CHMAX(x,y) x = max(x, y)

int A, B, C;

int main() {
    cin >> A >> B >> C;
    cout << C << " " << A << " " << B << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include<vector>
#include<algorithm>
#include<utility>
#include<queue>
#include<math.h>
#include<stack>
#include<set>
#include<map>
#define INF 2e9
#define rep(i,n,m) for(int i=n;i<m;i++)

using namespace std;

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

	rep(i, 0, 3)cout << s[i];
	cout << endl;
	return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define rep(i,n1) for(int i=0;i<n1;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define yesno(flg) if(flg){cout<<'YES'<<endl;}else{cout<<'NO'<<endl;}
#define vi vector<int>
#define pb push_back
#define i197 1000000007
#define MAX_N 200002
#define PI 3.141592653589793
using namespace std;

typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<Pii,int> Piii;
typedef pair<int,ll> Pil;
typedef pair<ll,ll> Pll;
typedef pair<string,int> Psi;
typedef pair<Psi,int> Psii;

const ll inf=1000000007;
struct edge{
	int myc,to,c,cost;
};
struct pos{
	int to,cost,color;
};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

vector<Pii> v[100001];
ll dp2[300000][60]={};
int main() {
	int h,n;
	cin>>h>>n;
	int r=0;
	rep(i,n){
		int a;
		cin>>a;
		r+=a;
	}
	if(r>=h){
		printf("Yes");
	}else{
		printf("No");
	}
	return 0;
}


Measured memory_bytes: 3968
//============================================================================
// Name        : b.cpp
// Author      :
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include<vector>
using namespace std;

int main() {
	int n;cin>>n;
	int ans=0;
	for(int i=1;i<=n;i++){
		int digit=0;
		int tempi=i;
		while(tempi){
			tempi/=10;
			digit++;
		}
		if(digit%2)ans++;
	}
	cout<<ans<<endl;
	return 0;
}


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

using Pii = pair<int, int>;
using Pll = pair<ll, ll>;
using edge = pair<ll, Pii>;

#define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back

ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

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;
}

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


class UnionFind{
    public:
        vector<int> uni;
        UnionFind(int s) : uni(s, -1) { }
 
       //頂点aが所属するグループを調べる
        int root(int a)
        {
            if (uni[a] < 0) return a;
            return uni[a] = root(uni[a]);
        }
    
        //頂点aと頂点bを繋ぐ。もともと同じグループの時falseを返す
        bool connect(int a,int b)
        {
            a = root(a);
            b = root(b);
            if (a == b) return false;
    
            if (uni[a] > uni[b])
            {
                a ^= b;
                b ^= a;
                a ^= b;
            }
    
            uni[a] = uni[a] + uni[b];
            uni[b] = a;
            return true;
        }
    
        //頂点a,bが同じグループであるかを調べる
        bool isConnect(int a,int b)
        {
            return root(a) == root(b);
        }
    
        //頂点aを含むグループの頂点数を調べる
        int size(int a)
        {
            return -uni[root(a)];
        }
    
    };


int main(){
    int n; cin >> n;
    UnionFind un(n+1);
    vector<vector<int> > lis(n, vector<int>(3));
    vector<edge> edges;
    REP(i, 0, n){
        cin >> lis[i][0] >> lis[i][1];
        lis[i][2] = i;
    }
    sort(ALL(lis), [](auto &x, auto &y){return x[0] < y[0];});
    REP(i, 0, n-1){
        edges.pb(edge(lis[i+1][0] - lis[i][0], Pii(lis[i+1][2], lis[i][2])));
    }
    sort(ALL(lis), [](auto &x, auto &y){return x[1] < y[1];});
    REP(i, 0, n-1){
        edges.pb(edge(lis[i+1][1] - lis[i][1], Pii(lis[i+1][2], lis[i][2])));
    }
    sort(ALL(edges));
    ll sum = 0;
    for(int i = 0; i < edges.size(); i++){
        int u = edges[i].second.first;
        int v = edges[i].second.second;
        if(un.connect(u, v)){
            sum += edges[i].first;
        }
    }
    cout << sum << endl;
}

Measured memory_bytes: 13228
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll n, a;
  a = 0;
  in(n);
  vector<ll> c(n), d(100009);
  rep(i, n)
    in(c[i]);
  rep(i, n){
    if(c[i] > 100008)
      a++;
    else
      d[c[i]]++;
  }
  rep(i, 100009){
    if(d[i] < i)
      a += d[i];
    else
      a += d[i] - i;
  }
  out(a);
  memi;
}

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

typedef long long ll;
typedef pair<int, int> P;

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

// Self settings
// clang-format off
#define MAX_N 500
#define REP(i, N) for (int i = 0; i < (int)(N); ++i)
#define SLN(i,N) (i == N-1 ? "\n" : " ")
// clang-format on

int N, K;
int A[MAX_N];

void solve()
{
  ll sum = 0;
  REP(i, N) sum += A[i];
  ll n = sum;
  set<ll> ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.insert(i);
      ret.insert(n / i);
    }
  }
  ll ans = 1;
  for (ll x : ret) {
    ll need = 0;
    {
      vector<ll> r(N);
      REP(i, N) r[i] = A[i] % x;
      sort(r.begin(), r.end());
      ll b = 0;
      REP(i, N) b += x - r[i];
      ll a = 0;
      need = 1e18;
      REP(i, N)
      {
        a += r[i];
        b -= x - r[i];
        need = min(need, max(a, b));
      }
    }
    if (need <= K) ans = max(ans, x);
  }
  cout << ans << endl;

  int r[MAX_N];
  // for (auto)
}

int main(void)
{
  cin >> N >> K;
  REP(i, N) cin >> A[i];
  solve();
  return 0;
}


Measured memory_bytes: 256
#include<cstdio>
using namespace std;
const int N=2005;
const int M=N*N;
const int mo=1e9+7;
int n,k,m;
long long p[M],q[M],f[N][N];
long long ksm(long long x,int y)
{
	long long t=1;
	for (;y;y>>=1)
	{
		if (y&1) t=t*x%mo;
		x=x*x%mo;
	}
	return t;
}
long long c(int x,int y){return p[x]*q[y]%mo*q[x-y]%mo;}
int main()
{
	scanf("%d%d",&n,&k),m=n*k;
	if (k==1){printf("1");return 0;}
	p[0]=q[0]=1;
	for (int i=1;i<=m;i++) p[i]=p[i-1]*i%mo;
	q[m]=ksm(p[m],mo-2);
	for (int i=m-1;i;i--) q[i]=q[i+1]*(i+1)%mo;
	f[0][0]=1;
	for (int i=1;i<=n;i++)
		for (int j=i;j>=0;j--)
		{
			f[i][j]=f[i][j+1];
			if (j) f[i][j]=(f[i][j]+f[i-1][j-1]*c(i*k-j-1,k-2))%mo;
		}
	printf("%lld",f[n][0]*p[n]%mo);
	return 0;
}


Measured memory_bytes: 92928
#include <bits/stdc++.h>
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define RREP(i,a,b) for(int i=(a);i>=(b);i--)
#define pq priority_queue
#define P pair<int,int>
#define P2 pair<int,P>
#define P3 pair<int,P2>
typedef long long ll; typedef long double ld;
using namespace std;
const int INF=1e9, MOD=1e9+7, around[]={0,1,1,-1,-1,0,-1,1,0,0};
const ll LINF=1e18;
const ld PI=abs(acos(-1));
int n,m,a[110],x,y;

int main(){
	cin >> n;
	REP(i,0,n) cin >> a[i];
	cin >> m;
	REP(i,0,m){
		cin >> x >> y; x--;
		int pos=0;
		REP(j,0,n) pos+=(j==x?y:a[j]);
		cout << pos << endl;
	}
	
	return 0;
}


Measured memory_bytes: 256
fun main(args:Array<String>) {
  val input = readLine()!!

  val x = input.toInt()
  
  val fx = input.toList().map(Char::toString).map(String::toInt).sum()
  
  when {
    x % fx == 0 -> "Yes"
    else -> "No"
  }.let(::println)
}

Measured memory_bytes: 33820
import java.io.*;
import java.util.*;
import static java.lang.System.out;

public class Main{
    static MyReader in = new MyReader();

    public static void main(String[] args){
        int N, K; {int[] a = in.ii(); N = a[0]; K = a[1];}
        int[] H = in.ii();
        Arrays.sort(H);
        long ans = 0;
        for(int i = 0, M = N-K; i < M; i++){
            ans += H[i];
        }
        out.println(ans);
    }

    static class MyReader extends BufferedReader{
        MyReader(){
            super(new InputStreamReader(System.in));
        }

        String s(){
            try{return readLine();}catch(IOException e){return "";}
        }

        String[] ss(){
            return s().split(" ");
        }

        int i(){
            return Integer.parseInt(s());
        }

        int[] ii(){
            String[] ss = ss();
            int[] ii = new int[ss.length];
            for(int j = 0; j < ss.length; j++) ii[j] = Integer.parseInt(ss[j]);
            return ii;
        }

        ArrayList<Integer> li(){
            String[] ss = ss();
            ArrayList<Integer> li = new ArrayList<>();
            for(int j = 0; j < ss.length; j++) li.add(Integer.parseInt(ss[j]));
            return li;
        }

        long l(){
            return Long.parseLong(s());
        }

        long[] ll(){
            String[] ss = ss();
            long[] ll = new long[ss.length];
            for(int j = 0; j < ss.length; j++) ll[j] = Long.parseLong(ss[j]);
            return ll;
        }
    }
}


Measured memory_bytes: 52748
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <string>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <set>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define INF (ll)1e18
#define MOD (ll)1e9 + 7
#define pb push_back

typedef long long ll;
typedef long long int llt;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

int main(void){
    cin.tie(0);
   	ios::sync_with_stdio(false);
	int n, a, b;
	cin >> n >> a >> b;
	vector<int> p(n);
	int cntx = 0, cnty = 0, cntz = 0;
	rep(i,n){
		cin >> p[i];
		if(p[i]<=a)
			cntx++;
			if(a+1<=p[i]&&p[i]<=b)
				cnty++;
				if(b+1<=p[i])
					cntz++;
	}
	int ans = min(cntx, cnty);
	ans = min(ans, cntz);
	cout << ans << endl;
	return 0;
}

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


void solve(std::string S){
    cout << S.substr(0, 3) << endl;
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


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

#define vec                vector<int>
#define vecll              vector<ll>
#define vecst              vector<string>
#define vecb               vector<bool>
#define vec2(var, n, m)    vector<vector<int>> var(n, vector<int>(m, 0))
#define vecll2(var, n, m)  vector<vector<ll>> var(n, vector<ll>(m, 0))

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define arrst(var, n)    vecst var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define uniqueall(v)     v.erase(unique(v.begin(), v.end()), v.end());
#define f_sum(var)       accumulate(all(var), 0)
#define f_sumll(var)     accumulate(all(var), 0LL)
#define chmin(v1, v2)    v1 = min(v1, v2)
#define chmax(v1, v2)    v1 = max(v1, v2)
#define mp(v1, v2)       make_pair(v1, v2)
#define pb(var)          push_back(var)
#define prt(var)         cout << (var) << "\n"
#define prtd(n, var)     cout << fixed << setprecision(n) << var << "\n"
#define prtfill(n, var)  cout << setw(n) << setfill('0') << var;
#define prt2(v1, v2)     cout << v1 << " " << v2 << "\n"
#define prt3(v1, v2, v3) cout << v1 << " " << v2 << " " << v3 << "\n"
#define prtall(v)        rep(i,v.size()){cout<<v[i]<<(i!=v.size()-1?" ":"\n");}
void prtok(bool ok){prt(ok ? "yes" : "no");}
//----------------------------------------------------------------

int main(void) {
  int n, k;
  cin >> n >> k;
  arr(a,n);

  int ans=0;
  sortall(a);
  rep(i,k){
    ans+=a[n-i-1];
  }

  prt(ans);
}


Measured memory_bytes: 256