akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>

#include <iostream>
using namespace std;

int max(int a, int b) {
    return a > b ? a : b;
}

int min(int a, int b) {
    return a < b ? a : b;
}

int main(int argc, const char * argv[]) {
//    int count = 0;
//    char current, new1;
//    cin >> current;
//    while ((new1 = getchar()) != '\n') {
//        if (new1 != current)
//            count++;
//        current = new1;
//    }
//    cout << count << endl;
//    
//    return 0;
    int N, T;
    cin >> N >> T;
    int currentPrice, nextPrice;
    cin >> currentPrice;
    int mods = 0;
    int maxProfit = 0;
    for (int n = 2; n <= N; n++) {
        cin >> nextPrice;
        int diff = nextPrice - currentPrice;
        if (diff > maxProfit) {
            maxProfit = diff;
            mods = 1;
        }
        else if (diff == maxProfit) {
            mods++;
        }
        else if (diff < 0) {
            currentPrice = nextPrice;
//            maxProfit = 0;
//            mods = 0;
        }
    }
    
    cout << mods << endl;
    return 0;
        
}

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

int main(void)
{
    string x;
    cin>>x;
    bool flag=false;
    for(char ch='a';ch<='z';ch++)
    {
        int pos=x.find(ch);
        if(pos==-1)
        {
            flag=true;
            cout <<ch<<endl;
            break;
        }
    }
    if(!flag)
    {
        cout <<"None"<<endl;
    }
    return 0;
}


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

int n;
int a[20];
int dp[20*2000*+1+2000];

