akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
int main(){
	int n,m,c;
	priority_queue<int>q;
	cin>>n>>m;
	for(int i=0;i<n;i++){
		cin>>c;
		q.push(c);
	}
	long long money=0;
	while(m>0){
		c=q.top()/2;
		q.pop();
		q.push(c);
		m--;
		
	}
	while(!q.empty()){
		money=money+q.top();
		q.pop();
	}
	cout<<money;
	
}


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

typedef long long ll;
ll N, K;
ll R;

int main() {
  cin >> N >> K;
  for (ll i = 0; i < N; ++i) {
    ll h;
    cin >> h;
    if (h >= K) ++R;
  }
  cout << R << endl;
  return 0;
}


Measured memory_bytes: 256
//Libra.java
import java.util.Scanner;
class Main
{
	public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		int a=sc.nextInt();
        int b=sc.nextInt();
        int c=sc.nextInt();
        int d=sc.nextInt();

        int l=a+b;
        int r=c+d;
        if(l==r){
            System.out.println("Balanced");
        }
        else if(l>r){
            System.out.println("Left");
        }
        else{
            System.out.println("Right");
        }
        sc.close();
    }
}	

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

using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr int inf = 1<<30;
constexpr int mo = 1e9+7;
constexpr ll infl = 1ll<<60;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    
    ll n,k;
    cin>>n>>k;
    vector<int> a(n);
    for(auto & b : a) cin>>b;
    ll ret = 0ll;
    for(int i=0;i<n;++i){
        ll pre = 0ll;
        ll count = 0ll;
        for(int j=0;j<n;++j){
            if(a[j] < a[i]){
                if(j > i)pre++;
                count++;
            }
        }
        ret += (pre *k%mo)%mo;
        ret %= mo;
        ret += (count * ((k-1)*k/2%mo))%mo;
        ret %= mo;
    }
    cout << ret << endl;
    return 0;
}

Measured memory_bytes: 3548
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
int main() {
  int A;
  cin >> A;
  if(A % 2 == 0) {
    cout << (A - 2) / 2 << endl;
  }
  else {
    cout << (A - 1) / 2 << endl;
  }
}

Measured memory_bytes: 3604
#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 argc, const char * argv[]) {



    cin.tie(0);
    ios::sync_with_stdio(false);

    int x,y;
    cin>>x>>y;
    if(x==2){
        if(y==2)cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
    else if(x==4||x==6||x==9||x==11){
        if(y==4||y==6||y==9||y==11){
            cout<<"Yes"<<endl;
        }
        else cout<<"No"<<endl;
    }
    else{
        if(y==1||y==3||y==7||y==8||y==10||y==12){
            cout<<"Yes"<<endl;
        }
        else cout<<"No"<<endl;
    }

    return 0;
}


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

using namespace std;
#define REPP(i,a,b,c) for(int i=a; i<=b; i+=c)
#define REP(i,a,b) REPP(i,a,b,1)
#define REVV(i,a,b,c) for(int i=a; i>=b; i-=c)
#define REV(i,a,b) REVV(i,a,b,1)
#define FOR(i,a) REP(i,0,(int)a-1)
#define FORD(i,a) REV(i,(int)a-1,0)
#define PB push_back
#define POB pop_back
#define FI first
#define SE second
#define MP make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef pair < int , int > pii;
typedef vector < int > vi;
typedef vector < pii > vii;
typedef vector < ll > vl;
typedef pair < ll , ll > pll;

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


ll addMod(ll a, ll b){
	if(a + b >= MOD) return a + b - MOD;
	return a + b;
}

ll mulMod(ll a, ll b){
	return (a*b)%MOD;
}

ll fast(ll a, ll b){
	if(b == 0) return 1;
	ll tmp = fast(a,b/2);
	tmp = mulMod(tmp,tmp);
	if(b & 1) tmp = mulMod(tmp,a);
	return tmp;
}

ll GCD(ll a, ll b){
	if(a > b) return GCD(b,a);
	if(a == 0) return b;
	return GCD(b%a,a);
}

//////////////////////////////////////////////



