akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using vi=vector<int>;
using vvi=vector<vi>;
using vs=vector<string>;
using msi=map<string,int>;
using mii=map<int,int>;
//using pii=pair<int,int>;
using vlai=valarray<int>;
using ll=long long;
using pii=pair<ll,ll>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1e9
#define EPS 1e-9
#define MOD (1e9+7)
void bulk(){}template<class H,class...T>void bulk(H&h,T&...t){cin>>h;bulk(t...);}
#define get(...) int __VA_ARGS__; bulk(__VA_ARGS__);


int main(){
    string s;cin>>s;
    int f=0;
    if(s.find('N')!=string::npos) f^=1;
    if(s.find('S')!=string::npos) f^=1;
    if(s.find('E')!=string::npos) f^=2;
    if(s.find('W')!=string::npos) f^=2;
    if(f) cout<<"No"<<endl;
	else cout<<"Yes"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
using namespace std;
//FILE *fi = freopen("1.txt", "r", stdin);
//FILE *fo = freopen("1", "w", stdout);
//FILE *fi = freopen("P.inp", "r", stdin);
//FILE *fo = freopen("P.out", "w", stdout);
typedef pair<int, int> ii;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int n, m, k;
struct Node
{
    int x, y;
    int w;
};
struct cmp
{
    bool operator()(Node a, Node b)
    {
        return a.w > b.w;
    }
};
string s[1000001];
ii S, T;
vector<vector<int>> Dist;
vector<vector<int>> vis;
void Dijktra()
{
    Dist.resize(n + 10);
    for (int i = 1; i <= n; i++)
    {
        Dist[i].resize(m + 10);
    }
    vis = Dist;
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= m; j++)
        {
            Dist[i][j] = 1e9;
        }
    }
    Dist[S.first][S.second] = 0;
    queue<Node> h;
    h.push({S.first, S.second, 0});
    while (h.size())
    {
        Node x = h.front();
        h.pop();
        ii u = {x.x, x.y};
        int du = x.w;
        if (du != Dist[u.first][u.second])
            continue;
        for (int i = 0; i < 4; i++)
        {
            for (int j = 1; j <= k; j++)
            {
                ii v;
                v.first = u.first + dx[i] * j;
                v.second = u.second + dy[i] * j;
                int val = j / k + (j % k != 0);
                if (v.first < 1 || v.first > n || v.second < 1 || v.second > m || s[v.first][v.second] == '@' || Dist[v.first][v.second] <= Dist[u.first][u.second])
                    break;
                if (vis[v.first][v.second])
                    continue;
                vis[v.first][v.second] = true;
                Dist[v.first][v.second] = Dist[u.first][u.second] + 1;
                h.push({v.first, v.second, Dist[v.first][v.second]});
            }
        }
    }
    if (Dist[T.first][T.second] == 1e9)
    {
        cout << -1;
        return;
    }
    cout << Dist[T.first][T.second];
}
int main()
{
    //------------------------------
    // Faster
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //-------------------------------
    cin >> n >> m >> k;
    cin >> S.first >> S.second >> T.first >> T.second;
    for (int i = 1; i <= n; i++)
    {
        cin >> s[i];
        s[i] = '.' + s[i];
    }
    Dijktra();
    return 0;
}

Measured memory_bytes: 44772
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        new Main().run();
    }

    private void run() {
        Scanner scanner = new Scanner(System.in);
        byte[] X = scanner.next().getBytes();
        int ok = 0;
        if(X[0] == X[1]) ok++;
        if(X[0] == X[2]) ok++;
        if(X[0] == X[3]) ok++;
        if(X[1] == X[2]) ok++;
        if(X[1] == X[3]) ok++;
        if(X[2] == X[3]) ok++;

        if(ok == 2) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }

    }
}

Measured memory_bytes: 21460
import copy
from collections import Counter

h, w, K = map(int, input().split())



c = [[False for _ in range(w)] for _ in range(h)]
for i in range(h):
    s = input()
    for j in range(len(s)):
        if s[j] == '#':
            c[i][j] = True


cnt = 0
for i in range(2**h):
    tmp = copy.deepcopy(c)
    for j in range(h):
        if((i >> j) & 1):
            tmp[j] = [False for _ in range(w)] 

    for k in range(2**w):
        tmp2 = copy.deepcopy(tmp)
        for m in range(w):
            if((k >> m) & 1):
                for a in range(h):
                    tmp2[a][m] = False
            
        if sum(tmp2, []).count(True) == K:
            cnt += 1

print(cnt)


Measured memory_bytes: 9568
use proconio::input;

fn main() {
    input! {
        s: String,
    }

    solve(s);
}

fn solve(s: String) {
    match s.as_str() {
        "SUN" => println!("7"),
        "MON" => println!("6"),
        "TUE" => println!("5"),
        "WED" => println!("4"),
        "THU" => println!("3"),
        "FRI" => println!("2"),
        "SAT" => println!("1"),
        _ => panic!("UNEXPECTED"),
    }
}


Measured memory_bytes: 2128
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <deque>
using namespace std;
using P = pair<int,int>;
typedef long long int ll;
#define rep(i, n) for (int(i) = 0; (i) < (n); (i)++)
ll choose2(ll n){
    return n*(n-1)/2;
}
int main(){
    int n; cin >>n;
    vector<int>a(n);
    rep(i,n){
        cin >> a[i];
        a[i]--;
    }
    vector<int>cnt(n);
    rep(i,n)cnt[a[i]]++;
    ll tot = 0;
    rep(i,n){
        tot += choose2(cnt[i]);
    }
    rep(i,n){
        ll ans = tot;
        ans -= choose2(cnt[a[i]]);
        cnt[a[i]]--;
        ans += choose2(cnt[a[i]]);
        cout << ans << endl;
        cnt[a[i]]++;
    }
    return 0;
}




Measured memory_bytes: 4096
#pragma warning(disable:4996)

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>

#pragma region 定義
#define i_cin(X) scanf("%d", &X)
#define i_cin2(X,Y) scanf("%d %d",&X,&Y)
#define i_cin4(X,Y,Z,W) scanf("%d %d %d %d",&X,&Y,&Z,&W)
#define i_cin3(X,Y,Z) scanf("%d %d %d",&X,&Y,&Z)
#define l_cin(X) scanf("%ld",&X)
#define f_cin(X) scanf("%f",&X)
#define l_cin2(X,Y) scanf("%ld %ld",&X,&Y)
#define s_cin(X) scanf("%s",&X)
#define ll_cin(X) scanf("%lld", &X)

