akhauriyash/Code-Regression huggingface dataset:
n = int(input()) 
list_R = [] 
for i in range(n):
    list_R.append(int(input()))

maxv = -20000000000000000
minv = list_R[0]

for j in range(1,n):
    if maxv < list_R[j]-minv:
        maxv = list_R[j]-minv
    if minv > list_R[j]:
        minv = list_R[j]
print(maxv)



Measured memory_bytes: 13588
//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;
const int N=5e5+5;
typedef long long ll;
struct node;typedef node* ptr;
struct node{
	ptr lc,rc;int c;
	inline void pd(){if(c)lc->c=c,rc->c=c,c=0;}
}e[N<<2],*pp=e,*rt;
ll s[N],dp[N],res;int a[N],b[N],l[N],r[N],st[N];
int n,P,m,top;
inline void upd(R int &x,R int y){(x+=y)>=P?x-=P:0;}
inline int add(R int x,R int y){return x+y>=P?x+y-P:x+y;}
inline int dec(R int x,R int y){return x-y<0?x-y+P:x-y;}
inline int mul(R int x,R int y){return 1ll*x*y-1ll*x*y/P*P;}
void build(ptr &p,int l,int r){
	p=++pp;if(l==r)return;
	int mid=(l+r)>>1;
	build(p->lc,l,mid),build(p->rc,mid+1,r);
}
int query(ptr p,int l,int r,int x){
	if(p->c||l==r)return p->c;
	int mid=(l+r)>>1;
	return x<=mid?query(p->lc,l,mid,x):query(p->rc,mid+1,r,x);
}
void update(ptr p,int l,int r,int ql,int qr,int v){
	if(ql>qr)return;
	if(ql<=l&&qr>=r)return p->c=v,void();
	int mid=(l+r)>>1;p->pd();
	if(ql<=mid)update(p->lc,l,mid,ql,qr,v);
	if(qr>mid)update(p->rc,mid+1,r,ql,qr,v);
}
ll ask(R int x){
	R int p=query(rt,1,top,x);
	if(!p)return 0;
	return dp[p]+dec(st[l[p]],st[x]);
}
int main(){
//	freopen("testdata.in","r",stdin);
	scanf("%d%d",&n,&P);
	fp(i,1,n){
		scanf("%d%d",&a[i],&b[i]),s[i]=s[i-1]+a[i];
		if(b[i]==1&&(a[i]<<1)>P)return puts("-1"),0;
	}
	fd(i,n,1){
		if(b[i]==1)l[i]=mul(s[i-1]%P,P-2),r[i]=mul(s[i]%P,P-2);
			else l[i]=0,r[i]=P-1;
		st[++top]=l[i],st[++top]=r[i];
	}
	sort(st+1,st+1+top),top=unique(st+1,st+1+top)-st-1;
	build(rt,1,top);
	fd(i,n,1){
		l[i]=lower_bound(st+1,st+1+top,l[i])-st;
		r[i]=lower_bound(st+1,st+1+top,r[i])-st;
		dp[i]=ask(l[i]);
		if(l[i]>r[i])update(rt,1,top,r[i]+1,l[i]-1,i);
		else update(rt,1,top,1,l[i]-1,i),update(rt,1,top,r[i]+1,top,i);
	}
	res=dp[1];
	fp(i,1,top)cmin(res,ask(i));
	printf("%lld\n",res+(s[n]<<1));
	return 0;
}

Measured memory_bytes: 21760
#include<bits/stdc++.h>
using namespace std;
int n,tmp;
set<int> set_d;
int main(){
  scanf("%d",&n);
  for(int i=0;i<n;i++){
    scanf("%d",&tmp);
    set_d.insert(tmp);
  }
  printf("%d",set_d.size());
}

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

using namespace std ;

#define sz(v) (int)v.size()
#define ll long long
#define all(v)  v.begin() , v.end()
#define rall(v)  v.rbegin() , v.rend()
#define pf push_front
#define pb push_back
#define fast FastInputOutput() ;
#define Clear( container , value ) memset( container , value , sizeof container )
#define PI acos( -1.0 )
#define forn( t , v , be , n ) for( t v = be ; v < n ; v++ )
#define fore( x , j ) for( auto x : j )
#define se second
#define fr first
//#define c_b fflush(stdin);

const ll Long_max = numeric_limits < ll > :: max() ;
const int Int_max = numeric_limits < int > :: max() ;

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

void File_input( string pathIn ) {
    freopen( pathIn.c_str(), "r", stdin ) ;
}

void File_output( string pathOut ) {
    freopen( pathOut.c_str(), "w", stdout ) ;
}

int msg() {
    srand( time( 0 ) ) ;
    vector < string > st = {
        "Wish everyone high ratings!",
        "Good luck!",
        "Have fun!",
        "Please, read all the problems!",
        "Go Go fight!"
    } ;
    cerr << st[ rand() % sz( st ) ] ;
    return 0 ;
}


void FastInputOutput() {
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}

int n , k ;
string str ;
set < string > ap ;
map < string , int > a_fr , b_fr ;

int main(){

   ap.insert("1") ;
   cin >> n ;
   forn( int , i , 0 , n ){
      cin >> str ;
      ap.insert( str ) ;
      a_fr[ str ]++ ;
   }

   cin >> k ;
   forn( int , i , 0 , k ){
      cin >> str ;
      b_fr[ str ]++ ;
   }

   int mx = -Int_max ;

   fore( i , ap ){
     int sum = a_fr[ i ] - b_fr[ i ] ;
     mx = max( sum , mx ) ;
   }


   cout << mx ;


}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define lsb(x) (x & (-x))

using namespace std;

const int MOD = (int) 1e9 + 7;
const int MAXN = (int) 2e5;

inline void mod(int &x) {
    if(x >= MOD)
        x -= MOD;
}

int last[MAXN + 1];