int main(){
	ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int n;
	cin >> n;
	int l,r, ans = 0;
	FOR(i,n){
		cin >> l >> r;
		ans += r - l + 1;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
//#include "h.h"
using namespace std;

#define MOD 1000000007

#define ll long long
#define pint pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define mp make_pair
#define pm(first, second) pb(mp(first, second))
#define SPACE " "
#define fpf first.first
#define fps first.second
#define spf second.first
#define sps second.second

#define all(X) (X).begin(), (X).end()

int N, Q;
string S;
vector<pair<char, char>> V;

int l, m, r;

int goWhere(int num){
	for(int i = 0; i < Q; i ++){
		if(S[num] == V[i].first){
			if(V[i].second == 'L')num --;
			else num ++;
			if(num < 0)return -1;
			if(num >= N)return 1;
		}
	}
	return 0;
}
//左に消えるもののうち一番右のものを探す
int searchLeft(){
	l = 0;
	r = N - 1;
	if(goWhere(r) == -1)return r;//全部左に消える
	if(goWhere(l) != -1)return -1;//ひとつも左に消えない
	while(true){
		m = (l + r) / 2;
		if(goWhere(m) == -1){
			if(goWhere(m + 1) != -1){
				return m;
			}
			l = m + 1;
		}
		else{
			r = m - 1;
		}
	}
}
//右に消えるもののうち一番左のものを探す
int searchRight(){
	l = 0;
	r = N - 1;
	if(goWhere(l) == 1)return l;//全部右に消える
	if(goWhere(r) != 1)return -1;//ひとつも右に消えない
	while(true){
		m = (l + r) / 2;
		if(goWhere(m) == 1){
			if(goWhere(m - 1) != 1){
				return m;
			}
			r = m - 1;
		}
		else{
			l = m + 1;
		}
	}
}
int main(){

	cin >> N >> Q >> S;
	char t, d;
	for(int i = 0; i < Q; i ++){
		cin >> t >> d;
		V.pm(t, d);
	}
	int ansl = searchLeft();
	int ansr = searchRight();
	if(ansl == -1){
		if(ansr == -1){
			cout << N << endl;
			return 0;
		}
		cout << ansr << endl;
		return 0;
	}
	if(ansr == -1){
		cout << N - ansl - 1 << endl;
		return 0;
	}
	cout << ansr - ansl - 1 << endl;

	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//clock_t start=clock();clock_t end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef tuple<ll,ll,ll> tl;
typedef pair<double,double> pdd;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll mod5=1000000009;
ll inf=1LL<<60;
double pi=3.141592653589793238462643383279L;
double eps=1e-9;
#define rep(i,m,n) for(ll i=m;i<n;i++)
#define rrep(i,n,m) for(ll i=n;i>=m;i--)
#define srep(itr,st) for(auto itr=st.begin();itr!=st.end();itr++)
#define Max(a,b) a=max(a,b)
#define Min(a,b) a=min(a,b)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll Pow(ll n,ll k){
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
ll beki(ll n,ll k,ll md){
  ll ret=1;
  ll now=n;
  while(k>0){
    if(k%2==1){
      ret*=now;
      ret%=md;
    }
    now*=now;
    now%=md;
    k/=2;
  }
  return ret;
}
ll gyaku(ll n,ll md){
  return beki(n,md-2,md);
}
ll popcount(ll n){
    ll ret=0;
    ll u=n;
    while(u>0){
        ret+=u%2;
        u/=2;
        
    }
    return ret;
}
int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    string s;cin>>s;
    int q;cin>>q;
    int h=0;
    deque<char> dq;
    rep(i,0,s.size())dq.push_back(s[i]);
    rep(i,0,q){
        int t;cin>>t;
        if(t==1)h^=1;
        else{
            int f;char c;cin>>f>>c;
            if(h%2!=f%2)dq.push_front(c);
            else dq.push_back(c);
        }
    }
    if(h)reverse(dq.begin(),dq.end());
    rep(i,0,dq.size())cout<<dq[i];
    cout<<endl;
}









Measured memory_bytes: 976
import scala.io.StdIn


object Main extends App {
  val Array(n, y)  = StdIn.readLine.split(" ").map(_.toInt)

  def solve(n: Int, y: Int) : String  = {
    var cnt = 0
    for(i <- 0 to n; j <- 0 to n - i) {
      val k = n - i - j
      val sum = i * 1000 + j * 5000 + k * 10000
      if (y == sum) return k + " " + j + " " +  i
    }
    "-1 -1 -1"
  }
  println(solve(n, y))

}
  



Measured memory_bytes: 27332
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        for(int i = 1;;i++){
            int x = sc.nextInt();
            if(x==0) return;
            System.out.printf("Case %d: %d\n",i,x);
        }
    }
}


Measured memory_bytes: 62728
N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(M)]

from operator import itemgetter

BC = sorted(BC, key=itemgetter(1), reverse=True)
A.sort(reverse=True)

ans = []

now = 0
for b, c in BC:
    if now + b < N:
        ans.extend([c] * b)
        now += b
    else:
        ans.extend([c] * (N - now))
        now += (N - now)
        break
if now < N:
    ans.extend([0] * (N - now))

a = 0
ans = ans[::-1]
# print(ans, A)

for i in range(N):
    if ans[i] < A[a]:
        ans[i] = A[a]
        a += 1

# print(ans)
print(sum(ans))


Measured memory_bytes: 33860
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int k;
  cin >> k;
  vector<int> a(32);
  a = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  cout << a.at(k-1) << endl;
}
  

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main()
{
 
    int N_org,N;
    cin>>N_org;
  	N=N_org;  
  
    int digit=0;
   /* 桁数を計算 */
   while(N!=0){
       N /= 10;
        ++digit;
    }

    if(digit==6){
        cout<<9+900+90000<<endl;
    }else if(digit==5){
        cout<<9+900+N_org-9999<<endl;
    }else if(digit==4){
        cout<<9+900<<endl;
    }else if(digit==3){
        cout<<9+N_org-99<<endl;
    }else if(digit==2){
        cout<<9<<endl;
    }else{//digit==1
        cout<<N_org<<endl;
    }
 
    return 0;
}  

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

int n,a[101],ans[101],an,s[101];
bool bo[101];

int main()
{
	scanf("%d",&n);
	for (int i=1; i<=n; i++) scanf("%d",&a[i]);
	memset(bo,0,sizeof(bo));
	memset(s,0,sizeof(s));
	for (int T=1; T<=n; T++)
	{
		bool fl=0;
		for (int i=n; i; i--)
			if (!bo[i]&&s[i]==a[i]-1) 
			{
				ans[++an]=a[i];
				for (int j=i; j<=n; j++) s[j]++;
				bo[i]=1;
				fl=1; break;
			}
		if (!fl) return puts("-1"),0;
	}
	for (int i=1; i<=an; i++) printf("%d\n",ans[i]);
	return 0;
}

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

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;++A)
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

