akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleTest
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a = new int[5];
            a[0] = int.Parse(Console.ReadLine());
            a[1] = int.Parse(Console.ReadLine());
            a[2] = int.Parse(Console.ReadLine());
            a[3] = int.Parse(Console.ReadLine());
            a[4] = int.Parse(Console.ReadLine());

        	var list = a.Where(x => x % 10 == 0).ToList();
        	list.AddRange(a.Where(x => x % 10 >= 1).OrderByDescending(x => x % 10));
     	    a = list.ToArray();
            int totalMin = 0;
            for (int i = 0; i < a.Length -1; i++)
            {
                var delta = (a[i]%10 == 0) ? 0 : 10-a[i]%10;
                totalMin += a[i] + delta;
            }
            totalMin += a[a.Length-1];
            System.Console.WriteLine($"{totalMin}"); 
        }
    }
}


Measured memory_bytes: 13396
#include<bits/stdc++.h>
using namespace std;
int main(void){

  int N;   cin >> N;
  vector<pair<int , int>> A(N);
  for(int i = 0 ; i < N ; i++){
    cin >> A[i].first;
    A[i].second = i;
  }

  sort(A.begin() , A.end());

  for(int i = 0 ; i < N ; i++){
    for(int j = N - 1 ; 0 <= j ; j--){

      if(A[j].second != i){
        cout << A[j].first << endl;
        break;
      }

    }
  }

  return 0;
}


Measured memory_bytes: 3200
#include<bits/stdc++.h>
#define title "title"
#define ll long long
#define ull unsigned ll
#define fix(x) fixed<<setprecision(x)
#define pii pair<ll,ll>
#define vint vector<ll>
#define pb push_back
using namespace std;
void Freopen(){
	freopen(title".in","r",stdin);
	freopen(title".out","w",stdout);
}
ll read(){
	ll g=0,f=1;
	char ch=getchar();
	while(ch<'0'||'9'<ch){if(ch=='-')f=-1;ch=getchar();}
	while('0'<=ch&&ch<='9'){g=g*10+ch-'0';ch=getchar();}
	return g*f;
}
const ll mod=998244353;
const ll N=5e5+5;
ll fac[N],inv[N],n,k,ans;
ll C(ll n,ll m){
	if(n<m)return 0;
	return fac[n]*inv[m]%mod*inv[n-m]%mod;
}
signed main(){
	n=read(),k=read();
	fac[0]=1;for(ll i=1;i<=k;i++)fac[i]=fac[i-1]*i%mod;
	inv[1]=1;for(ll i=2;i<=k;i++)inv[i]=(mod-mod/i)*inv[mod%i]%mod;
	inv[0]=1;for(ll i=1;i<=k;i++)inv[i]=inv[i]*inv[i-1]%mod;
	for(ll i=n;i<=k;i++)ans=(ans+C(k-1,i-1))%mod;
	return cout<<ans,signed();
}

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

using namespace std;

// MACROS

#define ll long long
#define ull unsigned long long
#define ld long double

#define vi vector<int>
#define vll vector<ll>
#define vld vector<ld>
#define u_s unordered_set

#define pii pair<int,int>
#define pll pair<ll,ll>

#define FOR(i, n) for (ll (i) = 0; i < n; i++)
#define FORN(i, a, b) for (ll (i) = a; i < b; i++)
#define FORE(i, l) for (auto (i) : l)

#define pb push_back
#define pob pop_back
#define emp emplace
#define fi first
#define se second

#define all(n) (n).begin(), (n).end()
#define in(n) cin >> (n);
#define debug(n) cout << #n << ": " << n << '\n';

// FUNCTIONS

template< typename T >
inline T gcd(T a, T b) { if (b) return gcd(b, a % b); return a; }

template< typename T >
inline T ext_gcd(T a, T b, T & x, T & y) { if (a == 0) { x = 0; y = 1; return b; } T x1, y1; T g = ext_gcd(b % a, a, x1, y1); x = y1 - (b / a) * x1; y = x1; return g; }

ll f1(string n, ll N)
{
    if (N < 0) return 0;
    if (N == 0) return n[0] - '0';
    string x = "";
    x.resize(N);
    FOR(i, N) x[i] = n[i];
    return 9 + f1(x, N - 1);
}

ll f2(string n, ll N)
{
    if (N < 1) return 0;
    string x = "";
    x.resize(N);
    FOR(i, N) x[i] = '9';
    ll res1 = (n[0] - '0' - 1) * f1(x, N - 1) + f2(x, N - 1);
    bool found = false;
    x = "";
    FORN(i, 1, N + 1)
    {
        if (n[i] != '0' || found)
        {
            x += n[i];
            found = true;
        }
    }

    ll res2 = f1(x, (ll)x.size() - 1);
    return res1 + res2;
}
ll f3(string n, ll N)
{
    if (N < 2) return 0;
    string x = "";
    x.resize(N);
    FOR(i, N) x[i] = '9';
    ll res1 = (n[0] - '0' - 1) * f2(x, N - 1) + f3(x, N - 1);
    bool found = false;
    x = "";
    FORN(i, 1, N + 1)
    {
        if (n[i] != '0' || found)
        {
            x += n[i];
            found = true;
        }
    }

    ll res2 = f2(x, (ll)x.size() - 1);
    return res1 + res2;
}

int main()
{
    //ios_base::sync_with_stdio(0);
    //cin.tie(0);	
    //cout << setprecision(15);
    string n; ll k;
    cin >> n >> k;
    ll N = n.size() - 1;
    if (k == 1) cout << f1(n, N) << '\n';
    else if (k == 2) cout << f2(n, N) << '\n';
    else cout << f3(n, N) << '\n';
}



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