#define  i_cout(X) printf("%d\n",X)
#define  f_cout(X) printf("%g\n",X)
#define  i_cout2(X,Y) printf("%d %d\n",X,Y)
#define  l_cout(X) printf("%ld\n",X)
#define  s_cout(X) printf("%s\n",X)
#define  ll_cout(X) printf("%lld\n",X)

typedef long long  ll;
#define rept(x, s, n) for (int x = s; x < n; x++)

#define S_RTN(S)  s_cout(S);return 0


#define _itoa(A,N) sprintf(A, "%d", N);

int i_cins(int n, int* A);
int l_cins2(int n, long* A, long* B);
int s_dsort(const void* a, const void* b);
int s_asort(const void* a, const void* b);

int  _gcd(int a, int b);
int  _swp(int* a, int* b);
int _cknum(char* a, int n);
int _atoi(char* s, int len);


int s_asorts(const void* a, const void* b);

//昇順
int s_asorts(const void* a, const void* b) {
	return(strcmp((char*)a, (char*)b));
}
int s_dsort(const void* a, const void* b) {
	return(*(int*)b - *(int*)a);
}
int s_asort(const void* a, const void* b) {
	return(*(int*)a - *(int*)b);
}
int l_cins2(int n, long* a, long* b) {
	int i;
	rept(i, 0, n) {
		l_cin2(*(a + i), *(b + i));
	}
	return 0;
}
int i_cins(int n, int* a) {
	int i;
	for (i = 0; i < n; i++) {
		i_cin(*(a + i));
	}

	return 0;
}
int _gcd(int a, int b) {
	int r, tmp;
	if (a < b) { tmp = a; a = b; b = tmp; }
	r = a % b;
	while (r) {
		if (!r) break;
		a = b; b = r;
		r = a % b;
	}
	return(b);
}

long _max(long a, long b) {
	return a > b ? a : b;
}
long _min(long a, long b) {
	return a < b ? a : b;
}
int _swp(int* a, int* b)
{
	int tmp;
	tmp = *b; *b = *a; *a = tmp;
	return 0;
}

int _cknum(char* a, int n) {
	int i;
	char t = '0';

	for (i = 0; i < n; i++) {
		if (a[i] < '0' || a[i]>'9') return 1;
	}
	return 0;
}


int _atoi(char* s, int len) {
	char tmp[20];
	memcpy(tmp, s, len);
	tmp[len] = 0x00;
	return (atoi(tmp));
}
#pragma endregion

static int a[200001], x[200001];

int main(void)
{

	int  x,i=0,tmp=0;

	i_cin(x);

	while (1) {
		tmp += i;
		if (tmp >= x) break;
		i++;
	}
	i_cout(i);
	
	return 0;
}



Measured memory_bytes: 128
#include <stdio.h>

void factorial(int *ans, int fact)
{
	int i;
	
	for (i = 19; i >= 0; i--){
		if (ans[i] != -1){
			ans[i] *= fact;
			if (ans[i] > 9){
				if (ans[i + 1] == -1){
					ans[i + 1] = 0;
				}
				ans[i + 1] += ((ans[i] % 100) - (ans[i] % 10)) / 10;
			}
			if (ans[i] > 99){
				if (ans[i + 2] == -1){
					ans[i + 2] = 0;
				}
				ans[i + 2] += ((ans[i] - ans[i] % 100)) / 100;
			}
			ans[i] = ans[i] % 10;
		}
	}
	for (i = 19; i >= 0; i--){
		if (ans[i] != -1 && ans[i] > 9){
			if (ans[i + 1] == -1){
				ans[i + 1] = 0;
			}
			ans[i + 1] += ((ans[i] % 100) - (ans[i] % 10)) / 10;
		}
		ans[i] = ans[i] % 10;
	}
}