/////////////////////////////////////////////////////
ll N, D, A;
pll XH[202020];
ll mk[202020];
ll i, j, k, ans;
int main(){
    scanf("%lld%lld%lld", &N, &D, &A);
    fornum(i,0,N){
        ll x, h;
        scanf("%lld%lld", &x, &h);
        h = (h - 1) / A + 1;
        XH[i] = {x, h};
        mk[i] = 1e18;
    }
    sort(XH, XH + N);
    j = 0;
    ans = 0;
    fornum(i,0,N){
        //printf("%lld %lld %lld\n", i, j, XH[i].first);
        if(ans-mk[i]>=XH[i].second)
            continue;
        while (j < N&&XH[j].first<=XH[i].first+D*2){
            //printf("a%lld %lld\n", XH[i].first, XH[j].first);
            mk[j] = ans;
            ++j;
        }
        //printf("b%lld %lld\n", XH[i].first, XH[j].first);
        ans += XH[i].second - ans + mk[i];
    }
    printf("%lld", ans);
    return 0;
}

Measured memory_bytes: 4992
#include <iostream>
using namespace std;
int a,b;
int main(){
	a=b=0;
	for(int i=0;i<4;i++){
		cin >>b;
		a+=b;
	}
	b=a/60;
	a=a%60;
	cout << b<<endl<<a<<endl;
	return 0;
}

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define INF 2147483647
#define INFF 9223372036854775807
#define ll long long
#define REP(i,n) for(long long i=0;i<n;i++)
#define REPP(i,m,n) for(long long i=m;i<n;i++)
#define ALL(N) N.begin(),N.end()
#define de cout << "line : " << __LINE__ << " debug" << endl;
#define pb push_back
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

ll A,B,Q;

ll myleft,myright,myleft1,myright1;

int main() {
    cin.tie(0);    
	ios::sync_with_stdio(false);
    cin >> A >> B >> Q;
  	vector<ll> s(A),t(B),x(Q);
    REP(i,A) cin >> s[i];
    REP(i,B) cin >> t[i];
    REP(i,Q){
      	bool myleftflag = 1,myrightflag = 1,myleft1flag = 1,myright1flag = 1;
        ll ans = INFF;
        cin >> x[i];
        auto Iter = lower_bound(ALL(s),x[i]);
        auto Iter1 = lower_bound(ALL(t),x[i]);

        if(Iter - s.begin() - 1 < 0){
            myleftflag = false; //x[i]の地点から西に神社は存在しない
        }
        else{
            myleft = x[i] - s[Iter - s.begin() - 1];
        }

        if(Iter - s.begin() > A-1){
            myrightflag = false;
        }
        else{
            myright = s[Iter - s.begin()] - x[i];
        }

        if(Iter1 - t.begin() - 1 < 0){
            myleft1flag = false;
        }
        else{
            myleft1 = x[i] - t[Iter1 - t.begin() - 1];
        }

        if(Iter1 - t.begin() > B-1){
            myright1flag = false;
        }
        else{
            myright1 = t[Iter1 - t.begin()] - x[i];
        }

        if(myrightflag && myright1flag){
            ans = min(max(myright,myright1),ans);
        //  cout << myright << ' ' << myright1 << endl;
        }

        if(myrightflag && myleft1flag){
            ll a = abs(myleft1);
            ans = min(ans,(max(a,myright) + 2*min(a,myright)));
        //  cout << myright << ' ' << a << endl;
        }

        if(myleftflag && myright1flag){
            ll b = abs(myleft);
            ans = min(ans,(max(b,myright1) + 2*min(b,myright1)));
        //  cout << b << ' ' << myright1 << endl;
        }
        if(myleftflag && myleft1flag){
            ans = min(ans,abs(max(myleft,myleft1)));
         // cout << myleft << ' ' << myleft1 << endl;
        }

        cout << ans << endl;
    }
}

Measured memory_bytes: 3712
#include <cstring>
#include <cassert>
#include <utility>
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <bitset>
#include <chrono>
#include <cstdlib>
#include <functional>
#include <tuple>
#include <climits>
#include <limits>
#include <deque>
#include <list>
#include <array>
#include <stack>
#include <queue>
#include <random>
#include <complex>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define ll              long long
#define pi              pair<int,int>
#define pll             pair<ll,ll>
#define pb              push_back
#define F               first
#define S               second
#define vi              vector<int>
#define vll             vector<ll>
#define endl            '\n'
#define all(v)          (v).begin(),(v).end()
#define MP(a,b)         make_pair(a,b)
#define debug(x)        cerr<< #x << " : " << x << endl;
#define debugp(p)       cerr<< #p << " : " << "(" << (p).first << "," << (p).second << ")\n";
#define debugv(v)       cerr<< #v << " : " << "["; for(int i = 0; i < (v).size(); i++) cerr << v[i] << " "; cerr<<"]\n";
#define debugs(m)       cerr<< #m << " : [ "; for(auto itr = m.begin(); itr != m.end(); itr++) cerr <<*itr << " "; cerr << "]\n";
#define debugm(m)       cerr<< #m << " : [ "; for(auto itr = m.begin(); itr != m.end(); itr++) cerr <<"(" << itr->first << "," << itr->second << ") "; cerr << "]\n";

/* ordered set: 
tree<T, null_type,less<T>, rb_tree_tag,tree_order_statistics_node_update>
member functions :
1. order_of_key(k) : number of elements strictly lesser than k
2. find_by_order(k) : k-th element in the set
*/

inline ll modexp(ll x, ll ex , ll md) {
    ll ans = 1ll;
    while (ex > 0) {
        if (ex & 1ll) ans = (ans * x) % md;
        ex >>= 1ll;
        x = (x * x) % md;
    }
    return ans;
}

const int inf = 1e9 + 7;