int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin>>n;
  for(int i=1;i<=min(n,5);i++){
      cout<<0<<"\n";
  }
  for(int p=6;p<=n;p++){
    int y=1;
    int z=sqrt(p)-1;
    int sum=0;
    int l=sqrt(p/6);
    for(int i=y;i<=l;i++){
        for(int j=i;j<=z;j++){
          for(int k=j;k<=z;k++){
            if(i*i+j*j+k*k+i*j+i*k+j*k==p){
              if(i==j && j==k){
                sum+=1;
              }
              if((i==j && j!=k)||(j==k && i!=k)||(i==k && i!=j)){
                 sum+=3;
              }
              if(i!=j && j!=k && i!=k){
                 sum+=6;
              }
              
              
            }
           
          }
        }
    }
    
     cout<<sum<<"\n";
    






  }




}
       
  


Measured memory_bytes: 3520
import java.util.Scanner;

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

		int n = sc.nextInt();
		int[] peoples = new int[n];
		int from = 0;
		int to = 0;


		for(int i=0; i<n; i++) {
			from += 0;
			to += 0;
			from = sc.nextInt();
			to = sc.nextInt();
			peoples[i] = (to-from+1);
		}
		int total = 0;
			for(int j=0; j<peoples.length; j++) {
				total += peoples[j];
			}
		System.out.println(total);

	}

}


Measured memory_bytes: 26596
#include <bits/stdc++.h>
using namespace std;
int main() {
  int N,count=0;
  long long res=0;
  cin >> N ;
  vector<string> A(N);
  for (int i = 0; i < N; i++) {
    cin >> A.at(i);
    sort(A.at(i).begin(), A.at(i).end());
  } 

  sort(A.begin(), A.end());
  
  for (int i = 1; i < N; i++){
        if(A.at(i)==A.at(i-1)){
            count++;
            res+=count;
        }else{
            count=0;
        }        
  }

  cout << res << endl;
}


Measured memory_bytes: 7296
#include<bits/stdc++.h>
using namespace std ;
int a[1200000];
int main()
{
	double a,b,x;
	cin>>a>>b>>x;
	if(x<=a*a*b/2){
		x=x/a/b*2/b;
		printf("%.10f",90-atan(x)* 180.0/3.1415926535898);
	}
	else{
		x=x/a;
		x=x*2/a;
		x=x-b;
		x=a/(b-(x));
		printf("%.10f",90-atan(x)* 180.0/3.1415926535898);
	}
}


Measured memory_bytes: 256
import java.util.Scanner;

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

    int a = sc.nextInt();
    int b = sc.nextInt();

    if (a % 2 == 1 && b % 2 == 1) {
      System.out.println("Odd");
    } else {
      System.out.println("Even");
    }
    
    sc.close();
  }
}