int main() {

    cin >> n;

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

    int q;

    cin >> q;

    int m;

    for(int i=0;i<20*2000+1;i++){
        dp[i] = 0;
    }

    for(int i=0;i<n;i++){
        for(int j=20*2000;j!=-1;j--){
            if(dp[j]!=0){
                dp[j+a[i]] = 1;
            }
        }
        dp[a[i]] = 1;
    }

    for(int i=0;i<q;i++){
        cin >> m;
        if(dp[m]!=0){
            cout << "yes" << endl;
        }
        else{
            cout << "no" << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 3280
N = int(input())
XY = []
for i in range(N):
  tmp = [int(i) for i in input().split()]
  XY.append(tmp)

result = 0

for i in range(N):
  for j in range(i+1,N):
    dis = (XY[i][0] - XY[j][0])**2 + (XY[i][1] - XY[j][1])**2
    dis = dis**0.5

    result += dis

print((result * 2)/N)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MN = 1e5 + 5;
int N, a[105];

int gcd(int n, int m) {
    return m ? gcd(m, n % m) : n;
}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> N;
    for (int i = 0; i < N; i++) cin >> a[i];
    int lcm = a[0];
    for (int i = 1; i < N; i++) lcm = (lcm * a[i]) / gcd(lcm, a[i]);
    int d = 0;
    for (int i = 0; i < N; i++) d += lcm / a[i];
    cout << fixed << setprecision(5) << (double) lcm / d << '\n';
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define N 200010
using namespace std;
template <typename T> void read(T &x){
	x=0;char c=getchar();int fh=1;
	while (!isdigit(c)){if (c=='-')fh=-1;c=getchar();}
	while (isdigit(c))x=x*10+c-'0',c=getchar();
	x*=fh;
}
int a[N],n,ansn;
bool v[N];
multiset<int> p;
bool comp(const int &a,const int &b){return a>b;}
int main(){
	read(n);
	for (int i=1;i<=n;i++){read(a[i]);p.insert(a[i]);}
	sort(a+1,a+n+1,comp);
	for (int i=1;i<=n;i++){
		if (p.find(a[i])!=p.end()){
			set<int>::iterator l=p.find(a[i]);
			p.erase(l);
			int j=1;
			while (j<=a[i]) j*=2;
			set<int>::iterator k=p.find(j-a[i]);
			if (k!=p.end())ansn++,p.erase(k);
		}
	}
	cout<<ansn<<endl;
	return 0;
}

Measured memory_bytes: 10368
///
// File:  2728.cpp
// Author: ymiyamoto
//
// Created on Thu Dec 28 20:03:55 2017
//

#include <algorithm>
#include <cmath>
#include <cstdint>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int64_t diff(string A, string B)
{
  return min(abs(stol(A) - stol(B)), (int64_t)pow(10, A.size()) - abs(stol(A) - stol(B)));
}

bool comp(pair<int64_t, string> x, pair<int64_t, string> y)
{
  if (x.first == y.first) {
    return x.second > y.second;
  }
  return x.first < y.first;
}

pair<int64_t, string> min_str(string A, vector<bool> used, string B)
{
  if (A.size() == B.size()) {
    return {diff(A, B), B};
  } else {
    vector<pair<int64_t, string>> strs;
    for (uint32_t i = 0; i < used.size(); i++) {
      if (!used[i]) {
        used[i] = true;
        string b = string(B);
        b += i + '0';
        strs.push_back(min_str(A, used, b));
        used[i] = false;
      }
    }
    sort(strs.begin(), strs.end(), comp);
    if (strs.size() > 0) {
      return strs[strs.size() - 1];
    } else {
      return {-1, ""};
    }
  }
}

int32_t main()
{
  string A;
  cin >> A;

  vector<bool> used(10, false);
  cout << min_str(A, used, "").second << endl;

  return 0;
}

Measured memory_bytes: 3364
#include<iostream>
#include<vector>
#include <stdio.h>
int main(){
	int w;
	std::cin>>w;
	std::vector<int> a(w+1);
	for(int i=1;i<=w;i++)a[i]=i;
	int n;
	std::cin>>n;
	while(n>0){
		int b,c;
		scanf("%d,%d",&b,&c);
		//std::cin>>b>>c;
		int d=a[b];
		a[b]=a[c];
		a[c]=d;
		n--;
	}
	for(int i=1;i<=w;i++)std::cout<<a[i]<<std::endl;
	return 0;
}

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

#define REP(i,n) for(ll i=0; i<(ll)(n); i++)
#define FOR(i,n,m) for (ll i=n; i<(ll)(m); i++)
#define pb push_back
#define INF 1000000007LL
#define all(a) (a).begin(),(a).end()
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)

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

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

#define MAX_N 100
ll pascal[MAX_N+1][MAX_N+1];
void make_pascal() {
    FOR(i, 2, MAX_N+1) REP(j, i+1) {
        if (j == 0 || j == i) {
            pascal[i][j] = 1;
        } else if(j == 1 || j == i - 1) {
            pascal[i][j] = i;
        } else {
            pascal[i][j] = pascal[i-1][j-1] + pascal[i-1][j];
        }
    }
}

ll mod_pow(ll x, ll n) {
    ll a = 1;
    while (n) {
        if (n%2) a = a*x%INF;
        x = x*x%INF;
        n/=2;
    }
    return a;
}

int N;
int main(){
    ios::sync_with_stdio(false);
    
    cin >> N;
    vector<ll> a(N+1);
    int pre_ind = -1;
    int ind = -1;
    vector<ll> used(N+1, -1);
    REP(i, N+1) {
        cin >> a[i];
        if(used[a[i]-1] != -1) {
            ind = i;
            pre_ind = used[a[i]-1];
        } else {
            used[a[i]-1] = i;
        }
    }
    ll M = N - ind + pre_ind;
    ll mcn = 1;
    ll ncn = N+1;
    cout << N << endl;
    FOR(i, 2, N+1) {
        ncn *= N + 1 - i + 1;
        ncn %= INF;
        ncn *= mod_pow(i, INF-2);
        ncn %= INF;
        if (i-1 <= M) {
            mcn *= M - i + 2;
            mcn %= INF;
            mcn *= mod_pow(i-1, INF-2);
            mcn %= INF;
            ll tmp = ncn - mcn;
            while(tmp < 0) tmp += INF;
            cout << tmp << endl;
        } else {
            cout << ncn << endl;
        }
    }
    cout << 1 << endl;
    
    return 0;
}


Measured memory_bytes: 2816
const N = '2019/04/30';
var s:packed array[1..10] of char; t:packed array[1..10] of char ;i:integer; c:char;
begin
  i:=0;
  repeat read(c); s[i+1]:=c; i:=i+1 until (i = 10) or eoln  ; 
  if s > N then write('TBD') else write('Heisei')
end.


Measured memory_bytes: 128
#include <iostream>
#include <vector>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N,D,X;
    cin >> N >> D >> X;
    vector<int> A(N); for(int i = 0; i < N; ++i) cin >> A[i];
    int ans = X;
    for(int i = 0; i < N; ++i){
        for(int j = 0;; ++j){
            if(j*A[i] + 1 > D) break;
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
const int maxn = 1e6 + 5;
const int mod = 1e9 + 7;
ll fact[maxn] , inv[maxn];
ll ksm (ll a , ll b)
{
    ll ans = 1 , base = a;
    while (b){
        if (b & 1) ans = ans * base % mod;
        b >>= 1;
        base = base * base % mod;
    }
    return ans;
}
ll C (int n , int m)
{
    ll res = fact[n] * inv[m] % mod;
    res = res * inv[n - m] % mod;
    return res;
}
int main()
{
    fact[0] = 1;
    inv[0] = 1;
    for (int i = 1 ; i < maxn ; i++){
        fact[i] = fact[i - 1] * i % mod;
        inv[i] = ksm(fact[i] , mod - 2) % mod;
    }
    ios::sync_with_stdio(false);
    ll n , m , a , b; cin >> n >> m >> a >> b;

    ll ans = 0;
    for (int i = 0 ; i <= min(m - b - 1 , n - a - 1) ; i++){
        ans = (ans + C(n - a + b - 1 , b + i) * C(m - b - 1 + a , m - b - 1 - i))%mod;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 19228
package main

import (
	"fmt"
	"sync"
)

func main() {
	var n, a, b int
	fmt.Scan(&n, &a, &b)

	var wg sync.WaitGroup
	valueChan := make(chan int, 100)

	for i := n; i > 0; i-- {
		wg.Add(1)
		go func(i int) {
			defer wg.Done()

			digitTotal := 0
			tempValue := i
			for tempValue > 0 {
				digitTotal += tempValue%10
				tempValue /= 10
			}

			if a <= digitTotal && digitTotal <= b {
				valueChan <- i
			}
		}(i)
	}

	go func() {
		wg.Wait()
		close(valueChan)
	}()

	sum := 0
	for v := range valueChan {
		sum += v
	}

	fmt.Println(sum)
}


Measured memory_bytes: 26720
#include  <bits/stdc++.h>
using namespace  std;
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rep2(r, aa, bb) for (int r = (aa)-1; r >= (bb); r--)
#define be(x) (x.begin(), x.end())
#define pb(t) push_back(t)
#define ll long long
int main()
{
	int n;
	cin>>n;
	vector<ll>A(n), B;
	rep(i,0,n)cin>>A[i];
	B=A;
	sort be(B);
	ll counter=0;
	rep(i,0,n)
	{
		if(A[i]!=B[i])counter++;
	//	cout<<A[i]<<" " <<B[i]
	}
	//cout<<counter<<endl;
	if(counter<=2)cout<<"YES";
	else cout<<"NO";
}


Measured memory_bytes: 256
// practice with Dukkha
#include <algorithm>
#include <iostream>

using namespace std;

const int N = 200000;

int pp[N], qq[N];

int main() {
	int n, k, c; cin >> n >> k >> c;
	string s; cin >> s;
	for (int h = 0, i = 0, o = i - c - 1; i < n; i++)
		if (s[i] == 'o' && i - o > c) {
			pp[h] = o = i;
			if (++h == k)
				break;
		}
	for (int h = 0, i = n - 1, o = i + c + 1; i >= 0; i--)
		if (s[i] == 'o' && o - i > c) {
			qq[k - 1 - h] = o = i;
			if (++h == k)
				break;
		}
	for (int h = 0; h < k; h++)
		if (pp[h] == qq[h])
			cout << pp[h] + 1 << '\n';
	return 0;
}


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

#define INF 1e9
using namespace std;
using ll = long long;

int main() {

    int n, m; cin >> n >> m;

    vector<vector<int>> jobs(m);
    for (int i = 0; i < n; ++i) {
        int a, b;
        cin >> a >> b;

        if (a > m) continue;

        jobs[m-a].push_back(b); //ある日付までにやらないといけない仕事
    }

    priority_queue<int> q;

    ll ans = 0;

    for (int i = m-1; i >= 0; --i) {
        for (int b : jobs[i]) {
            q.push(b); //ある日付までにやらないといけない仕事をキューに格納
        }

        if (!q.empty()) {
            ans += q.top();
            q.pop();
        }
    }

    cout << ans << endl;
}

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

using namespace std;

int main(){

	int n;
	cin>>n;
	
	int arr[n];
	for (int i=0;i<n;i++) cin>>arr[i];
	
	int dp[n];
	
	dp[0]=0;
	dp[1]=abs(arr[1]-arr[0]);
	
	for (int i=2;i<n;i++){
		dp[i]=min(abs(arr[i]-arr[i-1])+dp[i-1],abs(arr[i]-arr[i-2])+dp[i-2]);
	}
	
	cout<<dp[n-1]<<endl;

	return 0;
}


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

typedef long long STATES;

int main( void )
{
	register int i, j;
	int n;
	while ( cin >> n && n )
	{
		STATES goal_state = 0;
		for ( i = 0; i < n; i++ ) goal_state |= 1LL << i;

		vector <STATES> free_days( 30+1, 0 );
		for ( i = 0; i < n; i++ )
		{
			int k; cin >> k;
			for ( j = 0; j < k; j++ )
			{
				int free_day; cin >> free_day;
				free_days[free_day] |= 1LL << i;
			}
		}

		int answer = -1;
		vector <STATES> dp( n, 0 );
		for ( i = 0; i < n; i++ ) dp[i] = 1LL << i;
		for ( i = 1; answer == -1 && i <= 30; i++ )
		{
			STATES next = 0;
			for ( j = 0; j < n; j++ ) if ( free_days[i] & ( 1LL << j ) ) next |= dp[j];
			for ( j = 0; j < n; j++ ) if ( free_days[i] & ( 1LL << j ) ) dp[j] |= next;
			if ( next == goal_state ) answer = i;
		}

		cout << answer << endl;
	}

	return 0;
}

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

s = list(s)

li = []
que = []
for i in range(n-1):
    if s[i] != s[i+1]:
        li.append(i)
li.append(n-1)
if len(li) == 1:
    print(n-1)
    exit()

for i in range(0,len(li)-1, 2):
    if k > 0:
        char = s[li[i]]
        a = s[li[i]+1:li[i+1]+1]
        s[li[i]+1:li[i+1]+1] = char * (li[i+1] - li[i])
    k -= 1

happiness = 0

for i in range(n):
    if i == 0:
        if s[i] == 'R' and s[i+1] == 'R':
            happiness +=1
    elif i == n-1:
        if s[i] == 'L' and s[i-1] == 'L':
            happiness += 1
    else:
        if s[i] == 'R' and s[i + 1] == 'R':
            happiness += 1
        elif s[i] == 'L' and s[i - 1] == 'L':
            happiness += 1

print(happiness)

Measured memory_bytes: 7840
#include <stdio.h>

int count[100050];

int main()
{
	int n,i,ans=0;
	scanf("%d",&n);
	while(n--)
		scanf("%d",&i),count[i]++,count[i+1]++,count[i+2]++;
	for(i=0;i<=100000;i++)
		if(count[i]>ans) ans=count[i];
	printf("%d\n",ans);
}

Measured memory_bytes: 512
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x) x
#define rep(...) MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c) c.begin(),c.end()
#define mp make_pair
#define write(x) cout<<(x)<<"\n"
using namespace std; typedef long long ll; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T1, class T2>bool chmax(T1& a, const T2& b) { return a < b ? a = b, 1 : 0; }
template<class T1, class T2>bool chmin(T1& a, const T2& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

int N, K;
vector<int> A;

int main() {
    cin >> N >> K;
    A.resize(N);
    rep(i, N) cin >> A[i];

    int sumA = accumulate(all(A), 0);

    vector<int> divs;
    for (int i = 1; i * i <= sumA; ++i) {
        if (sumA % i == 0) {
            divs.push_back(i);
            divs.push_back(sumA / i);
        }
    }
    sort(all(divs));
    reverse(all(divs));

    vector<pair<int, int>> closeToMul_p, closeToMul_n;
    vector<bool> used(N);
    for (int d : divs) {
        closeToMul_p.resize(0);
        closeToMul_n.resize(0);

        rep(i, N) {
            int u = (A[i] + d - 1) / d * d;
            int l = A[i] / d * d;

            closeToMul_n.emplace_back(A[i] - l, i);
            closeToMul_p.emplace_back(u - A[i], i);
            //if (u - A[i] > A[i] - l) {
            //}
            //else {
            //}
        }

        sort(all(closeToMul_p));
        sort(all(closeToMul_n), [](auto& l, auto& r) { return l.first == r.first ? l.second > r.second : l.first < r.first; });

        used.assign(N, false);

        ll cnt = 0;
        for (int ip = 0, in = 0; ip < N && in < N; ) {
            while (ip < N && used[closeToMul_p[ip].second]) ip++;
            while (in < N && used[closeToMul_n[in].second]) in++;

            if (ip >= N || in >= N) {
                break;
            }

            if (closeToMul_p[ip].first < closeToMul_n[in].first) {
                cnt += closeToMul_p[ip].first;
                used[closeToMul_p[ip].second] = true;

                closeToMul_n[in].first -= closeToMul_p[ip].first;
                ip++;
            }
            else if (closeToMul_p[ip].first > closeToMul_n[in].first) {
                cnt += closeToMul_n[in].first;
                used[closeToMul_n[in].second] = true;

                closeToMul_p[ip].first -= closeToMul_n[in].first;
                in++;
            }
            else {
                cnt += closeToMul_n[in].first;
                used[closeToMul_p[ip].second] = true;
                used[closeToMul_n[in].second] = true;
                ip++;
                in++;
            }
        }

        if (cnt <= K) {
            write(d);
            return 0;
        }
    }

    write(1);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (long long i = 0; i < (long long)n; i++)
//#define _GLIBCXX_DEBUG
using namespace std;
using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using Vl = vector<ll>;
using vi = vector<int>;
using Graph = vector<vi>;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  // std::cout << std::fixed << std::setprecision(15); //"for float-base
  // problem"
  int A, B, C;
  cin >> A >> B >> C;
  if (A + B + C > 21)
    cout << "bust" << endl;
  else
    cout << "win" << endl;
}

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

// TYPEDEF
// ----------------------------------------
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> Pair;
typedef vector<ll> vll;
typedef vector<vector<ll>> Graph;
typedef vector<string> vs;
typedef vector<pair<ll, ll>> Pll;
typedef queue<ll> qll;

// REPEAT
// ----------------------------------------
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REPA(i,a) for(ll i=0;i<(ll)(a.size());i++);
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define COUT(a) cout << (a) << endl;
#define ENDL(a) cout << endl;
#define COUTA(i,a) for(ll i=0;i<(ll)(a.size());i++) {cout << (a)[i] << " ";} cout << endl;

// UTIL
// ----------------------------------------
#define pb push_back
#define paired make_pair
#define ALL(a) (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define RSORT(a) sort((a).rbegin(), (a).rend())

// DEBUG
// ----------------------------------------
#ifdef _DEBUG
#define debug(x) cout << "[debug] " << #x << ": " << x << endl
#else
#define debug(x)
#endif

template <typename T>
void debugV(const vector<T> v) {
#ifdef _DEBUG
  rep(i, v.size()) {
    cout << i << ":" << v[i] << " ";
  }
  cout << endl;
#else
  (void)v;
#endif
}

// BIT FLAG
// ----------------------------------------
const unsigned int BIT_FLAG_0 = (1 << 0); // 0000 0000 0000 0001
const unsigned int BIT_FLAG_1 = (1 << 1); // 0000 0000 0000 0010
const unsigned int BIT_FLAG_2 = (1 << 2); // 0000 0000 0000 0100
const unsigned int BIT_FLAG_3 = (1 << 3); // 0000 0000 0000 1000
const unsigned int BIT_FLAG_4 = (1 << 4); // 0000 0000 0001 0000
const unsigned int BIT_FLAG_5 = (1 << 5); // 0000 0000 0010 0000
const unsigned int BIT_FLAG_6 = (1 << 6); // 0000 0000 0100 0000
const unsigned int BIT_FLAG_7 = (1 << 7); // 0000 0000 1000 0000
const unsigned int BIT_FLAG_8 = (1 << 8); // 0000 0001 0000 0000
const unsigned int BIT_FLAG_9 = (1 << 9); // 0000 0010 0000 0000
const unsigned int BIT_FLAG_10 = (1 << 10); // 0000 0100 0000 0000
const unsigned int BIT_FLAG_11 = (1 << 11); // 0000 1000 0000 0000

// CONST
// ----------------------------------------
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr double PI=3.14159265358979323846; // or M_PI
constexpr int MOD = 1000000007;


void Main() {
  ll n;
  cin >> n;
  vll a(n);
  REP(i, n) {
    cin >> a[i];
  }

  vll index(n);
  iota(index.begin(), index.end(), 0);

  sort(index.begin(), index.end(), [&](ll i1, ll i2){
    return a[i1] < a[i2];
  });

  REP(i, index.size()) {
    COUT(index[i] + 1);
  }
}


int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
}

/*
3
2 3 1
*/


Measured memory_bytes: 4700
import java.io.*
import java.util.*
import java.lang.Math.*

class CumSum(val A: LongArray) {
    private var csum: LongArray = LongArray(A.size + 1){0L}
    init {
        for (i in 1..A.size) {
            this.csum[i] = this.csum[i-1] + A[i-1]
        }
    }
    fun sum(L: Int, R: Int): Long {
        val r = min(R, A.size)
        val l = max(L, 0)
        if (l >= r) return 0L
        return this.csum[r] - this.csum[l]
    }
    fun sum(i: Int): Long {
        return this.sum(0,i)
    }
}

fun bsCondClOp(A: LongArray, B: LongArray, K: Long, L: Int, R: Int): Int {
    val N = A.size
    val M = B.size
    val acs = CumSum(A)
    val bcs = CumSum(B)

    fun isCondition(K: Long, m: Int): Boolean {
        for (i in 0..N) {
            val j = m-i
            if (j < 0 || M < j) continue
            if (acs.sum(i) + bcs.sum(j) <= K) return true
        }
        return false
    }
    var l = L; var r = R
    while (l < r-1) {
        val m = (l + r) / 2
        if (isCondition(K, m)) {
            l = m
        } else {
            r = m
        }
    }
    return l
}


fun main() {
    val (N,M, K) = rd.readIntArray()
    val A = rd.readLongArray()
    val B = rd.readLongArray()

    val ans = bsCondClOp(A, B, K.toLong(), 0, N+M+1)

    println(ans)
}


//val rd = debug.Reader("abc", "172", "c", "sample-2")
val rd = Reader()
fun main(args: Array<String>) {
    Thread(null, MainThread(), "mainThread", 128 * 1024 * 1024).start()
}


const val MOD = 1_000_000_007L; const val INF = Int.MAX_VALUE/2; const val LINF = Long.MAX_VALUE/2
const val EPS = 1e-9; fun DBLEQ(a: Double, b: Double): Boolean {return abs(a - b) < EPS}
data class IntPair(val first: Int, val second: Int)
data class To(val idx: Int, val cost: Long)
typealias ALI = ArrayList<Int>
fun <T>edge(V: Int): Array<ArrayList<T>> { return Array(V){ArrayList<T>()} }
val errPrintln: (Any) -> Unit = { msg -> System.err.println(msg) }
class MainThread : Runnable {
    override fun run() { main() }
}
class Reader {
    private val br = BufferedReader(InputStreamReader(System.`in`))
    val readString: () -> String = { br.readLine() }
    val readInt: () -> Int = { br.readLine().toInt() }
    val readLong: () -> Long = { br.readLine().toLong() }
    val readIntArray: () -> IntArray = { br.readLine().split(' ').map { it.toInt() }.toIntArray() }
    val readLongArray: () -> LongArray = { br.readLine().split(' ').map { it.toLong() }.toLongArray() }
    val readListInt: () -> List<Int> = { br.readLine().split(' ').map { it.toInt() } }
    val readListLong: () -> List<Long> = { br.readLine().split(' ').map { it.toLong() } }
}


Measured memory_bytes: 81508
#include <bits/stdc++.h>
#define x first
#define y second
#define pb push_back
using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
const double PI  = acos(-1.0);
const double eps = 1e-8;
const int inf = 0x3f3f3f3f;
const LL INF  = 0x3f3f3f3f3f3f;
const int N=3e5+10;
const int M=1e6+10;
const int mod=1e9+7;
inline LL gcd(LL a, LL b) { return b ? gcd(b, a % b) : a; }
inline LL lcm(LL a, LL b) { return a * b / gcd(a, b); }
inline LL read(){LL x=0,f=1;char c=getchar();while(c<'0'||c>'9') {if(c=='-')f=-1;c=getchar();}while(c>='0'&&c<='9') {x=x*10+c-'0';c=getchar();}return x*f;}
inline LL qpow(LL x,LL k=mod-2,LL m=mod){LL res=1;while(k){if(k&1) res=res*x%m;x=x*x%m;k>>=1;}return res;}
/*=================================================================================================================*/


int main(){
    LL a,b,c,d;
    cin>>a>>b>>c>>d;
    LL res=a*c;
    res=max(res,a*d);
    res=max(res,b*c);
    res=max(res,b*d);
    if(a<=0&&b>=0||c<=0&&d>=0) res=max(res,0ll);
    cout<<res<<endl;
    return 0;
}


Measured memory_bytes: 3632
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
using ll = long long;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define REP(var, a, b) for (int var = (a); var < (b); var++)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()
#define rALL(c) (c).rbegin(), (c).rend()
ll MOD = 1000000007;
const ll INF = 1LL << 60;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;
  cin >> n;
  if (n < 1000) {
    cout << "ABC" << endl;
  } else {
    cout << "ABD" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define MOD 1000000007
#define INF 1000000000000000000

using namespace std;

int main(void){
  ll n;
  cin >> n;
  
  vector<ll> l(n);
  for (int i = 0; i < n; i++){
    cin >> l[i];
  }
  sort(l.begin(), l.end());


  ll ans = 0;
  ll m = l.size();
  for (int i = 0; i < m; i++){
    for (int j = i+1; j < m; j++){
      for (int k = j+1; k < m; k++){
        if (l[i] + l[j] > l[k] && l[i] < l[j] && l[j] < l[k])
          ans++;
      }
    }
  }
  cout << ans << endl;
  

  return 0;
}


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

using namespace std;
long long n,m,a[102],b[102],d[102][100005];
int main(void)
{
  cin>>n>>m;
  for(int i=1;i<=n;i++) cin>>a[i]>>b[i];
  for(int i=1;i<=n;i++)
    for(int j=0;j<=m;j++)
      if(j>=a[i])
        d[i][j]=max(d[i-1][j],d[i-1][j-a[i]]+b[i]);
      else d[i][j]=d[i-1][j];
  cout<<d[n][m]<<'\n';
  return 0;
}

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

int main(){
	int n,m,l,i,j,p;
	cin >> n;
	int f[1000][1000];
	for ( i = 0; i < n; i++){
		cin >> m;
		cin >> p;
		for ( j = 0; j < p; j++){
			cin >> l;
			f[m-1][l-1] = 1;
		}
	}
	for ( i = 0; i < n; i++){
		for ( j = 0; j < n-1; j++){
			cout << f[i][j] << " ";
		}
		cout << f[i][n-1] << endl;
	}
}

Measured memory_bytes: 1552
#include <iostream>

using namespace std;

int main() {

	int a[10000] = { 0 };

	for (int i = 0; i < 10000; i++) {

		cin >> a[i];

		if (a[i] == 0) {

			break;

		}

	}

	for (int i = 0; i < 10000; i++) {

		if (a[i] == 0) {

			break;

		}

		cout << "Case " << i + 1 << ": " << a[i] << endl;

	}

	return 0;

}

Measured memory_bytes: 3024
#include <bits/stdc++.h>
#define ll long long 

using namespace std;

int main()
{
    char a;
    cin >> a;
    if(a >= 97)
    {
        cout << "a";
    }
    else
    {
        cout << "A";
    }
     
      
    
    return 0;
}

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

using namespace std;

vector<pair<int,int>> graph[(int)1e5+10];
int color[(int)1e5+10];
bool visited[(int)1e5+10];

void dfs(int u){
    visited[u] = true;
    for(auto x: graph[u]){
        if(!visited[x.first]){
            if(x.second % 2 == 0)
                color[x.first] = color[u];
            else color[x.first] = 1 - color[u];
            dfs(x.first);
        }
    }
}

int main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n;
    cin >> n;

    int u, v, w;
    for(int i=1;i<n;++i){
        cin >> u >> v >> w;
        graph[u].push_back(make_pair(v,w));
        graph[v].push_back(make_pair(u,w));   
    }

    dfs(1);

    for(int i=1;i<=n;++i)
        cout << color[i] << '\n';

    return 0;
}

Measured memory_bytes: 8448
#include<bits/stdc++.h>
using namespace std;
#define NL            "\n"
#define _SAD()        ios::sync_with_stdio(0),cin.tie(0), cout.tie(0);
#define SZ(s)         s.size()
#define SRT(x,y)      sort(x,x+y)
#define REV(a,b)      reverse(a,a+b)
#define VSRT(x)       sort(x.begin(),x.end())
#define VREV(x)       reverse(x.begin(),x.end())
int main()
{
    _SAD()
    int m,n;
    cin>>m>>n;
    cout<<(m-1)*(n-1)<<NL;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>



using namespace std;



int main()



{



   int S, h, m, s;



cin >> S;



   h=S/60/60;



   m=S/60-h*60;



   s=S-h*60*60-m*60;



cout << h << ":" << m << ":" << s << endl;



   return 0;



}


Measured memory_bytes: 3080
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <map>
#include <iomanip>	
#include <deque>
#include <set>
#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 INF INT_MAX/2;
const int INF2 = 1001001001;
typedef long long ll;
using namespace std;
using vi = vector<int>;
using vll = vector<ll>;
ll mod = 1e9 + 7;
//ll llmax = 10000000000000000000ll;
using namespace std;
using Graph = vector<vector<int>>;


int cnt_digit(ll N)
{
	int digit = 0;

	while (N > 0)
	{
		N /= 10;
		digit++;
	}
	return digit;
}


 // 最大公約数計算
 
ll gcd(ll a, ll b)
{
	if (b == 0) {
		return a;
	}
	else {
		return gcd(b, a % b);
	}
}
// 最小公倍数の計算

ll lcm(ll a, ll b)
{
	ll g = gcd(a, b);

	return a / g * b;
}

struct union_find
{
	vector<int> par, r;
	union_find(int n)
	{
		par.resize(n);
		r.resize(n);
		init(n);
	}


	void init(int n)
	{
		for (int i = 0; i < n; i++) par[i] = i;
		for (int i = 0; i < n; i++) r[i] = 0;
	}

	int find(int x)
	{
		if (par[x] == x)return x;
		else return find(par[x]);
	}

	void unite(int x, int y)
	{
		x = find(x);
		y = find(y);

		if (r[x] < r[y])
		{
			par[x] = y;
		}
		else
		{
			par[y] = x;
			if (r[x] == r[y])
			{
				r[x]++;
			}
		}
	}
};

const int MAX_N = 110000;

int memo[MAX_N];

int rec(int n) {
	if (n == 0)return 0;
	if (memo[n] != -1)return memo[n];

	int res = n;

	for (int pow6 = 1; pow6 <= n; pow6 *= 6)res = min(res, rec(n - pow6) + 1);

	for (int pow9 = 1; pow9 <= n; pow9 *= 9)res = min(res, rec(n - pow9) + 1);

	return memo[n] = res;
}

int calc(int x) {
	int ret = 0;
	while (x % 2 == 0) {
		x /= 2;
		ret++;
	}

	return ret;
}

int a[12][12];
int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,k;

	cin >> n >> k;

	rep(i, 0, n) {

		int a;
		cin >> a;
	}

	int res, length;
	res = length = 0;

	while (length < n) {
		if (length == 0)length += k;
		else length += k - 1;
		res++;
	}


	cout << res << endl;
	

	
		
	



}
	

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

#define ln                '\n'
#define all(dat)           dat.begin(), dat.end()
#define loop(i, to)        for (int i = 0; i < to; ++i)
#define cont(i, to)        for (int i = 1; i <= to; ++i)
#define circ(i, fm, to)    for (int i = fm; i <= to; ++i)
#define foreach(i, dat)    for (__typeof(dat.begin()) i = dat.begin(); i != dat.end(); ++i)

typedef long long          num;

using namespace std;

const int nsz = 2e5;
bool vis[nsz + 5];
int n, m, c[nsz + 5];
int es, hd[nsz + 5];
pair<int, int> dat[nsz + 5];
vector<int> to, ans;

struct edge {
	int nxt, to, fm;
	
	edge(int nxt = 0, int to = 0, int fm = 0) {
		this->nxt = nxt, this->to = to, this->fm = fm;
	}
};
edge e[2 * nsz + 5];

void inline link(int u, int v, int fm) {
	e[++es] = edge(hd[u], v, fm), hd[u] = es;
	e[++es] = edge(hd[v], u, fm), hd[v] = es;
}

void dfs(int u) {
	vis[u] = 1;
	for (int i = hd[u]; i; i = e[i].nxt) {
		int v = e[i].to;
		if (vis[v])  continue;
		dfs(v);
		if (c[v]) {
			c[u] ^= 1, c[v] ^= 1;
			ans.push_back(e[i].fm);
		}
	}
}

int main() {
	scanf("%d%d", &n, &m);
	cont (i, n) {
		int p, s;
		scanf("%d%d", &p, &s);
		dat[i] = make_pair(p, s);
		to.push_back(p);
	}
	sort(dat + 1, dat + n + 1);
	to.push_back(0);
	sort(all(to));
	cont (i, n) {
		dat[i].first = lower_bound(all(to), dat[i].first) - to.begin();
		c[i] = dat[i].second ^ dat[i - 1].second;
	}
	cont (i, m) {
		int l, r;
		scanf("%d%d", &l, &r);
		l = (upper_bound(all(to), l - 1) - to.begin());
		r = (upper_bound(all(to), r) - to.begin());
		if (l >= r)  continue;
		link(l, r, i);
	}
	dfs(n + 1);
	cont (u, n) {
		if (vis[u])  continue;
		dfs(u);
		if (c[u]) {
			cout << -1 << ln;
			return 0;
		}
	}
	sort(all(ans));
	printf("%d\n", (int) ans.size());
	loop (i, ans.size()) {
		printf("%d ", ans[i]);
	}
}

Measured memory_bytes: 11256
import collections
import itertools
import sys

def getint(): return int(input())
def getints(): return list(map(int, input().split()))

h,w=getints()
grid=[input() for _ in range(h)]

def check(y, x):
    if grid[y][x] == '.':
        return True
    for xx in range(x-1, x+2):
        for yy in range(y-1, y+2):
            if abs(xx - x) + abs(yy - y) != 1:
                continue
            if xx < 0 or xx >= w or yy < 0 or yy >= h:
                continue
            if grid[yy][xx] == '#':
                return True
    return False

ok = True
for i in range(h):
    for j in range(w):
        if not check(i, j):
            ok = False
            break
print("Yes" if ok else "No")

Measured memory_bytes: 3316
#define _USE_MATH_DEFINES
#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <vector>
#include <random>
#include <list>
#include <numeric>
using namespace std;
 
typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<ll, int> ll_i;
typedef pair<int, ll> i_ll;
typedef pair<double, int> d_i;
typedef pair<ll, ll> ll_ll;
typedef pair<double, double> d_d;
struct edge { int u, v; ll w; };
 
#define rep(i, N) for (int i = 0; i < (int)(N); i++)
#define pb push_back
 
int INF = INT_MAX / 10;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int hoge[100010][27][27], sz[400010];

struct aho_corasick {
	int N, M;
	vector<vector<int> > next, accepts, uss;
	void dfs(int i, string& s, int j, int u) {
		if (j == s.length()) {
			accepts[u].pb(i);
			return;
		}
		int k = s[j] - 'a' + 1;
		if (next[u][k] == -1) {
			next.pb(vector<int>(27, -1));
			accepts.pb({});
			if (j + 1 == uss.size()) uss.pb({});
			uss[j + 1].pb(M);
			next[u][k] = M++;
		}
		dfs(i, s, j + 1, next[u][k]);
	}
	aho_corasick(vector<string> patterns) {
		N = patterns.size(); M = 1;
		next.pb(vector<int>(27, -1));
		accepts.pb({});
		uss.pb({0});
		rep(i, N) dfs(i, patterns[i], 0, 0);
		for (vector<int> us: uss)
			for (int u: us)
				for (int k = 1; k <= 26; k++) {
					if (next[u][k] == -1) continue;
					int v;
					for (v = next[u][0]; v != -1 && next[v][k] == -1; v = next[v][0]);
					next[next[u][k]][0] = (v == -1 ? 0 : next[v][k]);
				}
	}
	vector<int> search(string s) {
		vector<int> freq(M);
		int u = 0;
		for (char c: s) {
			int k = c - 'a' + 1;
			for (; u != -1 && next[u][k] == -1; u = next[u][0]);
			u = (u == -1 ? 0 : next[u][k]);
			freq[u]++;
		}
		vector<int> ans(N);
		for (int j = uss.size() - 1; j > 0; j--)
			for (int u: uss[j]) {
				for (int i: accepts[u]) ans[i] = freq[u];
				freq[next[u][0]] += freq[u];
			}
		return ans;
	}
	void dfs_sz(int u) {
		sz[u] = accepts[u].size();
		for (int k = 1; k <= 26; k++) {
			int v = next[u][k];
			if (v == -1) continue;
			dfs_sz(v);
			sz[u] += sz[v];
		}
	}
	void _dfs(int i, string& s, int j, int u) {
		if (j == s.length()) return;
		int k = s[j] - 'a' + 1;
		hoge[i][k][0] += accepts[u].size();
		for (int _k = 1; _k <= 26; _k++) {
			int v = next[u][_k];
			if (v == -1) continue;
			hoge[i][k][_k] += sz[v];
		}
		_dfs(i, s, j + 1, next[u][k]);
	}
};

int main() {
	int N; cin >> N;
	vector<string> s(N);
	rep(i, N) cin >> s[i];
	aho_corasick ac(s);
	ac.dfs_sz(0);
	rep(i, N) ac._dfs(i, s[i], 0, 0);
	int Q; cin >> Q;
	while (Q--) {
		int i; scanf("%d", &i); i--;
		char c[30]; scanf("%s", c);
		int ans = 0;
		for (int k = 1; k <= 26; k++)
			ans += hoge[i][k][0];
		for (int x = 0; x < 26; x++)
			for (int y = 0; y < x; y++)
				ans += hoge[i][c[x] - 'a' + 1][c[y] - 'a' + 1];
		printf("%d\n", ans + 1);
	}
}


Measured memory_bytes: 320464
#include <bits/stdc++.h>
#define err(args...) {}
#ifdef DEBUG
#include "_debug.cpp"
#endif
using namespace std;
using ll = long long;
using ld = long double;
template <typename T> using lim = numeric_limits<T>;
template <typename T> istream& operator>>(istream& is, vector<T>& a) { for(T& x : a) { is >> x; } return is; }
int rb(int n, int curr = 0, int dig = 0, bool has3 = 0, bool has5 = 0, bool has7 = 0) {
    int ans = curr <= n and has3 and has5 and has7;
    if(dig < 9) {
        ans += rb(n, curr * 10 + 3, dig + 1, true, has5, has7);
        ans += rb(n, curr * 10 + 5, dig + 1, has3, true, has7);
        ans += rb(n, curr * 10 + 7, dig + 1, has3, has5, true);
    }
    return ans;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    cout << rb(n) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<pair<int,int>> AB(N);
  for (int i=0;i<N;i++){
    int A,B;
    cin >> A >> B;
    AB[i]=make_pair(B,A);
  }
  sort(AB.begin(),AB.end());
  long long now=0;
  bool can=true;
  for (int i=0;i<N;i++){
    if (now+AB[i].second<=AB[i].first){
      now+=AB[i].second;
    }
    else {
      can=false;
      break;
    }
  }
  if (can){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}      

Measured memory_bytes: 1920
N = int(input())
X = list(map(int, input().split()))

hp_sums = []

for i in range(max(X)):
    P = i+1
    distance_list = list(map(lambda x: (x-P)**2, X))
    hp_sum = sum(distance_list)
    hp_sums.append(hp_sum)

print(min(hp_sums))

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

int main() {
  int N;
  cin >> N;
  string S;
  map<string, int> MA;
  int mx = 0;
  while (cin >> S) mx = max(mx, ++MA[S]);
  for (auto [a, b] : MA) if (b == mx) cout << a << "\n";
}

Measured memory_bytes: 19188
s = str(input())
flag = 0
flag2 = 0
if s[0] == 'A':
    for i in range(2,len(s)-1):
        if s[i] == 'C':
            flag += 1
    for i in range(1,len(s)):
        if s[i] == s[i].upper():
            flag2 += 1
#print(flag,flag2)
if flag == 1 and flag2 == 1:
    print("AC")
else:
    print("WA")

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;

int main() {
    string s, t;
    cin >> s >> t;
    int n = s.size();
    int res = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] != t[i]) res++;
    }
    cout << res << endl;
}


Measured memory_bytes: 3840
#include "bits/stdc++.h"
using namespace std;
#define FOR(i,a,b) for(int i =(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
#define REPm(i,n) for(int i=(n)-1;i>=0;i--)
#define REP1(i,n) for(int i=1;i<=(n);i++)
#define mp make_pair
typedef long long ll;
int main(){
    int a[3];
    cin >> a[0] >> a[1] >> a[2];
    int c = 0;
    REP(i,3){
        FOR(j,i+1,3){
            if(a[i] == a[j]) c++;
        }
    }
    if(c == 0) cout << 3 << endl;
    else if(c == 1) cout << 2 << endl;
    else cout << 1 << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
    int n;
    cin>>n;
    string a[n];
    string ans="Yes";
    char last;
    cin>>a[0];
    int m=a[0].size();
    last=a[0][m-1];
    for(int i=1;i<n;i++){
      cin>>a[i];
      int l=a[i].size();
      if(a[i][0]==last){
        last=a[i][l-1];
      }else{
        ans="No";
        break;
      }
    }
  rep(i,n-1){
    for(int j=i+1;j<n;j++){
      if(a[j]==a[i]){
           ans="No";
           break;
      }
    }
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			int n = sc.nextInt();
			int k = sc.nextInt();
			int result = 0;
			for (int i = 0; i < n; i++) {
				if (k <= sc.nextInt()) {
					result++;
				}
			}
			System.out.println(result);
		}
	}
}


Measured memory_bytes: 48044
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var firstLine = Console.ReadLine().Split(' ').Select(value => int.Parse(value)).ToArray();
            var h = firstLine[0];
            var w = firstLine[1];

            var field = new List<List<bool>>();

            for (var i = 0; i < h; i++)
            {
                var line = Console.ReadLine();
                field.Add(new List<bool>());

                for(var j = 0; j < w; j++)
                {
                    field[i].Add(line[j] == '#');
                }
            }

            var step = Bfs(field);

            if(step == -1)
            {
                Console.WriteLine(-1);
                return;
            }

            var blacks = field.Sum(row => row.Count(value => value));

            Console.WriteLine(h * w - blacks - step);
        }

        private static int Bfs(List<List<bool>> field)
        {
            var h = field.Count;
            var w = field[0].Count;
            var isFound = new bool[h, w];
            var costs = new int[h, w];
            costs[0, 0] = 1;
            var queue = new Queue<int[]>();
            queue.Enqueue(new int[2] { 0, 0 });

            while (queue.Count > 0)
            {
                var pos = queue.Dequeue();
                var y = pos[0];
                var x = pos[1];
                isFound[y, x] = true;

                var destY = y + 1;
                var destX = x;
                if (destY < h && !isFound[destY, destX] && !field[destY][destX])
                {
                    Update(isFound, queue, costs, y, x, destY, destX);
                }
                destY = y - 1;
                destX = x;
                if (destY >= 0 && !isFound[destY, destX] && !field[destY][destX])
                {
                    Update(isFound, queue, costs, y, x, destY, destX);
                }
                destY = y;
                destX = x + 1;
                if (destX < w && !isFound[destY, destX] && !field[destY][destX])
                {
                    Update(isFound, queue, costs, y, x, destY, destX);
                }
                destY = y;
                destX = x - 1;
                if (destX >= 0 && !isFound[destY, destX] && !field[destY][destX])
                {
                    Update(isFound, queue, costs, y, x, destY, destX);
                }

                if (costs[h - 1, w - 1] != 0)
                {
                    return costs[h - 1, w - 1];
                }
            }

            return -1;
        }

        private static void Update(bool[,] isFound, Queue<int[]> queue, int[,] costs, int y, int x, int destY, int destX)
        {
            isFound[destY, destX] = true;
            queue.Enqueue(new int[2] { destY, destX });
            costs[destY, destX] = costs[y, x] + 1;
        }
    }
}