void Solve(){
    int h , w , k;
    cin >> h >> w >> k;
    vector<string> g(h);
    for (int i = 0; i < h; i++){
        cin >> g[i];
    }
    int cnt = 0;
    for (int chr = 0; chr < (1 << h) ; chr++){
        for (int chc = 0; chc < (1 << w); chc++){
            vector<string> new_g = g;
            for (int r = 0; r < h; r++){
                for (int c = 0; c < w; c++){
                    if ( (chr & (1 << r)) || (chc & (1 << c))) new_g[r][c] = '$';
                }
            } 
            int bl = 0;
            for (int i = 0; i < h; i++){
                for (int j = 0; j < w; j++){
                    bl += (new_g[i][j] == '#');
                }
            }
            if (bl == k) cnt++;
        }
    }
    cout << cnt << endl;
}
int main(){
    ios :: sync_with_stdio(false); 
    cin.tie(nullptr); 
    cout.tie(nullptr);
    
    int T = 1;
    // cin >> T;
    for(int tc = 1; tc <= T; tc++){
        // cout << "Case #" << tc << ": ";
        Solve();
    }
    #ifdef LOCAL
    cerr << "Time elapsed\t: " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";       
    #endif
}



Measured memory_bytes: 3648
#include "bits/stdc++.h"

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define bit(n) (1LL << (n))
#define sz(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define en '\n'
#define pb push_back
#define mp make_pair

typedef long long ll;
using namespace std;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; }
const int dx[4] = { 1, 0, -1,  0 };
const int dy[4] = { 0, 1,  0, -1 };
const int INF = (int)1e9;
const ll  inf = (ll)1e18;
const int mod = 1000000007;

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


int main() {
	int n, h, w;
	cin >> n >> h >> w;
	if (h == 1 && w == 1) {
		cout << n * n << endl;
		return 0;
	}
	cout << (n - h + 1) * (n - w + 1) << endl;
	return 0;
}

Measured memory_bytes: 256
s = list(input())
opt = 0
if (s[0] == 'S'):
    if (s[1] == 'R'):
        opt += 1
    if (s[2] == 'R'):
        opt += 1
    print(opt)
    exit()
if (s[0] == 'R'):
    opt += 1
if (s[1] == 'R'):
    if (s[1] == 'R'):
        opt += 1
    if (s[2] == 'R'):
        opt += 1

print(opt)


Measured memory_bytes: 9120
#include <vector>
#include <list>
#include <string>
#include <iostream>
#define FOR(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define FORUL(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#define FORULE(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define FOREACH(it, X) for(__typeof((X).begin()) it = (X).begin(); it != (X).end(); it++)
#if defined(_MSC_VER) || __cplusplus > 199711L
#define AUTOVAR(newvar,v) auto newvar = (v)
#else
#define AUTOVAR(newvar,v) __typeof(newvar) r = (v)
#endif
#define PB(x) push_back(x)
#define MP(x,y) make_pair((x),(y))
#define MEMSET(m,v) memset(m,v,sizeof(m))

typedef long long				 ll;
typedef unsigned long long		ull;

#define DEBUG 1

#if DEBUG
#define DOUT cout<<"["<<__LINE__<<"]:"
#else
#define DOUT 0 && cout
#endif

using namespace std;

#define MAX_N (100000)

int N,K;
int h[MAX_N+5];

int main(int argc, char *argv[])
{
	ios::sync_with_stdio(false);

	cin >> N >> K;
	int ans = 0;
	FOR(n,N) {
		cin >> h[n];
		if(h[n]>=K) {
			ans++;
		}
	}

	cout << ans << endl;

	return 0;
}




Measured memory_bytes: 640
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n, s) for (int i = (s); i < (n); i++)
#define MOD 1000000007
typedef long long ll;
using namespace std;
using Graph = vector<vector<int>>;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> p(N);
    rep(i, N) cin >> p[i];
    sort(p.begin(), p.end(), greater<int>());
    int sum = accumulate(p.begin() + 1, p.end(), p[0] / 2);
    cout << sum << endl;
 //   system("pause");
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <math.h>
#include <string>
#include <numeric>
#include <queue>
#include <cstdio>
#include <cstring>
#define ll long long
#define rep(i,n) for(ll i=0;i<n;++i)
#define rep1(i,n) for(ll i=1;i<n;++i)
#define mrep(i,n) for(ll i=n;i>=0;--i)
#define all(a) (a).begin(),(a).end()
#define vl vector<ll>
#define vvl vector<vector<ll> >
#define vb vector<bool>
#define vvb vector<vector<bool> >
#define pl pair<ll,ll>
#define inf 1001001001001001000
//#define mod 1000000007
#define mod 998244353
#define pi 3.1415926535
using namespace std;
struct __INIT{
    __INIT(){
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout<<fixed<<setprecision(15);
    }
}__init;

int main(){
    ll n,k;
    cin>>n>>k;
    map<ll,ll> kosu;
    rep(i,n){
        ll a;
        cin>>a;
        kosu[a]++;
    }
    vl a;
    for(pl ngo:kosu){
        a.push_back(ngo.second);
    }
    sort(all(a));
    ll ans = 0;
    rep(i,(ll)a.size()-k){
        ans += a[i];
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 17672
#include<iostream>
using namespace std;
int main(){
  int time,total,m;
  total = 0;
  for(int i=0;i<4;i++){
    cin >> time;
    total += time;
  }
  m = 0;
  while(total>=60){
    m++;
    total -= 60;
  }
  cout << m << endl << total << endl;
  return 0;
}

Measured memory_bytes: 1160
import java.util.Scanner;
import java.util.ServiceConfigurationError;

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

        if(s.length() <= k){

        }else {
            StringBuilder sb = new StringBuilder();
            sb.append(s);

            sb.setLength(k);
            sb.append("...");
            s = sb.toString();
        }

        System.out.println(s);
    }
}


Measured memory_bytes: 35768
n = int(input())
h = [i for i in map(int, input().split())]

DP = [0, abs(h[0]-h[1])]

for i in range(n-2):
   DP += [min(DP[-2] + abs(h[i]-h[i+2]), DP[-1] + abs(h[i+1]-h[i+2]))]

