akhauriyash/Code-Regression huggingface dataset:
# https://atcoder.jp/contests/abc151/tasks/abc151_d

from collections import deque

h, w = map(int, input().split())
maze = [list(input()) for i in range(h)]


def bfs(sx, sy):
    result = 0
    count = [[-1] * w for i in range(h)]
    count[sx][sy] = 0
    d = deque([[sx, sy]])
    while d:
        x, y = d.popleft()
        result = count[x][y]
        for i, j in ([1, 0], [0, 1], [-1, 0], [0, -1]):
            tx, ty = x + i, y + j
            if (
                not (0 <= tx < h)
                or not (0 <= ty < w)
                or maze[tx][ty] == "#"
                or count[tx][ty] != -1
            ):
                continue
            else:
                count[tx][ty] = count[x][y] + 1
                d.append([tx, ty])
    return result


ans = 0
for i in range(w):
    for j in range(h):
        if maze[j][i] == ".":
            ans = max(ans, bfs(j, i))
print(ans)


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

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define X first
#define Y second
#define pb push_back
#define make_unique(x) sort(all(x)), x.resize(unique(all(x)) - x.begin())
#define int long long

const LL mod = 1e9 + 7;


template<class T>
istream& operator >> (istream& in, vector<T>& v){ for (auto &x : v) { in >> x; } return in; }

template<class T, class U>
istream& operator >> (istream& in, pair<T, U> & v){ in >> v.X >> v.Y;return in; }

template<class T, class U>
ostream& operator << (ostream& out, pair<T, U> & v){ out << v.X << " " << v.Y;return out; }

void chkmax(int &a, int b) {
    a = max(a, b);
    return;
}

void chkmin(int &a, int b) {
    a = min(a, b);
    return;
}

LL ppow (LL x, LL s) {
    if (!s) return 1;
    if (!(s - 1)) return x % mod;
    if (s % 2) return (x * ppow (x, s - 1)) % mod;
    LL b = ppow (x, s / 2);
    return (b * b) % mod;
}

int n;
vector<int> t;

int get(int l, int r) {
    int res = 0;
    for (l += n,r += n;l <= r;l>>=1,r>>=1) {
        if (l%2) res += t[l++];
        if (!(r%2)) res += t[r--];
    }
    return res;
}

int update(int pos, int x) {
    pos += n;
    t[pos] = x;
    for (pos>>=1;pos >= 1;pos>>=1) {
        t[pos] = t[pos*2] + t[pos*2 + 1];
    }
    return 0;
}

