akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;
#define pb push_back;
#define sz(v) ((int)(v).size())
#define ll long long;
int main()
{
    int x,i,j,c,max=0;
    cin>>x;    
    for(i=1;i<=x;i++)
    {
        for(j=2;j<=10;j++)
        {
            c=pow(i,j);
            if(c>x)
            {
                break;
            }
            if(c>=max)
            {
                max=c;
            }
        }
    }
    cout <<max<<endl;
    //system("pause");
    return 0;
}
    

Measured memory_bytes: 256
#include<stdio.h>

int main(void){

	double a,b,c,d,e,f,x,y;

	while(scanf("%lf %lf %lf %lf %lf %lf",&a,&b,&c,&d,&e,&f)!=EOF){

		if(b!=0){
		    x=((e*c/b)-f)/((e*a/b)-d);
		}
		else{
            x=c/a;
		}

		if(a!=0){
		y=((d*c/a)-f)/((d*b/a)-e);
		}
		else{
			y=c/b;
		}

		x=x*1000,y=y*1000;
		if(x>0){
			x=(double)(int)(x+0.5);
		}
		else{
			x=(double)(int)(x-0.5);
		}
		if(y>0){
			y=(double)(int)(y+0.5);
		}
		else{
			y=(double)(int)(y-0.5);
		}
		x=x/1000;y=y/1000;
		printf("%.3f %.3f\n",x,y);
	}

	return 0;
}

Measured memory_bytes: 652
#include<cstdio>
#include<algorithm>
#define MN 410000
using namespace std;

struct na{int x,o,p;}p[MN];
bool operator < (na a,na b){return a.x<b.x;}
int r,c,n,num=0,x,y,st[MN],top=0;
int main(){
	scanf("%d%d%d",&r,&c,&n);
	for (int i=1;i<=n;i++){
		int o=num;
		scanf("%d%d",&x,&y);
		if (x==0) p[++num].p=i,p[num].o=0,p[num].x=c-y;else
		if (y==0) p[++num].p=i,p[num].o=0,p[num].x=c+x;else
		if (x==r) p[++num].p=i,p[num].o=0,p[num].x=r+c+y;else
		if (y==c) p[++num].p=i,p[num].o=0,p[num].x=r+c+c+r-x;
		
		scanf("%d%d",&x,&y);
		if (x==0) p[++num].p=i,p[num].o=1,p[num].x=c-y;else
		if (y==0) p[++num].p=i,p[num].o=1,p[num].x=c+x;else
		if (x==r) p[++num].p=i,p[num].o=1,p[num].x=r+c+y;else
		if (y==c) p[++num].p=i,p[num].o=1,p[num].x=r+c+c+r-x;
		if (num-o<2)num=o;else
		if (p[num].x<p[num-1].x) swap(p[num].x,p[num-1].x);
		//printf("%d %d %d\n",num,p[num-1].x,p[num].x);
	}
	sort(p+1,p+1+num);
	for (int i=1;i<=num;i++){
		if (p[i].o==0) st[++top]=p[i].p;else
		if (st[top]==p[i].p) top--;else return puts("NO"),0;
	}
	puts("YES");
}

Measured memory_bytes: 2816
#include <bits/stdc++.h>
using namespace std;
int main() {
	int a;
	string s="0";
	cin >> a;
	int i = 0;
	while (a != 0) {
		if (a % 2 != 0 ) {
			if (i == 0)	s = '1';
			else s='1'+s;
			if (i % 2 == 1)a += 1;
			else a -= 1;
		}
		else if (i != 0)s = '0' + s;
		a=(a-a%2)/2;
		i++;
	}
	cout << s << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std; 
typedef long long ll;
typedef long double ld;
#define pb push_back
#define fi first
#define se second
const ll mod = 1e9+7;
const int N = 1e6+5;
void solve(){
	int n,m; 
	cin>>n>>m;
	priority_queue<ll>pq; 
	for(int i=1;i<=n;i++){
		ll x; 
		cin>>x; 
		pq.push(x);
	}
	for(int i=1;i<=m;i++){
		ll x = pq.top();
		pq.pop();
		x/=2ll;
		pq.push(x);
	}
	ll ans = 0;
	while(!pq.empty()){
		ll x = pq.top();
		pq.pop();
		ans+=x;
	}
	cout<<ans<<endl;
}
int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int t=1; 
//	cin>>t; 
	while(t--){
		solve();
	}
	return 0;
}


Measured memory_bytes: 4224
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int T, card[9];

bool is_same_number(int a,int b,int c){
  if(a==b && b==c) return true;
  else return false;
}

bool is_sequence(int a,int b,int c){
  if((a+2)==(b+1) && (b+1)==c) return true;
  else return false;
}

bool is_good_set(int a,int b,int c){
  return is_same_number(a,b,c) || is_sequence(a,b,c);
}

bool is_all_good_set() {
  return is_good_set(card[0],card[1],card[2]) && is_good_set(card[3],card[4],card[5]) && is_good_set(card[6],card[7],card[8]);
}

int win(){
  do{
    if(is_all_good_set()==1)return 1;
  }while(next_permutation(card,card+9));
  return 0;
}

int main() {
  cin >> T;
  for (int t=0; t<T; ++t) {
    for (int i=0; i<9; ++i) {
      cin >> card[i];
    }
    //for (auto e:card) cout << e;
    string color;
    for (int i=0; i<9; ++i) {
      cin >> color;
      if(color=="G"){
        card[i]+=10;
      }
      else if(color=="B"){
        card[i]+=20;
      }
    }
    //for (auto e:card) cout << e;
    //ここまででカード列生成
    sort(card,card+9);
    cout << win() << endl;
  }
}



Measured memory_bytes: 3012
#include<iostream>
#include<string>
#include<vector>
#include<numeric>
#include<algorithm>
#include<cmath>
#include<map>

using namespace std;

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(){

    int H, N;
    cin >> H >> N;

    vector<int> A(N);
    int i;
    for(i=0; i<N; i++) cin >> A.at(i);\

    int sum = accumulate(A.begin(), A.end(), 0);

    if(H <= sum) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}