int main(void)
{
	int ans[20];
	int input;
	int i;
	
	scanf("%d", &input);
	
	for (i = 0; i < 20; i++){
		ans[i] = -1;
	}
	
	ans[0] = 1;
	
	for (i = 2; i <= input; i++){
		factorial(ans, i);
	}
	
	for (i = 19; i >= 0; i--){
		if (ans[i] != -1){
			printf("%d", ans[i]);
		}
	}
	
	printf("\n");
	
	return (0);
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

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

    int x, a; cin >> x >> a;
    if(x < a){
        cout << 0 << endl;
    }
    else {
        cout << 10 << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define rrep(ri,n) for(int ri = (int)(n-1); ri >= 0; ri--)
#define rep2(i,x,n) for(int i = (int)(x); i < (int)(n); i++)
#define repit(itr,x) for(auto itr = x.begin(); itr != x.end(); itr++)
#define rrepit(ritr,x) for(auto ritr = x.rbegin(); ritr != x.rend(); ritr++)
#define ALL(n) begin(n), end(n)
using ll = long long;
using namespace std;

int main(){
	int k;
	cin >> k;
	if(k < 10){
		cout << k << endl;
		return 0;
	}
	ll now = 9, p = 9, count = 9;
	while(count < k){
		// cerr << p << " ";
		now = p + 1;
		string sn = to_string(now);
		string nsp;
		bool c = true;
		rep(i, sn.size()-1){
			int l = sn[i] - '0', r = sn[i+1] - '0';
			if(abs(l - r) > 1){
				c = false;
				break;
			}
		}
		if(c == false){
			string sp = to_string(p);
			int pos = -1;
			for(int i = sp.size()-1; i > 1; i--){
				int il = sp[i-2] - '0', im = sp[i-1] - '0', ir = sp[i] - '0';
				if(im != 9 && il >= im && im <= ir){
					pos = i-1;
					break;
				}
			}
			nsp = sp;
			if(pos != -1){
				nsp[pos] = nsp[pos] + 1;
				// cerr << "t:" << pos << " ";
				for(int i = pos+1; i < nsp.size(); i++){
					int add = nsp[i-1] - '0';
					if(add > 0) add--;
					nsp[i] = add + '0';
				}
			}else{
				string nn;
				if(sp.front() == '9'){
					rep(i, nsp.size()+1){
						if(i== 0)nn.push_back('1');
						else nn.push_back('0');
					}
				}else{
					rep(i, nsp.size()){
						if(i == 0){
							int add = sp[i] - '0';
							add++;
							nn.push_back(add + '0');
						}else{
							int add = nn[i-1] - '0';
							if(add != 0) add--;
							nn.push_back(add + '0');
						}
					}
				}
				nsp = nn;
			}
			now = stoll(nsp);
		}
		p = now;
		count++;
	}
	// cerr << endl;
	cout << p << endl;
	return 0;
}

Measured memory_bytes: 384
import kotlin.math.*
import java.util.*

const val MOD = 1_000_000_007L

fun readI() = readLine()!!.toInt()
fun readL() = readLine()!!.toLong()
fun readD() = readLine()!!.toDouble()
fun readIs() = readLine()!!.split(' ').map(String::toInt)
fun readLs() = readLine()!!.split(' ').map(String::toLong)
fun readDs() = readLine()!!.split(' ').map(String::toDouble)

fun main() {
  val s = readLine()!!
  val t = readLine()!!
  val sn = s.length
  val tn = t.length
  var x = Int.MAX_VALUE
  for (i in 0..sn - tn) {
    var n = 0
    for (j in 0 until tn) {
      if (t[j] != s[i + j]) n++
    }
    x = min(x, n)
  }
  println(x)
}


Measured memory_bytes: 36012
#include <iostream>
#include <vector>
#include <map>
#include <math.h>
#include <algorithm>

using namespace std;

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

	int color[13];

	for (int i = 0; i < 13; i++) {
		color[i] = 0;
	}
	for (int i = 0; i < N; i++) {
		int rate;
		cin >> rate;
		color[int(rate / 400)]++;
	}

	int min = 0;
	for (int i = 0; i < 8; i++) {
		if (color[i] > 0) {
			min++;
		}
	}
	if (min == 0) {
		cout << 1;
	}
	else {
		cout << min;
	}
	cout << " ";

	int max = min;
	for (int i = 8; i < 13; i++) {
		max += color[i];
	}
	cout << max;
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <functional>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#define nmax_def 110000
#define Cmax_def 2200
#define mod 1000000007
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;

int main() {
	int N, K, Q;
	cin >> N >> K >> Q;
	vl point(N, K - Q);
	rep(i, Q) {
		int A;
		cin >> A;
		A--;
		point[A]++;
	}
	rep(i, N) {
		if (point[i] > 0)
			cout << "Yes" << endl;
		else
			cout << "No" << endl;
	}

	return 0;
}

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

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 1000000007
#define MOD9 998244353
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

using II = pair<int, int>;

int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a * b / gcd(a, b); }
int extgcd(int a, int b, int &x, int &y) { int g = a; x = 1; y = 0; if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x; return g; }

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

signed main()
{
  int N, D, ans = 0;
  cin >> N >> D;
  REP(n,N) {
    int x, y; cin >> x >> y;
    if (x*x + y*y <= D*D) {
      ans++;
    }
  }

  cout << ans << endl;

  return 0;
}


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

// Inserted snippets: io, root
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
template<typename H> bool chmin(H& v1, const H v2) { if (v1 > v2) { v1 = v2; return true; } return false; }
template<typename H> bool chmax(H& v1, const H v2) { if (v1 < v2) { v1 = v2; return true; } return false; }
template<typename H> void read(H& head) { cin >> head; }
template<typename H, typename ...T> void read(H& head, T& ...tail) { cin >> head; read(tail...); }
template<typename H> void write(H head) { cout << head << '\n'; }
template<typename H, typename ...T> void write(H head, T ...tail) { cout << head << " "; write(tail...); }
template<typename ...T> void die(T ...tok) { write(tok...); exit(0); }
// End snippets

pii sp(int a, int b) {
	if (a <= b)
		return {a, b};
	else
		return {b, a};
}

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

	int n; read(n);
	vector<ll> v(n);
	rep(i, 0, n) read(v[i]);
	sort(v.rbegin(), v.rend());
	
	ll ans = 0;
	priority_queue<pii> pq;

	ans += v[0];
	pq.push(sp(v[0], v[1]));
	pq.push(sp(v[0], v[1]));

	rep(i, 2, n) {
		pii slot = pq.top();
		pq.pop();
		ans += slot.first;
		pq.push(sp(slot.first, v[i]));
		pq.push(sp(slot.second, v[i]));
	}

	write(ans);
}


Measured memory_bytes: 6892
#include "iostream"
#include "vector"
#include "string"
#include "algorithm"
#include "math.h"
#include "cstring"

using namespace std;
typedef long long ll;

string s, t;
int dpsize[3010][3010];	//i,jでのlcs

int main()
{
  cin >> s >> t;
  int size_s = s.size();
  int size_t = t.size();
  for (int i = 0; i < 3010; i++)
  {
    dpsize[0][i] = 0;
    dpsize[i][0] = 0;
  }
  for (int i = 0; i < size_s; i++)
  {
    for (int j = 0; j < size_t; j++)
    {
      if (s[i] == t[j])
      {
        dpsize[i + 1][j + 1] = dpsize[i][j] + 1;
      }
      else
      if (dpsize[i + 1][j] > dpsize[i][j + 1])
      {
        dpsize[i + 1][j + 1] = dpsize[i + 1][j];
      }
      else
      {
        dpsize[i + 1][j + 1] = dpsize[i][j + 1];
      }
    }
  }

  string ans = "";
  int i = size_s;
  int j = size_t;
  while (dpsize[i][j] > 0)
  {
    if (dpsize[i][j] == dpsize[i - 1][j])
    {
      i--;
    }
    if (dpsize[i][j] == dpsize[i][j - 1])
    {
      j--;
    }
    if (dpsize[i][j] > dpsize[i - 1][j] && dpsize[i][j] > dpsize[i][j - 1])
    {
      ans += s[i - 1];
      i--;
      j--;
    }
  }
  reverse(ans.begin(), ans.end());
  cout << ans << "\n";
}

Measured memory_bytes: 35584
#include <iostream>
#include <set>

using namespace std;