main(){
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    //freopen("ILUXA.in", "r", stdin);
    int d, a;
    cin >> n >> d >> a;
    t.resize(2*n, 0);
    vector<pair<int,int> > gg(n);
    cin >> gg;
    sort(all(gg));
    int ans = 0;
    for (int i = 0;i < n;i++) {
        pair<int,int> tt = {gg[i].X - d*2,-1e18};
        int l = int32_t(lower_bound(all(gg), tt) - gg.begin());
        gg[i].Y -= get(l, i)*a;
        //cout << gg[i].Y << '\n';
        if (gg[i].Y > 0) {
            //cout << gg[i].Y << '\n';
            int cur = (gg[i].Y + a - 1)/a;
            //cout << cur << '\n';
            ans += cur;
            update(i, cur);
        }
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 6528
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main(){
  ll n,a,b;
  cin>>n>>a>>b;
  
  ll x=n-(a+b-1);
  if(x<0||x>(a-1)*(b-1)){
      cout<<-1<<endl;
      return 0;
  }

  if(a==1){
      if(b==n){
          for(int i=n;i>=1;i--) cout<<i<<" ";
          cout<<endl;
      }else cout<<-1<<endl;
      return 0;
  }else if(b==1){
      if(a==n){
          for(int i=1;i<=n;i++) cout<<i<<" ";
          cout<<endl;
      }else cout<<-1<<endl;
      return 0;
  }

  vector<int> ans;
  bool used[n+1]={};
  for(int i=b;i>=1;i--){
      ans.push_back(i);
      used[i]=true;
  }
  for(int i=n-(a-1)+1;i<=n;i++){
      ans.push_back(i);
      used[i]=true;
  }

  for(int k=1;;k++){
      int ma=n-(a-1)*k;
      if(ma<=0) break; 
      for(int i=ma-(a-1)+1;i<=ma&&i<=n;i++){
          if(i<=0) continue;
          if(used[i]) continue;
          ans.push_back(i);
          used[i]=true;
      }
  } 

  for(int i=0;i<ans.size();i++) cout<<ans[i]<<" ";
  cout<<endl;

  return 0;
}


Measured memory_bytes: 3824
#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;

const int INF = 1e9 + 7, N = 1e5 + 7;

int a[N];

signed main()
{
	IO_OP;
	
	int n;
	cin >> n;
	for(int i = 0; i < n; i++) cin >> a[i];
	sort(a, a+n, greater<int>());
	int k = 1;
	while(k + 1 <= n && a[k] >= k + 1) k++;
	int up = a[k-1] - k;
	int right = 0;
	while(k+right+1 <= n && a[k+right] >= k) right++;
	if((up&1)||(right&1)) cout << "First" << endl;
	else cout << "Second" << endl;

}





Measured memory_bytes: 640
package main

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

func main() {
	sc.Split(bufio.ScanWords)
	h, w := nextInt(), nextInt()
	a := nextStrings(h)

	whiteh, whitew := make([]bool, h), make([]bool, w)
	for i := 0; i < h; i++ {
		white := true
		for j := 0; j < w; j++ {
			if a[i][j] == '#' {
				white = false
			}
		}
		whiteh[i] = white
	}
	for j := 0; j < w; j++ {
		white := true
		for i := 0; i < h; i++ {
			if a[i][j] == '#' {
				white = false
			}
		}
		whitew[j] = white
	}

	for i := 0; i < h; i++ {
		for j := 0; j < w; j++ {
			if !whiteh[i] && !whitew[j] {
				putf("%c", a[i][j])
			}
		}
		if !whiteh[i] {
			putf("\n")
		}
	}

	wt.Flush()
}

var (
	sc  = bufio.NewScanner(os.Stdin)
	rdr = bufio.NewReaderSize(os.Stdin, 1000000)
	wt  = bufio.NewWriter(os.Stdout)
)

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

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func nextFloat64s(n int) []float64 {
	slice := make([]float64, n)
	for i := 0; i < n; i++ {
		slice[i] = nextFloat64()
	}
	return slice
}

func nextMega() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, _ := rdr.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func nextStrings(n int) []string {
	slice := make([]string, n)
	for i := 0; i < n; i++ {
		slice[i] = next()
	}
	return slice
}

func putf(format string, a ...interface{}) {
	fmt.Fprintf(wt, format, a...)
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}


Measured memory_bytes: 640
package main

import (
	"fmt"
)

func main() {

	var N, K int
	fmt.Scanf("%d %d", &N, &K)

	var count int = 0
	var h int
	for i := 0; i < N; i++ {
		fmt.Scanf("%d", &h)
		if h >= K {
			count++
		}
	}

	fmt.Println(count)
}


Measured memory_bytes: 6308
//{{{
#include <bits/stdc++.h>
using namespace std;
#define repX(a,b,c,x,...) x
#define repN(a) repX a
#define rep(...) repN((__VA_ARGS__,rep3,rep2,loop))(__VA_ARGS__)
#define rrep(...) repN((__VA_ARGS__,rrep3,rrep2))(__VA_ARGS__)
#define loop(n) rep2(i_,n)
#define rep2(i,n) rep3(i,0,n)
#define rep3(i,begin,end) for(int i=(int)(begin),i##_end=(int)(end);i<i##_end;++i)
#define rrep2(i,n) rrep3(i,n,0)
#define rrep3(i,begin,end) for(int i=(int)(begin-1),i##_end=(int)(end);i>=i##_end;--i)
#define foreach(x,a) for(auto&x:a)
using ll=long long;
const ll mod=(ll)1e9+7;
//}}}

ll modpow(ll a, ll b){
  if(b == 0) return 1;
  if(b & 1){
    return a * modpow(a, b - 1) % mod;
  }else{
    ll half = modpow(a, b / 2);
    return half * half % mod;
  }
}

ll modfact(ll n){
  ll res = 1;
  rep(i, n) res = res * (i + 1) % mod;
  return res;
}

ll modcomb(ll n, ll r){
  ll res = 1;
  r = min(r, n - r);
  rep(i, r) res = res * (n - i) % mod;
  return res * modpow(modfact(r), mod - 2) % mod;
}

ll modh(ll n, ll r){
  return modcomb(n + r - 1, r);
}

int main(){
  int N, M;
  cin >> N >> M;
  vector<int> v;
  ll ans = 1;
  rep(n, 2, 100000){
    if(M == 1) break;
    int num = 0;
    while(M % n == 0){
      M /= n;
      num++;
    }
    if(num){
      ans *= modh(N, num);
      ans %= mod;
    }
  }
  if(M != 1){
    ans *= N;
    ans %= mod;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main()
{

  int i, h;
  int A[250];

  scanf("%d", &h);

  for(i = 1; i <= h; i++){
    scanf("%d", &A[i]);
  }

  //parent:i/2, left:2*i, right:2*i+1

  for(i = 1; i <= h; i++){
    printf("node %d: key = %d, ", i, A[i]);
    if(i != 1) printf("parent key = %d, ", A[i/2]);
    if(2*i <= h) printf("left key = %d, ", A[2*i]);
    if(2*i+1 <= h) printf("right key = %d, ", A[2*i+1]);
    printf("\n");
  }

  return 0;
}

Measured memory_bytes: 600
//#pragma GCC optimize ("-O3","unroll-loops")
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>


#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 REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define m0(x) memset(x,0,sizeof(x))
#define print(x) cout<<x<<'\n';
#define pe(x) cout<<x<<" ";
#define lb(v,n) lower_bound(v.begin(), v.end(), n);
#define ub(v,n) upper_bound(v.begin(), v.end(), n);
#define int long long
#define all(x) (x).begin(), (x).end()
//#define double long double

using namespace std;

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

const int MOD = 1000099253;
const int MOD2 = 1000311461;
const ll INF = 1e17;
const int INT_INF = 1e9;
const double pi = acos(-1);
const double EPS = 1e-10;
typedef pair<int, int>P;
const int MAX = 100010;



int like[100010];
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	string S; cin >> S;
	int K; cin >> K;
	int N = S.size();
	REP(i, N) {
		int now = S[i] - 'a';
		int cnt = (26 - now) % 26;
		if (K >= cnt) {
			S[i] = 'a';
			K -= cnt;
		}
		if (i == N - 1) {
			int rem = K % 26;
			REP(j, rem) {
				if (S[i] == 'z') {
					S[i] = 'a';
				}
				else {
					S[i]++;
				}
			}
		}
	}
	print(S);
}

Measured memory_bytes: 592
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
#define rep(i,n) for (int i=0; i<n;++i)
typedef long long ll;
using namespace std;
const ll MOD = 1000000007LL;
int N, A, B;

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

  cin >> N >> A >> B;
  if (N*A<B){
    cout << N*A << endl;
  }else{
    cout << B << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<stdlib.h>
#include<string.h>
#include<queue>
using namespace std;
inline int read( )
{
  int sum=0;char c=getchar( );bool f=0;
  while(c<'0'||c>'9') {if(c=='-') f=1;c=getchar( );}
  while(c>='0'&&c<='9') {sum=sum*10+c-'0';c=getchar( );}
  if(f) return -sum;
  return sum;
}
const int N=200005;
int n;
struct ex{int num,next;}map[N];
int head[N],len;
inline void link(int x,int y)
{
  len++;map[len].num=y;map[len].next=head[x];head[x]=len;
  len++;map[len].num=x;map[len].next=head[y];head[y]=len;
}
int f[N];
inline void dfs(int k,int p)
{
  int i,x,y=0;
  for(i=head[k];i;i=map[i].next)
    {
      x=map[i].num;
      if(x==p) continue;
      dfs(x,k);y^=(f[x]+1);
    }
  f[k]=y;
}
int main( )
{
  int i,j,x,y;
  n=read( );
  for(i=1;i<n;i++) x=read( ),y=read( ),link(x,y);
  dfs(1,0);
  puts(f[1]?"Alice":"Bob");
  return 0;
}


Measured memory_bytes: 5376
x,k,d = map( int, input().split())

if( x == 0 ):
    if( k % 2 == 0 ):
        print("{}".format(0))
        exit()
    else:
        print("{}".format(abs(d)))
        exit()

if( x > 0 ) :
    if( x - k * d >= 0 ) :
        ret = x - k * d
        print("{}".format(ret))
        exit()
    rem = x % d
    cost = x // d
    rem2 = abs(rem - d)
    remc = k - cost
    if( remc % 2 == 0 ) : 
        ret = rem
        print("{}".format(ret))
        exit()
    else:
        ret = rem2
        print("{}".format(ret))
        exit()
elif( x < 0 ) :
    if( x + k * d <= 0 ) :
        ret = abs( x + k * d )
        print("{}".format(ret))
        exit()
    rem = (-x) % d
    cost = (-x) // d
    rem *= -1
    rem2 = rem + d
    remc = k - cost
    if( remc % 2 == 0 ):
        ret = abs(rem)
        print("{}".format(ret))
        exit()
    else :
        ret = rem2
        print("{}".format(ret))
        exit()




Measured memory_bytes: 9256
/*  -*- coding: utf-8 -*-
 *
 * 3029.cc: AABABCAC
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 100000;

/* typedef */

/* global variables */

char s[MAX_N + 4], t[MAX_N + 4];

/* subroutines */

int rec(int k, char *(&cpt), char t[]) {
  if (k > 0 && ! rec(k - 1, cpt, t)) return false;
  for (char *tpt = t; *tpt; tpt++) {
    while (*cpt != '\0' && *cpt != *tpt) cpt++;
    if (*cpt == '\0') return false;
    cpt++; // *tpt
    if (k > 0 && ! rec(k - 1, cpt, t)) return false;
  }
  return true;
}

/* main */

int main() {
  scanf("%s%s", s, t);

  int k = 0;
  for (;; k++) {
    char *cpt = s;
    if (! rec(k, cpt, t)) break;
  }

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



Measured memory_bytes: 3352
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>

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

using namespace std;

typedef pair<int, int> P;
typedef long long ll;

int s[1<<20];
int size;

// k人目の状態をseg-treeで管理
// ノードは区間内の生存者の合計を保持

void init(int n){
	size = 1;
	while(size < n){
		size *= 2;
	}
	rep(i, size*2){
		s[i] = 0;
	}
}

// k番目にaを加算
void add(int k, int a){
	k += size-1;
	s[k] += a;
	while(k > 0){
		k = (k-1)/2;
		s[k]+=a;
	}
}

// 生存者のn番目の位置を探す
int query(int n, int k, int l, int r){
	if(s[k] < n || s[k] == 0) return -1;
	if(r - l == 1){
		return k-(size-1);
	}
	int chl = k*2+1, chr = k*2+2;
	int ret = query(n, chl, l, (l+r)/2);
	if(ret != -1) return ret;
	return query(n-s[chl], chr, (l+r)/2, r);
}


int main(){
	int q, lim;
	while(cin >> q >> lim, q|lim){
		init(q);
		map<int, int> idmap;
		vector<int> v(q);
		int idx = 0;
		rep(i, q){
			int type, x;
			cin >> type >> x;
			int pos;
			switch(type){
			case 0:
				v[idx] = x;
				idmap[x] = idx;
				add(idx++, 1);
				// 生存者がlim人を超えたら一番左を殺す
				if(s[0] > lim){
					add(query(1, 0, 0, size), -1);
				}
				break;
			case 1:
				add(query(x, 0, 0, size), -1);
				break;
			case 2:
				pos = query(x, 0, 0, size);
				cout << v[pos] << endl;
				break;
			case 3:
				add(idmap[x], -1);
				break;
			}
		}
		cout << "end" << endl;
    }

	return 0;
}

Measured memory_bytes: 25612
import java.util.Scanner;

public class Main {

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

		int n = sca.nextInt();
		int m = sca.nextInt();

		// n個から2個
		int ans_n = (n*(n-1))/2;

		// m個から2個
		int ans_m = (m*(m-1))/2;

		int ans = ans_n + ans_m;

		System.out.println(ans);

		// 後始末
		sca.close();
	}
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define PRECISION std::cout << std::fixed << std::setprecision(20);
  
using namespace std;
 
const ll inf = 1e18;
const ll N = 1e11;
const ll bits = 62;
const ll mod = 1e9+7;
const ld pi = 3.14159265358979323846;


int main(){
    FASTIO;
    PRECISION;

    int h,n,temp,sum=0;

    cin>>h>>n;

    for(int i=0;i<n;i++){
        cin>>temp;
        sum+=temp;
    }

    if(sum>=h){
        cout<<"Yes\n";
    }else{
        cout<<"No\n";
    }

}

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

#define endl '\n'
#define ff first
#define ss second
#define mp make_pair
#define pb push_back

typedef long long llong;
typedef pair<int, int> pii;

void transfer(string &res, deque<char> dq) {
	while (!dq.empty()) {
		res.pb(dq.front());
		dq.pop_front();
	}
}

void solve() {

	int n;
	cin >> n;
	string str;
	cin >> str;

	string res;
	string front, back;
	int lb = 0;

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

		if (str[i] == '(') {
			lb++;
		} else if (str[i] == ')') {
			if (lb == 0) {
				front.pb('(');
			} else {
				lb--;
			}
		} else abort();
	}

	for (int i = 0; i < lb; i++) {
		back.pb(')');
	}

	cout << front << str << back << endl;
}

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

	#ifdef LOCAL
		ifstream in("in");
		cin.rdbuf(in.rdbuf());
	#endif

	solve();
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

int main() {
  int n;
  cin >> n;
  int best = 0, ret = 0;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    ret += x;
    best = max(best, x);
  }
  ret -= best;
  ret += best / 2;
  cout << ret << endl;
  return 0;
}


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

template <typename InputIterator>
typename InputIterator::value_type summation(InputIterator first,
                                             InputIterator last) {
  return std::accumulate(first, last, typename InputIterator::value_type());
}
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v);
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p);
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v) {
  for (auto &i : v) {
    stream >> i;
  }
  return stream;
}
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p) {
  stream >> p.first >> p.second;
  return stream;
}