print(DP[-1])

Measured memory_bytes: 13980
#include <bits/stdc++.h>
using namespace std;
#define ll long long
ll n,a,b,ans;
int main()
{
	scanf("%lld %lld %lld",&n,&a,&b);
	ans=n/(a+b)*a;if(n%(a+b)) ans+=min(n%(a+b),a);
	printf("%lld\n",ans);return 0;
}

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

string mySolution(int num){
	for(int i=1; i<=9; i++){
		if(num%i==0){
			int d = num/i;
			if(d>=1 && d<=9) return "Yes";
		}
	}
	return "No";
}
int main(){
	int n;
	cin >> n;
	cout << mySolution(n) << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int n,d;
    scanf("%d%d", &n, &d);
    int x = 2*d+1;
    int y = n/x;
    if(n%x==0)
    {
        printf("%d\n",y);
    }
    else
    {
        printf("%d\n", y+1);
    }

}


Measured memory_bytes: 128
#include <iostream>
#include <set>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

int main(){
	int d[31]={0},t;
	rep(i,28)cin >> t , d[t] = 1;
	for(int i=1;i<=30;i++){
		if(!d[i])cout << i << endl;
	}
}

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

int main() {
    int n;
    cin >> n;
    vector<int> dp(100100, n);
    dp[0] = 0;
    for (int i = 0; i < n; ++i) {
        for (int j = 1; i + j <= n; j *= 6) {
            dp[i + j] = min(dp[i + j], dp[i] + 1);
        }
        for (int k = 1; i + k <= n; k *= 9) {
            dp[i + k] = min(dp[i + k], dp[i] + 1);
        }
    }
    cout << dp[n] << endl;
}


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

using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;

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

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

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

  int N;
  cin >> N;

  vector<pair<int, int>> P(N);

  rep(i, N){
    int p;
    cin >> p;
    P[i] = make_pair(p, i);
  }

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

  int max_len = 0;
  int cnt = 1;
  rep(i, N-1){
    if(P[i].second < P[i+1].second){
      cnt++;
    }else{
      chmax(max_len, cnt);
      cnt = 1;
    }
  }

  chmax(max_len, cnt);

  cout << N - max_len << endl;
  

  return 0;
}


Measured memory_bytes: 1792
#B
n = int(input())
w = list(map(int, input().split()))
ans=100
for i in range(n - 1):
    left = sum(w[:i + 1])
    right = sum(w[i + 1:])
    if abs(left - right) < ans:
        ans = abs(left - right)
print(ans)

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

int main() {
  int N;
  scanf("%d",&N);
  int row[N];
  for (int i=0;i<N;i++) 
    scanf("%d",&row[i]);
  
  int max=row[0];
  string answer="Yes";
  for (int i=1;i<N;i++) {
    if (row[i]>=max) {
      max=row[i];
      continue;
    }
    else {
      if (row[i]>=max-1) continue;
      else {
        answer="No";
        break;
      }
    }
  }

  cout << answer;
  return 0;
}


Measured memory_bytes: 640
while True:
    m, f, r = list(map(int, input().split()))
    if m == f == r == -1:
        break
    elif m == -1 or f == -1:
        print('F')
    elif (m + f) >= 80:
        print('A')
    elif (m + f) >= 65 and (m + f) < 80:
        print('B')
    elif (m + f) >= 50 and (m + f) < 65:
        print('C')
    elif (m + f) >= 30 and (m + f) < 50:
        if r >= 50:
            print('C')
        else:
            print('D')
    else:
        print('F')


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

ll n;
ll arr[3005];

ll dp[3005][3005];

ll solve(ll i,ll j){
	if(i>j || i>=n || j>=n || i<0 || j<0)return 0;
	//cout<<i<<" "<<j<<endl;
	if(dp[i][j]==-1){
	
		dp[i][j] = max(arr[i]+min(solve(i+2,j),solve(i+1,j-1)),arr[j]+min(solve(i+1,j-1),solve(i,j-2)));	
		
	}
	//s\cout<<i<<" "<<j<<" "<<dp[i][j]<<endl;
	return dp[i][j];
	
	
	
}

int main(){
	
	cin>>n;
	ll s = 0;
	memset(dp,-1,sizeof(dp));
	for(ll i=0;i<n;++i){
	cin>>arr[i];
	s+=arr[i];
    }
    //cout<<s<<endl;
	cout<<2*solve(0,n-1)-s<<endl;
	//cout<<s-2*solve(0,n-1)<<endl;
}

Measured memory_bytes: 71040
def main():
    n = int(input())
    a = set([int(a) for a in input().split()])
    m = int(input())
    b = set([int(a) for a in input().split()])

    c = a.difference(b)
    sorted_c = sorted(c)
    for i in sorted_c:
        print(i)
main()



Measured memory_bytes: 52720
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cfloat>
#include<climits>
#include<cmath>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

using namespace std;

typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;


template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T, typename... Ts>
auto make_v(size_t a, Ts... ts) {
	return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template<typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type
fill_v(T& t, const V& v) { t = v; }
template<typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type
fill_v(T& t, const V& v) {
	for (auto& e : t) fill_v(e, v);
}


#define ARRAY_MAX 100005
const int INF = INT32_MAX / 3;
const ll MOD = 1e9 + 7;

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


/******************************************************************************************/



//ユークリッド互除法
template<typename T>
T gcd(T x, T y) {

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

/*最小公倍数*/
template<typename T>
T lcm(T x, T y) {
	T tmp = gcd(x, y);

	return x / tmp * y;
}


int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(10);


	ll n, m;
	cin >> n >> m;
	ll ans = 0;
	vector<ll> a(n);

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

	for (int i = 0; i < n; i++)
	{
		hoge = lcm(hoge, a[i]);
	}

	bool flag = true;
	for (int i = 0; i < n; i++)
	{

		if ((hoge / a[i]) % 2 == 0) {
			flag = false;
		}
	}

	if (flag) {
		cout << (m / hoge + 1) / 2 << endl;
	}
	else
	{
		cout << 0 << endl;
	}


	return 0;
}



Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
 public static void main(String[] args) {
  Scanner sc = new Scanner(System.in);
  int a = sc.nextInt();
  int b = sc.nextInt();
  int area = a * b;
  int length = 2 * a + 2 * b;
  System.out.println(area + " " + length);
 }
}