Measured memory_bytes: 888
#include <iostream>
#define REP(i,n) for (int i = 0; i < (n); i++)
using namespace std;

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

    string str;
    cin >> str;

    int count = 0;
    REP(i, 3)
        if (str[i] == 'o') count++;

    cout << 700 + 100 * count << '\n';
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int p=1e9+7;
const int N=1e3+5;
int a[N],n;
ll ans;
int main()
{
	scanf("%d",&n);
	for(int i=2;i<=n;i++){
		int k=i;
		for(int j=2;j*j<=k;j++)
			while(k%j==0)a[j]++,k/=j;
		if(k!=1)a[k]++;
	}
	ans=1;
	for(int i=1;i<=n;i++)
		ans=ans*(a[i]+1)%p;
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
using ll = long long;
const int MX = 3005;
int a, p, ans[MX];
int exp(int b, int n){
	int res = 1;
	for(; n; n/=2,(b*=b)%=p) if(n%2) (res *= b) %= p;
	return res;
}
int fact[MX] = {1}, invf[MX];
void setcomb(int n){
	for(int i = 1; i <= n; i++) fact[i] = (fact[i-1] * i) % p;
	invf[n] =  exp(fact[n] ,p-2);
	for(int i = n; i > 0; i--) invf[i-1] = (invf[i] * i) % p;
}
inline int comb(int a, int b){return fact[a] * invf[a-b] % p * invf[b] % p;}
void solve(int t){
	rep(i,p) (ans[i] += p - comb(p-1,i) * exp(-t,p-1-i) % p) %= p;
	(ans[0] += 1) %= p;
}
int main(){
	scanf("%d", &p);
	setcomb(p-1);
	rep(i,p){
		scanf("%d", &a);
		if(a) solve(i);
	}
	rep(i,p) printf("%d%c", ans[i], i == p-1 ? '\n' : ' ');
}

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

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

using Pi = pair<int, int>;
using Tapris = tuple<int, int, int>;
using vint = vector<int>;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  int a, b;
  cin >> a >> b;
  bitset<32> ba(a), bb(b);
  cout << (ba&bb) << endl;
  cout << (ba|bb) << endl;
  cout << (ba^bb) << endl;

  return 0;
}



Measured memory_bytes: 3196
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    istream& in(cin);
    ostream& out(cout);
    int n,m,s{};
    in>>n>>m;
    vector<int> a(n);
    for(auto&i:a) in>>i,s+=i;
    sort(a.rbegin(),a.rend());
    puts(a[m-1]*4*m<s?"No":"Yes");
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  int now = k;
  int ret = 0;
  if (a <= k){
    ret += a;
    k -= a;
  } else {
    ret += k;
    k = 0;
  }
  if (b <= k)
  {
    k -= b;
  }
  else
  {
    ret += k;
    k = 0;
  }
  if (k > 0){
    ret -= k;
  }
  cout << ret << endl;
}

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

const string YES = "Yes";
const string NO = "No";

void solve(long long N, long long K, std::vector<long long> A){
    for(int i = K; i < N; ++i){
        //cout << A[i] << ":" << A[i-K] << endl;
        if(A[i] > A[i-K]) cout << YES << endl;
        else cout << NO << endl;
    }
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, K, std::move(A));
    return 0;
}


Measured memory_bytes: 4848
fun main(args: Array<String>) {
    val (x, y) = readLine()!!.split(" ").map { it.toInt() }
    if (y == 1) {
        println(0)
    } else {
        var a = 1
        var tmpx = x
        while (tmpx < y) {
            a += 1
            tmpx += x - 1
        }
        println(a)
    }
}


Measured memory_bytes: 37880
#!/usr/bin/env python
# -*- coding: utf-8 -*-

import sys  # {{{
import os
import time
import re
from pydoc import help
import string
import math
from operator import itemgetter
from collections import Counter
from collections import deque
from collections import defaultdict as dd
import fractions
from heapq import heappop, heappush, heapify
import array
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy as dcopy
import itertools
# }}}

# pre-defined{{{
sys.setrecursionlimit(10**7)
INF = 10**20
GOSA = 1.0 / 10**10
MOD = 10**9+7
ALPHABETS = [chr(i) for i in range(ord('a'), ord('z')+1)]  # can also use string module
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def DP(N, M, first): return [[first] * M for n in range(N)]
def DP3(N, M, L, first): return [[[first] * L for n in range(M)] for _ in range(N)]
from inspect import currentframe
# }}}

def solve():
    s = input()
    if s == "ABC":
        print("ARC")
    else:
        print("ABC")

    return 0

if __name__ == "__main__":# {{{
    solve()

# vim: set foldmethod=marker: }}}


Measured memory_bytes: 79748
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

int i,j,k,h,w,min,ans,mat[700][700],max[700][700];
char c;

int main(){
	while(scanf("%d %d",&h,&w)*h*w){
		for(i=0;i<h;i++){
			k=0;
			scanf("\n");
			for(j=0;j<w;j++){
				scanf("%c",&c);
				if(c=='.')k++; else k=0;
				mat[i][j]=k;
			}
		}

		ans=0;
		for(j=0;j<w;j++){
			for(k=h-1;k>=0;k--){
				min=mat[k][j];
				for(i=1;i+k<h;i++){
					if(min>mat[i+k][j])min=mat[i+k][j];
					if(min==0)break;
					if(min*(i+1)>ans)ans=min*(i+1);
				}
			}
		}
		printf("%d\n",ans);
	}
	return 0;
}

Measured memory_bytes: 1972
#include<bits/stdc++.h>
    #define REP(i,n) for(int i=0;i<n;i++)
    #define LOOP(i,x,n) for(int i=x;i<n;i++)
    #define ALL(v) (v).begin(),(v).end()
    #define PB push_back
    #define MP make_pair
    #define FIR first
    #define UB upper_bound
    #define LB lower_bound
    #define int long long
    using namespace std;
    const int MOD=1000000007;
    const int INF=1000000009;
     
    signed main(){
      string s,t;
      cin>>s>>t;
      if(s.size()<t.size()){
        cout<<"UNRESTORABLE"<<endl;
        return 0;
      }
      vector<string> str;
      REP(i,s.size()-t.size()+1){
        string u=s.substr(i,t.size());
        bool k=true;
        REP(j,u.size()){
          if(u[j]=='?')continue;
          if(u[j]!=t[j]){
            k=false;
            break;
          }
        }
        if(k){
          string v=s;
          int p=0;
          for(int j=i;j<i+t.size();j++){
            v[j]=t[p];
            p++;
          }
          REP(j,v.size())if(v[j]=='?')v[j]='a';
          str.PB(v);
        }
      }
      sort(ALL(str));
      if(!str.empty())cout<<str[0]<<endl;
      else cout<<"UNRESTORABLE"<<endl;
      return 0;
    }

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