int main() {
  int64_t n, m;
  std::cin >> n >> m;
  std::vector<int64_t> a(n);
  std::cin >> a;
  std::vector<std::pair<int64_t, int64_t>> p(m);
  for (int64_t i = 0; i < m; i++) {
    std::cin >> p[i].second >> p[i].first;
  }
  std::sort(p.begin(), p.end());
  std::reverse(p.begin(), p.end());

  std::multiset<int64_t> v(a.cbegin(), a.cend());

  for (const auto i : p) {
    int64_t count = 0;
    while (*v.cbegin() < i.first && count < i.second) {
      v.erase(v.cbegin());
      v.insert(i.first);
      count++;
    }
    if (count == 0) {
      break;
    }
  }

  std::cout << summation(v.cbegin(), v.cend()) << std::endl;

  return 0;
}

Measured memory_bytes: 7296
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

#ifndef U_L_LONG
typedef unsigned long long U_L_LONG;
#endif
#ifndef L_LONG
typedef long long L_LONG;
#endif

#ifndef LL_ABS
#define LL_ABS(x) (((((x) < 0) ? ((x) * (-1)) : (x))))
#endif

static void B_problem();

int main()
{
	B_problem();
	
	fflush(stdout);
	return 0;
}



static void B_problem()
{
	int N;
	int C[20] = { 0 };
	int V[20] = { 0 };

	scanf(" %d", &N);

	for (int i = 0; i < N; i++) {
		scanf(" %d", &V[i]);
	}
	for (int i = 0; i < N; i++) {
		scanf(" %d", &C[i]);
	}

	int tmp;
	int sum = 0;
	for (int i = 0; i < N; i++) {
		
		if ((tmp = V[i] - C[i]) > 0) {
			sum += tmp;
		}
	}
	printf("%d\n", sum);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> P;

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

    int n;
    while (cin >> n, n) {
        int ans = 0;

        rep2(l, 1, n) {
            int sm = 0;
            rep2(r, l, n) {
                sm += r;
                if (sm == n) {
                    ans++;
                }
            }
        }

        cout << ans << endl;
    }

}