int main()
{
	int n; cin>>n;
	while(n--){
		string s; cin>>s;
		set<string> se;
		for(int i=1;i<s.size();i++){
			string s1[2]={s.substr(0,i),string(s1[0].rbegin(),s1[0].rend())};
			string s2[2]={s.substr(i),string(s2[0].rbegin(),s2[0].rend())};
			for(int j=0;j<2;j++)
				for(int k=0;k<2;k++){
					se.insert(s1[j]+s2[k]);
					se.insert(s2[k]+s1[j]);
				}
		}
		cout<<se.size()<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 992
n, l = map(int, input().split())

total = (l - 1) * n + n * (n + 1) // 2
min_diff = 1e20
for i in range(n):
  apple = l + i
  apple_pie = total - apple
  diff = abs(apple)
  if diff < min_diff:
    min_diff = diff
    min_apple_pie = apple_pie
print(min_apple_pie)

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int h = sc.nextInt();
    	int a = sc.nextInt();
    	sc.close();
    	int cnt = 0;
    	while(0 < h){
    		h = h - a;
    		cnt++;
    	}
    	System.out.println(cnt);
    }
}

Measured memory_bytes: 22740
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_D main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LLONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
// functions

#endif


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

    const ll MOD = (ll)1e9 + 7;
    int N; cin >> N;
    string S1; cin >> S1;
    string S2; cin >> S2;

    ll ans = 1;

    int i = 0;
    bool pre_v = false;
    if (S1[0] == S1[1]) {
        ans *= 6;
        i += 2;
        pre_v = false;
    } else {
        ans *= 3;
        i++;
        pre_v = true;
    }
    while(i<N) {
        if (pre_v) {
            if (i+1 < N && S1[i] == S1[i + 1]) {
                ans *= 2;
                ans %= MOD;
                i += 2;
                pre_v = false;
            } else {
                ans *= 2;
                ans %= MOD;
                i++;
                pre_v = true;
            }
        } else {
            if (i+1 < N && S1[i] == S1[i + 1]) {
                ans *= 3;
                ans %= MOD;
                i += 2;
                pre_v = false;
            } else {
                //ans *= 1;
                //ans %= MOD;
                i++;
                pre_v = true;
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int a[20000],b[20000];
int main(){
	int n,m,z;
	while(true){
	cin>>n>>m;
	if(n==0&&m==0)
		break;
	for(int i=0;i<n;i++){
		cin>>z;
		a[i]=z;
	}
	for(int i=0;i<m;i++){
		cin>>z;
		a[i+n]=z;
	}
	sort(a,a+n+m);
	b[n+m-1]=a[0];
	for(int i=0;i<n+m-1;i++){
		b[i]=a[i+1]-a[i];
	}
	sort(b,b+n+m);
	cout<<b[n+m-1]<<endl;
	}
	return 0;
}

Measured memory_bytes: 1336
import std.stdio, std.conv, std.string, std.bigint;
import std.math, std.random, std.datetime;
import std.array, std.range, std.algorithm, std.container, std.format;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

void main(){
	auto s = readln.chomp;
	
	auto x = "keyence";
	
	auto ans = "NO";
	for(int i = 0; i <= s.length; i ++){
		for(int j = i; j <= s.length; j ++){
			if(s[0 .. i] ~ s[j .. $] == x) ans = "YES";
		}
	}
	
	ans.writeln;
}


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

int main() {
  int N, K, l=0;
  cin >> N >> K;
  for (int i;i<N;i++){
    int t;
    cin >> t;
    if(K-t<t){
      l+=(K-t)*2;
    }
    else{
      l+=t*2;
    }
  }
 cout << l << endl;
} 

Measured memory_bytes: 256
import math
import copy
from copy import deepcopy
import sys
import fractions
# import numpy as np
from functools import reduce
# import statistics
import decimal
import heapq
import collections
import itertools

sys.setrecursionlimit(100001)


# input = sys.stdin.readline
# sys.setrecursionlimit(10**6)

# ===FUNCTION===

def getInputInt():
    inputNum = int(input())
    return inputNum


def getInputListInt():
    outputData = []
    inputData = input().split()
    outputData = [int(n) for n in inputData]

    return outputData


def getSomeInputInt(n):
    outputDataList = []
    for i in range(n):
        inputData = int(input())
        outputDataList.append(inputData)

    return outputDataList


def getSomeInputListInt(n):
    inputDataList = []
    outputDataList = []
    for i in range(n):
        inputData = input().split()
        inputDataList = [int(n) for n in inputData]
        outputDataList.append(inputDataList)

    return outputDataList


# ===CODE===
n, m, l = map(int, input().split())

a = getSomeInputListInt(n)
b = getSomeInputListInt(m)

ans =[[0 for i in range(l)] for j in range(n)]

for i in range(n):
    for j in range(l):
        tmp_a = a[i]
        tmp_b = [b[k][j] for k in range(m)]

        tmp_ans = 0
        for k in range(len(a[i])):
            tmp_ans += tmp_a[k]*tmp_b[k]
        ans[i][j] = tmp_ans

for row in ans:
    print(*row, sep=" ")



Measured memory_bytes: 8404
# Author: cr4zjh0bp
# Created: Sun Mar 22 11:54:41 UTC 2020
import sys
 
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

n = ni()
a = na()
a = [i - 1 for i in a]
b = [0] * n
for i in range(n):
    b[a[i]] += 1
r = 0
for i in range(n):
    r += b[i] * (b[i] - 1) // 2

for i in range(n):
    l = b[a[i]] * (b[a[i]] - 1) // 2
    k = (b[a[i]] - 1) * (b[a[i]] - 2) // 2
    print(r - l + k)

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

int main() {
  int a[3];
  for (int i = 0; i < 3; i++) {
    cin >> a[i];
  }
  int count = 0, count2 = 0;
  for (int i = 0; i < 3; i++) {
    if (a[i] == 5) count++;
    else if (a[i] == 7) count2++;
  }
  if (count == 2 && count2 == 1) cout << "YES" << endl;
  else cout << "NO" << endl;

  return 0;
}


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

using namespace std;

const int INF = 1e9;

struct SegTree {
#define left 2 * i
#define right 2 * i + 1
#define m (l + r) / 2

    int n, len;
    vector<int> seg;

    SegTree(const int n) : n(n), len(4 * n), seg(len, INF) {}

    int read(int x, int y, int i, int l, int r) {
        if (y < l or r < x) {
            return INF;
        }
        if (x <= l and r <= y) {
            return seg[i];
        }
        return min(read(x, y, left, l, m), read(x, y, right, m + 1, r));
    }

    int read(int x, int y) { return read(x, y, 1, 1, n); }

    void update(int x, int val, int i, int l, int r) {
        if (l == r) {
            seg[i] = val;
            return;
        }
        if (x <= m)
            update(x, val, left, l, m);
        else
            update(x, val, right, m + 1, r);
        seg[i] = min(seg[left], seg[right]);
    }

    void update(int x, int val) { update(x, val, 1, 1, n); }

    int find(int x, int y) {
        int lo = x - 1, hi = y;
        const int val = read(x, y);
        while (lo + 1 < hi) {
            const int mid = (lo + hi) / 2;
            if (read(x, mid) == val)
                hi = mid;
            else
                lo = mid;
        }
        return hi;
    }

#undef left
#undef right
#undef m
};

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    SegTree seg(n);
    seg.update(n, 0);
    for (int i = n - 1; i > 0; i--) {
        const int val = s[i] == '1' ? INF : seg.read(i + 1, i + m);
        if (val == INF) continue;
        seg.update(i, val + 1);
    }

    if (seg.read(1, m) == INF) {
        cout << "-1\n";
        return 0;
    }

    for (int i = 0; i < n;) {
        const int j = seg.find(i + 1, i + m);
        cout << (j - i) << ' ';
        i = j;
    }
    cout << '\n';
}

Measured memory_bytes: 2256
#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
#define lson u << 1, l, mid
#define rson u << 1 | 1, mid + 1, r
inline char nc()
{
	// return getchar();
	static char buf[100000], * l = buf, * r = buf;
	if(l == r) r = (l = buf) + fread(buf, 1, 100000, stdin);
	if(l == r) return EOF;
	return *l++;
}
template<class T> void readin(T & x)
{
	x = 0; int f = 1, ch = nc();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=nc();}
	while(ch>='0'&&ch<='9'){x=x*10-'0'+ch;ch=nc();}
	x *= f;
}
int n, p[200050], Q;
int points[200050];
struct SegmentTree
{
	int mx[800050];
	inline void pushup(int u)
	{
		mx[u] = max(mx[u << 1], mx[u << 1 | 1]);
	}
	int query(int u, int l, int r, int ql, int qr)
	{
		if(l == ql && r == qr) return mx[u];
		int mid = (l + r) >> 1;
		if(qr <= mid) return query(lson, ql, qr);
		else if(ql > mid) return query(rson, ql, qr);
		else
		{
			int L = query(lson, ql, mid);
			int R = query(rson, mid + 1, qr);
			return max(L, R);
		}
	}
	void update(int u, int l, int r, int qp, int qv)
	{
		if(l == r)
		{
			mx[u] = qv;
			return;
		}
		int mid = (l + r) >> 1;
		if(qp <= mid) update(lson, qp, qv);
		else update(rson, qp, qv);
		pushup(u);
	}
} seg[2];
inline bool judge(int x, int y)
{
	if(y < 0) return 0;
	if(x == n) return y == 0;
	// cerr << x << ' ' << y << ' ' << seg[y & 1].query(1, 1, n, x + 1, n) << endl;
	return seg[y & 1].query(1, 1, n, x + 1, n) >= y;
}
inline bool judge(int cx, int cy, int hx, int hy)
{
	// cerr << endl;
	// cerr << cx << ' ' << cy << ' ' << Q << ' ' << hx << ' ' << hy << endl;
	return judge(hx, Q - cx + cy) || judge(hy, Q + cx - cy);
}
void solve()
{
	memset(seg[1].mx, -0x3f, sizeof(seg[1].mx));
	for(int i = 1, mx = -1; i <= n; ++i)
	{
		points[i] = 1;
		if(p[i] > mx)
		{
			mx = p[i];
			points[i] = 2;
			Q++;
		}
	}
	for(int i = n; i >= 1; --i)
	{
		int f[2];
		for(int j = 0; j < 2; ++j)
		{
			f[j] = seg[j ^ (points[i] == 1)].query(1, 1, n, p[i], n) + points[i];
		}
		for(int j = 0; j < 2; ++j)
		{
			seg[j].update(1, 1, n, p[i], f[j]);
		}
	}
	if(!judge(0, Q))
	{
		puts("-1");
		return;
	}
	int cx = 0, cy = 0, hx = 0, hy = 0;
	for(int i = 1; i <= n; ++i)
	{
		if(points[i] == 2) Q--;
		seg[0].update(1, 1, n, p[i], 0);
		seg[1].update(1, 1, n, p[i], -1);
		if(judge(cx + (p[i] > hx), cy, max(hx, p[i]), hy))
		{
			putchar('0');
			if(p[i] > hx)
			{
				hx = p[i];
				++cx;
			}
		}
		else
		{
			putchar('1');
			if(p[i] > hy)
			{
				hy = p[i];
				++cy;
			}
		}
	}
	putchar('\n');
}
int main()
{
	readin(n);
	for(int i = 1; i <= n; ++i)
	{
		readin(p[i]);
	}
	solve();
	return 0;
}


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

using namespace std;
using ll =long long;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define debug(x)  cerr << #x << " = " << (x) << endl;
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; }
void coY() {cout <<"Yes"<<endl;}
void coN(){cout <<"No"<<endl;}
const ll INF = 1LL << 60;
const int mod = 1e9+7;
//Write From this Line
#define leftunique(a) {SORT(a);(a).erase(unique((a).begin(),(a).end()),(a).end());}