Measured memory_bytes: 20820
#include <iostream>
#include <string.h>
using namespace std;
int main(void){
    int N,M,X;
    cin>>N>>M>>X;
    int num[M];
    for(int i=0;i<M;i++){cin>>num[i];}
    int a=0,b=0;
    for(int j=0;j<M;j++){if(num[j]<X) a++; else b++;}
    if(a<=b) cout<<a;
    else cout<<b;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
int main() {
  ll n,a,b;
  cin>>n>>a>>b;
  ll sum=a+b;
  ll div=n/sum;
  ll mod=n%sum;
  if(mod>=a)
    cout<<div*a+a;
  else
    cout<<div*a+mod;
}
 

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
#define P(p) cout<<(p)<<endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return
#define lb(v,n) lower_bound(v.begin(),v.end(),n)
#define ub(v,n) upper_bound(v.begin(),v.end(),n)
#define mae(v) max_element(v.begin(),v.end())
#define mie(v) min_element(v.begin(),v.end())
#define INF 0x7FFFFFFF
#define mod 1000000007
typedef long long ll;
////////////////////////////////////////////////////////////

int main(){
	int a,b;
	cin >> a >> b;
	if( a + b > 16 || a > 8 || b > 8)
		cout << ":(" << endl;
	else
		cout << "Yay!"  << endl;
	ret 0;
}

Measured memory_bytes: 256
n = int(input())
a = input().split()
b = input().split()
c = input().split()
count = 0
k = -100
for x in a:
  num = int(x)
  count += int(b[num-1])
  if k+1 == num:
    count += int(c[num-2])
  k = num
print(count)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int> b,a;
    for(int i=0;i<n-1;i++){
        int tmp;
        cin>>tmp;
        b.push_back(tmp);
    }
    for(int i=0;i<n;i++){
        a.push_back(0);
    }
    for(int i=0;i<n-1;i++){
        a[i]=b[i];
    }
    a[n-1]=b[n-2];

    for(int i=0;i<n-1;i++){
        if(b[i]<a[i+1]){
            a[i+1]=b[i];
        }
    }
    long long int sum=0;
    for(int i=0;i<n;i++){
        sum+=a[i];
    }
    cout << sum << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d", &x)
#define sz(v) (int) v.size()
#define pr(v) For(i, 0, sz(v)) {cout<<v[i]<<" ";} cout<<endl;
#define slld(x) scanf("%lld", &x)
#define all(x) x.begin(), x.end()
#define For(i, st, en) for(ll i=st; i<en; i++)
#define tr(x) for(auto it=x.begin(); it!=x.end(); it++)
#define fast std::ios::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define ll long long
#define int long long
#define mp make_pair
#define F first
#define S second
typedef pair<int, int> pii;
typedef vector<int> vi;
#define MOD 1000000007
#define INF 1000000000000000007LL

const int N = 100005;
 
// it's swapnil07 ;)
 
#ifdef SWAPNIL07
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
int begtime = clock();
#define end_routine() cout << "\n\nTime elapsed: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";
#else
#define endl '\n'
#define trace(...)
#define end_routine()
#endif


signed main()
{
    fast
    #ifdef SWAPNIL07
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    int n, m; cin>>n>>m;
    int v = 0;
    For(i, 0, m){
        int a; cin>>a;
        v+=a;
    }
    if(v > n){
        cout<<-1;
    }
    else{
        cout<<(n-v);
    }
    return 0;
}





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

int main() {
  long hh,ww,h,w,a=0;
  cin >> hh >> ww >> h >> w;
  vector<vector<long>> ans(hh,vector<long>(ww));
  for(long i=0;i<hh;i++) {
    for(long j=0;j<ww;j++) {
      if(i%h+j%w==0) ans[i][j]=999999999,a+=999999999;
      else if((i+1)%h+(j+1)%w==0) ans[i][j]=-1000000000,a-=1000000000;
    }
  }
  if(a>0&&h*w>1) {
    cout << "Yes" << endl;
    for(long i=0;i<hh;i++) {
      for(long j=0;j<ww;j++) cout << ans[i][j] << " ";
      cout << endl;
    }
  } else {
    cout << "No" << endl;
  }
}

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


void solve(long long N, long long K){
    int num = 1;
    for(size_t i = 0; i < N; i++)
    {
        if(num < K){
            num *= 2;
        }else{
            num += K;
        }
    }
    cout << num << endl;
    
}

int main(){
    long long N;
    scanf("%lld",&N);
    long long K;
    scanf("%lld",&K);
    solve(N, K);
    return 0;
}


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

ans = 0
for i in range(n):
  for j in range(21):
    if  (i+1)*(2**j) >= k:
      break
  ans += 1/(n * 2**j)
  
  if j == 0:
    break
    
ans += (n-i-1)/n
print(ans)

Measured memory_bytes: 2940
#include <iostream>
#include <stdio.h>
#include  <stdlib.h>
#include  <string.h>
using namespace std;
struct point
{
    int x,y;
}a[109],b[109];
bool line[109][109];
bool used[109];
int n;
int girl[109];
bool find(int x)
{
    int i,j;
    for (j=1; j<=n; j++)   //扫描每个妹子
        {
            if (line[x][j]==true && used[j]==false)
                //如果有暧昧并且还没有标记过(这里标记的意思是这次查找曾试图改变过该妹子的归属问题，但是没有成功，所以就不用瞎费工夫了）
                {
                    used[j]=1;
                    if (girl[j]==0 || find(girl[j]))
                        {
                            //名花无主或者能腾出个位置来，这里使用递归
                            girl[j]=x;
                            return true;
                        }
                }
        }
    return false;
}

int main()
{
    int all;
    scanf("%d",&n);
    all=0;
    for(int i=1; i<=n; i++)
        scanf("%d%d",&a[i].x,&a[i].y);
     for(int i=1; i<=n; i++)
        scanf("%d%d",&b[i].x,&b[i].y);
    memset(line,0,sizeof(line));
    for(int i=1; i<=n; i++)
        {
            for(int j=1; j<=n; j++)
                {
                    if(a[i].x<b[j].x&&a[i].y<b[j].y)
                        {
                            line[i][j]=true;
                        }
                }
        }
    memset(used,0,sizeof(used));
    for (int i=1; i<=n; i++)
        {
            memset(used,0,sizeof(used));    //这个在每一步中清空
            if (find(i)) all+=1;
        }

    printf("%d\n",all);
    return 0;
}


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

// int/long:		-2,147,483,648 - 2,147,483,647 (-2^31 <= int < 2^31)
// long/long long:	-9,223,372,036,854,775,808 - 9,223,372,036,854,775,807 (-2^63 <= long < 2^63)

// lower_bound(A.begin(), A.end(), N)
// upper_bound(...

// A.erase(unique(A.begin(), A.end()), A.end())

// bit: &/and, |/or, ^/xor, ~/not

// getline(cin, String)
// while (getline(cin, S)) {}

// cout <<fixed <<setprecision(10)

// priority_queue<int> q;
// priority_queue<int, vector<int>, less<int>> q; // Default: vector, less
// priority_queue<vector<int>, vector<vector<int>>, greater<vector<int>>> q;

// Graph
// Warshall-Floyd: Distance between each node, N^3
// Dijkstra: Distance from the start node, N^2
// DFS(Depth-First Search)

//
// Notes
//
// When specified less than N, try full scan.
// RE: empty vector
// Check Qs
// long/int
// xor -> count each bit
// Check values
// 	1,000,000 -> Loop
// 	100,000	-> vector(int:400KB, long:800KB) 

#define	INF (1<<30)
//1,073,741,824
//= 536,870,912 *2

#define	MOD 1000000007

#define	Rep0(i, n)	for (int i=0; i<n; i++)
#define	Rep1(i, n)	for (int i=1; i<=n; i++)
#define Sort(P)	sort(P.begin(), P.end())
#define Rev(P)	reverse(P.begin(), P.end())

int	main() {
	int N, R;
	cin >>N >>R;
	if (N<10)
		R +=100*(10-N);
	cout <<R <<endl;
	return 0;
}



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

ll n, m, q, ans = 0;
vector<vector<ll>> a;
void dfs(ll d, vector<ll> v) {
  if (d == n) {
    ll sum = 0;
    rep(i, q) {
      if (v[a[i][1]-1] - v[a[i][0]-1] == a[i][2])
        sum += a[i][3];
    }
    ans = max(ans, sum);
    return;
  }
  int i;
  if (d == 0) i = 1;
  else i = v[d-1];
  for (i; i <= m; i++) {
    v[d] = i;
    dfs(d+1, v);
  }
}

int main() {
  cin >> n >> m >> q;
  a = vector<vector<ll>>(q, vector<ll>(4));
  rep(i, q) rep(j, 4) cin >> a[i][j];
  vector<ll> v(n);
  dfs(0, v);
  cout << ans << endl;
  return 0;
}

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

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) (x).begin(), (x).end()
#define ll long long
#define ii pair<int,int>
#define vi vector<int>
#define vll vector<ll>
#define vii vector<ii>

const int maxn = 1e5+10;
const int mod = 1e9+7;

using namespace std;