Measured memory_bytes: 3144
import java.util.*;

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();
        System.out.println(Math.min(a, b)+Math.min(c,d));
    }
}

Measured memory_bytes: 22996
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int n, k, q; cin>>n>>k>>q;
	int s[100010]={};
	for(int i=0; i<q; i++){
		int a; cin>>a;
		s[a]++;
	}
	for(int i=1; i<=n; i++){
		if(k-q+s[i]>0) cout<<"Yes"<<endl;
		else cout<<"No"<<endl;
	}
	return 0;
}

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

bool f(const string& a, const string& b) {
  map<char, char> ab;
  for (int i = 0; i < a.size(); i++) {
    if (ab[a[i]] && ab[a[i]] != b[i]) {
      return false;
    } else ab[a[i]] = b[i];
  }
  return true;
}

int main() {
  string a, b; cin >> a >> b;
  if (f(a, b) && f(b, a)) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 776
import sys
from collections import defaultdict
import numpy as np

sys.setrecursionlimit(10 ** 6)
INF = float("inf")
MOD = 10 ** 9 + 7


def input():
    return sys.stdin.readline().strip()


def main():
    N, W = map(int, input().split())
    d = defaultdict(list)
    w, v = map(int, input().split())
    w1 = w
    d[w].append(v)
    for _ in range(1, N):
        w, v = map(int, input().split())
        d[w].append(v)

    cumsum = dict()
    L = defaultdict(int)
    for i in range(4):
        w = w1 + i
        d[w].sort(reverse=True)
        c = np.cumsum(d[w])
        cumsum[w] = c
        L[i] = len(d[w])

    ans = 0
    for i in range(L[0] + 1):
        if i != 0:
            v1 = cumsum[w1][i - 1]
        else:
            v1 = 0
        for j in range(L[1] + 1):
            if j != 0:
                v2 = v1 + cumsum[w1 + 1][j - 1]
            else:
                v2 = v1
            for k in range(L[2] + 1):
                if k != 0:
                    v3 = v2 + cumsum[w1 + 2][k - 1]
                else:
                    v3 = v2
                for l in range(L[3] + 1):
                    w = w1 * i + (w1 + 1) * j + (w1 + 2) * k + (w1 + 3) * l
                    if w > W:
                        continue

                    if l != 0:
                        v4 = v3 + cumsum[w1 + 3][l - 1]
                    else:
                        v4 = v3

                    if v4 > ans:
                        ans = v4

    print(ans)


if __name__ == "__main__":
    main()


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

#define xx first
#define yy second

const int N = 1e2 + 1;
const int K = 1e5 + 1;
const int mod = 1e9 + 7;

int add(int x, int y) {
    return ((x + y) % mod + mod) % mod;
}

int a[N], dp[N][K];

void solve() {
    int n, k; cin >> n >> k;
    for (int i = 0; i < n; i++)
        cin >> a[i];

    for (int i = 0; i < n; i++)
        fill(dp[i], dp[i] + k + 1, 0);
    for (int i = 0; i <= a[0]; i++)
        dp[0][k - i] = 1;
    for (int i = 0; i < k; i++)
        dp[0][i + 1] = add(dp[0][i + 1], dp[0][i]);

    for (int i = 1; i < n; i++) {
        for (int j = 0; j <= k; j++) {
            int x = 0;
            if (j) 
                x = add(x, -dp[i - 1][j - 1]);
            x = add(x, dp[i - 1][min(k, j + a[i])]);
            dp[i][j] = x;
        }
        for (int j = 0; j < k; j++)
            dp[i][j + 1] = add(dp[i][j + 1], dp[i][j]);
    }

    cout << dp[n - 1][0] << '\n';
}
int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    // int _; cin >> _; while (_--)
    solve();
    return 0;
}