int main()
{
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i,n) cin >>a[i];
	leftunique(a);
	if(a.size() == n ){
		cout << "YES"<<endl;
	}
	else cout <<"NO"<<endl;
}


Measured memory_bytes: 1024
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>
#include <stack>
using namespace std;
#define ll int64_t
const long mod = 1e9 + 7;


const long LINF = 1e13;
const long LLINF = 1e18;
const long ALPHABET = 26;

template <class T>
void Swap(T& r, T& l) {
  T tmp = r;
  r = l;
  l = tmp;
}

template<typename T>
istream& operator >> (istream& is, vector<T>& vec) {
  for (T& x : vec) is >> x; //for(int i=0; i<vec.size(); i++) is >> x[i]; とかでもいい
  return is;
}


int main() {
  // long a,b,c,d,e;

  // long n,m;
  // char s;
  // cin >> s;
  long k;
  vector<long> a(5,0);
  cin >> a;
  cin >>k;

  // vector<long> a(n);
  // vector<long> b(n);
  // cin >> b;

  bool ans = false;

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

  if (a[4] - a[0] > k){
    ans = false;
  }else{
    ans = true;
  }



  if (!ans){
    cout << ":(";
  }else{
    cout << "Yay!";
  }





}




















Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
 
#define maxn 200000 + 6
 
