akhauriyash/Code-Regression huggingface dataset:
//
//  keyence2019_c.cpp
//  Competitive programming
//
//  Created by idaten on 2019/05/08.
//  Copyright © 2019 idaten. All rights reserved.
//

#include "bits/stdc++.h"
using namespace std;
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define put(a) cout<<a<<"\n"
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){if(a>b){a=b;return 1;}return 0;}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){if(a<b){a=b;return 1;}return 0;}

int main(){
    int n;
    cin >> n;
    vector<ll> a(n);
    vector<ll> b(n);
    vector<ll> d(n,0);
    ll sa = 0;
    REP(i,n){
        cin >> a[i];
        sa += a[i];
    }
    ll sb = 0;
    ll ds = 0;
    int res = 0;
    REP(i,n){
        cin >> b[i];
        sb += b[i];
        if(a[i]>=b[i]){
            d[i] = a[i]-b[i];
        }else{
            res++;
            ds += b[i]-a[i];
        }
    }
    if(sb>sa){
        put(-1);
        return 0;
    }
    sort(all(d),greater<>());
    for(int i=0;i<n&&ds>0;++i){
        ds-=d[i];
        res++;
    }
    put(res);
    return 0;
}


Measured memory_bytes: 2560
# -*- coding: utf-8 -*-
import sys 
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
MOD = 998244353
N, S = map(int, readline().split())
A = list(map(int,readline().split()))
U = 3010
f = np.zeros(U,np.int64)
ans = 0
for a in A:
    f[0] += 1
    f[a:] += f[:-a].copy()
    f %= MOD
    ans += f[S]
ans %= MOD
print(ans)