Measured memory_bytes: 13652
#include<iostream>
#include<vector>
#include<string>
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
using ll = long long;
using namespace std;
int main() {
	string s;
	cin >> s;
	bool f = false;
	REP(i, s.size() - 1) {
		if (s[i] == s[i + 1])f = true;
	}
	if (f)cout << "Bad" << endl;
	else cout << "Good" << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {  
  		Scanner sc = new Scanner(System.in);
		int length = sc.nextInt();
      	int lowPos = sc.nextInt();
      	String str = sc.next();
      
      	String[] ary = str.split("", 0);
      	for(int i = 0; i < length; i++) {
        	if(i == lowPos -1 ) ary[i] = ary[i].toLowerCase();
          	System.out.print(ary[i]);
        }
    }
}

Measured memory_bytes: 21716
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<functional>
#include<fstream>
#include<utility>
#include<bitset>
#include<map>
#include<deque>
#include<cmath>
#include<random>
#include<string.h>
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define rep(N) for (int i = 0; i < N; ++i)
#define Rep(a, b) for (int i = a; i < b; ++i)
#define For(i, N) for (int i = 0; i < N; ++i)
#define all(v) v.begin(), v.end()
#define rev(v) v.rbegin(), v.rend()
#define makei(N) int N; cin >> N;
#define makel(N) ll N; cin >> N;
#define makes(s) string s; cin >> s;
#define maked(d) double d; cin >> d;
#define makev(v, N) vi v(N); rep(N)cin >> v[i];
#define mod 1000000007
#define re return 0