Measured memory_bytes: 42612
#include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

using namespace std;
class Piece{
public:
  int sq,wm,l,r;
  set<int> son;
  Piece (int s,int w) : sq(s),wm(w),l(1000),r(0),son(){;}
  Piece (void) : Piece(0,0){;}
  void add(int x){
    ++sq;
    wm+=x;
  }
  void sup(int x){
    l=min(l,x);
    r=max(r,x);
  }
  void operator+= (Piece p){
    sq+=p.sq;
    wm+=p.wm;
  }
};
vector<string> f;
vector<vector<int> > fp;
vector<Piece> ps;
int h,w;
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
bool inrange(int y,int x)
{
  return 0<=y && y<h && 0<=x && x<w;
}
void dfs(int y,int x,char c,int pp)
{
  if(inrange(y,x) && f[y][x]==c){
    fp[y][x]=pp;
    f[y][x]='.';
    REP(i,4) dfs(y+dy[i],x+dx[i],c,pp);
  }
}
bool dete(void)
{
  int pp=ps.size();
  REP(i,h) REP(j,w)
    if('1'<=f[i][j] && f[i][j]<='9'){
      ps.push_back(Piece());
      dfs(i,j,f[i][j],pp);
      return true;
    }
  return false;
}
void pupdate(void){
  REP(i,h) REP(j,w){
    if(fp[i][j]==-1) continue;
    ps[fp[i][j]].add(j);
    if(inrange(i-1,j)&&fp[i-1][j]!=-1&&fp[i-1][j]!=fp[i][j]){
      ps[fp[i][j]].son.insert(fp[i-1][j]);
      ps[fp[i-1][j]].sup(j);
    }
  }
  REP(j,w) if(fp[h-1][j]!=-1) ps[fp[h-1][j]].sup(j);
}
bool solve(int ind){
  Piece &p=ps[ind];
  for(auto spi:ps[ind].son){
    if(!solve(spi)) return false;
    p+=ps[spi];
  }
  return 2*p.sq*p.l-p.sq < 2*p.wm && 2*p.wm < 2*p.sq*p.r+p.sq;
}
int main(void)
{
  for(;;){
    cin >> w >> h;
    if(!w) return 0;
    f.resize(h);
    REP(i,h) cin >> f[i];
    fp.assign(h,vector<int>(w,-1));
    ps.resize(0);
    for(;dete(););
    pupdate();
    int root;
    REP(j,w) if(fp[h-1][j]!=-1) root=fp[h-1][j];
    if(solve(root)) cout << "STABLE" << endl;
    else cout << "UNSTABLE" << endl;
  }
}

Measured memory_bytes: 3152
import Data.Bool (bool)

main :: IO ()
main = readLn >>= print . solver

solver :: Int -> Int
solver n = go 0 False False False
  where
    go c s f t
      | c > n     = 0
      | otherwise = (bool 0 1 (and [s,f,t]))
      + go (10 * c + 7) True f t
      + go (10 * c + 5) s True t
      + go (10 * c + 3) s f True

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