Measured memory_bytes: 27500
//minamoto
#include<bits/stdc++.h>
#define R register
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmax(T&a,const T&b){return a<b?a=b,1:0;}
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
using namespace std;
char buf[1<<21],*p1=buf,*p2=buf;
inline char getc(){return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++;}
int read(){
    R int res,f=1;R char ch;
    while((ch=getc())>'9'||ch<'0')(ch=='-')&&(f=-1);
    for(res=ch-'0';(ch=getc())>='0'&&ch<='9';res=res*10+ch-'0');
    return res*f;
}
int read(char *s){
    R int len=0;R char ch;while(((ch=getc())>'9'||ch<'0'));
    for(s[++len]=ch;(ch=getc())>='0'&&ch<='9';s[++len]=ch);
    return s[len+1]='\0',len;
}
double readdb()
{
    R double x=0,y=0.1,f=1;R char ch;
    while((ch=getc())>'9'||ch<'0')(ch=='-')&&(f=-1);
    for(x=ch-'0';(ch=getc())>='0'&&ch<='9';x=x*10+ch-'0');
    for(ch=='.'&&(ch=getc());ch>='0'&&ch<='9';x+=(ch-'0')*y,y*=0.1,ch=getc());
    return x*f;
}
char sr[1<<21],z[20];int C=-1,Z=0;
inline void Ot(){fwrite(sr,1,C+1,stdout),C=-1;}
void print(R int x){
    if(C>1<<20)Ot();if(x<0)sr[++C]='-',x=-x;
    while(z[++Z]=x%10+48,x/=10);
    while(sr[++C]=z[Z],--Z);sr[++C]='\n';
}
const int N=205,M=5e5+5;
struct eg{int v,nx;}e[M];int head[N],tot;
inline void add(R int u,R int v){e[++tot]={v,head[u]},head[u]=tot;}
char s[N];int vis[N],ins[N],col[N],q[N],cnt,tim,n,mx,fl;
void dfs(int u,int d){
	col[u]=d,ins[u]=1;
//	printf("qwq %d %d %d\n",u,d,col[u]);
	go(u)if(!ins[v])dfs(v,d^1);
		else if(col[v]!=(d^1))fl=1;
}
void bfs(R int s){
	R int h=1,t=0,u;
	++tim,q[++t]=s,vis[s]=tim,col[s]=1;
	while(h<=t){
		u=q[h++];
		go(u)if(vis[v]!=tim)vis[v]=tim,col[v]=col[u]+1,q[++t]=v;
			else assert(abs(col[u]-col[v])==1);
	}
	cmax(mx,col[q[t]]);
}
int main(){
	scanf("%d",&n);
	fp(i,1,n){
		scanf("%s",s+1);
		fp(j,1,n)if(s[j]=='1')add(i,j);
	}
	dfs(1,0);if(fl)return puts("-1"),0;
	fp(i,1,n)bfs(i);
	printf("%d\n",mx);
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include<random>
#include<math.h>
#include<limits.h>
#include<iterator>
#include<queue>
#include<functional>
#define rep(i,a) for(int i=0;i<a;i++)
#define nrep(i,a,b) for(int i=a;i<b;i++)
#define mrep(i,a) for(int i=a;i>=0;i--)
#define ll long long
#define vl vector<ll> 
#define vvl vector<vector<ll> > 
#define vb vector<bool> 
#define vvb vector<vector<bool> > 
#define INF 11234567890123456789
using namespace std;

int main(){
	string s; cin >> s;
	cout << (s[0] == s[2] ? "Yes" : "No") << endl;
	return 0;
}

Measured memory_bytes: 256
//~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define shandom_ruffle random_shuffle

using ll=long long;
const int d=21;
const int nax=(1<<d);
using pii=pair<int,int>;

int n, k;

char wcz[nax];
vector <int> tab[d];

struct S
{
	int m;
	vector <int> trz[d];
	int licz()
	{
		int ret=0;
		for (int i=0; i<=m; i++)
			for (int j=0; j<(1<<i); j++)
				ret+=trz[i][j];
		return ret;
	}
};

pii wyn;

void rek(pii v, S &zbior)
{
	if (zbior.licz()<k)
		return;
	debug() << v;
	if (v.first>wyn.first || (v.first==wyn.first && v.second<wyn.second))
		wyn=v;
	if (!zbior.m)
		return;
	S now[2];
	int mam=zbior.m;
	for (int i=0; i<2; i++)
	{
		now[i].m=mam-1;
		for (int j=0; j<=mam-1; j++)
			now[i].trz[j].resize(1<<j, 0);
	}
	for (int i=0; i<2; i++)
	{
		for (int j=0; j<=zbior.m; j++)
		{
			for (int l=0; l<(1<<j); l++)
			{
				int d=j;
				int w=l;
				while(d>=0)
				{
					if ((w&1)==i)
					{
						w/=2;
						d--;
						break;
					}
					d--;
					w/=2;
				}
				if (d>=0)
					now[i].trz[d][w]+=zbior.trz[j][l];
			}
		}
	}
	for (int h=0; h<2; h++)
		rek({v.first+1, v.second+(h<<v.first)}, now[h]);
}

int rev(int v, int d)
{
	int ret=0;
	while(d--)
	{
		ret=(ret*2+(v&1));
		v>>=1;
	}
	return ret;
}

int main()
{
	scanf("%d%d", &n, &k);
	for (int i=0; i<=n; i++)
	{
		scanf("%s", wcz);
		for (int j=0; j<(1<<i); j++)
			tab[i].push_back(wcz[j]-'0');
	}
	S start;
	start.m=n;
	for (int i=0; i<=n; i++)
		start.trz[i]=tab[i];
	rek({0, 0}, start);
	debug() << wyn;
	for (int i=0; i<wyn.first; i++)
		printf("%d", (wyn.second&(1<<(wyn.first-1-i)))>0);
	printf("\n");
	return 0;
}


Measured memory_bytes: 36076
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double PI = acos(-1);

int main() {
  cout << fixed << setprecision(20);
  int A,B,H,M;
  cin >> A >> B >> H >> M;
  double RA = ((double) (H * 60 + M) / 2);
  double TA = RA * (PI / 180);
  double AX = A * sin(TA);
  double AY = A * cos(TA);
  double RB = M * 6;
  double TB = RB * (PI / 180); 
  double BX = B * sin(TB);
  double BY = B * cos(TB);
  cout << sqrt((AX-BX) * (AX-BX) + (AY-BY) * (AY-BY)) << endl;
}


Measured memory_bytes: 4100
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define mp make_pair
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define rep(i, a, b) for (int i = (a); i < (b); ++i)
std::mt19937 rng((int) std::chrono::steady_clock::now().time_since_epoch().count());
using namespace std;

// #define int long long
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
ll mod = (1000000007LL);
inline ll Mod(ll a, ll b){return (a%b);}
inline ll poww(ll a, ll b){ll res = 1;while (b > 0){if(b & 1) res = (res * a)%mod;a = (a * a)%mod;b >>= 1;}return res;}
ll gcd (ll a, ll b) { while (b) { a %= b,swap(a, b);}return a;}
void read(vector<int> &w, int n){w.resize(n);for(int i = 0; i < n; i++) cin>>w[i];}
void print(vector<int> &w){for(int i =0; i < sz(w); i++){if(i == sz(w) - 1) cout<<w[i]<<"\n";else cout<<w[i]<<" ";}}
int prodmod(vector<int> w);
int summod(vector<int> w);
///CUIDADO COM MAXN
#define N 300050

int n, m, q, k, v[N], ans;
pii w[N];
string s;
int mat[10][10];
int32_t main(){
	ios::sync_with_stdio(false); cin.tie(0);
	cin>>n>>m>>k;
	int tot=0;
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			char c;
			cin>>c;
			if(c=='#') mat[i][j]=1, tot++;
			// cin>>mat[i][j];
		}
	}
	for(int mask=0; mask<(1<<n); mask++){
		for(int mask2=0;mask2 <(1<<m);mask2 ++){
			int qtd=tot;
			for(int i=0;i<n;i++){
				for(int j=0;j<m;j++){
					if(((mask&(1<<i)) or (mask2&(1<<j))) and mat[i][j]==1)
						qtd--;
				}
			}
			if(qtd==k)ans++;
		}
	}
	cout<<ans<<"\n";
}
/*
    CUIDADO COM MAXN, MOD, OVERFLOW 
    >Colocar (>DEFINE INT LONG LONG<) no inicio do template
    >mod = (1e9 + 7), por padrao (NAO ESQUECER DE ALTERAR)
    >NAO ESQUECER DEFINE INT LONG LONG
    > N = 1 ? 
*/
int summod(vector<int> w){int curr=0;for(int i=0;i<sz(w); i++){curr = (curr+w[i])%mod;if(curr<0)curr+=mod;}return curr;}
int prodmod(vector<int> w){int curr = 1;
for(int i = 0; i < sz(w); i++){if(w[i] >= mod) w[i] %= mod;curr = (curr * w[i]) % mod;if(curr < 0) curr += mod;}return curr;}

Measured memory_bytes: 3632
#include <iostream>

int main(){
    int n, a, b;
    std::cin >> n >> a >> b;

    if (n * a < b)
    {
        std::cout << n * a << std::endl;
    }
    else
    {
        std::cout << b << std::endl;
    }
    
    return 0;
}