int g[5][5];

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    for(int i=1;i<=3;++i){
        for(int j=1;j<=3;++j){
            cin>>g[i][j];
        }
    }
    int n,ans=0;
    cin>>n;
    for(int i=0,v;i<n;++i){
        cin >> v;
        for(int r=1;r<=3;++r){
            for(int c=1;c<=3;++c){
                if(g[r][c]==v){
                    g[r][c] = -1;
                }
            }
        }
        bool ok = true;
        for(int r=1;r<=3;++r){
            if(g[r][r]!=-1) ok=false;
        }
        if(ok) ans=1;
        ok=true;
        for(int r=3,c=1;r>=1;r--,++c){
            if(g[r][c]!=-1)
                ok=false;
        }
        if(ok)
            ans=1;
        for(int r=1;r<=3;++r){
            ok=true;
            for(int c=1;c<=3;++c){
                if(g[r][c]!=-1) ok =false;
            }
            if(ok)
                ans=1;
        }
        for(int c=1;c<=3;++c){
            ok = true;
            for(int r=1;r<=3;++r){
                if(g[r][c]!=-1)
                    ok=false;
            }
            if(ok)
                ans=1;
        }
    }
    if(ans)
        cout<<"Yes\n";
    else
        cout<<"No\n";
    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 N=sc.nextInt();	//Nマス
		int A=sc.nextInt();	//Aliceの位置
		int B=sc.nextInt();	//Borysの位置
		String ans;

		if((A-B-1)%2==0) ans="Borys";
		else ans="Alice";

		System.out.println(ans);

	}
}

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

int ceil(int s,int t){
	return (s+t-1)/t;
}