int main() {
    //ifstream cin("A.in");
    //ofstream cout("A.out");
    int i, n;
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cin >> n;
    vector <int> arr(n + 1);
    for(i = 1; i <= n; i++) {
        cin >> arr[i];
    }
    vector <int> dp(n + 1);
    dp[0] = 1;
    for(i = 1; i <= n; i++) {
        dp[i] = dp[i - 1];
        if(last[arr[i]] != i - 1 && last[arr[i]] > 0) {
            dp[i] += dp[last[arr[i]]];
        }
        mod(dp[i]);
        last[arr[i]] = i;
        //cerr << dp[i] << " ";
    }
    cout << dp[n];
    //cin.close();
    //cout.close();
    return 0;
}


Measured memory_bytes: 2560
/*
  Krishnakant Tiwari
  Problem Link:

 */
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
using namespace std;
typedef long long ll;
#define _cin      ios_base::sync_with_stdio(0);  cin.tie(0);
#define endl "\n"
#define pb push_back
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define repd(i,a,b) for(ll i=a;i>=b;--i)
#define mp make_pair
#define hell 1000000007
#define vvll vector<vector<ll> >
#define vll vector<ll>
#define mll map<ll,ll>
#define sz(x) (ll)x.size()
#define sll set<ll>
#define pll pair<ll,ll>
#define F first
#define S second
#define eb	emplace_back
#define ppb	pop_back
#define pf	push_front
#define ppf	pop_front
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for (auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define precise(x)	cout<<fixed<<setprecision(x)
const ll MAX = 1000004;
const ll INF = 1e18L + 5;
template <class T, class U>
void chmin(T &t, const U &u)
{
    if (t > u) t = u;
}
template <class T, class U>
void chmax(T &t, const U &u)
{
    if (t < u) t = u;
}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T)
{
    cerr << " " << H;
    debug_out(T...);
}
template <typename Arg1>
void pn(Arg1 &&arg1)
{
    cout << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void pn(Arg1 &&arg1, Args &&... args)
{
    cout << arg1 << "\n";
    pn(args...);
}
template <typename Arg1>
void ps(Arg1 &&arg1)
{
    cout << arg1 << " ";
}
template <typename Arg1, typename... Args>
void ps(Arg1 &&arg1, Args &&... args)
{
    cout << arg1 << " ";
    ps(args...);
}
template <typename Arg1>
void read(Arg1 &&arg1)
{
    cin >> arg1;
}
template <typename Arg1, typename... Args>
void read(Arg1 &&arg1, Args &&... args)
{
    cin >> arg1;
    read(args...);
}

ll g[MAX];
ll a[MAX];

void solve()
{
    ll d,s,t;
    read(d,t,s);
    if(d<=t*s) pn("Yes");
    else pn("No");
}


int main()
{

    _cin
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);	
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
    // ll tc;
    // cin>>tc;
    // while(tc--){
    solve();
    // }

}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
string S, T;
int memo[3005][3005];
int solve(int x, int y)
{
	if(x==S.size()) return 0;
	if(y==T.size()) return 0;
	if(memo[x][y]!=-1) return memo[x][y];
	if(S[x]==T[y])
	{
		return memo[x][y]=solve(x+1, y+1)+1;
	}
	return memo[x][y]=max(solve(x+1, y), solve(x, y+1));
}

void bt(int x, int y)
{
	if(x==S.size()) return;
	if(y==T.size()) return;
	if(S[x]==T[y])
	{
		printf("%c", S[x]);
		bt(x+1, y+1);
		return;
	}
	if(memo[x+1][y] > memo[x][y+1])
	{
		bt(x+1, y);
	}
	else bt(x, y+1);
	return;
}

int main()
{
	cin>>S;
	cin>>T;
	memset(memo, -1, sizeof(memo));
	solve(0, 0);
	bt(0, 0);
	printf("\n");
	return 0;
}

Measured memory_bytes: 35840
#include<bits/stdc++.h>
            using namespace std;
            #define rep(i,b) for(i=0;i<b;++i)
            #define repp(i,a,b) for(i=a;i<b;++i)
            #define endl "\n"
            //#define LLONG_MAX 99999999999999
            typedef long long int lli;
            int main(){
                ios_base::sync_with_stdio(false);
                cin.tie(NULL);
                lli t,n,i,j,b,a,q,m;
                double r;
                cin>>r;
                double ans=2.0*3.141*r;
                cout<<ans<<endl;

            }



Measured memory_bytes: 3792
#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<set>
#include<string>
#include<map>
#include<string.h>
#include<complex>
#include<math.h>
#include<queue>
#include<time.h>
using namespace std;
typedef long long int llint;
typedef pair<int, int> pint;
typedef vector<int> vint;
typedef vector<llint> vllint;
typedef vector<pair<int, int>> vpint;
typedef vector<pair<llint, llint>> vpllint;
#define rep(i,n) for(int i=0;i<n;i++)
#define drep(i,n) for(int i=n-1;0<=i;i--)
#define yes(ans) if(ans)cout<<"yes"<<endl;else cout<<"no"<<endl;
#define Yes(ans) if(ans)cout<<"Yes"<<endl;else cout<<"No"<<endl;
#define YES(ans) if(ans)cout<<"YES"<<endl;else cout<<"NO"<<endl;
#define POSSIBLE(ans) if(ans)cout<<"POSSIBLE"<<endl;else cout<<"IMPOSSIBLE"<<endl;

class UnionFind {
public:
	//親の番号を格納する。親だった場合は-(その集合のサイズ)
	vector<int> Parent;

	//作るときはParentの値を全て-1にする
	//こうすると全てバラバラになる
	UnionFind(int N) {
		Parent = vector<int>(N, -1);
	}

	//Aがどのグループに属しているか調べる
	int root(int A) {
		if (Parent[A] < 0) return A;
		return Parent[A] = root(Parent[A]);
	}

	//自分のいるグループの頂点数を調べる
	int size(int A) {
		return -Parent[root(A)];//親をとってきたい
	}

	//AとBをくっ付ける
	bool connect(int A, int B) {
		//AとBを直接つなぐのではなく、root(A)にroot(B)をくっつける
		A = root(A);
		B = root(B);
		if (A == B) {
			//すでにくっついてるからくっ付けない
			return false;
		}

		//大きい方(A)に小さいほう(B)をくっ付けたい
		//大小が逆だったらひっくり返しちゃう。
		if (size(A) < size(B)) swap(A, B);

		//Aのサイズを更新する
		Parent[A] += Parent[B];
		//Bの親をAに変更する
		Parent[B] = A;

		return true;
	}
};