Measured memory_bytes: 26128
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <unordered_map>
#include <climits>
#include <set>
#include <unordered_set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
#include <random>
#include <complex>
#include <regex>

using namespace std;

#define SHOW_VECTOR(v) {std::cerr << #v << "\t:";for(const auto& xxx : v){std::cerr << xxx << " ";}std::cerr << "\n";}
#define SHOW_MAP(v){std::cerr << #v << endl; for(const auto& xxx: v){std::cerr << xxx.first << " " << xxx.second << "\n";}}


int main() {

    int N;
    cin >> N;

    vector<int> A(N), B(N);
    for (int i = 0; i < N; i++)cin >> A[i] >> B[i];

    int maxV = *max_element(A.begin(), A.end());
    int minV = *min_element(B.begin(), B.end());

    cout << maxV + minV << endl;

}















































Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
  
  int N,A,B;string S;
  
  cin>>N>>A>>B>>S;
  
  
  int check=0;
  
  int B_check=0;
  
  for(int i=0;i<N;i++){
    if(S[i]=='c'){
      cout<<"No"<<endl;
    }
    else if(S[i]=='a'){
      if(check<A+B){
        cout<<"Yes"<<endl;
        check++;
      }
      else if(check=A+B){
        cout<<"No"<<endl;
      }
    }
    else if(S[i]=='b'){
      if(check<A+B&&B_check<B){
        cout<<"Yes"<<endl;
        check++;
        B_check++;
      }
      else{
        cout<<"No"<<endl;
      }
    }
  }
}

Measured memory_bytes: 896
#include <cmath>
#include <cstdio>
#include<string>
#include <vector>
#include <iostream>
#include<bits/stdc++.h>
#include <algorithm>
#define pb push_back
#define ll long long
#define mk make_pair
using namespace std;
int main()
{
    int n;
    cin>>n;
    int tot=0;
    int m=1;
    
        while(m<=n)
        {
            m*=2;
        }
    cout<<(m/2)<<endl;
    
}

Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
int X[130000];
int Y[130000];
int Z[130000];
pair<int,pair<int,int> >pt[130000];
double x[130000];
double y[130000];
double z[130000];
double EPS=1e-9;
pair<double,int>ev[130000];
int main(){
	int a,b,c,d;
	while(scanf("%d%d%d%d",&a,&b,&c,&d),a+b){
		for(int i=0;i<a;i++)scanf("%d%d%d",X+i,Y+i,Z+i);
		int g=c;
		for(int i=a;i<a+b;i++){
			X[i]=(g/7)%100+1;
			Y[i]=(g/700)%100+1;
			Z[i]=(g/70000)%100+1;
			if(g%2==0)g/=2;
			else g=(g/2)^d;
		}
		int n=a+b;
		for(int i=0;i<n;i++)pt[i]=make_pair(X[i],make_pair(Y[i],Z[i]));
		std::sort(pt,pt+n);
		for(int i=0;i<n;i++){
			X[i]=pt[i].first;
			Y[i]=pt[i].second.first;
			Z[i]=pt[i].second.second;
		}
		for(int i=0;i<n;i++){
			double r=sqrt(X[i]*X[i]+Y[i]*Y[i]+Z[i]*Z[i]);
			x[i]=(double)X[i]/r;
			y[i]=(double)Y[i]/r;
			z[i]=(double)Z[i]/r;
		}
		for(int i=0;i<n;i++){
			double nx=x[i]*cos(1.0)-y[i]*sin(1.0);
			double ny=x[i]*sin(1.0)+y[i]*cos(1.0);
			x[i]=nx;y[i]=ny;
		}
		for(int i=0;i<n;i++)ev[i]=make_pair(x[i],i);
		std::sort(ev,ev+n);
		double ret=999999;
		int L=0;int R=0;
		for(int i=0;i<n;i++){
			for(int j=i-1;j>=0;j--){
				if(ev[i].first-ev[j].first>ret+EPS)break;
				int p=ev[i].second;
				int q=ev[j].second;
				if(q<p)swap(p,q);
				double dist=sqrt((x[p]-x[q])*(x[p]-x[q])+(y[p]-y[q])*(y[p]-y[q])+(z[p]-z[q])*(z[p]-z[q]));
				if(dist<EPS)continue;
				if(ret-EPS>dist){
					ret=dist;
					L=p;R=q;
				}else if(ret+EPS>dist&&(L>p||(L==p&&R>q))){
					L=p;R=q;
				}
			}
		}
		//printf("%f: %d %d\n",ret,L,R);
		printf("%d %d %d %d %d %d\n",X[L],Y[L],Z[L],X[R],Y[R],Z[R]);
	}
}

Measured memory_bytes: 8816
#include <cstdio>
#include <set>
#include <vector>
#include <algorithm>
#include <map>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)