int main() {
	// your code goes here
	int n,k;cin>>n>>k;
	
	if(ceil(n,2)>=k){
		cout<<"YES"<<endl;
	}else{
		cout<<"NO"<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,K=MI()
    A=LI()
    A.sort()
    
    #0~Nまで逆元などを事前計算
    def cmb(n, r, mod):
        if (r < 0) or (n < r):
            return 0
        r = min(r, n - r)
        return (fact[n] * factinv[r] * factinv[n-r])%mod

    fact=[1,1]
    factinv=[1,1]
    inv=[0,1]

    for i in range(2, N + 1):
        fact.append((fact[-1] * i) % mod)
        inv.append((-inv[mod % i] * (mod // i)) % mod)
        factinv.append((factinv[-1] * inv[-1]) % mod)
        
    
    def calc(ii,a):
        # ii番目が最大となる時，それの寄与は？
        # 0~ii-1のii個からK-1個えらぶ
        temp=cmb(ii,K-1,mod)
        return (temp*a)%mod
    
    ans=0
    for i in range(N):
        ans+=calc(i,A[i])
        
    for i in range(N):
        A[i]*=-1
    A.sort()
    for i in range(N):
        ans+=calc(i,A[i])
        
    print(ans%mod)
        
    
    
    

main()


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

int main(){
  long long N;
  cin >> N;
  
  if(N==1){
    cout << 0 << endl;
    return 0;
  }
  
  map<long long,long long> M;
  for(long long i=2;i*i<=N;i++){
    while(N%i==0){
      M[i]++;
      N /= i;
    }
  }
  if(N!=1) M[N]++;
  
  long long ans=0;
  for(auto p : M){
    long long x = p.second;
    for(int i=1;;i++){
      if(x>=i){
        ans++;
        x -= i;
      }
      else break;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3632
#include<iostream>
using namespace std;
int main(){
    int a1,a2,a3;
    int b1,b2,b3;
    cin >> a1;
    cin >> b1;
    cin >> a2;
    cin >> b2;
    cin >> a3;
    cin >> b3;
    int i,j;
    int city[6] = {a1,a2,a3,b1,b2,b3};
    int count = 0;
    int flug = 0;
    for(i = 1; i < 5; i++){
        for(j = 0;j<6;j++){
            if(city[j] == i){
                count++;
            }
        }
        if(count >= 3){
            cout << "NO" << "\n";
            flug = 1;
            break;
        }
        count = 0;
    }
    if(flug == 0) cout << "YES" << "\n";
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>
#include <deque>
#include <list>
using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
#define LNF __LONG_LONG_MAX__
const ll MOD = 1000000007;
const int MAX = 200000;

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;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//最大公約数
long long gcd(long long x, long long y){
    if(y==0) return x;
    else return gcd(y,x%y);
}
//最小公倍数
long long lcm(long long x, long long y){
    return x / gcd(x, y) * y;
}
// nが大きく,kが10^7程度の時の二項係数
long long com[200005];
void combination(long long n,long long k){
    com[0] = 1;
    for(int i=1;i<=k;i++){
        com[i] = (com[i-1]*(n-i+1)%MOD)*modinv(i,MOD)%MOD;
    }
}

int main(){
    int N,X; cin>> N >> X;
    int L;
    int D=0;
    int cnt=1;
    for(int i=0;i<N;i++){
        cin >> L;
        D += L;
        if(D>X) break;
        cnt++;
    }
    cout << cnt << endl;
    return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,T;
  cin >> N >> T;
  vector<int> c(N);
  for(int i=0;i<N;i++){
    int d,t;
    cin >> d >> t;
    if(T>=t)c[i]=d;
    else c[i]=1001;
  }
  sort(c.begin(),c.end());
  if(c[0]==1001)cout << "TLE";
  else cout <<c[0];
}

Measured memory_bytes: 256
from operator import itemgetter

N = int(input())
xyh = [list(map(int,input().split())) for _ in range(N)]
xyh.sort(key=itemgetter(2))
xyh.reverse()
for Cx in range(101):
    for Cy in range(101):
        H_MAX = -1
        H = -1
        for i in range(N):
            x = xyh[i][0]
            y = xyh[i][1]
            h = xyh[i][2]
            if h > 0 and i == 0:
                H = h + abs(x-Cx) + abs(y-Cy)
            elif h > 0:
                if H == h + abs(x-Cx) + abs(y-Cy):
                    pass
                else:
                    break
            elif h < 0 and i == 0:
                H_MAX = abs(x-Cx) + abs(y-Cy)
                if H_MAX == 0:
                    break
            else:
                if H_MAX == -1:
                    if H <= abs(x-Cx) + abs(y-Cy):
                        pass
                    else:
                        break
                else:
                    H_MAX = abs(x-Cx) + abs(y-Cy)
                    if H_MAX == 0:
                        break
            if i == N-1:
                print(Cx,Cy,max(H,H_MAX))
                exit()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define all(v) (v).begin(), (v).end()
#define lp(i, n) for (int i = 0; i < (n) ; ++i)
#define sz(v) (ll)(v).size()
#define int long long
#define mod 1000000007

void solve() {
        int a, b; cin >> a>> b;
        double x= 0.08, y= 0.1;
        double tx= ceil(a/ x), ty= ceil(b/ y);
        double txx= (a+ 1)/ x, tyy= (b+ 1)/ y;
        for (int i= tx; i< txx; i++) {
                for (int j= ty; j< tyy; j++) {
                        if (i== j) {
                                cout << i<< "\n";
                                return;
                        }
                }
        }
        cout << "-1";
        return;
}

int32_t main(){
ios::sync_with_stdio(0), cin.tie(NULL), cout.tie(NULL);
        int t = 1;
        //cin >> t;
        while ( t-- ) {
                solve();
        }
return 0;
}


Measured memory_bytes: 256
N, K = map(int, input().split())
A = list(map(int, input().split()))
MOD = 10 ** 9 + 7

### Combination Table ###
g1 = [1, 1]      # 元テーブル
g2 = [1, 1]      # 逆元テーブル
inverse = [0, 1] # 逆元テーブル計算用テーブル

def comb(n, r, mod):
  if r < 0 or r > n:
    return 0
  r = min(r, n - r)
  return g1[n] * g2[r] * g2[n - r] % mod

for i in range(2, N + 1):
  g1.append((g1[-1] * i) % MOD)
  inverse.append((-inverse[MOD % i] * (MOD // i) ) % MOD)
  g2.append((g2[-1] * inverse[-1]) % MOD)
#########################
  
A.sort()

answer = 0
for i in range(N):
  if i > N - K:
    break
  answer = (answer + (A[N - i - 1] - A[i]) * comb(N - 1 - i, K - 1, MOD)) % MOD

print(answer)


Measured memory_bytes: 77608
import sys
n = int(sys.stdin.readline())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

score = 0
tmp =-100
for a in A:
    score+=B[a-1]
    if tmp +1 ==a:
        score+=C[tmp-1]
    tmp = a

print(score)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin>>S;
  if(S.at(2)==S.at(3)){
    if(S.at(4)==S.at(5)){
      cout<<"Yes"<<endl;
      return 0;
    }
  }
  cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;

int main() {
    int h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    int res = h2 * 60 + m2 - h1 * 60 - m1 - k;
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 3636
H,W,D=map(int,input().split());S=H*W;A=[map(int,input().split())for _ in range(H)];d=[0]*S;e=[0]*S
for i,l in enumerate(A):
 for j,v in enumerate(l):d[v-1]=(i,j)
for i in range(S):
 if i>=D:e[i]=sum(abs(p-q)for p,q in zip(d[i-D],d[i]))+e[i-D]
for i in range(int(input())):l,r=map(int,input().split());print(e[r-1]-e[l-1])

Measured memory_bytes: 16288
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <array>
#include <map>
#include <set>
#include <string>
#include <deque>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <assert.h>
#include <sstream>
typedef long long ll;
#define vi vector<int>
using namespace std;

int dX[4] = { 0, 0, -1, 1 };
int dY[4] = { -1, 1, 0, 0 };

int factors(int x) {
	int cnt = 0;
	for (int i = 1; i * i <= x; i++) {
		if (x % i == 0) {
			if (i * i == x) {
				cnt += 1;
			}
			else {
				cnt += 2;
			}
		}
	}
	return cnt;
}

int main() {
	int N;
	cin >> N;
	ll ans = 0;
	for (int i = 1; i < N; i++) {
		ans += factors(i);
	}
	cout << ans << '\n';
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define maxn 30
#define N 1100000
#define ll long long
#define mod 1000000007
using namespace std;
int head[maxn], nxt[maxn * 2], a[maxn * 2], edge, id[maxn * 2], path[maxn][maxn];
int sum[N], f[N], g[N], node[N], fac[N], inv[N];
int calc(int a, int k)
{
	int ans = 1;
	while (k)
	{
		if (k % 2) ans = (ll)ans * a % mod;
		a = (ll)a * a % mod;
		k /= 2;
	}
	return ans;
}
void create(int u, int v, int t)
{
	edge++; a[edge] = v; nxt[edge] = head[u]; head[u] = edge; id[edge] = t;
}
void get_val(int u, int fa, int rt, int cur)
{
	path[u][rt] = cur;
	for (int i = head[u]; i; i = nxt[i])
	{
		int v = a[i];
		if (v != fa) get_val(v, u, rt, cur + (1 << id[i] - 1));
	}
}
void get_sum(int *a, int n)
{
	for (int l = 2; l <= n; l *= 2)
	{
		int m = l / 2;
		for (int *p = a; p != a + n; p += l)
			for (int i = 0; i <= m - 1; i++)
				p[i + m] = (p[i + m] + p[i]) % mod;
	}
}
void get_trans(int pre, int nxt, int s, int sum)
{
	int fa = (ll)g[pre] * fac[s + sum] % mod * inv[s] % mod;
	g[nxt] = (g[nxt] + fa) % mod;
	int tmp = (ll)f[pre] * fac[s + sum + 1] % mod * inv[s + 1] % mod;
	tmp = (tmp + (ll)node[nxt] * fa % mod) % mod;
	f[nxt] = (f[nxt] + tmp) % mod;
}
int main()
{
	int n, m;
	scanf("%d%d", &n, &m);
	fac[0] = 1;
	for (int i = 1; i <= m + 1; i++)
		fac[i] = (ll)fac[i - 1] * i % mod;
	inv[m + 1] = calc(fac[m + 1], mod - 2);
	for (int i = m; i >= 0; i--)
		inv[i] = inv[i + 1] * ((ll)i + 1) % mod;
	for (int i = 1; i <= m; i++)
	{
		int u, v;
		scanf("%d%d", &u, &v);
		if (i <= n - 1)
		{
			create(u, v, i);
			create(v, u, i);
		}
		else sum[path[u][v]]++;
		if (i == n - 1)
		{
			for (int j = 1; j <= n; j++)
				get_val(j, 0, j, 0);
		}
	}
	get_sum(sum, 1 << n - 1);
	f[0] = 0; g[0] = 1;
	int full = (1 << n - 1) - 1;
	for (int i = 0; i <= full; i++)
		for (int j = 1; j <= n - 1; j++)
			node[i] += (i >> j - 1) & 1;
	for (int i = 0; i <= full; i++)
		for (int j = 1; j <= n - 1; j++)
			if (((i >> j - 1) & 1) == 0)
			{
				int nxt = i + (1 << j - 1), tot = m - (n - 1) - sum[full - i] + node[i];
				get_trans(i, nxt, tot, sum[full - i] - sum[full - nxt]);
			}
	printf("%d\n", f[full]);
	return 0;
}

Measured memory_bytes: 18688
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
typedef long long ll;
template<class T>inline bool chmax(T &a, const T &b){if(a < b){a = b; return 1;}return 0;}
template<class T>inline bool chmin(T &a, const T &b){if(a > b){a = b; return 1;}return 0;}
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int x;
  cin >> x;
  cout << (int)pow(x, 3) << endl;
}


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

using namespace std;
using ll = long long;

const int INF = 1e9;
const double PI = acos(-1.0);
const ll MOD = 1e9 + 7;

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define debug(x) cout << #x << ": " << x << endl;
#define popcnt __builtin_popcount


int main() {
    int H, W;
    cin >> H >> W;
    vector<char> grid[10];
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            char c;
            cin >> c;
            grid[i].push_back(c);
        }
    }

    int cnt = 0;
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            if(grid[i][j]=='#')
                cnt++;
        }
    }

    if(cnt==H+W-1)
        puts("Possible");
    else{
        puts("Impossible");
    }

    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;
public class Main {
    public static void main(String[] args) throws Exception{
        
        Scanner sc = new Scanner(System.in);
        int tests;
        int n;
        int m;
      int l;
        
        
       
        n = sc.nextInt(); m = sc.nextInt();l=sc.nextInt();
       System.out.print(l + " " + n + " " + m);
     
       
       
        
  }
}
        


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

typedef long long int ll;
typedef long double ld;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define REPR(i,n) for(int i=n-1;i>=0;i--)
#define FORR(i,n,m) for(int i=n-1;i>=m;i--)
#define ARR(array) for(int i=0;i<array.size();i++)
#define all(in) (in).begin(),(in).end()
#define ALL(in,K) (in),(in)+(K)

#define INF 1e18
#define MOD 1000000007
#define SIZE 10005
#define PI 	3.14159265358979323846

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; } //最小公倍数

char input(){
  char a;
  cin >> a;
  return a;
}

int main(){
  string s;
  cin >> s;
  if(s=="Sunny")cout << "Cloudy" << endl;
  if(s=="Cloudy")cout << "Rainy" << endl;
  if(s=="Rainy")cout << "Sunny" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_map>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>
#include<iomanip>
#include<bitset>

using namespace std;

#define ll long long int

ll const MOD = 1000000007;
ll const INF = (long long int)1 << 61;

ll mypow(ll x,ll n){
    ll ret = 1;
    while(n > 0){
        if(n&1){
            ret = (ret*x)%MOD;
        }
        x = (x*x)%MOD;
        n >>= 1;
    }
    return ret;
}

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

    vector<ll> a(n);
    for(int i = 0; i < n; i++){
        cin >> a[i];
        if(a[i] > i+1){
            cout << "-1" << endl;
            return 0;
        }
    }
    vector<bool> used(n,false);

    stack<ll> ans;

    for(int i = 0; i < n; i++){
        ll pass = 0;
        ll tmp = -1;
        for(int j = 0; j < n; j++){
            if(used[j]){
                pass++;
            }else if(j + 1 - pass == a[j]){
                tmp = j;
            }
        }
        ans.push(a[tmp]);
        used[tmp] = true;
    }

    while(!ans.empty()){
        cout << ans.top() << endl;
        ans.pop();
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <cctype>
#include <cstring>
#define rep(i, m, n) for (int i = m; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define ll long long
#define ull unsigned long long
#define push(a) push_back(a)
#define pop(a) pop_back(a)
#define debug(x) cout << #x << ": " << x << endl
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

ll n, sum=0;
ll p[100005] = {};
ll ans = 0;

int f(ll n) {
    while(n!=0){
        sum+=n%10;
        n/=10;
    }
    return sum;
}

int main()
{
    cin >> n;
    if(n%f(n)==0){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
}

Measured memory_bytes: 256
#include <ios>
#include <iomanip>
#include <iostream>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>

using namespace std;
typedef long long int ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define INF (1e9)
#define PI (acos(-1))
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl

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; }
typedef pair <ll,ll> P;

int main()
{
    ll N, M, K;
    cin >> N >> M >> K;
    rep(k, N+1) {
        rep(l, M+1) {
            if (k*(M-l) + l*(N-k) == K) {
                yes;
                return 0;
            }
        }
    }
    no;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vector<VecP>;
template <typename T>
using Vec1 = vector<T>;
template <typename T>
using Vec2 = vector<Vec1<T> >;
#define REP(i, m, n) for(ll i = (m); (i) < (n); ++(i))
#define REPN(i, m, n) for(ll i = (m); (i) <= (n); ++(i))
#define REPR(i, m, n) for(ll i = (m)-1; (i) >= (n); --(i))
#define REPNR(i, m, n) for(ll i = (m); (i) >= (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}
template <typename T>
ll pow2(const T n){return (1LL << n);}
template <typename T>
void cosp(const T n){cout << n << ' ';}
void co(void){cout << '\n';}
template <typename T>
void co(const T n){cout << n << '\n';}
template <typename T1, typename T2>
void co(pair<T1, T2> p){cout << p.fs << ' ' << p.sc << '\n';}
template <typename T>
void co(const Vec1<T> &v){for(T i : v) cosp(i); co();}
template <typename T>
void co(initializer_list<T> v){for(T i : v) cosp(i); co();}
template <typename T>
void ce(const T n){cerr << n << endl;}
void sonic(){ios::sync_with_stdio(false); cin.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
constexpr int INF = 1e9+1;
constexpr ll LINF = 1e18+1;
constexpr ll MOD = 1e9+7;
// constexpr ll MOD = 998244353;
constexpr ld EPS = 1e-11;
const ld PI = acos(-1);

Vec v, w;
VecB fin;
Vec2<ll> dp;

ll f(ll m, ll l){
	// co({m, l});
	if (l < 0) return -LINF;
	if (m >= 512) return max(f(m / 2, l), f(m / 2, l - w[m]) + v[m]);
	if (!fin[m / 2]) f(m / 2, l);
	if(!fin[m]){
		rep(i, 100005) dp[m][i] = dp[m / 2][i];
		rep(i, 100005) if(i - w[m] >= 0) chmax(dp[m][i], dp[m / 2][i - w[m]] + v[m]);
		fin[m] = true;
	}
	return dp[m][l];
}

int main(void){
	ll n;
	cin >> n;
	v.resize(n + 1);
	w.resize(n + 1);
	repn(i, n) cin >> v[i] >> w[i];

	fin.assign(512, false);
	fin[0] = true;
	dp.resize(512);
	rep(i, 512) dp[i].assign(100005, 0);

	ll q;
	cin >> q;
	rep(i, q){
		ll m, l;
		cin >> m >> l;
		co(f(m, l));
	}

	return 0;
}


Measured memory_bytes: 408744
#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<queue>
#define maxn 1000003
using namespace std;
struct A{
	char color[maxn];
	int num;
};
char tcolor[maxn] = {0};
int main(){
	cin >> tcolor;
	for(int i = 0; i < strlen(tcolor); i++){
		cout << "x";
	}
	return 0;
} 

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

int main() {
  int N, A, B;
  string S;
  cin >> N >> A >> B >> S;
  int pass = A+B;
  
  int count_a = 0;
  int count_b = 0;
  
  for (int i = 0; i < N; i++) {
    char s = S[i];
    if (s == 'a') {
      if ((count_a + count_b) < pass) {
        cout << "Yes" <<endl;
        count_a++;
      }
      else {
        cout << "No" << endl;
      }
    }
    else if (s == 'b') {
      if ((count_a + count_b) < pass && count_b+1 <= B) {
        cout << "Yes" << endl;
        count_b++;
      }
      else {
        cout << "No" << endl;
      }
    }
    else {
      cout << "No" << endl;
    }
  }
}

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

int main() {
  string S;
  cin >> S;
  if(S.size()%2 == 1){
    cout << "No" << endl;
    return 0;
  }
  for(int i=0; i<S.size(); i++){
    if(i%2==0){
      if(S.at(i) != 'h'){
        cout << "No" << endl;
        return 0;
      }
    }
    
    if(i%2==1){
      if(S.at(i) != 'i'){
        cout << "No" << endl;
        return 0;
      }
    }
  }
  cout << "Yes" <<endl;
}

// int型の2次元配列(3×4要素の)の宣言
  //vector<vector<int>> data(3, vector<int>(4));
 
  // 入力 (2重ループを用いる)
  //for (int i = 0; i < 3; i++) {
    //for (int j = 0; j < 4; j++) {
      //cin >> data.at(i).at(j);
   // }
  //}


Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author KharYusuf
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BRollerCoaster solver = new BRollerCoaster();
        solver.solve(1, in, out);
        out.close();
    }

    static class BRollerCoaster {
        public void solve(int testNumber, FastReader s, PrintWriter w) {
            int n = s.nextInt(), k = s.nextInt(), ans = 0;
            for (int i = 0; i < n; i++) if (s.nextInt() >= k) ans++;
            w.println(ans);
        }

    }

    static class FastReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastReader.SpaceCharFilter filter;

        public FastReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {

            if (numChars == -1)
                throw new InputMismatchException();

            if (curChar >= numChars) {

                curChar = 0;

                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (numChars <= 0)
                    return -1;
            }

            return buf[curChar++];
        }

        public int nextInt() {

            int c = read();

            while (isSpaceChar(c))
                c = read();

            int sgn = 1;

            if (c == '-') {
                sgn = -1;
                c = read();
            }

            int res = 0;

            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();

                res *= 10;
                res += c - '0';
                c = read();
            }
            while (!isSpaceChar(c));

            return res * sgn;
        }

        public boolean isSpaceChar(int c) {

            if (filter != null)
                return filter.isSpaceChar(c);

            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }
}



Measured memory_bytes: 22228
#include <stdio.h>

int main(){
   long n,i;
   char ans[20];

   scanf("%ld",&n);
   for (i=0;n>0;i++) {
      n--;
      ans[i]='a'+n%26;
      n/=26;
   }
   for (i--;i>=0;i--) printf("%c",ans[i]);
   puts("");
   return 0;
}

Measured memory_bytes: 1660
#include <iostream>

using namespace std;

const int MAX_N = 1 << 19;
const int MAX_LG = 20;

pair<int, int> dp [MAX_N][MAX_LG];
int ans [MAX_N];
int arr [MAX_N];

pair<int, int> merge (pair<int, int> p, pair<int, int> q) {
  if (p.first < q.first) {
    swap(p, q);
  }
  return make_pair(p.first, max(p.second, q.first));
}

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

  for (int i = 0; i < 1 << length; i++) {
    cin >> arr[i];
  }

  for (int i = 0; i < 1 << length; i++) {
    dp[i][0] = make_pair(arr[i], -1);
  }

  for (int k = 1; k <= length; k++) {
    for (int i = 0; i < 1 << length; i++) {
      if (i & (1 << (k - 1))) {
        dp[i][k] = merge(dp[i][k - 1], dp[i - (1 << (k - 1))][k - 1]);
      } else {
        dp[i][k] = dp[i][k - 1];
      }
    }
  }

  for (int i = 1; i < 1 << length; i++) {
    ans[i] = max(ans[i - 1], dp[i][length].first + dp[i][length].second);
    cout << ans[i] << '\n';
  }
}


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

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

    long long ans = 0;
    for (int i = 0; i < N - K; i ++) {
        ans += A[i];
    }
    
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 1024
#include <cstdio>
using namespace std;
int main(void){
    // Here your code !
    int x;
    scanf("%d", &x);
    int hour = x/3600;
    int minute = x%3600/60;
    int second = x%3600%60;
    printf("%d:%d:%d\n", hour, minute, second);
    return 0;
}

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

int main() {
  int a, b;
  scanf("%d %d", &a, &b);
  for(int i = 1; i < 1010; i++) {
    if(i * 8 / 100 == a && i / 10 == b) {
      printf("%d\n", i);
      return 0;
    }
  }
  printf("-1\n");
}

Measured memory_bytes: 256
# coding: utf-8
# Your code here!
N=int(input())

l=[]
for i in range(N):
    l.append(list(map(int,input().split())))

dis=[[0]*(N) for i in range(N-1)]
#print(dis)

for i in range(N-1):
    for j in range(i+1,N):
        if l[i][0]-l[j][0]>0:
            dis[i][j]=[(l[i][0]-l[j][0]),(l[i][1]-l[j][1])]
        elif l[i][0]-l[j][0]<0:
            dis[i][j]=[-(l[i][0]-l[j][0]),-(l[i][1]-l[j][1])]
        else:
            dis[i][j]=[(l[i][0]-l[j][0]),abs(l[i][1]-l[j][1])]

temp=0
for i in range(N-1):
    for item in dis[i]:
        if item!=0:
            temp=max(sum(x.count(item) for x in dis),temp)

#print(l)
#print(dis)
print(N-temp)



Measured memory_bytes: 3188
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner scan=new Scanner(System.in);
        int n=scan.nextInt();
        int[] a=new int[n];
        
            for(int i=0; i<n; i++)
                a[i]=scan.nextInt();
            for(int i=n-1; i>0; i--)
                System.out.print(a[i]+" ");
        
            System.out.println(a[0]);
    }
}


Measured memory_bytes: 26236
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <ctime>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <numeric>
#include <list>

using namespace std;

#ifdef _MSC_VER
#define __typeof__ decltype

template <class T>
int __builtin_popcount(T n) { return n ? 1 + __builtin_popcount(n & (n - 1)) : 0; }
#endif

#define foreach(it, c) for (__typeof__((c).begin()) it=(c).begin(); it != (c).end(); ++it)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define popcount __builtin_popcount

#define rep(i, n) for (int i = 0; i < n; ++i)

template <class T> void max_swap(T& a, const T b) { a = max(a, b); }
template <class T> void min_swap(T& a, const T b) { a = min(a, b); }

const double EPS = 1e-10;
typedef long long ll;
typedef pair<int, int> pint;


struct Range
{
	Range() {}
	Range(int top, int n) : top(top), n(n) {}
	pair<Range, Range> split(int num)
	{
		return make_pair(Range(top, num), Range(top + num, n - num));
	}
	int top, n;
};
queue<Range> pile;
Range a[100000], b[500000], c[500000];
int size;
int next(int& sum, int until_sum, Range* a)
{
	int j = 0;
	for (; sum < until_sum; )
	{
		if (sum + pile.front().n <= until_sum)
		{
			a[j++] = pile.front();
			sum += pile.front().n;
			pile.pop();
		}
		else
		{
			pair<Range, Range> t = pile.front().split(until_sum - sum);
			a[j++] = t.first;
			sum = until_sum;

			pile.front() = t.second;
			break;
		}
	}
	return j;
}
int main()
{
	int n, m, p, q, r;
	while (scanf("%d", &n), n)
	{
		scanf("%d%d%d%d", &m, &p, &q, &r);

		pile = queue<Range>();
		pile.push(Range(1, n));
		while (m--)
		{
			int x, y;
			scanf("%d%d", &x, &y);

			int sum = 0;
			int a_size = next(sum, x, a);
			int b_size = next(sum, y, b);
			
			rep (i, b_size)
				pile.push(b[i]);
			rep (i, a_size)
				pile.push(a[i]);
		}

		int i = 0, sum = 0;
		int a_size = next(sum, p - 1, a);
		int b_size = next(sum, q, b);

		int res = 0;
		rep (i, b_size)
			res += min(b[i].n, max(0, r - (b[i].top - 1)));
		
		printf("%d\n", res);
	}
}

Measured memory_bytes: 1064
x = gets.to_i
flag = 0
a = b = 0
while flag == 0
  d = a**5 - x
  tmp = (d**(1/5.0)).abs
  #puts "#{a} #{d} #{tmp} #{tmp.floor}"
  if d - (tmp.abs.floor)**5 == 0
    flag = 1
    b = tmp.abs.floor
  elsif d + (tmp.abs.floor)**5 == 0
    flag = 1
    b = tmp.abs.floor * (-1)
  else
    a += 1
  end
end
puts "#{a} #{b}"

Measured memory_bytes: 14692