Measured memory_bytes: 3552
#include<iostream>
#include<algorithm>
#include<vector>
#include<cmath>
#include<complex>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef complex<double> P;
typedef vector<P> G;
struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
};
struct C{
	P c;double r;
	C(const P &c,double r):c(c),r(r){}
};
namespace std {
	bool operator < (const P& a, const P& b) {
		return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
		//return imag(a) != imag(b) ? imag(a) < imag(b) : real(a) < real(b);  
	}
	bool operator == (const P& a, const P& b) {
		return a.real()==b.real()&&a.imag()==b.imag();
	}
}
double dot(P a,P b){
	return real(conj(a)*b);
}
P projection(L a,P p){
	double t=dot(p-a[0],a[0]-a[1])/norm(a[0]-a[1]);
	return a[0]+t*(a[0]-a[1]);
}
double distanceLP(const L &l, const P &p) {
	return abs(p - projection(l, p));
}
P turn(P p,double t){
	return p*exp(P(.0,t*PI/180.0));
}
vector<L> tangentCC(C a,C b){
	if(a.r<b.r)swap(a,b);
	double d=abs(a.c-b.c);
	vector<L>l;
	if(d<EPS)return l;
	if(a.r+b.r<d-EPS){//hanareteiru
		double t=acos((a.r+b.r)/d);
		t=t*180/PI;
		l.pb(L(a.c+turn(a.r/d*(b.c-a.c),t),b.c+turn(b.r/d*(a.c-b.c),t)));
		l.pb(L(a.c+turn(a.r/d*(b.c-a.c),-t),b.c+turn(b.r/d*(a.c-b.c),-t)));
	}else if(a.r+b.r<d+EPS){//kuttuiteiru soto
		P p=a.c+a.r/d*(b.c-a.c);
		l.pb(L(p,p+turn(b.c-a.c,90)));
	}
	if(abs(a.r-b.r)<d-EPS){//majiwatteiru
		double t1=acos((a.r-b.r)/d);
		t1=t1*180/PI;
		double t2=180-t1;
		l.pb(L(a.c+turn(a.r/d*(b.c-a.c),t1),b.c+turn(b.r/d*(a.c-b.c),-t2)));
		l.pb(L(a.c+turn(a.r/d*(b.c-a.c),-t1),b.c+turn(b.r/d*(a.c-b.c),t2)));
	}else if(abs(a.r-b.r)<d+EPS){//kuttuiteiru uti
		P p=a.c+a.r/d*(b.c-a.c);
		l.pb(L(p,p+turn(b.c-a.c,90)));
	}
	return l;
}
int main(){
	int n;
	while(cin>>n,n){
		vector<C>c;
		rep(i,n){
			double a,b,e,d;
			cin>>a>>b>>e>>d;
			c.pb(C(P(a,b),e));
			c.pb(C(P(a,b),e+d));
		}
		if(n==1){
			cout<<1<<endl;
			continue;
		}
		vector<L>l,tmp;
		rep(i,c.size())loop(j,i+1,c.size()){
			tmp=tangentCC(c[i],c[j]);
			rep(k,tmp.size()){
				l.pb(tmp[k]);
			}
		}
		int out=0;
		rep(i,l.size()){
			L t=l[i];
			int co=0;
			rep(j,c.size()){
				double d=distanceLP(t,c[j].c);
				if(d+EPS>c[j].r&&d<c[j+1].r+EPS)co++;
				j++;
			}
			out=max(out,co);
		}
		cout<<out<<endl;
	}
}

Measured memory_bytes: 3560
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();
        int W = sc.nextInt();
        StringBuilder sb = new StringBuilder();
        for(int i=1;i<=W+2;i++) sb.append("#");
        System.out.println(sb.toString());
        for(int i=1;i<=H;i++){
            String cur = sc.next();
            StringBuilder now = new StringBuilder();
            now.append("#");
            now.append(cur);
            now.append("#");
            System.out.println(now.toString());
        }
        System.out.println(sb.toString());
    }
}
 

Measured memory_bytes: 23124
import java.util.ArrayList

fun main(args: Array<String>) {
    val N = readLine()!!.toInt()
    val D = readLine()!!.split(" ").map { it.toInt() }

    val C = Array(13) {0}
    C[0] = 1

    for (p in D) {
        C[p]++
    }

    var res = 0
    for (s in 0..(1 shl 13)) {
        val list = ArrayList<Int>()
        list.addAll(Array(C[0]) {0})
        list.addAll(Array(C[12]) {12})

        for (i in 1..11) {
            if (C[i] == 0) {
                continue
            }

            when {
                C[i] > 1 -> {
                    list.add(i)
                    list.addAll(Array(C[i] - 1) {24 - i})
                }
                ((s shr i) and 1) == 1 -> {
                    list.add(i)
                }
                else -> {
                    list.add(24 - i)
                }
            }
        }

        var h = 24
        for (i in 0 until list.size) for (j in (i + 1) until list.size) {
            val d = Math.abs(list[i] - list[j])
            h = Math.min(h, Math.min(d, 24 - d))
        }
        res = Math.max(res, h)
    }

    println(res)
}


Measured memory_bytes: 42716
# ABC074D

import sys
input=sys.stdin.readline

def main():
    N=int(input())
    A=[tuple(map(int,input().split())) for i in range(N)]
    
    ans=0
    for i in range(N):
        for j in range(i+1,N):
            ans+=A[i][j]
            for k in range(N):
                if i!=k and j!=k:
                    if A[i][j]>A[i][k]+A[k][j]:
                        print(-1)
                        exit()
                    elif A[i][j]==A[i][k]+A[k][j]:
                        ans-=A[i][j]
                        break
                    
    print(ans)
    
    