int health[maxn];
 
int cmp(const void *a,const void *b)
{
    return *(int *)a - *(int *)b;
}
 
int main()
{
	int N, K;
	scanf("%d%d", &N, &K);
 
	for (int i = 0; i < N; ++i)
	{
		scanf("%d", &health[i]);
	}
 
	qsort(health, N, sizeof(health[0]), cmp);
 
	long long int sum = 0;
 
	for (int i = 0; i < N - K; ++i)
	{
		sum += health[i];
	}
 
	printf("%lld", sum);
	return 0; 
}

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

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

  string s;
  cin >> s;
  int n = s.size();
  int d = 1000;
  for (int i = 0; i < n - 2; i++) {
    int x = stoi(s.substr(i, 3));
    d = min(d, abs(753 - x));
  }
  cout << d << '\n';
  return 0;
}

Measured memory_bytes: 256
# 2020/01/29
# AtCoder Beginner Contest 087 - B

# Input
a = int(input())
b = int(input())
c = int(input())
x = int(input())

# Count
ans = 0
for i in range(a+1):
    for j in range(b+1):
        for k in range(c+1):
            if i * 500 + j * 100 + k * 50 == x:
                ans = ans + 1

# Output
print(ans)

Measured memory_bytes: 3188
//============================================================================
// Name        : one.cpp
// Author      : Lich_Ning
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
//#include<fstream>
#include<string>
using namespace std;
//ofstream fout;
//ifstream fin;
struct node
{
	int data;
	node * l;
	node * r;
	node(){data=0;l=r=nullptr;}
	node(int x){data=x;l=r=nullptr;}
};
struct tree
{
	node * root;
	tree(){root=nullptr;}
	tree(int x){root=new node(x);}
	void insert(int);
	void inorder(node * p);
	void preorder(node * p);
	node * find(int);
	node * findParent(int x);
	void Delete(int);
};
int main() {
	ios::sync_with_stdio(false);
	//fout.open("out");
	//fin.open("in.");
	int n;
	cin>>n;
	tree bt;
	int data;
	string t;
	string a="insert";
	string b="print";
	string c="find";
	string d="delete";
	for(int i=0;i<n;i++){
		cin>>t;
		if(t==a){
			cin>>data;
			bt.insert(data);
		}
		if(t==b){
			bt.inorder(bt.root);
			cout<<endl;
			bt.preorder(bt.root);
			cout<<endl;
		}
		if(t==c){
			cin>>data;
			if(bt.find(data))
				cout<<"yes"<<endl;
			else
				cout<<"no"<<endl;
		}
		if(t==d){
			cin>>data;
			bt.Delete(data);
		}
	}
	//fout.close();
	//fin.close();
	return 0;
}
void tree::insert(int x)
{
	if(root==nullptr){
		root=new node(x);
	return;
	}
	node * p=root;
	node * q=root;
	while(p!=nullptr){
		q=p;
	if(p->data>x)
		p=p->l;
	else
		p=p->r;
	}
	if(q->data>x)
		q->l=new node(x);
	else
		q->r=new node(x);
}
void tree::inorder(node * p)
{
	if(p==nullptr)
		return ;
	inorder(p->l);
	cout<<' '<<p->data;
	inorder(p->r);
}
void tree::preorder(node * p)
{
	if(p==nullptr)
		return ;
	cout<<' '<<p->data;
	preorder(p->l);
	preorder(p->r);
}
node * tree::find(int x)
{
	node * p=root;
	while(p!=nullptr){
		if(p->data==x)
			return p;
		else if(x<p->data)
			p=p->l;
		else
			p=p->r;
	}
	return 0;
}
node * tree::findParent(int x)
{
	node * p=root;
	if(p->data==x) return 0;
	while(p!=nullptr){
		if(p->l->data==x||p->r->data==x)
			return p;
		else if(x<p->data)
			p=p->l;
		else
			p=p->r;
	}
	return 0;
}
void tree::Delete(int x)
{
	node * p=find(x);
	if(p==nullptr) return;
	node * q=findParent(x);
	if(q==nullptr){
		if(p->r!=nullptr){
			root=p->r;
			node * t=p->r;
			while(t->l!=nullptr) t=t->l;
			t->l=p->l;
			delete p;
			return;
		}
		else {
			root=p->l;
			delete p;
			return;
		}
	}
	if(p->l==nullptr||p->r==nullptr){
		if(p->l==nullptr&&p->r==nullptr){
			if(q->l==p){q->l=nullptr;delete p;return ;}
			else{q->r=nullptr;delete p;return ;}
			}
		else if(p->l!=nullptr){
			if(q->l==p){q->l=p->l;delete p;return;}
			else{q->r=p->l;delete p;return ;}
		}
		else{
			if(q->l==p){q->l=p->r;delete p;return;}
			else{q->r=p->r;delete p;return;}
		}
	}
	else{
		if(q->l==p){
			node * t=p->l;
			while(t->r!=nullptr) t=t->r;
			q->l=t;
			t->r=p->r;
			delete p;
			return ;
		}
		else{
			node * t=p->r;
			while(t->l!=nullptr) t=t->l;
			q->r=t;
			t->l=p->l;
			delete p;
			return;
		}
	}
}

Measured memory_bytes: 15672
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 100000000

int main(){
	
	long long N;
	cin>>N;
	
	int ans = Inf;
	
	for(long long i=1;i*i<=N;i++){
		if(N%i!=0)continue;
		long long a = i;
		long long b = N/i;
		
		ans = min(ans,max((int)to_string(a).size(),(int)to_string(b).size()));
	}
	
	cout<<ans<<endl;
	
    return 0;
}



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