int main(){

    int res;
    cin >> res;

    set<int> b;
    b.insert(res);

    int count = 1;

    while(true){

        if (res % 2 == 0){
            res = res/2;
        } else {
            res = res*3 + 1;
        }
        count += 1;

        if (b.count(res)) {
            cout << count << endl;
            return 0;
        } else {
            b.insert(res);
        }
    }
}

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

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    
    int n, k;
    cin >> n >> k;
    
    vector<int> vec(n);
    for (int i = 0; i < n; ++i) {
        cin >> vec[i];
    }
    
    vector<int> D(n);
    D[0] = 0;
    for (int i = 1; i < n; ++i) {
        D[i] = (int)2e9;
        for (int j = i - 1; j >= max(i - k, 0); --j) {
            D[i] = min(D[i], D[j] + abs(vec[i] - vec[j]));
        }
    }
    
    cout << D.back();
    
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<list>
#include <array>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807
#define INF I64_MAX
#define MOD 1000000007


void solve(void)
{

  vector<pair<int,int> > data;
  int H,W,N;
  cin>>H>>W>>N;
  for (int i = 0; i < N; i++)
  {
    int A,B;
    cin>>A>>B;
    A--;
    B--;
    for (int h = -1; h <= 1; h++)
    {
      for (int w = -1; w <= 1; w++)
      {
        if((h+A>=1)&&(h+A<H-1) &&(w+B >= 1) &&(w+B<W-1))
        {
          data.emplace_back(h+A,w+B);
        }
      }
    }

  
  }

  sort(data.begin(),data.end());
    vector<int> ANS(10,0);
    

    for (int i = 0; i < data.size(); i++)
    {
      static int count = 0;
      // cout<<data[i].first<<" "<<data[i].second<<endl;
      if(data[i] == data[i+1])count++;
      else
      {
        ANS[count+1]++;
        count=0;
      }
    }

    int SUM = 0;
    for (int i = 0; i < 10; i++)
    {
        SUM += ANS[i];
    }
    
    ANS[0] = H*W - 2*H - 2*W + 4 - SUM;

    for (int i = 0; i < 10; i++)
    {
      cout<<ANS[i]<<endl;
    }
    
  
  

  return;
}



int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  // std::cout << std::fixed;
  // std::cout << std::setprecision(8);

  solve();

 
  return 0;
}

Measured memory_bytes: 18152
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
int main(){
    string a;
    cin>>a;
    int length=a.size();
    for(int i=0;i<length;i++){
    	if(a[i]=='9'){
    		cout<<"Yes";
    		return 0;
		}
	}
	cout<<"No";
    return 0;
}


Measured memory_bytes: 256
//Author- VMAX


#include<bits/stdc++.h>
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_multiset tree<long long , null_type,less_equal<long long >, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_set tree<long long , null_type,less<long long >, rb_tree_tag,tree_order_statistics_node_update>
*/
using namespace std;
#define ll long long int
#define YES cout<<"YES"<<"\n";
#define NO cout<<"NO"<<"\n";
#define ld     long double 
#define yes cout<<"yes"<<"\n";
#define no cout<<"no"<<"\n";
#define No cout<<"No"<<"\n";
#define Yes cout<<"Yes"<<"\n";
#define f(i,a) for(i=0;i<a;i++)
#define fo(i,a) for(i=1;i<=a;i++)
#define fa(i,a) for(auto i:a)
#define r(i,a) for(auto i=a.rbegin();i!=a.rend();i++)
#define en cout<<"\n";
#define ull unsigned long long int
#define o(x) cout<<x<<"\n";
#define o1(x) cout<<x<<" ";
#define pb push_back
#define F first
#define in insert
#define mp make_pair
#define S second
#define pre(n) cout<<fixed<<setprecision(n);
#define      gcd(a,b)    __gcd(a,b)
#define bs            binary_search
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
#define test ll t;cin>>t;while(t-->0)
const ll Mod = 998244353;
#define mod 1000000007
#define pi 3.14159265358979323846
#define all(x) x.begin(),x.end()
#define re return 0;
// *#######################################################################################*

/*
bool isp(ll n)
{
    ll i;
    for(i=2;i*i<=n;i++)
    {
        if(n%i==0)
        {
            return false;
        }
        
    }
}
  */
  /*
  ll powerm(ll x, unsigned ll y, ll p)  
{  
    ll res = 1;    
  
    x = x % p; 
   
    if (x == 0) return 0;
  
    while (y > 0)  
    {  
        if (y & 1)  
            res = (res*x) % p;  
   
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;  
}
  long long lcm(long long a, long long b){//最小公倍数を求める
   return a * b / gcd(a, b);
}
*/
/*
ll po(ll z,ll z1)
{
    ll rer=0;
    rer=     ((z*(z-1))/2+(z1*(z1-1))/2);
    return rer;

}
*/
/*
bool sortbysec(const pair<int,int> &a, 
              const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
}
*/


       int main()
       {
      fast
   
         ll n;
         cin>>n;
         ll a[n+2],i;
         for(i=1;i<=n;i++)
          {
              cin>>a[i];
          }
   ll s=0;
   for(i=1;i<=n;i+=2)
   {
       if((abs(a[i])%2)!=0)
       {
           s++;
       }
   }
   
   
   o(s)
   
             
             
           
             

re}

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

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

int N;
vector<vector<int> > G;
using P = pair<int, int>;
map<P, int> ch;

vector<int> pre;
void dfs(int p, int v) {
  // cout << p << " " << v << endl;
  for ( int u: G[v] ) {    
    if ( u == p ) continue;    
    pre[u] = v;    
    dfs(v, u);    
  }
}