using namespace std;
using ll = long long int;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vector<bool>>;
using vs = vector<string>;
using pii = pair<int, int>;
using pis = pair<int, string>;
using msi = map<string, int>;

template<typename T>
void say(T s) {
	cout << s << "\n";
}

template<typename T>
void say(vector<T> s) {
	auto itr = s.begin();
	cout << *(itr++);
	while (itr != s.end()) {
		cout << " " << *(itr++);
	}
	cout << "\n";
}

void yn(bool b) {
	if (b)say("YES");
	else say("NO");
}

int main() {
	makes(O);
	makes(E);
	auto io = O.begin();
	auto ie = E.begin();
	while (ie != E.end()) {
		cout << *(io++) << *(ie++);
	}
	if (io != O.end())cout << *io;
	cout << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <deque>

int main(){
  int N;
  scanf("%d", &N);
  std::vector<int > A(N), B(N), C(N);
  for (int i=0; i<N; i++){
    scanf("%d", &A[i]);
  }
  for (int i=0; i<N; i++){
    scanf("%d", &B[i]);
  }
  for (int i=0; i<N; i++){
    scanf("%d", &C[i]);
  }
  std::sort(A.begin(), A.end());
  std::sort(B.begin(), B.end());
  std::sort(C.begin(), C.end());

  long long Csum[N+3];
  Csum[N] = 0;
  for (int i=N-1; i>=0; i--){
    // B[i]以降のBに対するCの総和を求める
    int left = 0;
    int right = N;
    int mid;
    while(right-left>1){
      //      printf("while\n");
      mid = (right+left)/2;
      if (C[mid]<=B[i]){
        left = mid;
      } else {
        right = mid;
      }
    }
    if(B[i]<C[left]){
      Csum[i] = Csum[i+1]+(N-left);
    } else {
      Csum[i] = Csum[i+1]+(N-right);
    }
    //printf("Csum[%d]=%d\n", i, Csum[i]);
  }

  long long ans = 0;
  for (int i=0; i<N; i++){
    int left = 0;
    int right = N;
    int mid;
    while(right-left>1){
      mid = (left+right)/2;
      //printf("mid=%d\n", mid);
      if (B[mid]<=A[i]){
        left = mid;
      } else {
        right = mid;
      }
    }
    if (B[left]>A[i]){
      ans += Csum[left];
    //printf("mid=%d, mid2=%d\n", left, left2);
      //printf("+=%d\n", Csum[left]);
    } else {
      ans += Csum[right];
      //printf("+=%d\n", Csum[right]);      
    }

  }
  printf("%lld\n", ans);
  return 0;
}


Measured memory_bytes: 2808
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long tmp, a, b, c, k, i, sum=0;
	cin >> a >> b >> c >> k;

	sum += min(a, k);
	k -= min(a, k);
	k -= min(b, k);

	sum += -min(c, k);

	cout << sum << endl;
	return 0;
}


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