template <class T>
inline void read(T &x) {
    x = 0;
    char c = getchar();
    bool f = 0;
    for (; !isdigit(c); c = getchar()) f ^= c == '-';
    for (; isdigit(c); c = getchar()) x = x * 10 + (c ^ 48);
    x = f ? -x : x;
}

template <class T>
inline void write(T x) {
    if (x < 0) {
        putchar('-');
        x = -x;
    }
    T y = 1;
	int len = 1;
    for (; y <= x / 10; y *= 10) ++len;
    for (; len; --len, x %= y, y /= 10) putchar(x / y + 48);
}

int a;
string s;

int main() {
	cin >> a >> s;
	if (a < 3200) puts("red");
	else cout << s << '\n';
	return 0;
}

Measured memory_bytes: 256
# coding: utf-8
import sys
sysread = sys.stdin.readline

def run():
    N,K = map(int, sysread().split())
    d = []
    A = []
    for i in range(K):
        d.append(int(sysread()))
        A.append(list(map(int, sysread().split())))
    persons = [False] * (N + 1)
    for a in A:
        for k in a:
            persons[k] = True
    print(persons[1:].count(False))

if __name__ == "__main__":
    run()

Measured memory_bytes: 9204
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
typedef pair<int,int> P;
#define INF 1e18
int n,m,start,goal;
int u,v,a,b;
struct edge{int to,cost;};
vector<edge>yen[114514];
vector<edge>snuuk[114514];
int d1[114514];
int d2[114514];
void dijkstra(int s,string S){
	priority_queue<P,vector<P>,greater<P>>q;
	if(S=="yen"){
		fill(d1,d1+n,INF);
		d1[s]=0;
	}
	else{
		fill(d2,d2+n,INF);
		d2[s]=0;
	}
	q.push({s,0});
	while(!q.empty()){
		P p=q.top();q.pop();
		if(S=="yen"){
			if(d1[p.first]<p.second)continue;
			for(int i=0;i<yen[p.first].size();i++){
				edge e=yen[p.first][i];
				if(d1[e.to]>p.second+e.cost){
					d1[e.to]=p.second+e.cost;
					q.push({e.to,d1[e.to]});
				}
			}
		}
		else{
			if(d2[p.first]<p.second)continue;
			for(int i=0;i<snuuk[p.first].size();i++){
				edge e=snuuk[p.first][i];
				if(d2[e.to]>p.second+e.cost){
					d2[e.to]=p.second+e.cost;
					q.push({e.to,d2[e.to]});
				}
			}
		}
	}
}
signed main(){
	cin>>n>>m>>start>>goal;
	rep(i,m){
		cin>>u>>v>>a>>b;
		yen[u-1].push_back({v-1,a});
		yen[v-1].push_back({u-1,a});
		snuuk[u-1].push_back({v-1,b});
		snuuk[v-1].push_back({u-1,b});
	}
	
	dijkstra(start-1,"yen");
	dijkstra(goal-1,"snuuk");
	priority_queue<P,vector<P>,greater<P>>q;
	rep(i,n)q.push({d1[i]+d2[i],i+1});
	rep(i,n){
		P p;
		while(1){
			p=q.top();
			if(p.second>=i+1)break;
			q.pop();
		}
		cout<<(int)pow(10,15)-p.first<<endl;
	}
	return 0;
}


Measured memory_bytes: 25152
#include <iostream>
#include <cmath>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <cstring>

using namespace std;

#define f first
#define s second
#define pb push_back
#define mp make_pair
#define ll long long
#define pii pair < int, int >
#define pll pair < long long, long long>
#define ull unsigned long long
#define vi vector < int >
#define vll vector < long long >
#define sz(a) (int)a.size()
#define forit(it, s) for(__typeof(s.begin()) it = s.begin(); it != s.end(); it++)
#define all(a) a.begin(), a.end()
#define sqr(x) ((x) * (x))
#define fname "searching"

const int inf = (int)1e9;
const ll INF = (ll)1e18;
const double eps = 1e-9;
const double pi = acos(-1.0);
const int mod = (int)1e9 + 7;

int sx, sy, tx, ty;
string ans = "";

string solve(){
    cin >> sx >> sy >> tx >> ty;
    for(int i = sx; i < tx; ++i) ans += 'R';
    for(int i = sy; i < ty; ++i) ans += 'U';
    for(int i = sx; i < tx; ++i) ans += 'L';
    for(int i = sy; i < ty; ++i) ans += 'D';
    ans += 'D';
    for(int i = sx; i < tx + 1; ++i) ans += 'R';
    for(int i = sy; i < ty + 1; ++i) ans += 'U';
    ans += 'L';
    ans += 'U';
    for(int i = sx; i < tx + 1; ++i) ans += 'L';
    for(int i = sy; i < ty + 1; ++i) ans += 'D';
    ans += 'R';
    return ans;
}

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

    cout << solve() << "\n";
    
    return 0;
}


Measured memory_bytes: 256
def main():
    N = int(input())

    # f(n) = 1 (n < 2)
    # f(n) = n * f(n - 2)
    # f(n) = n * (n - 2) * (n - 4) * ... * 4 * 2

    if (N % 2 == 0):
        c = 0
        a = 5
        while 2 * a <= N:
            c += N // (2 * a)
            a *= 5
        print(c)

    else:
        print(0)


main()


Measured memory_bytes: 2940
using System;
using System.Linq;

namespace abc112_b
{
	class Program
	{
		static void Main(string[] args)
		{
			int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
			int min = int.MaxValue;
			for (int i = 0; i < x[0]; i++)
			{
				int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
				if (a[1] <= x[1]) min = Math.Min(min, a[0]);
			}
			Console.WriteLine(min == int.MaxValue ? "TLE" : min.ToString());
		}
	}
}

Measured memory_bytes: 13396
#include <bits/stdc++.h>
#define int long long
#define R(i,a,n) for(int i=a;i<n;i++)
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef pair<int,int>P;
#define fi first
#define se second
int dx[]={0,1,0,-1};
int dy[]={-1,0,1,0};
int ddx[]={0,1,1,1,0,-1,-1,-1};
int ddy[]={-1,-1,0,1,1,1,0,-1};
int dp[111111];
#define pb push_back
vector<int>v;
signed main(){
  int n;
  cin>>n;
  if(n>=1000)cout<<"ABD"<<endl;
  else cout<<"ABC"<<endl;
}