//aとbの最大公約数を求めるよ
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

// 返り値: a と b の最大公約数
// ax + by = gcd(a, b) を満たす (x, y) が格納される
long long extGCD(long long a, long long b, long long& x, long long& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}

bool check(int a, int b) {
	return a > b;
}

// mod. m での a の逆元 a^{-1} を計算する
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;
}

//aCbを1000000007で割った余りを求める
llint convination(llint a, llint b) {
	llint ans = 1;
	for (llint i = 0; i < b; i++) {
		ans *= a - i;
		ans %= 1000000007;
	}
	for (llint i = 1; i <= b; i++) {
		ans *= modinv(i, 1000000007);
		ans %= 1000000007;
	}
	return ans;
}

int main() {
	vpint a;
	while (1) {
		int x, y;
		cin >> x >> y;
		if (x > y)swap(x, y);
		if (x != 0 || y != 0)a.push_back({ x,y });
		else {
			break;
		}
	}
	rep(i, a.size()) {
		cout << a[i].first << " " << a[i].second << endl;
	}
	return 0;
}


Measured memory_bytes: 3152
//高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
	int ans = 0;
	int tmp;
	string s;
	cin >> s;
	if (s[2] == s[3] && s[4] == s[5]) cout << "Yes" << endl;
	else cout << "No" << endl;
	
	//cout << ans << endl;
}

Measured memory_bytes: 256
N = int(input()) + 1

Answer = 0

def getGCD(a,b,c):
    if a == b and b == c:
        d = 1
    elif a == b or b == c or c == a:
        d = 3
    else:
        d = 6
        
    surplus = a % c
    while surplus != 0:
        a = int(c)
        c = int(surplus)
        surplus = a % c
    surplus = b % c
    while surplus != 0:
        b = int(c)
        c = int(surplus)
        surplus = b % c
    return c * d


for i in range(1,N):
    for j in range(i,N):
        for k in range(j,N):
            Answer += getGCD(k,j,i)
            
print(Answer)


Measured memory_bytes: 9228
#include <bits/stdc++.h>
using namespace std;
string s;
int x;
int main(){
	cin>>s;
	int len=s.length();
	len/=2;
	if(s.length()%2==1){
		x=len+1;
	}else{
		x=len;
	}
	string a=s.substr(0,len);
	string b=s.substr(x,len);
	if(a==b){
		cout<<"Yes"<<'\n';
	}else{
		cout<<"No"<<'\n';
	}
}

Measured memory_bytes: 256
import java.util.*;class Main{public static void main(String[]g){Scanner S=new Scanner(System.in);for(int i=S.nextInt(),j,x,y,z,a[]=new int[3];i-->0;System.out.println(a[2]*a[2]==a[1]*a[1]+a[0]*a[0]?"YES":"NO")){for(j=0;j<3;)a[j++]=S.nextInt();Arrays.sort(a);}}}


Measured memory_bytes: 33800
class SegmentTree

  def initialize xs, id, &block
    @id = id
    @block = block
    i = 1
    i *= 2 while i < xs.size
    @width = i
    @data = Array.new(2 * i - 1, id)
    @data[i-1...i-1+xs.size] = xs
    (i-2).downto(0) {|j| @data[j] = block[@data[2*j+1], @data[2*j+2]] }
  end

  def query i, j, k = 0, a = 0, b = @width
    return @data[k] if i == a && j == b
    c = (a + b) / 2
    case
    when j <= c
      query i, j, 2 * k + 1, a, c
    when c <= i
      query i, j, 2 * k + 2, c, b
    else
      @block[query(i, c, 2 * k + 1, a, c), query(c, j, 2 * k + 2, c, b)]
    end
  end

  def [] i
    @data[@width - 1 + i]
  end

  def []= i, x
    i = @width - 1 + i
    @data[i] = x
    while i > 0
      j = (i-1)/2
      @data[j] = @block[@data[2*j+1], @data[2*j+2]]
      i = j
    end
  end

end

n, q = gets.split.map(&:to_i)
st = SegmentTree.new(Array.new(n, 0), 0) {|a, b| a + b }
q.times do
  c, x, y = gets.split.map(&:to_i)
  if c.zero?
    st[x-1] += y
  else
    p st.query x - 1, y
  end
end

Measured memory_bytes: 11800
# -*- coding: utf-8 -*-

import itertools
comb = list(map(''.join, itertools.product("ACGT", repeat=4)))

N = int(input())

dp = {c: [0, 0] for c in comb}
dp["TTTT"] = [1, 0]

for _ in range(N):
    dp_new = {c: [0, 0] for c in comb}
    for k in dp:
        for b in "ACGT":
            if k[2:4] + b in ("AGC", "ACG", "GAC") or k[1:4] + b in ("ACGC", "AGGC", "ATGC", "AGCC", "AGGC", "AGTC"):
                dp_new[k[1:4] + b][1] += dp[k][0] + dp[k][1]
            else:
                dp_new[k[1:4] + b][0] += dp[k][0]
                dp_new[k[1:4] + b][1] += dp[k][1]
    dp = dp_new

mod = int(1e9) + 7
print((4 ** N - sum([dp[k][1] for k in dp])) % mod)


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

using namespace std;
using int64 = long long;