if __name__=="__main__":
    main()


Measured memory_bytes: 76232
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,m,a,h,p,q;;
  int map[1000][100];
  while(1){
    for(int i=0;i<1000;i++){
      for(int j=0;j<100;j++){
	map[i][j]=0;
      }
    }
    cin>>n>>m>>a;
    if(n==0 && m==0 && a==0) break;
    for(int i=0;i<m;i++){
      cin>>h>>p>>q;
      map[h][p]=1;
    }
    for(int i=999;i>=0;i--){
      if(map[i][a]==1) a++;
      else if(map[i][a-1]==1) a--;
    }
    cout<<a<<endl;
  }
  return 0;
}



Measured memory_bytes: 3480
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.StringTokenizer;


public class Main {
    static BufferedReader reader;
    static StringTokenizer tokenizer;
    static void init(InputStream input) {
        reader = new BufferedReader(new InputStreamReader(input));
        tokenizer = new StringTokenizer("");
    }
    static String next() throws IOException {
        while (!tokenizer.hasMoreTokens()){tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
    public static void main(String []args) throws IOException {
        init(System.in);
        int n=nextInt();
        int A[]=new int [2*n];
        for (int i=0;i<2*n;i++){
            A[i]=nextInt();
        }
        Arrays.sort(A);
        int sum=0;
        for (int i=0;i<2*n;i+=2){
            if(A[i]<A[i+1]){
                sum+=A[i];
            }
            else{
                sum+=A[i+1];
            }
        }
        System.out.println(sum);
    }
}

Measured memory_bytes: 22996
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var abcd = Sarray();
            var a = abcd[0];
            var b = abcd[1];
            var c = abcd[2];
            var d = abcd[3];
            if (Abs(a - c) <= d || (Abs(a - b) <= d && Abs(b - c) <= d))
                WriteLine("Yes");
            else
                WriteLine("No");
        }

        static long Mod = 998244353;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
    }
}

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

#define mod      1e9+7;
#define INF      1e9+9;
#define ps(x,y)  fixed<<setprecision(y)<<x
# define PI 3.14159265358979323846264338327950 L
typedef long long ll;
typedef unsigned long long ull;
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
#endif
	int n,a;
	cin>>n;
	set<int> s;
	for(int i=0;i<n;i++){
		cin>>a; 
		s.insert(a);
	}
	if(s.size()==n)
		cout<<"YES\n";
	else
		cout<<"NO\n";

	return 0;
}

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

void solveA(){
  int a,b,c,d,e,k;
  cin >> a >> b >> c >> d >> e >> k;

  if(e-a > k){
    cout << ":(" << endl;
  }
  else{
    cout << "Yay!" << endl;
  }
}
void solveB(){
  int a[5];
  cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4];

  int min = 9;
  int minad = 0;

  for(int i=0;i<5;i++){
    if(a[i]%10 < min && a[i]%10 != 0){
      min = a[i]%10;
      minad = i;
    }
  }
  int ans = 0;
  for(int i=0;i<5;i++){
    if(i==minad || a[i]%10==0){
      ans += a[i];
    }
    else{
      ans = ans + 10-a[i]%10 + a[i];
    }
  }
  
  cout << ans << endl;

}
void solveC(){

}

void solveD(){

}

int main(){
  solveB();
}


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


class Program
{
    static void Main(string[] args)
    {
        // 入力
        //var s = Console.ReadLine();
        var n = long.Parse(Console.ReadLine());
        long[] x = new long[n];
        long[] l = new long[n];
        for (int i = 0; i < n; i++)
        {
            int[] t = Console.ReadLine().Split().Select(int.Parse).ToArray();
            x[i] = t[0];
            l[i] = t[1];
        }

        long[] s = new long[n];
        long[] e = new long[n];
        for (int i = 0; i < n; i++)
        {
            s[i] = x[i] - l[i];
            e[i] = x[i] + l[i];
        }

        Array.Sort(e, s);

        //区間スケジューリング
        var ans = 0;
        var num = long.MinValue;
        for (int i = 0; i < n; i++)
        {
            if (num <= s[i])
            {
                num = e[i];
                ans++;
            }
        }

        // 出力
        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 49944
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in); 
        String s = sc.next();
        if(s.equals("A")){System.out.println("T");}
		if(s.equals("T")){System.out.println("A");}
        if(s.equals("G")){System.out.println("C");}
        if(s.equals("C")){System.out.println("G");}
  }
}

Measured memory_bytes: 21844
if __name__ == '__main__':
    nums = sorted(list(map(int, input().split())))

    ans = 0
    l_s = nums[2] - nums[0]
    l_m = nums[2] - nums[1]
    ans += l_s // 2 + l_m // 2
    nums[0] += 2 * (l_s // 2)
    nums[1] += 2 * (l_m // 2)

    # print(ans)
    # print(nums)
    if nums[0] == nums[1] and nums[0] == nums[2]:
        print(ans)
    elif nums[0] == nums[1] and nums[1] != nums[2]:
        print(ans + 1)
    else:
        print(ans + 2)


Measured memory_bytes: 3064
// A - Weather Prediction

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

		String S = sc.next();

		if(S.equals("Sunny")){
			System.out.println("Cloudy");
		}else if (S.equals("Cloudy")){
			System.out.println("Rainy");
		}else{
			System.out.println("Sunny");
		}
		
	}
}

Measured memory_bytes: 21972
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<queue>
#include<cmath>
#include<cstdio>
#include<tuple>
#include<bitset>