vector<int> path(int u, int v) {
  pre = vector<int>(N, -1);  
  dfs(-1, u);
  vector<int> ret;
  int now = v;
  // cout << pre[u] << endl;
  while ( pre[now] != -1 ) {
    ret.push_back(ch[P(now, pre[now])]);    
    now = pre[now];
  }

  return ret;
}

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);
  
  cin >> N;
  G.resize(N);

  for ( int i = 0; i < N-1; i++ ) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    G[a].push_back(b);
    G[b].push_back(a);
    ch[P(a, b)] = i;
    ch[P(b, a)] = i;    
  }

  int M;
  cin >> M;

  vector<int> mask(M, 0);
  for ( int i = 0; i < M; i++ ) {
    int u, v;
    cin >> u >> v;
    u--; v--;
    // cout << i << endl;
    vector<int> tmp = path(u, v);
    // cout << i << endl;
    for ( int j: tmp ) mask[i] |= (1LL<<j);
    // cout << bitset<3>(mask[i]) << endl;
  }

  int ans = 1;
  for ( int i = 0; i < N-1; i++ ) ans *= 2;
  for ( int i = 1; i < (1<<M); i++ ) {
    vector<int> used(N, 0);
    int b = 0;    
    for ( int j = 0; j < M; j++ ) {
      if ( i&(1<<j) ) b |= mask[j];      
    }
    int cnt = N - __builtin_popcountll(b) - 1;
    int tmp = 1;
    for ( int i = 0; i < cnt; i++ ) tmp *= 2;
    if ( __builtin_popcountll(i) % 2 == 0 ) ans += tmp;
    else ans -= tmp;    
  }

  cout << ans << endl;
  
  return 0;
}


Measured memory_bytes: 384
#include<stdio.h>
#include<stdlib.h>
int d[10];

int main(){
	while(1){
		int n,i,a;
		scanf("%d",&n);
		if(n==0)return 0;
		for(i=0;i<10;i++)d[i]=0;
		for(i=0;i<n;i++){
			scanf("%d",&a);
			d[a]++;
		}
		for(i=0;i<10;i++){
			for(int k=0;k<d[i];k++)printf("*");
			if(d[i]==0)printf("-");
			printf("\n");
		}
	}
}

		

Measured memory_bytes: 1000
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(int argc, char** argv) {
  int n, li;
  vector<int> l;
  cin >> n;
  for (size_t i = 0; i < n * 2; i++) {
    cin >> li;
    l.push_back(li);
  }
  sort(l.begin(), l.end());
  int s = 0;
  for (int i = 0; i < n * 2; i += 2) {
    s += l[i];
  }
  cout << s;
  return 0;
}

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

using namespace std;

typedef long long ll;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<ll> sum(n + 1, 0);
	for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + i;
	while (n != 0) {
		int Max = lower_bound(sum.begin(), sum.end(), n) - sum.begin();
		cout << Max << endl;
		n -= Max;
	}
	return 0;
}