struct aaa{aaa(){cin.tie(nullptr); ios::sync_with_stdio(false); cout<<fixed<<setprecision(20);};}aaa;

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

    int ans = 0;
    for (int i=0; i<1000; i++) {
        int pin = i;
        int cnt = 0;
        for (int j=n-1; j>=0; j--) {
            if (s[j]-'0' != pin%10)
                continue;
            cnt++;
            if (cnt == 3) {
                ans++;
                break;
            }
            pin /= 10;
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 3196
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main(){
	
	string s;
	int n, k;
	cin >> n >> k;
	cin >> s;

	for (int i = 0; i < n; i++){
		if (i == k - 1){
			if (s[i] == 'A'){ s[i] = 'a'; }
			else if (s[i] == 'B'){ s[i] = 'b'; }
			else if (s[i] == 'C'){ s[i] = 'c'; }
			break;
		}
	}
	cout << s << endl;

	system("pause");
	return 0;
}

Measured memory_bytes: 504
import math

n=int(input())
ans=10**11
for i in range(1,math.floor(math.sqrt(n)+1)):
    if n%i == 0:
        a=i
        b=n//i
        a_len=len(str(a))
        b_len=len(str(b))
        ans=min(ans,max(a_len,b_len))
print(ans)

Measured memory_bytes: 64912
import java.util.Scanner;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int one = sc.nextInt();
		int two = sc.nextInt();
		if (one == two) {
			System.out.println(one + two);
		} else if (one > two) {
			System.out.println(one * 2 - 1);
		} else {
			System.out.println(two * 2 - 1);
		}
		sc.close();
	}
}

Measured memory_bytes: 23764
/* C++14 (Clang 3.8.0) for AtCoder */

#include <iostream>
#include <vector>
#include <string>
// #include <cmath>
// #include <math.h>
// #include <map>
#include <algorithm>

namespace AtCoder {
	using Str = std::vector<std::string>;
	using Num = std::vector<int>;
	using BigNum = std::vector<double>;

	class InputData {
	public:
		void getInput(void);
		void skipInput(void);
		Str getStr(void);
		Num getNum(void);
		BigNum getBigNum(void);
	private:
		Str str;
		Num num;
		BigNum bNum;
	};
	Str AtCoder::InputData::getStr(void) {
		return this->str;
	}
	Num AtCoder::InputData::getNum(void) {
		return this->num;
	}
	BigNum AtCoder::InputData::getBigNum(void) {
		return this->bNum;
	}
	void AtCoder::InputData::skipInput(void) {
		std::string buf = "";
		std::getline(std::cin, buf);
	}
	void AtCoder::InputData::getInput(void) {
		this->str.clear();
		this->num.clear();
		this->bNum.clear();

		std::string buf = "", row = "";
		std::getline(std::cin, buf);
		for (unsigned int i = 0; i < buf.size(); i++) {
			if (' ' == buf[i]) {
				this->str.push_back(row);
				this->num.push_back(std::atoi(row.c_str()));
				this->bNum.push_back(std::atof(row.c_str()));
				row = "";
			} else {
				row += buf[i];
			}
		}
		this->str.push_back(row);
		this->num.push_back(std::atoi(row.c_str()));
		this->bNum.push_back(std::atof(row.c_str()));
	}

	class Ans {
	public:
		void showResult(void);
		void increment(void);
		void increment(double);
		void decrement(void);
		void decrement(double);
		double getResult(void);
	private:
		double result;
	};
	void Ans::showResult(void) {
		printf("%.0lf\n", this->result);
	}
	void AtCoder::Ans::increment(void) {
		this->result++;
	}
	void AtCoder::Ans::increment(double value) {
		this->result += value;
	}
	void AtCoder::Ans::decrement(void) {
		this->result--;
	}
	void AtCoder::Ans::decrement(double value) {
		this->result -= value;
	}
	double AtCoder::Ans::getResult(void) {
		return this->result;
	}

	void exp(std::string* str,  Str* newStr) {
		std::string pre = *str;
		newStr->clear();
		for (unsigned int i = 0; i < pre.length(); i++) {
			newStr->push_back(pre.substr(i, 1));
		}
	}
	void rsort(std::vector<int>* vec) {
		std::sort(vec->begin(), vec->end(), std::greater<int>());
	}
}

int main(void) {
	AtCoder::InputData* data = new AtCoder::InputData();
	data->getInput();

	AtCoder::BigNum bnum = data->getBigNum();

	data->getInput();
	AtCoder::Num num = data->getNum();

	AtCoder::rsort(&num);

	AtCoder::Ans* ans = new AtCoder::Ans();
	const int max = num.size();
	bool ansf = false;
	for (int i = 0; i < max; i++) {
		ans->increment(num[i]);
		if (bnum[0] <= ans->getResult()) {
			ansf = true;
			break;
		}
	}

	if (ansf) {
		printf("Yes\n");
	} else {
		printf("No\n");
	}

	delete(ans);
	delete(data);

	return 0;
}


Measured memory_bytes: 6260
import math
A, B, H, M = map(int, input().split())

Hang = H * 30 + 30 * M / 60 #時針時計回り角度
Mang = M * 6 #分針時計回り角度

ang = abs(Hang - Mang)
ans = math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(math.radians(ang)))

print(ans)

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    int N;
    cin >> N;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];
    int odd = 0;
    rep(i, N) {
        if (A[i] % 2) odd++;
    }
    if (odd % 2 ) {
        cout << "NO" << '\n';
    }else{
        cout << "YES" << '\n';
    }

}

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


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

long long gcd(long long a, long long b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    long long n, m;
    cin >> n >> m;
    long long ans = 1;
    for(long long i = m/n; i > 0; i--){
        if((m-i*n)%i == 0){
            ans = i;
            break;
        }
    }
    cout << ans << endl;
    return 0;
}

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

#define ll long long
vector< int > v, ans(10004, -1);

void solve(){
	int h, m, a, b, k;
	cin>>h>>m>>a>>b>>k;
	cout<<((a * 60) + b - (h * 60) - m - k)<<endl;
}

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