using namespace std;
//#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define ALL(x) x.begin(),x.end()
#define ll long long
const int inf=1000000007;
const int MOD=1000000007;
signed main(){
  vector<int> a(4);
  rep(i,4)cin>>a[i];
  sort(ALL(a));
  bool flag=false;
  if(a[0]==1&&a[1]==4){
    if(a[2]==7&&a[3]==9){
      flag=true;
    }
  }
  if(flag){
    cout<<"YES"<<endl;
  }
  else{
    cout<<"NO"<<endl;
  }
  return 0;
}


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

bool f[300001] = {};

int main() {

  vector< long long int > v;

  for ( long long int i = 1; true; i++ ) {

    long long int k = ( i / 2 ) * 7 + 1 + ( i % 2 ) * 5;
    if ( k > 300000 ) break;

    if ( f[k] == false ) {

      v.push_back( k );

      for ( long long int j = 2; j * k <= 300000; j++ ) {

	f[ j*k ] = true;

      }

    }

  }

  while( true ) {

    long long int n;
    cin >> n;
    if ( n == 1 ) break;

    cout << n << ":" ;

    for ( long long int i = 0; i < v.size(); i++ ) {

      if ( ( n % v[i] ) == 0 ) {
	cout << " " << v[i];
      }

    }

    cout << endl;

  }

  return 0;

}

Measured memory_bytes: 1884
//raja1999
#include <bits/stdc++.h>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <iomanip> 
//setbase - cout << setbase (16); cout << 100 << endl; Prints 64
//setfill -   cout << setfill ('x') << setw (5); cout << 77 <<endl;prints xxx77
//setprecision - cout << setprecision (14) << f << endl; Prints x.xxxx


using namespace std;
#define f(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) f(i,0,n)
#define fd(i,a,b) for(i=a;i>=b;i--)
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sz(a) a.size()
#define inf (1000*1000*1000+5)
#define all(a) a.begin(),a.end()
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >

//std::ios::sync_with_stdio(false);
string s;
int check(int j)
{
	int i;
	rep(i,j/2)
	{
		if(s[i]!=s[i+j/2])
			return 0;
	}
	return 1;

}
int main(){
	std::ios::sync_with_stdio(false);
	  int i,j;
	cin>>s;
	j=s.length();
	j--;
	j--;
	if(j%2)
	{
		for(i=j;j>=1;j-=2)
			if(check(j))
			{
				cout<<j<<endl;
				break;
			}
	}
	else
	{
		for(i=j-1;j>=1;j-=2)
			if(check(j))
			{
				cout<<j<<endl;
				break;
			}
	}

} 


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main()
{
    int l,i,j,b,k;
    char n[1000];
    while(gets(n))
    {
        l=strlen(n);
        b=-1;
        for(i=0;i<l;i++)
        {
            if(n[i]==' ')

            {
                for(j=i-1;j>b;j--)
                printf("%c",n[j]);
                printf(" ");
                b=i;
            }

        }

        for(i=l-1;i>b;i--)
        printf("%c",n[i]);
        printf("\n");
    }
    return 0;
}

Measured memory_bytes: 908
#include<bits/stdc++.h>
using namespace std;
using LL = long long;
constexpr int maxn = 12000;
string s[maxn];
int main(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	int N, BA = 0, XA = 0, BX = 0, ans = 0;
	cin >> N;
	for(int i = 0; i < N; i += 1){
		cin >> s[i];
		for(int j = 0; j + 1 < s[i].size(); j += 1) if(s[i][j] == 'A' and s[i][j + 1] == 'B') ans += 1;
		if(*s[i].begin() == 'B' and *s[i].rbegin() == 'A') BA += 1;
		else if(*s[i].begin() == 'B') BX += 1;
		else if(*s[i].rbegin() == 'A') XA += 1;
	}
	if(BX == 0 and XA == 0) ans += max(BA - 1, 0);
	else ans += min(BX, XA) + BA;
	cout << ans;
}

Measured memory_bytes: 768
#include <iostream>
#include <iomanip>
#include <utility>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <cstring>
#include <map>
#include <climits>
#include <bitset>

#define ll long long
const ll MOD = 1e9 + 7;
const ll INF = 1 << 29;

std::vector<long long> Eratoshtnes(long long N)
{
    // 求める最大素数
    long long maxPrime = 2;
    std::vector<long long> p;
    for (long long i=0; i<=N; ++i)
    {
        if (i * i <= N)
            maxPrime = i;

        p.push_back(i);
    }

    long long prime = 2;
    p[0] = -1;
    p[1] = -1;

    long long loopCount = 0;
    while (prime <= maxPrime)
    {
        for (auto i=loopCount; i<p.size(); ++i)
        {
            // 素数でないことが確定してる
            if (p[i] == -1)
                continue;

            if (p[i] % prime == 0)
            {
                // 素数
                if (p[i] / prime == 1)
                    continue;
                // 倍数
                else
                    p[i] = -1;
            }
        }

        prime++;
        loopCount++;
    }

    std::vector<long long> result;
    for (long long i=0; i<p.size(); ++i)
    {
        // i が素数でないならスルー
        if (p[i] == -1)
            continue;

        // 素数 i が 2017 likeNumber か
        auto likeNumber = p[i] * 2 - 1;
        if (N < likeNumber)
            break;

        if (p[likeNumber] != -1)
            result.emplace_back(likeNumber);
    }

    return result;
}

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

    const int Max = 100000;
    auto primeNumbers = Eratoshtnes(Max);

    std::vector<int> sum(Max+1, 0);

    /*
    for (auto num : primeNumbers)
    {
        std::cout << "num " << num << " / " << (num + 1) / 2 << std::endl;
    }
    */

    auto lastPrimeIndex = 0;
    for (auto i=1; i<=Max; ++i)
    {
        auto candidates = 0;
        while (primeNumbers[lastPrimeIndex] < i && lastPrimeIndex < primeNumbers.size())
        {
            candidates++;
            lastPrimeIndex++;
        }

        sum[i] = sum[i-1] + candidates;
    }

    /*
    for (auto i=0; i<sum.size(); ++i)
        std::cout << i << " : " << sum[i] << std::endl;
        */

    for (auto i=0; i<Q; ++i)
    {
        int from, to;
        std::cin >> from >> to;
        std::cout << sum[to + 1] - sum[from] << std::endl;
    }
}


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