using namespace std;

struct fenwick{
  int n;
  vector<int> f;
  void init(int m)
  {
    n = m + 1;
    f = vector<int> (n, 0);
  }
  void update(int x, int val)
  {
    assert(x > 0 && x < n);
    for(; x < n; x += x & (-x))
    {
      f[x] += val;
    }
  }
  int rsq(int x)
  {
    assert(x >= 0 && x < n);
    int sum = 0;
    for(; x > 0; x -= x & (-x))
    {
      sum += f[x];
    }
    return sum;
  }
};

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m;
  cin >> n >> m;
  fenwick bit;
  bit.init(m + 1);
  vector<pair<int, pair<int, int>>> svn(n);
  for(int i = 0; i < n; i++)
  {
    cin >> svn[i].second.first >> svn[i].second.second;
    svn[i].first = abs(svn[i].second.second - svn[i].second.first + 1);
  }
  sort(svn.begin(), svn.end());
  for(int i = 1, j = 0, cur = n; i <= m; i++)
  {
    for(; j < n && svn[j].first < i; j++)
    {
      bit.update(svn[j].second.first, 1);
      bit.update(svn[j].second.second + 1, -1);
      cur--;
    }
    int ans = cur;
    for(int k = i; k <= m; k += i)
    {
      ans += bit.rsq(k);
    }
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 4864
import math
N = int(input())
GCD = [[math.gcd(i, j) for i in range(1, N+1)] for j in range(1, N+1)]
#print(GCD)
all_gcd = [GCD[GCD[i][j]-1][m] for i in range(N) for j in range(N) for m in range(N)]
print(sum(all_gcd))

Measured memory_bytes: 72032
#include <cmath>
#include <iostream>
#include <vector>
#include <iomanip>

using namespace std;

int main() {
  int N;
  cin >> N;
  vector<pair<int, int>> x(N);
  for (auto &p : x) {
    cin >> p.first >> p.second;
  }

  double t{};
  for (auto i = 0; i != N; ++i) {
    for (auto j = i + 1; j < N; ++j) {
      t += hypot(x[i].first - x[j].first, x[i].second - x[j].second);
    }
  }
  cout << fixed << setprecision(10) << t * 2 / N << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;

int main(){

    ll a, b, c, k;
    cin >> a >> b >> c >> k;

    ll ans = a - b;
    if (abs(ans) > INF) cout << "Unfair" << endl;
    else if (k%2 == 0) cout << ans << endl;
    else cout << -1*ans << endl;
    return 0;
}

Measured memory_bytes: 256
n=int(input())
if n==1:
    print(1)
    exit()
from itertools import accumulate
a=[0]*(4500)
for i in range(1,4500):
    a[i-1]=i

ac=list(accumulate(a))

for i in range(n+1):
    if ac[i]+a[i+1]>=n:
        maxi=a[i+1]
        break

a=[i for i in range(1,maxi)]

ans=[maxi]
n-=maxi

def solve(n):
    if n==1:
        ans.append(1)
        return 0
    a=[0]*4500
    for i in range(1,4500):
        a[i-1]=i
    
    ac=list(accumulate(a))
    
    for i in range(n+1):
        if ac[i]+a[i+1]>=n:
            maxi=a[i+1]
            break
    ans.append(maxi)
    n-=maxi
    return n

while n>0:
    n=solve(n)

for i in ans:
    print(i)

Measured memory_bytes: 57812
/*
    ____        __
   / __ \____  / /_  ____ _____ ___
  / /_/ / __ \/ __ \/ __ `/ __ `__ \
 / _, _/ /_/ / / / / /_/ / / / / / /
/_/ |_|\____/_/ /_/\__,_/_/ /_/ /_/
*/
#include<bits/stdc++.h>

typedef long long ll ;

#define X   first
#define Y   second
#define mp  make_pair
#define pii pair<int , int>
#define vec vector
#define vpii vector<pair<int , int>>
#define i_n   int i = 0 ; i< n ; i++
#define cn  int n ; cin>>n
#define file_io freopen("input.txt", "r", stdin);freopen("output.txt", "w", stdout);
#define migmig ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define cina int a[n] ; for(int i = 0 ; i < n ; i++) cin>>a[i]
#define pb push_back
#define SZ(x) ll(x.size())

using namespace std;
const int maxn = 1000*100+5 ;

int main()
{
	migmig ;
	int n ;
	cin>>n ;
	int h[n] ; 
	int ans = 0 ; 
	for(int i = 0 ; i < n ; i ++)
	{
		cin>>h[i] ;
		bool b = true;  
		for(int j = i- 1 ; j >= 0 ; j--)
		{
			if(h[i] < h[j]) b = false ; 
		}
		if(b) ans++ ; 
	}
	cout<<ans; 
}
//////
////////
///////////



Measured memory_bytes: 256
from itertools import combinations_with_replacement as cwr
while True:
    L = map(int,raw_input().split())
    if L == [0]:
        break
    c = L.count(1)
    s = sum(map(lambda a:min(10,a) if a!=1 else 0, L))
    if s + c > 21:
        print 0
    else:
        print min([sum(n)+s for n in cwr([1,11],c)],
                  key = lambda x:abs(21-x) if x <= 21 else x)

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

lint gcd(lint x, lint y) {
  if(x == 0) { return y; }
  else { return gcd(y%x,x); }
}

lint lcm(lint x, lint y) { return abs(x-y)/gcd(x,y); }


int main() {
  int w,h,x,y; cin >> w >> h >> x >> y;

  printf("%.10lf ",(double)w*(double)h/2);
  if(w%2==0 && h%2==0 && x==w/2 && y==h/2) { printf("1\n"); }
  else { printf("0\n"); }

  return 0;
}

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

// マクロ //
#define rep(i,N) for(int i = 0; i < N; i++)
#define all(x) x.begin(), x.end()
#define sort(x) sort(all(x))
#define cou(x) cout << x << endl
#define y() cout << "Yes" << endl
#define n() cout << "No" << endl
#define Y() cout << "YES" << endl
#define N() cout << "NO" << endl
#define x2(x) (x) * (x)

// 型エイリアス //
using lint = long long;
using vi = vector<int>;
using vli = vector<lint>;
using vc = vector<char>;
using vs = vector<string>;
using vb = vector<bool>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using msi = map<string, int>;

// 関数 //
int gcd(int a, int b) {
    int t;
    while (b != 0) {
        t = a % b;
        a = b;
        b = t;
    }
    return a;
}

int lcm(int a, int b) {
    return a * b / gcd(a, b);
}

double distance(pii a, pii b) {
    double dist;
    dist = sqrt(x2(a.first - b.first) + x2(a.second - b.second));
    return dist;
}

lint perm(int a) {
    lint perm = 1;
    for (int i = a; i >= 1; i--) {
        perm *= i;
    }
    return perm;
}

lint comb(int n, int m) {
    return perm(n) / (perm(n - m) * perm(m));
}

// End of Template //

void prim(vi& prime) {
    bool flag = false;
    for (int i = 2; i < 1e5 + 7; i++) {
        for (int j = 2; j < (sqrt(i) + 1); j++) {
            if (i % j == 0) {
                flag = true;
                break;
            }
        }
        if (flag == false) {
            prime.push_back(i);
        }
        flag = false;
    }
}

int main() {

    int N;
    cin >> N;

    vi prime;

    prime.push_back(2);
    prim(prime);
    int max = prime.size() - 1;
    int min = 0;
    int mid = (prime.size() + 1) / 2;

    while (1) {
        if (N > prime[mid]) {
            min = mid;
            mid = (max + mid) / 2;
        }
        else if (N < prime[mid]) {
            max = mid;
            mid = (min + max) / 2;
        }
        else {
            cou(prime[mid]);
            break;
        }

        if (prime[mid] < N && prime[mid + 1] > N) {
            cou(prime[mid + 1]);
            break;
        }
    }
}

Measured memory_bytes: 384
n, k = map(int, input().split())

########関数部分##############
def Base_10_to_n(X, n):
    if (int(X/n)):
        return Base_10_to_n(int(X/n), n)+str(X%n)
    return str(X%n)
############################


#####関数をつかってみる．#####
x2 = Base_10_to_n(n, k)
print(len(x2))#"100011"が表示される．


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


const int MAX = 1000001;

using namespace std;

int prime[MAX];

void make(void){

  fill(prime,prime+MAX,1);
  prime[0] = 0;
  prime[1] = 0;
  for(int i = 2; i < MAX; i++){
    if(prime[i]){
      for(int j = 2*i; j < MAX; j+=i){
	prime[j] = 0;
      }
    }
  }
}

int main(){
  make();
  int menu, money;

  while(cin >> menu >> money && menu && money){

    int data[money+1];
    fill(data,data+money+1,0);
    int price[menu];

    for(int i = 0; i < menu; i++){
      cin >> price[i];
      for(int j = price[i]; j <= money; j+=price[i]){
	data[j] = 1;
      }
    }

    for(int i = 0; i < menu; i++){
      for(int j = price[i]; j <= money; j++){
	if(data[j-price[i]]) data[j] = 1;
      }
    }
    for(int i = money; i >= 0; i--){
      if(i == 0) cout << "NA" << endl;
      if(data[i] && prime[i]){
	cout << i << endl;
	break;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 0
#define ALL(v) v.begin(), v.end()
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;


int main() {

	int n;
	cin >> n;
	vector<int> a(n);

	vector<int> b(n);
	vector<int> c(n-1);

	

	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	for (int i = 0; i < n; i++)
	{
		cin >> b[i];
	}
	for (int i = 0; i < n - 1; i++)
	{
		cin >> c[i];
	}

	
	int total = 0;
	for (int i = 0; i < n; i++)
	{
		int eat = a[i];

		
		total += b[eat - 1];

		
		if (i == 0)continue;
		if (a[i -1] + 1 == a[i]) {
			total += c[eat-2];
		}

	}
		cout << total << endl;

}




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

int main()
{
	int n;
	cin>>n;
	long long a[n+1],sum=0;
	for(int i=0;i<n;i++)cin>>a[i];
	for(int i=0;i<n-1;i++){
		if(a[i]>a[i+1]){
			sum+=a[i]-a[i+1];
			a[i+1]=a[i];
		}
	}
	cout<<sum<<"\n";
	return 0;
}


Measured memory_bytes: 5180
#include <stdio.h>
#define MAX_V 1000000
int prime[MAX_V+1] = {0};
int primeSum[MAX_V+2] = {0};
int main(){
    int i, k, n;

    for(i = 2; i <= MAX_V; i++){
        prime[i] = 1;
    }
    for(i = 2; i * i <= MAX_V; i++){
        if(prime[i]){
            for(k = 2*i;k <= MAX_V; k += i){
                prime[k] = 0;
            }
        }
    }

    for(i = 0; i < MAX_V + 2; i++){
        primeSum[i] = primeSum[i-1] + prime[i];
    }

    while(scanf("%d", &n) != EOF){
        printf("%d\n",primeSum[n]);
    }
    return 0;
}

Measured memory_bytes: 9548
#include<stdio.h>

int isPrime(int x)
{
	if(x == 2) return 1;
	
	if(x < 2 || x % 2 == 0)
	{
		return 0;
	}
	
	int i = 3;
	while(i*i <= x)
	{
		if(x % i == 0)
		{
			return 0;
		}
		i = i + 2;
	}
	
	return 1;
}
	
	
int main(void)
{
	int x, n, i;
	int count = 0;
	
	scanf("%d", &n);
	
	for(i = 0; i < n; i++)
	{
		scanf("%d", &x);
		if(isPrime(x)) count++;
	}
	printf("%d\n", count);
	
	return 0;
}


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

int n,m,q;
vector<int> a,b,c,d;
int ans;


void dfs(vector<int>A){
  //終了ステップは、配列Aの長さがn+1になったとき。(配列が完成)
  if((int)A.size() == n+1){
    // calc score
    int now = 0;
    rep(i,q){ //クエリ分処理
      if(A[b[i]] - A[a[i]] == c[i])now += d[i];
    }
    ans = max(ans,now);//最大値更新
    return; //返す。
    //イメージとしてはn=3,m=3で、[1,1,1]→dfs→[1,1,2]→dfs→[1,1,3](ここでwhile文を抜けて[1,1]にreturn,末尾がインクリされて[1,2]→[1,2,2]→dfs→[1,2,3]([1,2]にreturnして[1,3])])
  }
  A.push_back(A.back());
  while(A.back() <= m){ //末尾の要素がmになったらループを抜ける。
    dfs(A);
    A.back()++;
  }
}

int main(){
  cin >> n >> m >> q;
  a = b = c = d = vector<int>(q);
  rep(i,q){
    cin >> a[i] >> b[i] >> c[i] >> d[i];
  }
  dfs(vector<int>(1,1));
  cout << ans << endl;
}

Measured memory_bytes: 3636
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        long x = Long.parseLong(sc.next());
        long y = Long.parseLong(sc.next());

        // 主処理
        int result = 0;
        long target = x;
        while (target <= y) {
            target *= 2;
            result++;
        }

        // 出力
        System.out.println(result);
        sc.close();
    }
}


Measured memory_bytes: 21844
#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
using ll=long long;
#define rep(i,a,b) for(ll i=a;i<b;i++)
inline constexpr int intpow(ll a,ll b){
    if(b==0) return 1;
    ll ans=intpow(a,b/2);
    return ans*ans*(b&1?a:1);
}
int main(){
    int n;
    cin>>n;
    vector<ll> d(n);
    rep(i,0,n) cin>>d[i];
    sort(d.begin(),d.end());
    int cnt=1;
    rep(i,0,n-1){
        if(d[i]!=d[i+1]) cnt++;
    }
    cout<<cnt;
}

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

int main(){
    int N, A, B;
    cin >> N >> A >> B;

    int ans = 0;
    for(int n=1; n<=N; n++){
        string str = to_string(n);
        int sum =0;
        for(int j=0; j<str.size(); j++){
            sum += str[j] - '0';
        }

        if(sum >= A && sum <= B){
            ans += n;
        }
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;

long long int n,m;
long long int arr[100011];
string str,str1,str2;
long long int count1[51][51],countc1[51][51],countc0[51][51],count0[51][51];
long long int s_arr[100011];

long long int q,h,s,d;
long long int cost[4];
int main()
{
	cin>>q>>h>>s>>d;
	cost[0] = q;
	cost[1] = h;
	cost[2] = s;
	cost[3] = d;
	cin>>n;
	if( 2*q <= h)
		cost[1] = 2*q;
	if( 4*q <= s)
		cost[2] = 4*q;
	if( 8*q <= d)
		cost[3] = 8*q;
	if( 2*cost[1] <= cost[2])
		cost[2] = 2*cost[1];
	if( 4*cost[1] <= cost[3])
		cost[3] = 4*cost[1];
	if( 2*cost[2] <= cost[3] )
		cost[3] = 2*cost[2];
	//cout<<cost[0]<<" "<<cost[1]<<" "<<cost[2]<<" "<<cost[3]<<"\n";
	long long int ans = (n/2)*cost[3];
	n = n%2;
	ans += ((long long int) n)*cost[2];
	n = n%1;
	cout<<ans<<"\n";
	return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i=0;i<((int)(n));i++)
#define reg(i,a,b) for(int i=((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i=((int)(n))-1;i>=0;i--)
#define ireg(i,a,b) for(int i=((int)(b));i>=((int)(a));i--)
typedef long long int lli;
typedef pair<int,int> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#define pque(type) priority_queue<type,vector<type>,greater<type> >
#define memst(a,b) memset(a,b,sizeof(a))

struct edge{
	int to,co,p;
};

vector<edge> vs[105];

int ds[105];
void bfs(int st){
	queue<mp> que;
	que.push(mp(0,st));
	memset(ds,-1,sizeof(ds));
	while(!que.empty()){
		mp pa=que.front();
		que.pop();
		int no=pa.sec,
			nd=pa.fir;
		if(ds[no]>=0)continue;
		ds[no]=nd;
		rep(i,vs[no].size()){
			int to=vs[no][i].to,
				ec=vs[no][i].co;
			if(ec<=0 || ds[to]>=0)continue;
			que.push(mp(nd+1,to));
		}
	}
}

int seen[105];
int dfs(int no,int gl,int f){
	if(no==gl)return f;
	for(int& i=seen[no]; i<vs[no].size(); i++){
		edge& e=vs[no][i];
		if(e.co<=0 || ds[e.to]<=ds[no])continue;
		int tf=dfs(e.to,gl,min(f,e.co));
		if(tf<=0)continue;
		e.co-=tf;
		vs[e.to][e.p].co+=tf;
		return tf;
	}
	return 0;
}

/*
??????????????????????????¨???

print "32 61"
for i in xrange(30):
	print ("%d %d %d" % (i,i+1,3))
	print ("%d %d %d" % (i,i+1,3))
print "0 31 1"

??§????????????
???????????????????????????gone?????\?????????????????????????????§????????????

?????£???????????¬???????£??????¨???????????????????????????iterate?????????????????????

(?????????AOJ??§?????????????????£???????????????????????????...)
*/

int dinic(int st,int gl){
	int res=0;
	for(;;){
		bfs(st);
		if(ds[gl]<0)break;
		memset(seen,0,sizeof(seen));
		for(;;){
			int f=dfs(st,gl,IINF);
			if(f<=0)break;
			res+=f;
		}
	}
	return res;
}
	
int n,m;
int main(void){
	scanf("%d%d",&n,&m);
	rep(i,m){
		int a,b,c;
		scanf("%d%d%d",&a,&b,&c);
		edge e;
		e.to=b; e.co=c; e.p=vs[b].size();
		vs[a].push_back(e);
		e.to=a; e.co=0; e.p=vs[a].size()-1;
		vs[b].push_back(e);
	}
	printf("%d\n",dinic(0,n-1));
	return 0;
}

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

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
#define all(v) (v).begin(), (v).end()
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1e18;

ll N, X;
ll a[51], p[51];

ll F(ll N, ll X) {
    if(N == 0) {
        if(X <= 0) return 0;
        return 1;
    }
    if(X <= 1 + a[N - 1]) {
        return F(N - 1, X - 1);
    }
    return p[N - 1] + 1 + F(N - 1, X - 2 - a[N - 1]);
}

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

    cin >> N >> X;
    a[0] = 1;
    p[0] = 1;
    rep(i, 1, N + 1) {
        a[i] = a[i - 1] * 2 + 3;
        p[i] = p[i - 1] * 2 + 1;
    }

    cout << F(N, X) << endl;

}


Measured memory_bytes: 256
// 2014/01/28 Tazoe

#include <iostream>
using namespace std;

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

	int A[1000];
	for(int i=0; i<N; i++){
		cin >> A[i];
	}

	int B[1000];
	for(int i=0; i<M; i++){
		cin >> B[i];
	}

	int C[1000] = {0};
	for(int i=0; i<M; i++){
		for(int j=0; j<N; j++){
			if(B[i]>=A[j]){
				C[j]++;
				break;
			}
		}
	}

	int i_max = 0;
	for(int i=1; i<N; i++){
		if(C[i]>C[i_max]){
			i_max = i;
		}
	}

	cout << i_max+1 << endl;

	return 0;
}

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

typedef long long int ll;
ll n, k, a[200007];

int main() {
   scanf("%lld %lld", &n, &k);
    for(ll i = 1; i <= n; ++i) scanf("%lld", &a[i]);

    for(ll i = k + 1; i <= n; ++i) {
        if(a[i] > a[i - k]) {
            printf("Yes\n");
        } else printf("No\n");
    }

    return 0;
}

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


int main() {
    int N, K;
  while (cin >> N >> K) {

    vector<int> v;
    v.resize(N);
    for (int i = 0; i < N; ++i) cin >> v[i];
    int res = 0;
    int right = 0;
    while (true) {
      if (res == 0) right += K;
      else right += K-1;
      ++res;

      if (right >= N) break;
    }
    cout << res << endl;
  }
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define mp make_pair
#define pb(x) push_back(x)
#define vll vector<long long>
#define pll pair<long long, long long>
#define mll map<long long, long long>
#define sz(v) ((int)(v).size())
#define all(v) (v).begin(), (v).end()
#define gcd __gcd
#define clr(x) memset(x, 0, sizeof(x))
#define mod 1000000007LL
#define mod2 998244353LL
#define INF 1e18
 

typedef long long ll;
typedef long double ld;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> o_tree;

const int N = 6e5 + 6;
ll lo[4 * N + 1], hi[4 * N + 1], delta[4 * N + 1], mini[4 * N + 1];

// change update and rmq according to question

void buildSeg(ll node, ll l, ll r)
{
  lo[node]=l;
  hi[node]=r;
  if (l == r)
  {
    return;
  }
  ll mid = l+(r-l)/2;
  buildSeg(2*node+1,l,mid);
  buildSeg(2*node+2,mid+1,r);
}

void prop(ll i)
{
  delta[2*i+1]+=delta[i];
  delta[2*i+2]+=delta[i];
  delta[i]=0;
}


void update(ll i)
{
  mini[i] = mini[2*i+1]+delta[2*i+1]+mini[2*i+2]+delta[2*i+2];
}

void increment(ll i,ll l,ll r,ll val)
{
   if(r<lo[i]||l>hi[i])
   {
      return;
   }
   if(l<=lo[i]&&r>=hi[i])
   {
     delta[i]+=val;
     return;
   }
   prop(i);

   increment(2*i+1,l,r,val);
   increment(2*i+2,l,r,val);
   update(i);
}

ll rmq(ll i,ll l,ll r)
{
   if(r<lo[i]||l>hi[i])
   {
     return 0;
   }
   if(l<=lo[i]&&r>=hi[i])
   {
     return (mini[i]+delta[i]);
   }
   prop(i);
   ll lefmin=rmq(2*i+1,l,r);
   ll rigmin=rmq(2*i+2,l,r);
   update(i);
   return lefmin+rigmin;
}

void solve()
{
    ll n,q;
    cin>>n>>q;
    ll i,j;
    ll a[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    array<ll,3> op[q];
    for(i=0;i<q;i++)
    {
        cin>>op[i][1]>>op[i][0];
        op[i][1]--;
        op[i][0]--;
        op[i][2]=i;
    }
    sort(op,op+q);
    buildSeg(1,1,n+5);
    ll last[n+1];
    ll ans[q];
    clr(ans);
    ll qq=0;
    for(i=0;i<=n;i++)
    {
        last[i]=-1;
    }
    for(i=0;i<n;i++)
    {
        if(last[a[i]]!=-1)
        {
            increment(1,last[a[i]]+1,last[a[i]]+1,-1);
        }
        last[a[i]]=i;
        increment(1,i+1,i+1,1);
        while(qq<q&&op[qq][0]==(i))
        {
            ans[op[qq][2]]=rmq(1,op[qq][1]+1,op[qq][0]+1);
            qq++;
        }
    }
    for(i=0;i<q;i++)
    {
        cout<<ans[i]<<"\n";
    }


}


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


if (fopen("input.txt","r" ))
  {
     freopen("input.txt", "r", stdin);
     freopen("output.txt", "w", stdout);
  }
cout<<setprecision(20);


ll t=1;


// cin>>t;


while(t--)
{
solve();
} 


return 0;
}

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

int main(void)
{
    string s = "";
    string t = "";
    cin >> s;
    cin >> t;

    if (t.substr(0, s.length()).compare(s) == 0)
    {
        cout << "Yes";
    }
    else
    {
        cout << "No";
    }

    return 0;
}

Measured memory_bytes: 3604
import java.util.*
import kotlin.collections.ArrayList

fun main() {
    val (n,k) = readLine()!!.split(" ").map { it.toInt() }
    val arr = readLine()!!.split(" ").map { it.toInt() }.sorted()

    val fdp = Array(n+1){BooleanArray(k)}
    val bdp = Array(n+1){BooleanArray(k)}


    for(i in 1..n) {
        fdp[i-1][0] = true
        val v = arr[i - 1]
        for(j in 1 until k) {
            if(j - v < 0) continue
            fdp[i][j] =  fdp[i-1][j] or fdp[i-1][j-v]
        }
    }

    for(i in 1..n) {
        bdp[i-1][0] = true
        val v = arr[n - i]
        for(j in 1 until k) {
            if(j - v < 0) continue
            bdp[i][j] =  bdp[i-1][j] or bdp[i-1][j-v]
        }
    }

    var ans = 0
    for(i in 0 until n) {
        if(arr[i] >= k)
            continue

        val f = fdp[i]
        val b = bdp[n - 1 - i]

        var has = false

        for(j in 0 until k) {
            if(!f[j]) continue
            if(j >= k - arr[i] && j <= k - 1) {
                has = true
                break
            }
        }

        if(has) {
            continue
        }

        for(j in 0 until k) {
            if(!b[j]) continue
            if(j >= k - arr[i] && j <= k - 1) {
                has = true
                break
            }
        }

        if(has) {
            continue
        }

        for(j in 0 .. k - arr[i]) {
            if(f[j] && b[k - arr[i] - j]) {
                has = true
                break 
            }
        }

        // f[j] 에서 k - arr[i] 보다 작은 애들.
        // b[j] 에서 k - arr[i] 보다 작은 애들.
//        val l1 = ArrayList<Int>()
//
//        for(j in 1 until k) {
//            if(!f[j]) continue
//            if( j >= k - arr[i])
//                break
//            l1.add(j)
//        }
//
//        val r1 = TreeSet<Int>()
//        for(j in 1 until k) {
//            if(!b[j]) continue
//            if( j >= k - arr[i])
//                break
//            r1.add(j)
//        }
//
//        val req = k - arr[i] - 1
//        for(d in l1) {
//            val v = r1.higher(req - d)?:continue
//            if(v + d >= k) {
//                break
//            }
//            has = true
//            break
//        }

        if(!has) {
            ++ans
        }
    }
    print(ans)


}

Measured memory_bytes: 103280
n=int(input())
a=sorted(list(map(int,input().split())),
         reverse=True)
ans=[]
p=-1
cnt=0
flag =False
for index,i in enumerate(a):
    if p!=i:
        if cnt>=4:
            ans.append(p)
            ans.append(p)
        if cnt>=2:
            ans.append(p)
        p=i
        cnt=1
    else:
        cnt+=1
    if len(ans)>=2:
                print(ans[0]*ans[1])
                flag=True
                break
if not flag:
    if cnt>=4:
            ans.append(p)
            ans.append(p)     
    elif cnt>=2:
            ans.append(p)
    if len(ans)>=2:
        print(ans[0]*ans[1])
        flag=True
       
if not flag:
    print(0)

Measured memory_bytes: 62704
//
//  main.cpp
//

#include <algorithm>
#include <array>
#include <assert.h>
#include <complex>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <math.h>
#include <memory>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = int64_t;
using ull = uint64_t;
constexpr ll LL_MAX = numeric_limits<ll>::max();
constexpr ull ULL_MAX = numeric_limits<ull>::max();

template<typename T>
vector<T> make_vec_nd(T init, ll size) {
	return vector<T>(size, init);
}
template<typename T, typename... Args>
auto make_vec_nd(T init, ll size, Args... rest) {
	auto inner = make_vec_nd(init, rest...);
	return vector<decltype(inner)>(size, inner);
}

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

ll gen_seq(ll len, ll sum, vector<vector<ll>>& seqs) {
    if (len == 0) {
        seqs.push_back({});
        return 1;
    }
    ll ret = 0;
    rep(val,0,sum+1) {
        ll cnt = gen_seq(len-1, sum-val, seqs);
        rep(i,seqs.size()-cnt,seqs.size()) {
            seqs[i].push_back(val);
        }
        ret += cnt;
    }
    return ret;
}

int main() {
    ll N, M, Q;
    cin >> N >> M >> Q;
    struct Require {
        ll a;
        ll b;
        ll c;
        ll d;
    };
    vector<Require> requires(Q);
    rep(q,0,Q) {
        Require& req = requires[q];
        cin >> req.a >> req.b >> req.c >> req.d;
        req.a--;
        req.b--;
    }
    vector<vector<ll>> bs;
    gen_seq(N-1, M-1, bs);
    ll ans = numeric_limits<ll>::min();
    for (vector<ll>& b : bs) {
        vector<ll> A;
        A.push_back(0);
        for (ll elem : b) {
            A.push_back(A.back() + elem);
        }
        ll ans_loc = 0;
        rep(q,0,Q) {
            const Require& req = requires[q];
            if (A[req.b] - A[req.a] == req.c) {
                ans_loc += req.d;
            }
        }
        ans = max(ans, ans_loc);
    }
    cout << ans << endl;
}


Measured memory_bytes: 10888
#include <stdio.h>
int main(void){
    // Your code here!
    int W,H,x,y,r;
    scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
    if (x+r <= W && y+r <= H && x-r >= 0 && y-r >= 0) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }
}



Measured memory_bytes: 2108
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <deque>
#define repeat(i,n) for (int i = 0; (i) < (n); ++(i))
#define repeat_from(i,m,n) for (int i = (m); (i) < (n); ++(i))
#define whole(f,x,...) ([&](decltype((x)) whole) { return (f)(begin(whole), end(whole), ## __VA_ARGS__); })(x)
typedef long long ll;
using namespace std;
int main() {
    int n; cin >> n;
    vector<int> a(n); repeat (i,n-1) cin >> a[i];
    int sum_a = accumulate(a.begin()+2, a.end(), 0);
    deque<int> dp(sum_a+1); whole(iota, dp, 0);
    repeat_from (i,2,n) {
        repeat (j,a[i]) dp.push_front(dp[2*j+1]);
    }
    int m; cin >> m;
    while (m --) {
        int x; cin >> x;
        cout << (x < dp.size() ? dp[x] : x - sum_a) + a[0] - a[1] << endl;
    }
    return 0;
}


Measured memory_bytes: 11136
N, K = list(map(int, input().split()))
haves = [False for _ in range(N)]

def judge_Flag(flags):
    As = list(map(int, input().split()))
    for A in As:
        flags[A - 1] = True

for _ in range(K):
    people_num = int(input())
    judge_Flag(haves)
print(haves.count(False))

Measured memory_bytes: 9184
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <string>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <list>
#include <tuple>
#include <bitset>
#include <ciso646>
#include <cassert>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;

inline bool check(ll x, ll y, ll xMax, ll yMax) { return x >= 0 && y >= 0 && xMax > x && yMax > y; }
inline int toint(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string tostring(T x) { ostringstream sout; sout << x; return sout.str(); }
template<class T> inline T sqr(T x) { return x*x; }
template<class T> inline T mypow(T x, ll n) { T res = 1; while (n > 0) { if (n & 1)res = res * x;	x = x * x;	n >>= 1; }return res; }
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

#define For(i,a,b)	for(ll (i) = (a);i < (b);(i)++)
#define rep(i,n)	For(i,0,n)
#define rFor(i,a,b)	for(ll (i) = (a-1);i >= (b);(i)--)
#define rrep(i,n)	rFor(i,n,0)
#define each(i,n)	for(auto &i : n)
#define clr(a)		memset((a), 0 ,sizeof(a))
#define mclr(a)		memset((a), -1 ,sizeof(a))
#define all(a)		(a).begin(),(a).end()
#define sz(a)		(sizeof(a))
#define tostr(a)	tostring(a)
#define dump(val) 	cerr << #val " = " << val << endl;
#define Fill(a,v)	fill((int*)a,(int*)(a+(sz(a)/sz(*(a)))),v)

const ll dx[8] = { 1, 0, -1, 0, 1, 1, -1, -1 }, dy[8] = { 0, -1, 0, 1, -1, 1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = 1e17 + 9;

#define int ll
#define double ld

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

	set<char> se;
	string s;
	cin >> s;
	each(c, s) {
		se.insert(c);
	}
	if (se.count('N') != se.count('S')) {
		cout << "No" << endl;
	}else
	if (se.count('W') != se.count('E')) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
	}

	return 0;
}

Measured memory_bytes: 764
// Sky's the limit :)
#include<bits/stdc++.h>
using namespace std;
#define int long long

signed main() 
{
    //int t; cin >> t; while(t--) 
    {
    	int r;
      	cin >> r;
      
      	cout << 2 * 3.14 * r << '\n';
    }
    
    return 0;
}

Measured memory_bytes: 3712
#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>;

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

char alpha[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

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

int main(){
    int x;  cin >> x;
    if(x >= 30){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define int long long
#define double long double
#define rep(i,s,n) for(int i = (s); i < (n); i++)
#define all(v) begin(v), end(v)
#define allg(v) begin(v), end(v), greater<int>()



signed main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  
  string s;
  ll n;
  
  cin >> n;
  
  map<string, int> m;  
  rep(i, 0, n) {
    cin >> s;
    m[s]++;
  }
  
  int maxi = -1;
  map<string, int>::iterator p;
  for(p = m.begin(); p != m.end(); p++)
    maxi = max(maxi, p->second);
    
  for(p = m.begin(); p != m.end(); p++) {
    if(p->second == maxi)
      cout << p->first << "\n";
  }

}


Measured memory_bytes: 23808
#include <bits/stdc++.h>
//----***やべーやつら***----
using namespace std;
#define int long long

//----***型定義***----
using ll = long long;
using P = pair<int,int>;

//----***Like a Pythonista***----
#define REP(ii,jj,nn) for (ll ii=jj;ii<(nn);ii++)
#define RREP(ii,nn,jj) for (ll ii = nn; jj<ii;ii--)
#define each(i,...) for (auto&& i:__VA_ARGS__)
#define ALL(vec) (vec).begin(),(vec).end()
#define sum(...) accumulate(ALL(__VA_ARGS__),0LL)
#define dsum(...) accumulate(ALL(__VA_ARGS__),0.0)
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
template<class T> inline auto max(const T& a){ return *max_element(ALL(a)); }
template<class T> inline auto min(const T& a){ return *min_element(ALL(a)); }
inline ll gcd(ll a,ll b){if(b == 0) return a;return  gcd(b,a%b);}
inline ll lcm(ll a,ll b){ll g = gcd(a,b);return a / g * b;}

//----***定数***----
#define MOD 1000000007
#define INF 100000000000000000
#define EPS 1e-9
#define PI  acos(-1)
const vector<vector<int>> DXY={{-1,0},{1,0},{0,-1},{0,1}};

//----***パーツ***----
#define fi first
#define se second
#define pb push_back
#define re return
#define br break

//----***入出力***---
void print() { std::cout << "\n"; }
template <class T>void print(const T &x) {std::cout << x<<"\n";}
template <class T, class... Args>void print(const T &x, const Args &... args) {std::cout << x << " ";print(args...);}
#define debug(var)  do{std::cerr << #var << " ↓ "<<"\n";view(var);}while(0);
#define dbg cerr<<"🥺🥺🥺🥺🥺🥺"<<endl;
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

//----***初期時読み込み***----
struct initial{initial(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15);};}initial_;

vector< int > divisor(int n) {
  vector< int > ret;
  for(int i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

signed main(){
  int N;cin>>N;
  vector<int> div=divisor(N);
  int ans=0;
  // debug(div);
  each(v,div){
    if(v==1)continue;
    if(N/(v-1)==N%(v-1)){
      ans+=v-1;
    }
  }
  print(ans);


}


Measured memory_bytes: 384
#include<stdio.h>

void swap();

int main()
{
	int a,b,c;
	int keep;
	scanf("%d %d %d",&a,&b,&c);
	if(a>b)	swap(&a,&b);
	if(a>c) swap(&a,&c);
	if(b>c) swap(&b,&c);

	printf("%d %d %d\n",a,b,c);
	
 	return 0;

}

void swap(int *x, int *y)
{
	int keep;

	keep = *x;
	*x = *y;
	*y = keep;
}


Measured memory_bytes: 2052
#include <bits/stdc++.h>
#define ft first
#define sc second
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) {if(a<b) a=b;}
#define chmin(a, b) {if(a>b) a=b;}
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
static const ll INF=1e18;
static const ll MAX=1e5+7;
static const ll MOD=1e9+7;
ll max(ll a, ll b) {return a>b?a:b;}
ll min(ll a, ll b) {return a<b?a:b;}




int main(void) {
  ll N, K;
  cin >> N >> K;
  string s;
  cin >> s;
  ll i;
  vector<ll> l, r;
  
  ll ans=0;
  for(i=0; i<N; i++) {
    ll t=1;
    while(i<N-1 && s[i]==s[i+1]) {
      t++;
      i++;
    }
    ans+=t-1;
  }
  
  pt(min(ans+K*2, N-1));
  
}


Measured memory_bytes: 512