Measured memory_bytes: 3696
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    REP(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    REP(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

int main()
{
    int N = inputValue();
    string S;
    cin >> S;
    string s1 = S.substr(0, N/2);
    string s2 = S.substr(N/2, N/2);
    string ans = "No";
    if(N % 2 == 0 && s1 == s2){
        ans = "Yes";
    }
    cout << ans << endl;
}


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

int main(){
  int n, q; string s;
  cin >> n;
  cin >> s;
  cin >> q;
  int k[q];
  rep(i,q) cin >> k[i];
  rep(i,q) {
    ll a = 0;
    ll nm = 0, nd = 0, dm = 0;
    rep(j,k[i]) {
      if(s[j] == 'D') {
        nd++;
      } else if(s[j] == 'M') {
        nm++;
        dm += nd;
      } else if(s[j] == 'C') {
        a += dm;
      }
    }
    for(int j = 1; j <= n-k[i]; j++) {
      if(s[j-1] == 'D' && s[j+k[i]-1] == 'D') {
        dm -= nm;
      } else if(s[j-1] == 'D' && s[j+k[i]-1] == 'M') {
        dm -= nm; nd--; nm++; dm += nd;
      } else if(s[j-1] == 'M' && s[j+k[i]-1] == 'D') {
        nd++; nm--;
      } else if(s[j-1] == 'M' && s[j+k[i]-1] == 'M') {
        dm += nd;
      } else if(s[j+k[i]-1] == 'D') {
        nd++;
      } else if(s[j-1] == 'D') {
        nd--; dm -= nm;
      } else if(s[j+k[i]-1] == 'M') {
        nm++; dm += nd;
      } else if(s[j-1] == 'M') {
        nm--;
      }
      if(s[j+k[i]-1] == 'C') {
        a += dm;
      }
    }
    cout << a << endl;
  }
  return 0;
}

Measured memory_bytes: 1412
#include <bits/stdc++.h>
using namespace std;
long long num[100005];
int main() {
    //freopen("datain.txt","r",stdin);
    int n;
    cin>>n;
    for (int i=1;i<=n;++i) scanf("%lld",&num[i]);
    sort(num+1,num+n+1);
    //for (int i=0;i<n;++i) cout<<num[i]<<" ";
    long long cnt=0;
    num[0]=num[1];
    long long now=num[0];
    int state=0;
    for (int i=1;i<=n;++i) {
        if (num[i]==num[i-1]) {
            ++state;
        }
        else {
            cnt+=(state%2);
            state=1;
        }
    }
    cnt+=(state%2);
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007

long long fact(int c) {
    long long ret = 1;
    for (int i = 1; i <= c; i++) ret = ret * i % mod;
    return ret;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    vector<int> v(n);
    for (int i = 0; i < n; i++) cin >> v[i];
    long long ans = 1;
    int curr = 1;
    for (int i = 0; i < n; i++, curr++) {
        if (i == n-1) ans = ans * fact(curr) % mod;
        else if (v[i] < curr*2 - 1) {
            ans = ans * curr-- % mod;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define abs(x)  ((x)>=0 ? (x) : ((x)*-1))

int main(){
  int N;
  cin >> N;
  int w[N], i, j, min=999999, a, b, all=0;
  for(i=0; i<N; i++){
    cin >> w[i];
    all+=w[i];
  }
  
  for(i=0; i<N; i++){
    a=0;
    b=0;
   for(j=i+1; j<N; j++){
     a+=w[j];
   }
  b=all-a;
  if (abs(b-a) <= min){
    min = abs(b-a);
  }
}
cout << min;
return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <list>
#include <string>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <utility>

using namespace std;
using ll = long long int;
int gcd(unsigned a, unsigned b) {
  if(a < b) gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
int main(){

int N,X;
cin >> N >> X;
vector<int> t;

int D;
cin >> D;
D=X-D;
if(D<0){D=-D;}
for(int i=1;i<N;i++){
    int a;cin >> a;
    a=X-a;
    if(a<0){a=-a;}
    
    
    D=gcd(a,D);
}

cout << D;

return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
   char s[100860];
int main(){
 
    scanf("%s",&s);
    int n=strlen(s);
    if(n%2!=0){
        cout<<"No"<<endl;
        return 0;
    }
    else {
        for(int i=0;i<=n/2;i++) {
		int num=abs(s[i]-s[n-1-i]);
		if(num!=1&&num!=2)
		{
			cout<<"No"<<endl;
			return 0;
		}
    }}
    cout<<"Yes"<<endl;
    return 0;
}

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

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

	sort( A.begin(), A.end() );
	int t = 0;
	long long a = 0;
	for( int i = 0; i < N - 1; i++ )  {
		a += A[i];
		if( a * 2 < A[i + 1] ) t = i + 1;
	}
	int ans = N - t;

	cout << ans << endl;
}


Measured memory_bytes: 4040
from sys import stdin
import itertools

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
li.sort()
key = n//2

if li[:key][-1] == li[key:][0]:
    print(0)
else:
    print(li[key:][0]-li[:key][-1])

Measured memory_bytes: 14352
#include <stdio.h>

int main (void){

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

if(a <= b){


	if(a < b){
		printf("a < b\n");
	}
	else{
		printf("a == b\n");
	}

}



else{


printf("a > b\n");


}




return 0;


}

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


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

    cin >> a >> b >> c;
    if (a == b) {
        cout<<c;
    }else {
        if ( a==c){
             cout <<b;
        }else{
            cout <<a;
        }
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define Rep(i, r, n) for (ll i = r; i < n; i++)
#define pb push_back
#define MOD 1000000007
#define INF 1000000000000
#define EPS 0.00000000001
typedef long long ll;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    //---------------------------------------------

    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int x, y, z;
    x = a - c;
    if (x < 0)
        x *= -1;
    if (x <= d)
    {
        cout << "Yes" << endl;
    }
    else
    {

        vector<int> aaa = {a, b, c};
        sort(aaa.begin(), aaa.end());

        if (aaa.at(2) - aaa.at(1) <= d && aaa.at(1) - aaa.at(0) <= d)
            cout << "Yes" << endl;
        else
            cout << "No" << endl;
    }
}

Measured memory_bytes: 256
import math as mt
a, b, h, m = map(int, input().split())
hd = h*30
md = m*6
hd += md/12
d = abs(hd - md)
cd = mt.cos(d* mt.pi/180)
print(round(mt.sqrt(a*a + b*b - 2*a*b*cd), 20))

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

int main() {
	int H, W;
	cin >> H >> W;
	vector<vector<char>> map(H, vector<char>(W));
	for (int i = 0; i < H; i++) {
		for (int j = 0; j < W; j++)
			cin >> map.at(i).at(j);
	}
	vector<int> tate(W), yoko(H);
	bool kienai = false;
	for (int i = 0; i < H; i++) {
		kienai = false;
		for (int j = 0; j < W; j++) {
			if (map.at(i).at(j) == '#') {
				kienai = true;
				break;
			}
		}
		if (kienai == false) yoko.at(i)++;
	}
	for (int i = 0; i < W; i++) {
		kienai = false;
		for (int j = 0; j < H; j++) {
			if (map.at(j).at(i) == '#') {
				kienai = true;
				break;
			}
		}
		if (kienai == false) tate.at(i)++;
	}
	for (int i = 0; i < H; i++) {
		if (yoko.at(i) == 1) continue;
		for (int j = 0; j < W; j++) {
			if (tate.at(j) == 0) cout << map.at(i).at(j);
		}
		cout << endl;
	}
}

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

const int64_t MOD = 1000000007;
typedef int64_t ll;
typedef uint64_t ull;

#define FOR(i, start, end) for(uint64_t i=start; i<end; i++)
#define REP(i, n) FOR(i, 0, n)

// 最大公約数gcd
// 最小公倍数lcm=m*n/gcd
uint64_t gcd(uint64_t m, uint64_t n) {
  uint64_t temp;
  while (m % n != 0){
    temp = n;
    n = m % n;
    m = temp;
  }
  return n;
}

uint64_t lcm(uint64_t m, uint64_t n) {
  return (m*n)/gcd(m,n);
}

// vector<vector<uint64_t> > v(n+1, vector<uint64_t>(n+1, 0))
// v[n][k]に組み合わせ数が入る。
void comb(vector<vector <uint64_t> > &v){
  for(uint64_t i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(uint64_t k = 1;k <v.size();k++){
    for(uint64_t j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j]);
    }
  }
}

// 掛け算オーバーフロー判定
bool is_product_overflow(uint64_t a, uint64_t b) {

	uint64_t prod = a * b;
	
	return (prod / b != a);
}

//素因数分解
void primeFactorization(uint64_t a, list<uint64_t> &factors){ //素因数分解を出力するプログラム
  long i,sq;
  if(a%2==0){ //偶数の場合
    factors.push_back(2);
    primeFactorization(a/2,factors); //2で割った値で再帰
    return;
  }
  sq = sqrt(a);
  for(i=3;i<=sq;i+=2){ //3以上√a以下の奇数の場合
	if(a%i==0){
	  factors.push_back(i);
      primeFactorization(a/i,factors); //割れた値で再帰
      return;
	}
  }
  //偶数でも3以上√a以下の奇数の場合でも割り切れない場合
  if(a!=1){ //aが1でないなら、a自身は素数
    factors.push_back(a);
  }
}

// フェルマーの小定理
// mod. m での a の逆元 a^{-1} を計算する
// (a/b)%m = a*movinv(b,m)%m  
int64_t modinv(int64_t a, int64_t m) {
    int64_t b = m, u = 1, v = 0;
    while (b) {
        int64_t t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

/* 
  //エラトステネスのふるい
  int maxNum = 100000;
  char isNotPrime[maxNum+1] = {};
  isNotPrime[0]=isNotPrime[1]=1;
  for(int i=2;i<maxNum;i++){
    if(isNotPrime[i]==1) continue;
    int num = i+i;
    while(num<=maxNum){
      isNotPrime[num]=1;
      num += i;
    }
  }
*/
// 円周率
// M_PI

// #include <iomanip> // setprecisionを使用するのに必要
// cout << std::fixed << std::setprecision(15) << y << endl;

// 昇順
// priority_queue<int, vector<int>, greater<int> > queue;

// 降順ソート vector<int> v;
// sort(v.begin(),v.end(),greater<int>());

signed main() {
  int n;
  cin >> n;
  
  unordered_map<int, int> number;
  int a;
  for(int i=0;i<n;i++){
    cin >> a;
    if(number.count(a)!=0){
      number.erase(a);
    }
    else{
      number[a] = 1;
    }
  }
  
  cout << number.size() << endl;
  return 0;
}



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

//入力文字列と四つの文字列を反転し、後ろ側から比較していくことを考える。
//dreamerとeraserをTの前半に持ってくることで反転なしでも解けそうに見えるが、dreameraseなどに対応できない。

int main() {

  string S;

  vector<string> T = {"dream","dreamer","erase","eraser"};

  bool can = true;

  cin>>S;

  reverse(S.begin(),S.end());//入力文字列の反転

  for(int i=0;i<4;i++){
    reverse(T.at(i).begin(),T.at(i).end());//使用可能文字列の反転
  }
 

  for(int i=0;i<S.size();){
    bool can2 = false;
    for(int j=0;j<4;j++){
      string d = T.at(j);
      if(S.substr(i,d.size())==d) {
        i += d.size();
        can2 = true;
      }
    }
    if(can2==false){
      can = false;
      break;
    }

  }

    if (can) cout << "YES" << endl;
    else cout << "NO" << endl;
}

Measured memory_bytes: 512
#include<stdio.h>

typedef long long ll;
ll a,b,c;
int main(){
	scanf("%lld%lld%lld",&a,&b,&c);
	ll x = 2*a*b;
	ll y = a*a+b*b+c*c;
	ll z = 2*c*(b+a);
	if(x < (y - z) && c-a-b > 0){
		printf("Yes\n");
	}else printf("No\n");
	return 0;
}

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

int N, x, ans = 0, loc = 0;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> N >> x;
    for (int temp, i = 0; i < N; i++) {
        cin >> temp;
        loc += temp;
        if (loc <= x)
            ans++;
        else
            break;
    }
    cout << ans + 1 << "\n";

    return 0;
}

Measured memory_bytes: 256
#include<cstdio> 
#include<algorithm>
#include<cstring>
#include<cmath>
#include<map>
//¿ª O2£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡ 
using namespace std;
#define fo(i,j,k) for(i=j;i<=k;i++)
#define fd(i,j,k) for(i=j;i>=k;i--)
#define cmax(a,b) (a=(a>b)?a:b)
#define cmin(a,b) (a=(a<b)?a:b)
typedef long long ll;
typedef long long LL;
typedef double db;
const int N=2e5+5,mo=10007;
int tmp,a[N],n,i;
ll ans;
int main()
{
	scanf("%d",&n);
	fo(i,1,n) scanf("%d",a+i);
	tmp=0;
	fd(i,n,1)
	{
		tmp=max(tmp-1,0);
		if (tmp>a[i]||a[i]>=i)
		{
			printf("-1\n");
			return 0;
		}
		if (a[i]!=tmp)
		{
			ans+=a[i];
			tmp=a[i];
		}
	}
	printf("%lld\n",ans);
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false), cin.tie(0);
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define endl '\n'

using namespace std;

main()
{
    fast;
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if (a+b>c+d)
        cout<<"Left\n";
    else if (a+b<c+d)
        cout<<"Right\n";
    else
        cout<<"Balanced\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define IOS ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mp make_pair
#define pb push_back
#define mod 1000000007

using namespace std;

int n, a[105], res[105];

int main () {
	IOS;
	cin >> n;
	for (int i = 1; i <= n; i++)
		cin >> a[i];

	for (int q = 0; q < n; q++) {
		int ind = -1;

		for (int i = n - q; i; i--)
			if (a[i] == i) {
				ind = i;
				break;
			}

		if (ind == -1) {
			cout << -1 << endl;
			return 0;
		}

		res[n - q] = ind;
		for (int i = ind; i < n; i++)
			a[i] = a[i+1];
	}

	for (int i = 1; i <= n; i++)
		cout << res[i] << endl;

	return 0;
}


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

using namespace std;

typedef long long ll;

const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = (ll)1e9 + 7;

int main()
{
  int N, A; scanf("%d %d", &N, &A);
  vector<int> X(N);
  for (int i = 0; i < N; ++i) {
    scanf("%d", &X[i]);
  }

  vector<vector<vector<ll>>> dp(N + 5, vector<vector<ll>>(N + 5, vector<ll>(N * A + 5, 0)));
  for (int i = 0; i <= N; ++i) { dp[i][0][0] = 1; }
  int MAX_SUM = N * A;
  for (int i = 1; i <= N; ++i) {
    for (int j = 1; j <= i; ++j) {
      for (int k = 0; k <= MAX_SUM; ++k) {
        dp[i][j][k] = dp[i - 1][j][k];
        if (k - X[i - 1] >= 0) {
          dp[i][j][k] += dp[i - 1][j - 1][k - X[i - 1]];
        }
      }
    }
  }

  ll ans = 0;
  for (int i = 1; i <= N; ++i) {
    ans += dp[N][i][i * A];
  }
  printf("%lld\n", ans);
  return 0;
}


Measured memory_bytes: 60672
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

public class ABC
{
    //          long[] sp = Console.ReadLine().Split().Select(long .Parse).ToArray();
    //          int[] sp = Console.ReadLine().Split().Select(int.Parse).ToArray();
    //          int N =  int.Parse(Console.ReadLine());
    public static void Main()
    {
        string[] x = { "Sunny","Cloudy","Rainy" };
        string s = Console.ReadLine();
        string output = "";
        if (x[0] == s) output = x[1];
        else if (x[1] == s) output = x[2];
        else output = x[0];
        Console.WriteLine(output);

    }

}


Measured memory_bytes: 11092
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = 9;
		while (n-- > 0) {
			System.out.print(scanner.next() + " ");
			int a = scanner.nextInt();
			int b = scanner.nextInt();
			System.out.print(a + b + " ");
			System.out.println(a * 200 + b * 300);
		}
	}
}

Measured memory_bytes: 17176
#define _USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <cstdio>
#include <complex>
#include <numeric>
#include <string.h>
#include <random>
#include <cmath>
#define rep(i,n) for (int i = 0; i < (int)n; i++)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<pi, pi> pp;
typedef pair<ll, ll> pl;
double PI = 3.141592653589793238462643383279;
const double EPS = 1e-9;
const ll MOD = 1000000007;
const int inf = 1 << 30;
const ll linf = 1LL << 60;

int N, K;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> K;
    int ans = 0;
    rep(i,N) {
        int h; cin >> h;
        if (h >= K) ans++;
    }
    cout << ans << endl;


}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main
{
    public static void main(String[] args)
    {
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);

        while(scan.hasNext())
        {
            String input = scan.next();
            int num2,num1;
            switch(input)
            {
                case "+":
                    num2 = Integer.parseInt(formula.poll());
                    num1 = Integer.parseInt(formula.poll());
                    formula.push(String.valueOf(num1+num2));
                    break;
                case "-":
                    num2 = Integer.parseInt(formula.poll());
                    num1 = Integer.parseInt(formula.poll());
                    formula.push(String.valueOf(num1-num2));
                    break;
                case "*":
                    num2 = Integer.parseInt(formula.poll());
                    num1 = Integer.parseInt(formula.poll());
                    formula.push(String.valueOf(num1*num2));
                    break;
                default:
                    formula.push(input);
                    break;
            }
        }
        System.out.println(formula.poll());
    }
}

Measured memory_bytes: 26292
#include<cstdio>
#include<iostream>
#include<cstring>
#include<algorithm>
#include<queue>
#include<cmath>


using namespace std;

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



int hikaku(int a,int b,int c,int d){
    int A=a*a+b*b;
    int C=c*c+d*d;

    if(A>C)return 1;
    if(C>A)return -1;
    if(a>c)return 1;
    if(c>a)return -1;
    return 0;
}


int main(void){

    int h,w;

    for(;;){
        cin >> h >> w;
        if(h==0)return 0;
        int retH=1000,retW=1000;
        for(int H=1;H<=150;H++){
            for(int W=H+1;W<=150;W++){
                if(h==H && w == W)continue;

                if(hikaku(h,w,H,W)<0){
                    if(hikaku(H,W,retH,retW)<0){
                        retH=H;
                        retW=W;
                    }
                }

            }
        }
        cout << retH <<" "<<retW<<endl;
    }

       	return 0;
}

Measured memory_bytes: 1160
#include<algorithm>
#include<algorithm>     //sort,二分探索,など
#include<bitset>        //固定長bit集合
#include<cmath>         //pow,logなど
#include<complex>       //複素数
#include<deque>         //両端アクセスのキュー
#include<functional>    //sortのgreater
#include<iomanip>       //setprecision(浮動小数点の出力の誤差)
#include<iostream>      //入出力
#include<iterator>      //集合演算(積集合,和集合,差集合など)
#include<map>           //map(辞書)
#include<numeric>       //iota(整数列の生成),gcdとlcm(c++17)
#include<queue>         //キュー
#include<set>           //集合
#include<stack>         //スタック
#include<string>        //文字列
#include<unordered_map> //イテレータあるけど順序保持しないmap
#include<unordered_set> //イテレータあるけど順序保持しないset
#include<utility>       //pair
#include<vector>        //可変長配列

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvld;
typedef vector<vector<string>> vvs;
typedef vector<vector<bool>> vvb;
const ll MOD = 1000000007;
const ll INF = 1000000000000000000;
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,s,e) for(int i=s;i<e;i++)
#define reple(i,s,e) for(int i=s;i<=e;i++)
#define revrep(i,n) for(int i=n-1;i>=0;i--)
#define all(x) (x).begin(),(x).end()

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

ll calc(ll x, ll y)
{
    ll ans = INF;

    reple(i, 1, x - 1)
    {
        if(x - i >= 2)
        {
            vll v(3);
            v[0] = (ll)y * i;
            v[1] = (ll)y * ((x - i) / 2);
            v[2] = (ll)y * (((x - i) / 2) + ((x - i) % 2));
            chmin(ans, *max_element(all(v)) - *min_element(all(v)));
        }

        {
            vll v(3);
            v[0] = (ll)y * i;
            v[1] = (ll)(x - i) * (y / 2);
            v[2] = (ll)(x - i) * ((y / 2) + (y % 2));
            chmin(ans, *max_element(all(v)) - *min_element(all(v)));
        }
    }

    return ans;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int H, W;
    cin >> H >> W;

    ll ans = INF;
    chmin(ans, calc(H, W));
    chmin(ans, calc(W, H));

    cout << ans << endl;

    return 0;
}

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

using namespace std;

int main()
{
    unsigned long long int h,w;
    cin>>h>>w;
    if(h==1 || w==1)
    {
        cout<<1<<endl;
        return 0;
    }
    unsigned long long int mul=h*w;
    if(mul%2==0)
    {
        cout<<mul/2<<endl;
        return 0;
    }
    else
    {
        cout<<(mul/2)+1<<endl;
        return 0;
    }
}

Measured memory_bytes: 384
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <queue>
#include <string>
#include <set>
#include <map>
#define REP(i,n) for(ll i = 0; i < (ll)n; i++)
#define INF 1000000000000000
using namespace std;
typedef long long ll;
typedef double db;
typedef string str;

int main(){
  int a,b;
  cin >> a >> b;
  if(a<=8&&b<=8){
    cout << "Yay!" << endl;
  }else{
    cout << ":(" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
/*------------------------------------
........Bismillahir Rahmanir Rahim....
..........created by Abdul Aziz.......
------------------------------------*/
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <set>
#include <list>
#include <stack>
#include <map>
#include <cstring>
#include <unordered_map>
#include <queue>
#define   mod  998244353
#define   int  long long 
#define   ld   long double
#define   pb   push_back
#define   vi  vector<int> 
#define   dbg(x)  cerr << #x << " = " << x << '\n'
#define   sz(x)  (int)x.size()
#define   all(a) (a.begin(),a.end())
#define   ff   first
#define   ss   second
#define   pii  pair<int,int> 
#define   lcm(a,b) (a*b)/__gcd(a,b) 
using namespace std;

int  dp[105][5][2], k, n ; 
string  s ; 

int dpp(int idx, int len, int flag){ 
	if ( idx == n or len >= k ) 
		return k == len; 
	if (dp[idx][len][flag] != -1)  return  dp[idx][len][flag] ; 
	int sum = 0LL;
	int limit = (flag ? s[idx]-'0' : 9 ) ;  
	for (int i=0;i<=limit;i++){
		sum += dpp(idx+1, len+(i>0), flag && i==limit);
	}
	return dp[idx][len][flag] = sum ;
}

signed main()
{
    cin >> s >> k ; 
    n = sz(s) ; 
    memset (dp,-1,sizeof(dp)) ; 
    cout << dpp(0,0,1) << endl ; 
    return 0;
}


Measured memory_bytes: 3644
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <iostream>
#include <queue>
#include <list>
#include <stack>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;

ll dp[55][2505];

int main(){
  ios::sync_with_stdio(false);

  int N, A;
  cin >> N >> A;
  vector<int> x;
  rep(i,N){
    int a;
    cin >> a;
    x.push_back(a);
  }

  //dp[i][j]:=i枚使って合計jにする組み合わせ数
  dp[0][0] = 1;

  rep(t,N){
    for(int i=t+1; i>=0; i--){
      rep(j,2505){
        if(dp[i][j]>0){
          dp[i+1][j+x[t]] += dp[i][j];
        }
      }
    }
  }
  ll ret = 0;
  REP(i,1,N+1){
    if(A*i<2505){
      ret += dp[i][A*i];
    }
  }

  cout << ret << endl;
  
  return 0;
}



Measured memory_bytes: 768
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
#define int long long
#define boost() ios_base :: sync_with_stdio(0); cin.tie(); cout.tie(); cout << fixed; cout << setprecision(15); srand(time(NULL))
#define all(x) x.begin(), x.end()
using namespace __gnu_pbds;
using namespace std;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

int n, k, h[100010];
int dp[100010][110];

signed main () {
  cin >> n >> k;
  for (int i = 1; i <= n; i++) cin >> h[i];
  for (int i = 2; i <= n; i++) {
    int mn = INT_MAX;
    for (int j = 1; j <= k; j++) {
      dp[i][j] = (i - j < 1 ? INT_MAX : dp[i - j][k + 1] + abs (h[i - j] - h[i]));
      mn = min (mn, dp[i][j]);
    }
    dp[i][k + 1] = mn;
  }
  cout << dp[n][k + 1];
  return 0;
}


Measured memory_bytes: 86912
#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <iomanip>
#include <map>
#include <cstdlib>
using namespace std;
int main()
{
    int n, a, b;
    cin >> n >> a >> b;
    cout << (n * a < b ? n * a : b) << endl;
    return 0;
}

Measured memory_bytes: 256