#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define intll int long long
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main() {
  string s ;
  cin >> s ;
  string ans = "Yes";
  
  sort(all(s));
  if(s.size() % 2 == 1)
    ans ="No";
  for(int i=0;i<s.size()-1;i+=2){
    if(s.at(i) !=s.at(i+1))
      ans = "No" ;
  }
  
  cout <<ans ;
 


}


Measured memory_bytes: 256
N, K = input().split()
D = [int(x) for x in input().split()]
L = [str(i) for i in range(10) if i not in D]
ANS = ''
for i, n in enumerate(N):
  if n in L:
    ANS += n
  elif int(L[-1]) > int(n):
    ANS += [l for l in L if int(l) > int(n)][0]
    ANS += L[0] * (len(N) - len(ANS))
    break
  else:
    while ANS:
        c = ANS[-1]
        ANS = ANS[:-1]
        if int(L[-1]) > int(c):
          ANS += [l for l in L if int(l) > int(n)][0]
          break
    if ANS:
      ANS += L[0] * (len(N) - len(ANS))
    else:
      ANS = (L[0] if int(L[0]) else L[1]) + L[0] * len(N)
    break
print(ANS)

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

int main() {
  int N, K, Q;
  int A[100001], score[100001];
  cin >> N >> K >> Q;
  for (int i = 0; i < Q; i++) cin >> A[i];
  for (int i = 0; i < N; i++) score[i] = K - Q;

  for (int i = 0; i < Q; i++) {
    score[A[i]-1] += 1;
  }

  for (int i = 0; i < N; i++) {
    if (score[i] > 0) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}


Measured memory_bytes: 1408