Measured memory_bytes: 78464
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define loop(i,a,b) for(ll i=a;i<=b;i++)
#define vi vector <int>
#define vs vector <string>
#define vc vector <char>
#define vl vector <ll>
#define all(c) (c).begin(),(c).end()
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)
#define deb(x) cerr<<#x<<' '<<'='<<' '<<x<<'\n'
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// ordered_set s ; s.order_of_key(val)  no. of elements strictly less than val
// s.find_by_order(i)  itertor to ith element (0 indexed)
typedef vector<vector<ll>> matrix;
ll power(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll modInverse(ll a){return power(a,mod-2);}
const int N=500023;
bool vis[N];
vector <int> adj[N];
void solve()
{
    string s;
    cin>>s;
    for(auto ch:s)
    {
        if(ch=='?')
            cout<<'D';
        else
            cout<<ch;
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int T=1;
    //cin>>T;
    int t=0;
    while(t++<T)
    {
        //cout<<"Case #"<<t<<":"<<' ';
        solve();
        //cout<<'\n';
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}

Measured memory_bytes: 15700
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n; i >= 0; i--)
#define reprr(i, m, n) for (ll i = m; i < n; i++)
#define inf 2e9
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;


int main()
{
    ll N; cin >> N;
    map<ll, ll> deadlines;
    rep(i, N) {
        ll a, b; cin >> a >> b;
        if (a > b) {cout << "No" << endl; return 0;}
        deadlines[b] += a;
    }

    ll total = 0;
    for (auto elem : deadlines) {
        total += elem.second;
        if (elem.first < total) {cout << "No" << endl; return 0;}
    }
    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 12800
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#define Rep(i, n) for(int i=0;i<n;++i)
#define rep(i, n) for(int i=1;i<=n;++i)
#define ll long long int
#define INF 1e9
#define LINF 1e18
#define MOD 1000000007
#define PI 3.14159265359
#define All(a) (a).begin(), (a).end()
 
using namespace std;
using P = pair<ll, ll>;
 
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
 
/**
 * Usage:
 * 
 * G[from].push_back(Edge(to, weight));
 * using Graph = vector<vector<Edge>>;
 * 
 */ 
struct Edge {
  int to;     
  ll weight; 
  Edge(int t, ll w) : to(t), weight(w) { }
};
 
template<typename T>
void printv(vector<T>& v) {
  if (v.size() == 0) {
    cout << "\n";
    return;
  }
 
  Rep(i, v.size()) {
    cout << v[i] << ((i + 1 < v.size()) ? ' ' : '\n');
  }
}
 
 
 
int K, X;
 
int main () {
  cin >> K >> X;
 
  if (500 * K >= X) {
    cout << "Yes" << "\n";
  } else {
    cout << "No" << "\n";
  }
}

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

namespace AtCoder
{
    class Program
    {
        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }

        class Problem
        {
            public readonly int p;
            public readonly int c;
            public readonly int g;
            public Problem(int[] args, int i)
            {
                p = args[0];
                c = args[1];
                g = p * (i + 1) * 100 + c;
            }
        }
        static int Calculate(int D, int G, Problem[] problems, int mask)
        {
            int p = 0;
            int g = 0;
            for (int i = 0; i < D; ++i)
            {
                if ((mask & (1 << i)) != 0)
                {
                    p += problems[i].p;
                    g += problems[i].g;
                }
            }
            if (g >= G) { return p; }
            int min = int.MaxValue;
            for (int i = 0; i < D; ++i)
            {
                int s = (i + 1) * 100;
                if ((mask & (1 << i)) == 0 && G - g < problems[i].p * s)
                {
                    min = Math.Min(p + (G - g + s - 1) / s, min);
                }
            }
            return min;
        }
        static int Solve(int D, int G, Problem[] problems)
        {
            int min = int.MaxValue;
            for (int i = 0; i < 1 << D; ++i)
            {
                min = Math.Min(Calculate(D, G, problems, i), min);
            }
            return min;
        }
        static void Main(string[] args)
        {
            int[] V = ReadInts();
            int D = V[0];
            int G = V[1];
            var problems = new Problem[D];
            for (int i = 0; i < D; ++i) { problems[i] = new Problem(ReadInts(), i); }
            Console.WriteLine(Solve(D, G, problems));
        }
    }
}


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


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

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

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

    @staticmethod
    def string_list(n):
        return [input() for i in range(n)]

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

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


class Math():
    @staticmethod
    def gcd(a, b):
        if b == 0:
            return a
        return Math.gcd(b, a % b)

    @staticmethod
    def lcm(a, b):
        return (a * b) // Math.gcd(a, b)

    @staticmethod
    def divisor(n):
        res = []
        i = 1
        for i in range(1, int(n ** 0.5) + 1):
            if n % i == 0:
                res.append(i)
                if i != n // i:
                    res.append(n // i)
        return res

    @staticmethod
    def round_up(a, b):
        return -(-a // b)

    @staticmethod
    def is_prime(n):
        if n < 2:
            return False
        if n == 2:
            return True
        if n % 2 == 0:
            return False
        d = int(n ** 0.5) + 1
        for i in range(3, d + 1, 2):
            if n % i == 0:
                return False
        return True


class PriorityQueue:
    def __init__(self, l=[]):
        self.q = l
        heapq.heapify(self.q)
        return

    def push(self, n):
        heapq.heappush(self.q, n)
        return

    def pop(self):
        return heapq.heappop(self.q)


MOD = int(1e09) + 7
INF = int(1e15)


def factorization(n):
    S = {}
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            S[i] = cnt

    if temp != 1:
        S[temp] = 1

    if S == []:
        S[n] = 1

    return S


def main():
    # sys.stdin = open("sample.txt")
    N, P = Scanner.map_int()
    S = factorization(P)
    ans = 1
    for k, v in S.items():
        if v >= N:
            ans *= k ** (v // N)
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 39020
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
typedef long long ll;
const int INF = 100000000, mod = 1000000007;
using namespace std;

int n, f[105][15], p[105][15], ans = -(1<<30);

int main() {
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 10; j++) cin >> f[i][j];
    }
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 11; j++) cin >> p[i][j];
    }
    for (int work = 1; work < (1 << 10); work++) {
        int t = 0;
        for (int i = 0; i < n; i++) {
            int count = 0;
            for (int j = 0; j < 10; j++) if ((work >> j & 1) && f[i][j]) count++;
            t += p[i][count];
        }
        if (ans < t) ans = t;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define mem(x,y) memset(x,y,sizeof(x))//memset only use to initialize 0 or -1 no other number.
#define pii pair<int,int>
#define pll pair<ll,ll>
#define INF 1e9
#define INFL 1e18
#define mod 1000000007
//#define mod 998244353
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
using namespace __gnu_pbds; 
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> os;
typedef tree<pii,null_type,less<pii>,rb_tree_tag,tree_order_statistics_node_update> os_pair;

ll power(ll x,ll n){ll res =1;while(n>0){if(n%2==1){res=res*x;}x=x*x;n=n/2;}return res;}
ll powm(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

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

int main(){

    fast;
    int T;
    T=1;
    //cin>>T;
    while(T--){
        ll n,i,j;
        cin>>n;
        vector<pair<int,int> > v; 
  
    
    for (ll i = 2; i * i <= n; ++i) { 
        if (n % i == 0) { 
            int count = 0; 
            while (n % i == 0) { 
                n /= i; 
                count += 1; 
            } 
  
            // For every prime factor we are storing 
            // count of it's occurenceand itself. 
            v.push_back({ i, count }); 
        } 
    } 
  
    // If n is prime 
    if (n > 1) { 
        v.push_back({ n, 1 }); 
    }
    vector<int>a;
    a.pb(0);
    int x=0;
    for(i=1;i<64;i++)
    {
    	x+=i;
    	a.pb(x);
	}
	vector<int>::iterator it;
    int ans=0;
    for(i=0;i<(int)v.size();i++)
    {
    	x=v[i].se;
    	if(x==1)
    	{
    		ans=ans+1;
		}
		else
		{
			it=lower_bound(all(a),x);
			if(*it==x)
			{
				ans=ans+it-a.begin();
			}
			else
			{
				it--;
				int y=x-*it;
				int z=it-a.begin();
				if(z<y)
				{
					ans+=z+1;
				}
				else
				{
					ans+=z;
				}
			
			}
		}
    	
	}
	cout<<ans;
	

    }

}

Measured memory_bytes: 3680