struct UF {
  vector<int> data;
  int nDistinct;
  UF() {}
  UF(int n) : data(n, -1), nDistinct(n) {}
  void init(int n) { data.assign(n, -1); nDistinct = n; }
  int size(void) const { return nDistinct; }
  int rootOf(int a) { return data[a] >= 0 ? data[a] = rootOf(data[a]) : a; }
  int count(int a) { return -data[rootOf(a)]; }
  bool isSameGroup(int a, int b) { return rootOf(a) == rootOf(b); }
  bool unify(int a, int b) {
    int ra = rootOf(a), rb = rootOf(b);
    if(ra == rb) return false;
    if(data[ra] < data[rb]) swap(ra, rb);
    data[rb] += data[ra]; data[ra] = rb; --nDistinct;
    return true;
  }
};

map<int,int> fromX, fromY;

typedef long long ll;
struct P {
  int x, y;
};
P ps[100000+10];

struct E {
  int a, b, c;
};
bool operator<(const E& e1, const E& e2) {
  return e1.c < e2.c;
}

int main(void) {
  ll n;
  scanf("%lld", &n);
  vector<E> es;
  REP(i, n) {
    int x, y;
    scanf("%d%d", &x, &y);
    ps[i] = (P){x, y};
    {
      auto it = fromX.lower_bound(x);
      if(it != fromX.end()) { // x以上のが既にある
        es.push_back((E){i, it->second, it->first - x});
      }
      if(it != fromX.begin()) { // x未満のが既にある
        --it;
        es.push_back((E){i, it->second, x - it->first});
      }
    }
    {
      auto it = fromY.lower_bound(y);
      if(it != fromY.end()) { // y以上のが既にある
        es.push_back((E){i, it->second, it->first - y});
      }
      if(it != fromY.begin()) { // y未満のが既にある
        --it;
        es.push_back((E){i, it->second, y - it->first});
      }
    }
    fromX[x] = i;
    fromY[y] = i;
  }

  sort(es.begin(), es.end());
  UF uf(n);
  ll res = 0;
  REP(i, es.size()) {
    const E& e = es[i];
    if(uf.unify(e.a, e.b)) {
      res += e.c;
    }
  }

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


Measured memory_bytes: 16812
#include<bits/stdc++.h>
using namespace std;
int h,w;
int dx[] = {0,1,0,-1,1,-1,1,-1};
int dy[] = {1,0,-1,0,1,-1,-1,1};
char a[55][55];
int main() {
	ios::sync_with_stdio(false);
	cin >> h >> w;
	for(int i = 1; i <= h; i++)
		for(int j = 1; j <= w; j++)
			cin >> a[i][j];
	for(int i = 1; i <= h; i++)
		for(int j = 1; j <= w; j++)
			if(a[i][j] == '.') {
				a[i][j] = 0;
				for(int k = 0; k < 8; k++)
					a[i][j] += a[i + dx[k]][j + dy[k]] == '#';
			}
	for(int i = 1; i <= h; i++) {
		for(int j = 1; j <= w; j++)
			if(a[i][j] == '#')
				cout << "#";
			else
				cout << int(a[i][j]);
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <string>
#include <iostream>
#include <map>
using namespace std;
#define pi 3.14159265

int main()
{
	long long ans = 0, i = 0, j = 0, k = 0, N, max=0;
	string S;
	cin >> N >> S;

	for (i = 0; i<N; i++) {
		int a[27] = { 0 }, b[27] = { 0 }, cnt=0;

		for (j = 0; j < i; j++) {
			a[S[j]-'a']++;
		}
		for (k = i; S[k]; k++) {
			b[S[k]-'a']++;
		}
		for (int l = 0; l < 27; l++) {
			if (a[l] * b[l]) cnt++;
		}
		if (cnt > max)max = cnt;
	}

	cout << max << endl;
	return 0;
}

Measured memory_bytes: 256
package main

import (
    "bufio"
    "fmt"
    "os"
    "strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
    sc.Scan()
    i, e := strconv.Atoi(sc.Text())
    if e != nil {
        panic(e)
    }
    return i
}

func nextString() string {
    sc.Scan()
    return sc.Text()
}


func getScore(l int, s string) int {
    score := 0
    for i := 0; i < l; i++ {
        if s[i] == 'L' && i > 0 {
            if s[i - 1] == 'L' {
                score++;
            }
        } else if s[i] == 'R' && i < l - 1 {
            if s[i + 1] == 'R' {
                score++;
            }
        }
    }
    return score;
}

func getDivPos(l int, s string) ([]int, []int) {
    var LR, RL []int
    LR = make([]int, 0, l)
    RL = make([]int, 0, l)
    for i := 0; i < l - 1; i++ {
        if s[i:i+1+1] == "LR" {
            LR = append(LR, i)
        } else if s[i:i+1+1] == "RL" {
            RL = append(RL, i)
        }
    }
    return LR, RL
}

func turnString(l int, s string, start int, end int) string {
    if start > end {
        tmp := start
        start = end
        end = tmp
    }

    start++;
    
    turned := []byte(s)
    for i := 0; i <= (end - start); i++ {
        if s[end - i] == 'L' {
            turned[start + i] = 'R'
        } else {
            turned[start + i] = 'L'
        }
    }
    //fmt.Println(s, " -(",start,",",end,")-> ", string(turned))
    return string(turned)
}

func loopSearch(l int, opnum int, s string) int {
    beforescore := getScore(l, s)

    LR, RL := getDivPos(l, s)

    //fmt.Println(LR, RL)

    needstepnum := len(LR)
    if (len(RL) > needstepnum) {
        needstepnum = len(RL)
    }

    if (needstepnum <= opnum) {
        return l - 1
    } else {
        return beforescore + (opnum * 2)
    }
}

func main() {
    buf := make([]byte, 0)
    sc.Buffer(buf, 4000000)
    sc.Split(bufio.ScanWords)
	n := nextInt()
	k := nextInt()
    s := nextString()
    //fmt.Println("N:",n)
    //fmt.Println("K:",k)
    //fmt.Println("S:",s)
    
    fmt.Println(loopSearch(n, k, s))
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define dump(x) cerr<<#x<<": "<<x<<endl;
#define bit(k) (1LL<<(k))
typedef long long ll;
typedef pair<int, int> i_i;
typedef pair<ll, ll> l_l;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 >& p) {
  os << "{" <<p.first << ", " << p.second << "}";
  return os;
}
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; }

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = (ll)1e9+7;
const double PI = acos(-1.0);
/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/

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

    ll N;
    cin >> N;
    string ans;
    while(N){
        N--;
        ans.push_back(char('a'+N%26));
        N /= 26;
    }
    reverse(all(ans));
    cout << ans << endl;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const ll LINF = 1e18;
const int MOD = 1e9 + 7;

int main() {
  char c;
  cin >> c;
  if (c == 'A')
    cout << 'T' << endl;
  else if (c == 'T')
    cout << 'A' << endl;
  else if (c == 'C')
    cout << 'G' << endl;
  else if (c == 'G')
    cout << 'C' << endl;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int N = sc.nextInt();
            StringBuilder result = new StringBuilder();

            List<Long> tmp = new ArrayList<>();
            for (int i = 0; i < N; i++) {
                tmp.add(sc.nextLong());
            }

            result.append(new HashSet<Long>(tmp).size() == tmp.size() ? "YES" : "NO");

            System.out.println(result);
        }
    }
}