Measured memory_bytes: 256
import scala.io.StdIn.readLine

object Main extends App {

  val lines = Iterator.continually(readLine())
  val xs = {
    val xs = for {
      line           <- lines
      Array(a, op, b) = line.split(" ")
    } yield (a.toInt, op, b.toInt)

    xs.takeWhile {
      case (_, "?", _) => false
      case _           => true
    }
  }

  val convert: String => (Int, Int) => Int = {
    case "+" => _ + _
    case "-" => _ - _
    case "*" => _ * _
    case "/" => _ / _
  }

  val results = xs.map {
    case (a, op, b) => convert(op)(a, b)
  }

  results.foreach(println)
}



Measured memory_bytes: 44212
#include <iostream>
#include<sstream>
#include<vector>
#include<iterator>
#include<map>
#include<utility>
using namespace std;

int main(void)
{
	int H, W, N;
	cin >> H >> W >> N;

	map<pair<int, int>, int> stage;
	for(int i=0; i<N; i++)
	{
		int a, b;
		cin >> a >> b;

		for(int j=0; j<3; j++)
		{
			for(int k=0; k<3; k++)
			{
				int y = a - j;
				int x = b - k;
				if(x<1 || x>W-2 || y<1 || y>H-2)
					continue;

				stage[make_pair(x, y)]++;
			}
		}
	}

	long long sum = 0;
	vector<long long> cnt(10, 0);
	for(auto it=stage.begin(); it!=stage.end(); it++)
	{
		cnt[it->second]++;
		sum++;
	}
	cnt[0] = (long long)(H-2)*(W-2) - sum;
	
	for(int i=0; i<10; i++)
		cout << cnt[i] << endl;


	return 0;
}


Measured memory_bytes: 56448
def main():
    N = int(input())
    A = list(int(input()) for _ in range(N))
    cnt = 0
    for i in range(N):
        if i == N-1:
            cnt += A[i] // 2
            break
        cnt += A[i] // 2
        mod = A[i] % 2
        if A[i+1] >= mod:
            cnt += mod
            A[i+1] -= mod

    print(cnt)



if __name__ == "__main__":
    main()

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

int main(){
  int H, W, K;
  cin >> H >> W >> K;
  vector<vector<char>> sHW(H, vector<char>(W));
  int firstRow = 0;
  bool firstIchigo = false;
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      cin >> sHW[i][j];
      if(sHW[i][j] == '#' && !firstIchigo){
        firstIchigo = true;
        firstRow = i;
      }
    }
  }
  
  //cout << "firstRow " << firstRow << endl; 
  
  vector<vector<int>> ans(H, vector<int>(W));
  int nowLabel = 1;
  vector<int> posFI;
  for(int i = 0; i < W; i++){
    if(sHW[firstRow][i] == '#') posFI.push_back(i);
  }
  int nowColumn = 0;
  for(int i = 0; i < posFI.size(); i++){
    if(i == posFI.size()-1){
      for(int j = 0; j <= firstRow; j++){
        for(int k = nowColumn; k < W; k++) ans[j][k] = nowLabel;
      }//j
      nowLabel++;
    }else{
      for(int j = 0; j <= firstRow; j++){
        for(int k = nowColumn; k <= posFI[i]; k++) ans[j][k] = nowLabel;
      }//j
      nowLabel++;
      nowColumn = posFI[i]+1;
    }
  }//i
  
  vector<int> posI;
  for(int i = firstRow+1; i < H; i++){
    nowColumn = 0;
    for(int j = 0; j < W; j++){
      if(sHW[i][j] == '#') posI.push_back(j);
    }//j
    if(posI.size() == 0){
      for(int j = 0; j < W; j++) ans[i][j] = ans[i-1][j];
    }else{
      for(int j = 0; j < posI.size(); j++){
        if(j == posI.size()-1){
          for(int k = nowColumn; k < W; k++) ans[i][k] = nowLabel;
          nowLabel++;
        }else{
          for(int k = nowColumn; k <= posI[j]; k++) ans[i][k] = nowLabel;
          nowLabel++;
          nowColumn = posI[j]+1;
        }
      }//j
    }
    int num = posI.size();
    for(int j = 0; j < num; j++) posI.pop_back();
  }//i
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      if(j == 0) cout << ans[i][j];
      else cout << " " << ans[i][j];
    }
    cout << endl;
  }//i
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printVec(v) printf("{"); for (const auto& i : v) { std::cout << i << ", "; } printf("}\n");
#define degreeToRadian(deg) (((deg)/360)*2*M_PI)
#define radianTodegree(rad) (((rad)/2/M_PI)*360)
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; }
using namespace std;
using P = pair<int,int>;
using ll = long long;
const ll INF = 1LL<<60;
const int MOD = 1e9 + 7;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//cin.tie(0);ios::sync_with_stdio(false);
//cout << fixed << setprecision(15) << y << endl;
int main() {
  int n, k, q;
  cin >> n >> k >> q;
  vector<int> a(n, k - q);
  rep (i, q) {
    int x; cin >> x;
    a[x - 1]++;
  }

  for (auto v : a) {
    if (v <= 0) {
      cout << "No" << endl;
    } else {
      cout << "Yes" << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 3704
//#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <array>
#include <iostream>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define inf 1e+9
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define msg(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
#define pri(a) cout << a << endl;

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

  ll n,ans=0,c=0;
  cin >> n;
  //ll n,k,ans=0;
  //cin >> n >> k;
  // stirng s;
  // cin >> s;
  vint l(n);
  rep(i,n){
    cin >> l[i];
  }

	std::sort(l.begin(), l.end());

  rep(i,n-2){
    for(int j=i+1;j<n-1;j++){
      for(int k=n-1;k>j;k--){
        if(l[k]<l[i]+l[j]){
          ans += k-j;
          //cout << i << j << k;
          c=1;
          break;
        }
      }
    }
  }


  cout << ans << endl;

}

Measured memory_bytes: 256