int main() {
  int x;
  cin >> x;
  int ans = 1;
  for (int b = 2; b * b <= x; ++b) {
    int p = 2;
    while (pow(b, p) <= x) {
      ans = max(ans, (int)pow(b, p));
      ++p;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 4080
#include<bits/stdc++.h>
using namespace std;
typedef double db;
typedef long long ll;
#define w1 first
#define w2 second
#define ls (x<<1)
#define rs (x<<1|1)
#define pb push_back
#define mid ((l+r)>>1)
#define SZ(x) ((x).size())
#define All(x) (x).begin(),(x).end()
#define rep(i,a,b) for(int (i)=(a);(i)<=(b);(i)++)
#define rep2(i,a,b) for(int (i)=(a);(i)<(b);(i)++)
#define per(i,a,b) for(int (i)=(a);(i)>=(b);(i)--)
#define Rep(p,x) for(int (p)=head[(x)];(p);(p)=nxt[(p)])
template<class T>void read(T&num){
	num=0;T f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9')num=num*10+ch-'0',ch=getchar();
	num*=f;
}
int power(int x,int k,int p){int res=1;for(;k;k>>=1,x=1ll*x*x%p)if(k&1)res=1ll*res*x%p;return res;}
const int maxn=505;
int n,m;
char str[maxn][maxn],ans1[maxn][maxn],ans2[maxn][maxn];
int main(){
	read(n);read(m);
	rep(i,1,n){
		scanf("%s",str[i]+1);
		rep(j,1,m)ans1[i][j]=ans2[i][j]=str[i][j];
	}
	rep(i,1,n)ans1[i][1]='#',ans2[i][m]='#';
	rep(i,1,n)rep(j,2,m-1)if(i&1)ans1[i][j]='#';
	else ans2[i][j]='#';
	rep(i,1,n)puts(ans1[i]+1);
	puts("");
	rep(i,1,n)puts(ans2[i]+1);
	return 0;
}

Measured memory_bytes: 1536
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import string
import heapq
import _collections
from collections import Counter
from collections import defaultdict
from collections import deque
from functools import lru_cache
import bisect
import re
import queue
import copy
import decimal


class Scanner():
    @staticmethod
    def int():
        return int(sys.stdin.readline().rstrip())

    @staticmethod
    def string():
        return sys.stdin.readline().rstrip()

    @staticmethod
    def map_int():
        return [int(x) for x in Scanner.string().split()]

    @staticmethod
    def string_list(n):
        return [Scanner.string() for i in range(n)]

    @staticmethod
    def int_list_list(n):
        return [Scanner.map_int() for i in range(n)]

    @staticmethod
    def int_cols_list(n):
        return [Scanner.int() for i in range(n)]


def solve():
    a, b, c, d = Scanner.map_int()
    ans = max(a * c, a * d, b * c, b * d)
    if a <= 0 and 0 <= b:
        ans = max(ans, 0)
    if c <= 0 and 0 <= d:
        ans = max(ans, 0)
    print(ans)


def main():
    # sys.setrecursionlimit(1000000)
    # sys.stdin = open("sample.txt")
    # T = Scanner.int()
    # for _ in range(T):
    solve()


if __name__ == "__main__":
    main()


Measured memory_bytes: 10776
def create_card_set():
    card_types=["S","H","C","D"]
    cart_nums=[i+1 for i in range(13)]
    
    card_set=set()
    
    for ct in card_types:
        for cn in cart_nums:
            card_set = card_set | {(ct,cn)}
    
    return card_set
    
def read_card():
    n=int(input())
    init_card_set=set()
    
    for i in range(n):
        ct,cn_s=tuple(input().split())
        cn = int(cn_s)
        init_card_set = init_card_set | {(ct,cn)}
        
    return init_card_set
    

def sort_card(left_card):
    #card typeをバケットソート
    spade_ls=[]
    heart_ls=[]
    club_ls=[]
    diamond_ls=[]
    
    for card in left_card:
        ct=card[0]
        if ct=="S":
            spade_ls.append(card)
        elif ct == "H":
            heart_ls.append(card)
        elif ct=="C":
            club_ls.append(card)
        elif ct=="D":
            diamond_ls.append(card)
            
    #カード毎の数字を昇順ソート
    spade_ls=sorted(spade_ls,key=lambda x:x[1])
    heart_ls=sorted(heart_ls,key=lambda x:x[1])
    club_ls=sorted(club_ls,key=lambda x:x[1])
    diamond_ls=sorted(diamond_ls,key=lambda x:x[1])
    
    return spade_ls+heart_ls+club_ls+diamond_ls


def find_miss_card():

    init_card_set=read_card()
    
    all_card=create_card_set()
    
    left_card=all_card - init_card_set
    
    result=sort_card(left_card)


    for ct,cn in result:
        print(f"{ct} {cn}")

find_miss_card()


Measured memory_bytes: 5628
#include <bits/stdc++.h>
using namespace std;
#define INF 10000

int N;
int A[20], B[20];
int dp[1<<20][20];

int main() {
    cin >> N;
    for (int i=0; i<N; i++) cin >> A[i];
    for (int i=0; i<N; i++) cin >> B[i];
    for (int i=0; i<(1<<N); i++) for (int j=0; j<N; j++) dp[i][j] = INF;
    for (int i=0; i<N; i++) dp[1<<i][i] = 0;
    
    for (int S=0; S<(1<<N); S++) {
        int cnt = 0;
        for (int i=0; i<N; i++) if ((S>>i)&1) cnt++;
        
        for (int i=0; i<N; i++) {
            int cost = cnt;
            
            for (int j=0; j<N; j++) {
                if (!((S>>j)&1)) {
                    int n1 = (i-(cnt-1))%2==0 ? A[i] : B[i];
                    int n2 = (j-cnt)%2==0 ? A[j] : B[j];
                    if (n1>n2) continue;
                    dp[S|(1<<j)][j] = min(dp[S|(1<<j)][j], dp[S][i]+cost);
                }
                else cost--;
            }
        }
    }
    
    int ans = INF;
    for (int i=0; i<N; i++) ans = min(ans, dp[(1<<N)-1][i]);
    cout << (ans==INF ? -1 : ans) << endl;
}

Measured memory_bytes: 22912
#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
#include <stack>
using namespace std; 

#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 pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define tmin(a,b,c) min((a),min((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;

typedef pair<int, int> Pii;
typedef map<int, int> Mii;
typedef vector<int> Vi;
typedef vector<vector<int> > VVi;
typedef long long ll;
const int inf = 2e9;
const ll ll_inf = 1e17;
const int mod = 1e9 + 7;
const long double eps = 1e-10;
typedef pair<ll, ll> Pll; 

map<Pll, int> m;
ll sum[11];

int main()
{
	ll H, W, N;
	cin >> H >> W >> N;
	ll h, w;
	sum[0] = (H-2)*(W-2);
	rep(i,0,N) {
		cin >> h >> w; 
		h--; w--;
		rep(i,0,3) rep(j,0,3) {
			if (h-i >= 0 && h-i < H-2 && w-j >= 0 && w-j < W-2 ) {
				sum[m[Pll(h-i,w-j)]]--;
				m[Pll(h-i,w-j)]++;
				sum[m[Pll(h-i,w-j)]]++;
			}
		}
	}
	rep(i,0,10) {
		cout << sum[i] << endl;
	}

	return 0;
}

Measured memory_bytes: 56448
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
 
int main(){
    string s,t;
    cin>>s>>t;
    int change =t.size();
    
    for(int i=0; i<=(s.size()-t.size()); i++){
        int cnt = 0;
        for(int j=0; j<t.size(); j++){
            if(t[j] != s[i+j]){
                cnt++;
            }
        }
        change = min(change, cnt);
    }

    cout<<change<<endl;
    return 0;
}

Measured memory_bytes: 3640
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

N = iIn()
K = iIn()

ans = 1
for i in range(N):
    ans = min(ans * 2, ans + K)

print(ans)

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


int main() {
    ll X,K,D;
    cin >> X >> K >> D;
    X=abs(X);
    
      
       
    ll cc=X/D;
    X=X-cc*D;
    
    K-=cc;
    if(K<0){
        cout << X-D*K << endl;
        return 0;
    }
    if(K%2==0){
      cout << X << endl;
    }else{
      cout << abs(X-D) << endl;
    }
    
    
    
}

Measured memory_bytes: 3668
# -*- coding: utf-8 -*-
N, K = map(int, input().split())
R, S, P = map(int, input().split())
T = str(input())
win_point_dict = {
    "r": R,
    "s": S,
    "p": P
}

from collections import deque
last_hand_queue = deque("a" * K)
last_result_queue = deque("a" * K)

def get_winning_hand(opponents_hand):
    if opponents_hand == "r":
        return("p")
    elif opponents_hand == "s":
        return("r")
    elif opponents_hand == "p":
        return("s")

ans = 0
for i in range(N):
    last_k_hand = last_hand_queue.pop()
    last_k_result = last_result_queue.pop()
    if get_winning_hand(T[i]) == last_k_hand and last_k_result == "w":
        last_hand_queue.appendleft(T[i])
        last_result_queue.appendleft("e")
    else:
        last_hand_queue.appendleft(get_winning_hand(T[i]))
        last_result_queue.appendleft("w")
        ans += win_point_dict[get_winning_hand(T[i])]

print(ans)

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

using namespace std;
typedef long long ll;

bool contain(ll a, ll b) {
  for (int i = 0; i < 30; i++) {
    if (!(a >> i & 1)) continue;
    if (!(b >> i & 1)) return false;
  }
  return true;
}

int main(void) {
  ll N, K;
  cin >> N >> K;

  vector<ll> a(N), b(N);
  for (int i = 0; i < N; i++) {
    cin >> a[i] >> b[i];
  }

  vector<ll> v(1, K);
  for (int i = 0; i < 30; i++) {
    if (!(K >> i & 1)) continue;
    v.push_back(((K >> (i + 1)) << (i + 1)) + (1 << i) - 1);
  }

  ll ans = 0;
  for (int i = 0; i < v.size(); i++) {
    ll sum = 0;
    for (int j = 0; j < N; j++) {
      if (!contain(a[j], v[i])) continue;
      sum += b[j];
    }
    ans = max(ans, sum);
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
using namespace std;

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
typedef pair<int, int>P;
typedef pair<int, bool> sP;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef pair<ll, ll> LP;
typedef vector<ll> vec;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-5;
const ld pi = acos(-1.0);
typedef vector<vector<ll>> mat;
typedef vector<ll> vec;

void solve() {
	int ans = 0;
	int n, k; cin >> n >> k;
	rep(i, n) {
		int h; cin >> h;
		if (h >= k)ans++;
	}
	cout << ans << endl;
}


signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//init();
	solve();
	//stop
	return 0;
}



Measured memory_bytes: 256
import sys
from itertools import permutations


# sys.stdin = open('d1.in')


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


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    def floyd_warshall():
        for k in range(n):
            for i in range(n):
                for j in range(n):
                    dd = d[i][k] + d[k][j]
                    if dd < d[i][j]:
                        d[i][j] = dd

    n, m, r = read_int_list()
    v = read_int_list()
    v = [x - 1 for x in v]
    d = [[float('inf')] * n for i in range(n)]
    for i in range(n):
        d[i][i] = 0
    for i in range(m):
        a, b, c = read_int_list()
        a -= 1
        b -= 1
        d[a][b] = c
        d[b][a] = c
    floyd_warshall()
    res = float('inf')
    for p in permutations(v):
        s = 0
        for i in range(r - 1):
            s += d[p[i]][p[i + 1]]
        if s < res:
            res = s
    print(res)


main()


Measured memory_bytes: 4720
import sys
sin = sys.stdin.readline
N, M = map(int, sin().split())
bs = [tuple(map(int, sin().split())) for _ in range(M)]
bs.sort(key=lambda x: x[1])

rbs = []
for a, b in bs:
    if not rbs or a > rbs[-1]:
        rbs.append(b - 1)
ans = len(rbs)
print(ans)

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

//前処理は O(n)、毎回の二項係数計算は O(1)

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

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

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

map<int, int>prime_factor(int n) {
	map<int, int>res;
	for (int i = 2; i*i <= n; i++) {
		while (n%i == 0) {
			res[i]++;
			n /= i;
		}
	}
	if (n != 1)res[n]++;//nは素数
	return res;
}


int main() {
	// 前処理
	COMinit();
	int n, m;
	cin >> n >> m;
	map<int, int>mp = prime_factor(m);
	long long ans = 1;
        long long d = 1;
	for (int i = 2; i*i <= m; i++) {
		if (mp[i] > 0) {
			//iの素因数
			ans *= COM(n + mp[i] - 1, mp[i]);
			ans %= MOD;
                        for (int j = 0; j < mp[i]; j++) {
                            d *= i;
                        }
			//n/iの素因数
			if ((m / d) * (m / d) > m) {
				ans *= COM(n + mp[m / d] - 1, mp[m / d]);
				ans %= MOD;
			}
		}
	}
	if (mp[m] == 1)ans = n;
	cout << ans << endl;
}


Measured memory_bytes: 13696
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const double PI = acos(-1);
const ll MOD = 1000000007;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
 
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

int main() {
  int N,W; cin >> N >> W;
  vector<int> v(N),w(N);
  rep(i,N) cin >> v[i] >> w[i];

  vector<vector<int>> dp(N+1, vector<int>(W+1));

  rep(i,N) {
    rep(j,W+1) {
      if (j < w[i]) dp[i+1][j] = dp[i][j];
      else dp[i+1][j] = max(dp[i][j],dp[i+1][j-w[i]] + v[i]); 
    }
  }

  cout << dp[N][W] << endl;
}


Measured memory_bytes: 6828
#%%
import itertools

n = int(input())
l = list(itertools.product(range(2), repeat=n))
s = [[] for _ in range(n)]

for i in range(n):
    tmp = int(input())
    for j in range(tmp):
        tmp_list = list(map(int, input().split()))
        s[i].append(tmp_list)

#print(s)

ans = 0
for i in range(len(l)):
    #print(' ', l[i])
    tmp = 0
    tmp_list = l[i]
    flag = True
    for j in range(n):
        if tmp_list[j] == 0:
            pass
        else:
            tmp += 1
            for k in range(len(s[j])):
                #print(tmp_list[s[j][k][0]-1], s[j][k][1])
                if tmp_list[s[j][k][0]-1] == s[j][k][1]:
                    pass
                else:
                    flag = False
                    break
    if flag:
        ans = max(ans, tmp)
    #print('ans', ans)

print(ans)

Measured memory_bytes: 8820
# coding=utf-8

def partition(A, p, r):
    x = A[r][1]
    i = p-1
    for j in range(p, r):
        if A[j][1] <= x:
            A[i+1], A[j] = A[j], A[i+1]
            i += 1
    A[i+1], A[r] = A[r], A[i+1]
    return i+1

def quick_sort(A, p, r):
    if p < r:
        q = partition(A, p, r)
        quick_sort(A, p, q-1)
        quick_sort(A, q+1, r)

def is_stable(A):
    for i in range(len(A) - 1):
        if A[i][1] == A[i+1][1]:
            if A[i][2] > A[i+1][2]:
                return False
    return True


n = int(input())
cards = []
for i in range(n):
    suit, num = input().split()
    cards.append([suit, int(num), i])

quick_sort(cards, 0, n-1)

if is_stable(cards):
    print("Stable")
else:
    print("Not stable")

for i in range(n):
    print(cards[i][0], cards[i][1])

Measured memory_bytes: 24660