Measured memory_bytes: 94648
read = input
a = [read() for i in range(5)]
a = list(map(int, a))
if all(map(lambda x: x%10 == 0, a)):
    print(sum(a))
else :
    g10 = list(filter(lambda x:x%10 > 0 , a))
    l10 = list(filter(lambda x:x%10 == 0 , a))
    m = min(g10, key=lambda x:x%10)
    g100= list(map(lambda x:x//10*10 + 10, g10))
    print(sum(g100)  +sum(l10)- m//10*10 - 10 + m)
    
    

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

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;

int main(){
  int N, T, H, L;
  while(cin>>N>>T>>H>>L && N){
    int myt = T;
    int myh = H;
    int idx = 0;
    int t[100], h[100];
    REP(i, N) cin>>t[i]>>h[i];
    int ans = -1;
    int rest = 0;
    while(true){
      if(t[idx] > 0){
        myt++;
        t[idx]--;
        rest += 10;
      }else if(h[idx] > 0){
        myh++;
        h[idx]--;
        rest += 100;
      }else{
        ans = idx;
        break;
      }
      if(myt > L){
        ans = idx;
        break;
      }
      if(rest >= 90){
        int res = rest - 90;
        if(res / 10 > myt){
          ans = idx;
          break;
        }else{
          myt -= res / 10;
          t[idx] += res / 10;
        }
        rest = 0;
      }
      idx = (idx + 1) % N;
    }
    cout<<ans + 1<<endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
#define pb emplace_back
#define ll long long
#define mp make_pair
#define PI acos(-1)
using namespace std;
bool ar[1000005];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll i,j,k,x,y,z,m,t,n,b,a,c,d,l,r;
    cin>>n;
        x=0;
        ll cnt=1;
        while(1)
        {
            x*=10;
            x+=7;
            x%=n;
            if(ar[x])
                break;
            if(x==0)
            {
                cout<<cnt<<'\n';
                return 0;
            }
            ar[x]=1;
            cnt++;

        }
        cout<<-1<<'\n';
}










Measured memory_bytes: 4540
import numpy as np
if __name__ == "__main__":
    # 入力パターン．
    # 要素の数がわかっているパターン
    ### a b
    x = int(input())
    y = 1
    m = 100

    while True:
        m = int(m * 1.01)
        if m >= x:
            break
        y += 1
    print(y)


Measured memory_bytes: 27144
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)

typedef int long long ll;
using namespace std;
typedef pair<int,int> P;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const ll MOD=1e9+7;
static const int MAX = 100;
static const int INF = (1<<23);
template<class T> T gcd(T a, T b){return b? gcd(b,a%b) : a;}
template<class T> T lcm(T a,T b){return a / gcd(a,b)*b;}
ll n;
vector<ll> v;

int main(){
    cin>>n;
    ll k;
    cin>>k;

    rep(i,n){
        ll a;
        cin>>a;
        v.push_back(a);
    }
    int now = 1;
    vector<bool> al(n+1,false);
    al[1]=true;
    vector<int> mt;
    mt.push_back(1);
    int last = -1;
    while(true){
        now=v[now-1];
        if(al[now]){
            last = now;
            break;
        }else{
            mt.push_back(now);
            al[now]=true;
        }
    }

//    rep(i,mt.size()){
//        cout<<mt[i]<<endl;
//    }


    ll miti = 0;
    rep(i,mt.size()) {
        if (mt[i] == last) {
            break;
        }
        miti++;
    }

    if(last==1){
        if(mt.size()==1){cout<<1<<endl;return 0;}else{
            cout<<mt[k%mt.size()]<<endl;
            return 0;
        }
    }

    ll zyun = mt.size()-miti;

    if(k<=mt.size()-1){
        cout<<mt[k]<<endl;
    }else{
        k-=miti;
        ll nokori = k%zyun;
        cout<<mt[miti+nokori]<<endl;
    }













    return 0;
}


Measured memory_bytes: 6440
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
  int n[3];
  for (int i = 0; i < 3; i++)
    cin >> n[i];
  sort(n, n + 3);
  string ans = "NO";
  if (n[0] == 5 && n[1] == 5 && n[2] == 7)
    ans = "YES";
  cout << ans << endl;
  return 0;
}

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

int main() {
  ll x;
  cin>>x;
  ll i=0,pls=1,ans=0;
  while(i<x){
    i+=pls;
    pls++;
    ans++;
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256