akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	unsigned long long n, a, b;
	cin >> n >> a >> b;
	if (b < a) swap(a, b);
	unsigned long long mid = a + (b - a) / 2LL;
	if (mid - a == b - mid)
		cout << mid - a << endl;
	else
	{
		cout << min((a + b) / 2LL, (n - a + n - b + 2LL) / 2LL) << endl;
	}
}

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

#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 OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

int main()
{
    char c[3][3];

    rep(i, 3) rep(j, 3) cin >> c[i][j];
    cout << c[0][0] << c[1][1] << c[2][2] << endl;

    return 0;
}

Measured memory_bytes: 256
a, b = map(int, input().split())
ans = 1

if a > 0 and b > 0:
    print("Positive")
elif a == 0:
    print("Zero")
elif a < 0 and b > 0:
    print("Zero")
elif b == 0:
    print("Zero")
elif a < 0 and b < 0:
    diff = b - a
    if diff % 2 == 0:
        print("Negative")
    elif diff % 2 != 0:
        print("Positive")


Measured memory_bytes: 9052
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <set>
#include <cmath>
using namespace std;

void solve(){
  int n, t; cin >> n >> t;
  vector<int> v(n), aida(n - 1);
  for(int i = 0; i < n; i++){
    cin >> v[i];
  }
  for(int i = 0; i < n - 1; i++){
    aida[i] = v[i + 1] - v[i];
  }
  long long ans = 0;
  for(int i = 0; i < n - 1; i++){
    if(aida[i] < t) ans += aida[i];
    else ans += t;
  }
  ans += t;
  cout << ans << endl;
  return;
}

int main(){
  solve();
  return 0;
}


Measured memory_bytes: 1792
#![allow(unused_imports)]
use proconio::{input, fastout};
use proconio::marker::*;

#[fastout]
fn main() {
    input! {
    k: usize,
    s: Chars,
    }
    let n = s.len();
    for i in 0..n {
        print!("{}", s[i]);
        if i + 1 >= k  && i != n - 1{
            println!("...");
            return
        }
    }
}


Measured memory_bytes: 2124
#include <cstdlib>
#include <iostream>
#include <iomanip>
#include <string>
#include <limits.h>
#include <math.h>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <typeinfo>
#include <stdlib.h>

#define ll long long
#define ld long double

using namespace std;

int main(int argc, char* argv[]){
  ll n, a, i, count = 0, diff, key, val;
  cin >> n;
  map<ll, ll> number_map;

  for(i=0; i<n; i++){
    cin >> a;
    if(number_map[a]){
      number_map[a] += 1;
    }else{
      number_map[a] = 1;
    }
  }

  for(auto itr = number_map.begin(); itr != number_map.end(); ++itr) {
    key = itr->first;
    val = itr->second;
    if(val > 0){
      if(val > key){
        count += (val - key);
      }else if(val < key){
        count += val;
      }
    }
  }

  cout << count << endl;
  return 0;
}


Measured memory_bytes: 6272
#include<iostream>
#include<iomanip>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long ll;
int N;
string S;
bool ans[100001];

int main(){
	cin >> N >> S;
	bool init[4][2] = {{1,1},{1,0},{0,1},{0,0}};
	for(int i=0; i<4; i++){
		ans[0] = init[i][0];
		ans[1] = init[i][1];
		for(int j=2; j<N; j++){
			if(ans[j-1]){
				if(S[j-1]=='o'){
					ans[j] = ans[j-2];
				}
				else{
					ans[j] = !ans[j-2];
				}
			}
			else{
				if(S[j-1]=='o'){
					ans[j] = !ans[j-2];
				}
				else{
					ans[j] = ans[j-2];
				}
			}
		}
		if(((ans[N-1]==ans[1]) == (ans[0]^(S[0]!='o'))) &&
				((ans[N-2] == ans[0]) == (ans[N-1]^(S[N-1]!='o')))){
			for(int j=0; j<N; j++){
				cout << (ans[j] ? 'S' : 'W');
			}
			cout << endl;
			return 0;
		}
	}
	cout << -1 << endl;

	return 0;
}


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

int main() {
    int r, s, p; cin >> r >> s >> p;
    vector<int> nums;
    for (int _ = 0; _ < p; ++_) {
        int i, j; cin >> i >> j; --i, --j;
        if (j >= s) ++j;
        nums.push_back(abs(i - r) + abs(j - s));
    }
    sort(nums.begin(), nums.end(), greater<int>());
    int res = 0;
    for (int i = 0; i < p; ++i) {
        res = max(res, nums[i] + i);
        //cout << i << ": " << nums[i] << endl;
    }
    cout << res << endl;
}



Measured memory_bytes: 4888
// created by mtnshh
 
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
 
#define ll long long
#define ld long double
 
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
 
#define err() cout<<"=================================="<<endl;
#define errA(A) for(auto i:A)   cout<<i<<" ";cout<<endl;
#define err1(a) cout<<#a<<" "<<a<<endl
#define err2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define err3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl
#define err4(a,b,c,d) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<" "<<#d<<" "<<d<<endl
 
#define pb push_back
#define all(A)  A.begin(),A.end()
#define allr(A)    A.rbegin(),A.rend()
#define ft first
#define sd second
 
#define pll pair<ll,ll>
#define V vector<ll>
#define S set<ll>
#define VV vector<V>
#define Vpll vector<pll>
 
#define endl "\n"
 
const ll logN = 20;
const ll M = 1000000007;
const ll INF = 1e12;
#define PI 3.14159265
 
const ll N = 100005;

int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll n,m;
	cin>>n>>m;
	cout<<n*(n-1)/2 + m*(m-1)/2 << endl;
    return 0;
}

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

struct UnionFind {
    vector<int> par;
    vector<int> sz;

    UnionFind(int n=0){
        if(n>0) initialize(n);
    }

    void initialize(int n){
        par.resize(n);
        sz.resize(n);
        for(int i=0; i<n; i++){
            par[i] = i;
            sz[i] = 1;
        }
    }

    int find(int x){
        if(par[x] == x){
            return x;
        }else{
            return par[x] = find(par[x]);
        }
    }

    void unite(int x, int y){
        x = find(x);
        y = find(y);
        if(x == y) return;
        if(sz[x] < sz[y]){
            par[x] = y;
            sz[y] += sz[x];
        }else{
            par[y] = x;
            sz[x] += sz[y];
        }
    }

    bool same(int x, int y){
        return find(x) == find(y);
    }
};

int main(){
    int N, M;
    cin >> N >> M;
    static int64_t A[100000], B[100000], C[100000];
    for(int i=0; i<N; i++){
        cin >> A[i] >> B[i];
        C[i] = max(A[i] - B[i], (int64_t) 0);
    }
    vector<int> edges[100000];
    for(int i=0; i<M; i++){
        int a, b;
        cin >> a >> b;
        edges[a-1].push_back(b-1);
        edges[b-1].push_back(a-1);
    }

    vector<int> order;
    for(int i=0; i<N; i++) order.push_back(i);
    sort(order.begin(), order.end(), [&](int a, int b){ return C[a] < C[b];});

    UnionFind uf(N);
    bitset<100000> used;
    static int64_t dp[100000];
    for(int i : order){
        used[i] = true;
        int64_t result = C[i], Bsum = B[i];
        for(int j : edges[i]) if(used[j] && !uf.same(i, j)){
            j = uf.find(j);
            result = min(result, max(C[i] - B[j], dp[j]));
            Bsum += B[j];
            uf.unite(i, j);
        }
        i = uf.find(i);
        dp[i] = result;
        B[i] = Bsum;
    }

    int64_t ans = dp[uf.find(0)] + B[uf.find(0)];
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 10360
#include<iostream>
#include<string>
using namespace std;
int main(){
  string s;
  cin>>s;
  int a=0;
  for(int i=0;i<4;i++){
    if(s[i]=='+'){
      a++;
    }
    else{
      a--;
    }
  }
  cout<<a<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cmath>
#include <functional>
#include <algorithm>
#include <numeric>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <deque>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <boost/range/irange.hpp>
#include <boost/container/static_vector.hpp>
#include <boost/utility/string_ref.hpp>

class input
{
    std::istream& cin;

public:
    input() : cin(std::cin)
    {
        std::cin.tie(nullptr);
        std::ios::sync_with_stdio(false);
    }

    template <class T>
    inline input& operator>>(T& var)
    {
        cin >> var;
        return *this;
    }
    template <class T>
    inline input& operator,(T& var)
    {
        cin >> var;
        return *this;
    }

    template <class T>
    inline T read()
    {
        T var;
        cin >> var;
        return var;
    }

    template <class InputIterator>
    inline void read(InputIterator head, std::size_t n)
    {
        for (std::size_t i = 0; i < n; ++i) {
            cin >> *head;
            ++head;
        }
    }

    template <class T, class F>
    inline void online(std::size_t n, F&& f)
    {
        T var;
        for (std::size_t i = 0; i < n; ++i) {
            cin >> var;
            f(var);
        }
    }
};
template <class T, std::size_t n>
std::istream& operator>>(std::istream& in, std::array<T, n>& var)
{
    for (std::size_t i = 0; i < n; ++i) {
        in >> var[i];
    }
    return in;
}

class output
{
    std::ostream& cout;

public:
    class proxy
    {
        std::ostream& cout;

    public:
        proxy() : cout(std::cout) {}
        ~proxy() { cout << '\n'; }
        template <class T>
        proxy& operator,(T&& val)
        {
            cout << ' ' << val;
            return *this;
        }
    };

public:
    output() : cout(std::cout)
    {
        cout << std::fixed << std::setprecision(15);
    }

    template <class T>
    proxy operator<<(T&& val)
    {
        cout << val;
        return {};
    }

    template <class T>
    void print(const T& container)
    {
        bool first = true;
        for (auto&& x : container) {
            if (!first) {
                cout << ' ';
                first = false;
            }
            cout << x;
        }
    }
};

int main()
{
    input in;
    output out;

    int N = in.read<int>();
    std::vector<int> L(N);
    in.read(L.begin(), N);

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

    std::uint64_t res = 0;
    for (int i : boost::irange(0, N - 2)) {
        for (int j : boost::irange(i + 1, N - 1)) {
            res += std::distance(std::upper_bound(L.begin() + j + 1, L.end(), L[j] - L[i]),
                                 std::lower_bound(L.begin() + j + 1, L.end(), L[i] + L[j]));
        }
    }
    out << res;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
const int maxn=1e5+10;
int a[maxn],n,m;
bool vis[maxn];
int main(){
    std::cin>>n>>m;
    std::memset(vis,0,sizeof(vis));
    vis[1]=1;
    for(int i=1;i<=n;i++){
        a[i]=1;
    }
    int x,y;
    for(int i=1;i<=m;i++){
        std::cin>>x>>y;
        if(a[x]==1&&vis[x]){
            vis[x]=0;
            a[x]--;
            vis[y]=1;
            a[y]++;
        }
        else if(a[x]>=1&&vis[x]){
            a[x]--;
            a[y]++;
            vis[y]=1;
        }
        else {
            a[x]--;
            a[y]++;
        }
    }
    int sum=0;
    for(int i=1;i<=n;i++){
        if(vis[i]) sum++;
    }
    std::cout<<sum;
    return 0;
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
#include <iostream>
#include <utility> // pair
#include <string>
#include <vector>
#define MAX_N 100001
#define MAX_A 100001
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define FOR(i, a, b) for(ll i=a; i<b; i++)
#define REP(i, n) for(ll i=0; i<n; i++)
#define REV(i, n) for(ll i=n-1; i>=0; i--)
#define ALL(v) v.begin(), v.end()
#define pb push_back
const ll INF = 9e18;
ll n, m, max_b[MAX_N], now[MAX_N];
vector<ll> v[MAX_A];
// priority_queue<ll, vector<ll>, greater<ll>> q;
priority_queue<ll> q;

signed main(){
	cin >> n >> m;
	ll ret = 0;
	REP(i, n){ ll a, b; cin >> a >> b; v[a].pb(b); }
	FOR(i, 1, m+1){
		for(auto e: v[i]){
			q.push(e);
		}
		if(!q.empty()){
			ret += q.top();
			q.pop();
		}
	}
	cout << ret << endl;

    return 0;
}

Measured memory_bytes: 5632
#include <bits/stdc++.h>
#define f(a, n) for (int a=0; a<n; a++)
#define F(a, n) for (int a=1; a<=n; a++)
using namespace std;
int n, A[100];
int maxi, best;
int main(){
	cin>>n;
	F(i, n) cin>>A[i];
	F(i, n) maxi = max(maxi, abs(A[i]));
	F(i, n) if (abs(A[i]) == maxi) best = i;
	cout<<2*n-1<<endl;
	F(i, n) cout<<best<<" "<<i<<endl;
	if (A[best] >= 0) for (int i = 2; i<=n; i++) cout<<i-1<<" "<<i<<endl;
	else for (int i = n-1; i>=1; i--) cout<<i+1<<" "<<i<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
using namespace std;
int n,K;
#define Maxn 10010
char S[Maxn],Ans[Maxn];
int L=0,H;
int G=0;
char c='z';
char ch[Maxn];
int sum[Maxn];

inline void solve(){
	for(register int i=1;i<=n-L;++i)ch[i]=ch[L-H+i];
	for(register int i=n-L+1;i<=n;++i)ch[i]=c;
	reverse(ch+1,ch+n+1);
}

int main(){
	scanf("%d%d",&n,&K);
	scanf("%s",S+1);
	for(register int i=1;i<=n;++i)Ans[i]=c;
	for(register int i=1;i<=n;++i)
	    if(S[i]<c)c=S[i];
    int at;
    bool flag=false;
	for(register int i=1;i<=n;i=at)
        if(S[i]==c){
         	at=i;
         	while(at<=n&&S[at]==c)at++;
         	if(at==n+1)G=at-i;
         	if(at-i>=L){
         		L=at-i;
         		if(at==n+1)flag=true;
			}
		}else at=i+1;
	H=L;
	if(G*2>H){
		H=G;L=G; 
		flag=true;
	} 
	if(!flag)K--;
	for(register int i=1;i<=K;++i){
		L*=2;
		if(L>=n){
			for(register int j=1;j<=n;++j)printf("%c",c);
			return 0;
		}
	}
	if(flag){
		for(register int i=1;i<=n;++i)ch[i]=S[i];
		solve();
		bool Ha=false;
		for(register int i=1;i<=n;++i){
			if(Ha==false&&ch[i]>Ans[i])break;
			if(ch[i]<Ans[i])Ha=true;
			if(Ha)Ans[i]=ch[i];
		}
	}else{
		for(register int i=n+1;i<=2*n;++i)S[i]=S[2*n+1-i];
		sum[0]=0;
		for(register int i=1;i<=2*n;++i){
			sum[i]=sum[i-1];
			if(S[i]==c)sum[i]++;
		}
		for(register int i=n;i<=2*n;++i)
		    if(sum[i]-sum[i-H]==H){
		    	for(register int j=1;j<=n;++j)ch[j]=S[i-n+j];
		    	solve();
		    	bool Ha=false;
		    	for(register int i=1;i<=n;++i){
		    		if(Ha==false&&ch[i]>Ans[i])break;
		    		if(ch[i]<Ans[i])Ha=true;
		    		if(Ha)Ans[i]=ch[i];
				}
			}
	}
	for(register int i=1;i<=n;++i)printf("%c",Ans[i]);
	return 0;
}

Measured memory_bytes: 384
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(int i=0;i<N;++i)
typedef long long int LL;

std::vector<LL>v(3);
LL ans;

int main()
{
	in >> v[0] >> v[1] >> v[2];
	std::sort(v.begin(), v.end());
	ans = v[2] - v[1];
	v[0] += v[2] - v[1];
	ans += (v[2] - v[0]) / 2;
	if ((v[2] - v[0]) % 2 == 1) ans += 2;
	out << ans << std::endl;
	return 0;
}


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

using namespace std;

const int max_n = 5055, inf = 1000111222;

int n, c[2][3];
long long dp1[max_n], dp2[max_n * max_n];

long long solve(int n, long long dp[]) {
    for (int i = 1; i <= n; ++i) {
        dp[i] = i;
        for (int j = 0; j < 3; ++j) {
            if (i >= c[0][j]) {
                dp[i] = max(dp[i], dp[i - c[0][j]] + c[1][j]);
            }
        }
    }
    return dp[n];
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> n;
    for (int i = 0; i < 2; ++i) {
        for (int j = 0; j < 3; ++j) {
            cin >> c[i][j];
        }
    }
    int cnt = solve(n, dp1);
    for (int j = 0; j < 3; ++j) {
        swap(c[0][j], c[1][j]);
    }
    long long ans = solve(cnt, dp2);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 196864
// a_i < b_iに対して、a_iはb_iの親であると仮定した場合（after_contest_*が通らない）
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;

vector<int> ans;
vector<int> to[200005]; // 2次元配列 無向グラフ

void dfs(int me, int parent=-1){
	for(int child : to[me]){
		if(child == parent) continue; // 自分の親にはカウンタは足さない
		ans[child] += ans[me]; // 子に自分のカウンタを足す
		dfs(child, me);
	}

}

int main(){
	int n, q;
	cin >> n >> q;
	
	rep(i,n-1){
		int a, b;
		cin >> a >> b;
		--a; --b;
		to[a].push_back(b);
		to[b].push_back(a);
	}
	
	ans.resize(n);
	
	rep(i,q){
		int p, x;
		cin >> p >> x;
		--p;
		ans[p] += x;
	}
	
	dfs(0);
	
	rep(i,n){
		cout << ans[i] << endl;
	}
}

Measured memory_bytes: 23552
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>

bool enough(const int& t, const int& a, const int& b, std::vector<int>& hp) {
  int t_cnt = 0;
  for (auto& h : hp) {
    if (h < b * t)
      continue;
    t_cnt += (int)ceil((h - b * t) * 1.0 / (a - b));
    if (t_cnt > t)
      return false;
  }
  return true;
}

int main() {
  int n, a, b;
  std::cin >> n >> a >> b;
  std::vector<int> hp;
  int max = 0;
  for (int i = 0; i < n; ++i) {
    int h;
    std::cin >> h;
    hp.push_back(h);
    if (h > max)
      max = h;
  }
  int r = max / b + 1;
  int l = max / a;
  int t = (r + l) / 2;
  while (1) {
    if (enough(t, a, b, hp)) {
      r = t;
      t = (int)ceil((r + l) * 1.0 / 2);
    } else {
      l = t;
      t = (int)ceil((r + l) * 1.0 / 2);
    }
    if (r - l <= 1)
      break;
  }
  std::cout << t << std::endl;
}


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

//type
#define ll long long
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素
#define Z class
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)
#define FORA(i, I) for (const auto &i : I)

// vector
#define ALL(x) x.begin(), x.end()

// output
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
  cout << a;
  ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
  cout << a << ' ';
  pr(b);
}

int ans = 0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

int main()
{
  int a, b;
  string s;
  cin >> s;
  rep(i, 3)
  {
    if (s[i] != 'x')

      ans += 100;
  }
  pr(ans + 700);
  return 0;
}


Measured memory_bytes: 3572
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
typedef long long ll;
#define int ll
using namespace std; 

int a[15], len; 
char s[5]; 

template < typename T >
inline T read()
{
	T x = 0, w = 1; char c = getchar();
	while(c < '0' || c > '9') { if(c == '-') w = -1; c = getchar(); }
	while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return x * w; 
}

bool query(ll x)
{
	printf("? %lld\n", x), fflush(stdout), scanf("%s", s + 1);
	return s[1] == 'Y'; 
}

signed main()
{
	int x = 1e9;
	if(query(x))
	{
		for(int i = 9; i; i--)
		{
			if(!query(x - 1)) break; 
			x /= 10; 
		}
		printf("! %d\n", x);
		return 0; 
	}
	for(int i = 9; i; i--)
	{
		x /= 10;
		if(query(x)) break; 
	}
	int l = x + 1, r = x * 10 - 1, ans, mid;
	while(l <= r)
	{
		mid = (l + r) >> 1;
		if(query(mid * 10)) r = mid - 1, ans = mid;
		else l = mid + 1; 
	}
	printf("! %d\n", ans); 
	return 0; 
}


Measured memory_bytes: 3708
N = int(input())
A = list(map(int, input().split() ))

n = 0
leave = False
while True:
    for i in range(N):
        if A[i]%2 == 1:
            leave = True
    if leave == True:
        break
    n+=1
    A = list(map(lambda x : x/2, A))

print(n)

Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;

bool predication(string arg1, string arg2){
    return arg1.size() > arg2.size();
}

int main(){
    string str,tmpstr="";
    vector<string> vs;
    int pos;
    cin >> str;
    
    while((pos = str.find("egg")) != string::npos){
        str.replace(pos, 3, "A");
    }
    while((pos = str.find("chicken")) != string::npos){
        str.replace(pos, 7, "B");
    }
    int n=str.size();
    char tmp = str[0];
    tmpstr += tmp;
    for(int i=1;i<n;i++){
        if(str[i] != tmp){
            tmp = str[i];
        }else{
            vs.push_back(tmpstr);
            tmpstr = "";
        }
        tmpstr += tmp;
    }
    vs.push_back(tmpstr);
    stable_sort(vs.begin(),vs.end(), predication);

    string ret = vs[0][vs[0].size()-1] == 'A'?"egg":"chicken";
    cout << ret << endl;
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
using namespace std;
const int MAX = 1000001;
char p[MAX] = {0};

void f(){
	for(int i=2 ; i < MAX ; i++ )
		p[i] = 1;
	for(int i=2 ; i*i < MAX ; i++ ){
		if( p[i] ){
			for(int j=i*2 ; j < MAX ; j += i ){
				p[j] = 0;
			}
		}
	}
}

int main(){
	int a,d,n,ans;
	f();

	while( cin >> a >> d >> n , a||d||n ){
		vector<int> v;

		for(int i=a ; v.size() != n ; i += d ){
			if( p[i] ){
				v.push_back( i );
			}
		}
		cout << v[v.size()-1] << endl;
	}
}

Measured memory_bytes: 0
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <list>
#include <numeric>
#include <map>
#include <cmath>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
//================================================

int a = 0, b = 0, c, d, n, k = 0;
string s, t;



int main()
{
	int a, b, c, d, e;
	cin >> a >> b >> c >> d >> e>>k;
	bool x=true;
	if (e - a > k)x = false;
	if (e - b>k)x = false;
	if (e - c>k)x = false;
	if (e - d>k)x = false;
	if (d - a>k)x = false;
	if(d-b>k)x = false;
	if(d-c>k)x = false;
	if(c-a>k)x = false;
	if(c-b>k)x = false;
	if (b - a > k)x = false;
	if (x)cout << "Yay!" << endl;
	else cout << ":(" << endl;
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
map<char, set<int>>mp;
string test = "uids";
set<int>calc(const set<int>&l, const set<int>&r,char c) {
	set<int>ans;
	if (c == 'u') {
		ans = l;
		for (auto n : r)ans.emplace(n);
	}
	else if (c == 'i') {
		for (auto&&n : l) {
			if (r.find(n)!=r.end())ans.emplace(n);
		}
	}
	else if (c == 'd') {
		for (auto&&n : l) {
			if (r.find(n) == r.end())ans.emplace(n);
		}
	}
	else if (c == 's') {
		for (auto &&n : l) {
			if (r.find(n) == r.end())ans.emplace(n);

		}
		for (auto&&n : r) {
			if (l.find(n) == l.end())ans.emplace(n);
		}
	}
	return ans;
}
string st; int a;
set<int>expr();
set<int>exp() {
	if (st[a] == '(') {
		a++;
		auto n= expr();
		return n;
	}else if (st[a] == 'c') {
		a++;
		auto n = exp();
		n = calc(mp['U'], n, 'd');
		return n;
	}
	else {
		char c(st[a]);
		assert(mp.find(c) != mp.end());

		set<int>n(mp[c]);
		a++;
		return n;
	}
}
set<int>expr() {
	set<int>l(exp());
	while (1) {
		if (a == st.size() || st[a] == ')') {
			a++;
			return l;
		}
		else {
			char op = st[a];
			assert(test.find(op) != string::npos);
			a++;
			set<int>r(exp());
			l = calc(l, r, op);
		}
	}
}
int main() {
	char c; int n;
	while (cin >> c >> n) {
		if (c == 'R') {
			set<int>v;
			for (auto m : mp) {
				for (auto n : m.second) {
					v.insert(n);
				}
			}
			mp['U'] = v;
			cin >> st;
			auto ans = expr();
			for (auto aa : ans) {
				cout << aa;
				if (*prev(ans.end()) == aa) {
					cout << endl;
				}
				else cout << " ";
			}
			if (ans.empty()) {
				cout << "NULL" << endl;
			}
			mp.clear();
			a = 0;
		}
		else {
			for (int i = 0; i < n; ++i) {
				int a; cin >> a;
				mp[c].emplace(a);
			}
		}
	}
	return 0;
}

Measured memory_bytes: 3168
n,t = map(int,input().split())
c0 = 10000
for i in range(n):
     cn,tn = map(int,input().split())
     if tn <= t and cn <= c0:
     	 c0 = cn
if c0 == 10000:
	print("TLE")
else:
	print(c0)

Measured memory_bytes: 2940
#include<iostream>
#include<vector>
#include<sstream>
#include<string>
#include<numeric>
#include <algorithm>
#include<math.h>
#include<cstdio>
#include<string.h>
#include<unistd.h>
#include <array>
#include <map> 




using namespace std;
typedef long long ll;
struct point{
  int x;
  int y;

};
int gcd(int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd
int lcm( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm
int input(){
  int x;
  cin>>x;
  return x;
}

int moji(char in)
{
    int ans = (int)in-(int)'a';
    if((ans < 0) || (ans > 25)){
        ans = 26;
    }
    return ans;
}
const int VV=10;//場合に応じてVVの値のみ変更する必要あり
//dijkstra(s)sがスタート地点でそこからの最短距離を配列dで表す。正の重みのみ使用可能
int cost[VV][VV];
int d[VV];
bool used[VV];
void dijkstra(int s){
  fill(d,d+VV,100000);
  fill(used,used+VV,false);
  d[s]=0;
  while(true){
    int v=-1;
    for(int u=0;u<VV;u++){
      if(!used[u]&&(v==-1||d[u]<d[v]))v=u;
    }
    if(v==-1)break;
    used[v]=true;
    for(int u=0;u<VV;u++){
      d[u]=min(d[u],d[v]+cost[v][u]);
    }
  }

}

int compare_int(const void *a, const void *b)//qsort(quick sort利用時に使用)
{
    return *(int*)a - *(int*)b;
}

int binary_searchh(long long x,long long k[],int n){
  int l=0;
  int r=n;
  while(r-l>=1){
    int i=(l+r)/2;
    if(k[i]==x)return i;
    else if(k[i]<x)l=i+1;
    else r=i;
  }
  return -1;
}

struct File {
    int aa;
    int bb;

    File(const int& aa, const int& bb)
        : aa(aa), bb(bb) {}
};

bool operator<(const File& a, const File& b)
{
    // ファイル種別、ファイル名の順番で優先順位を付けて比較
    return std::tie(a.aa, a.bb) < std::tie(b.aa, b.bb);
}




int main(){
  int N;
  cin>>N;
  int res=N;
  for(int i=0;i<=N;i++){
    int cc=0;
    int t=i;
    while(t>0){
      cc+=t%6;
      t/=6;

    }
    t=N-i;
    while(t>0){
      cc+=t%9;
      t/=9;
    }
    if(res>cc){
      res=cc;
    }
  }
  cout<<res<<endl;

  


}


  
  

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

using namespace std;

int main(){
    int a,n,maxi=-10000000,mini=10000000;
    long sum =0;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> a;
        maxi = max(maxi,a);
        mini = min(mini,a);
        sum += a;
    }
    cout << mini << " " << maxi << " " << sum << endl;
    return 0;
}


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

typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> ii;
typedef vector<vector<ll>> vvll;
typedef vector<pair<ll, ll>> vii;
typedef long double ld;
typedef vector<ld> vld;
typedef vector<vector<ld>> vvld;
typedef vector<bool> vbl;
typedef vector<vbl> mbl;
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(s) (s).begin(), (s).end()
const ll MOD = 1e9 + 7;


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int a, b;
    cin >> a >> b;
    for (int i = 1; i <= 2000; i++)
    {
        int x = i * 8 / 100, y = i / 10;
        if (x == a && y == b)
        {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

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



int main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
     ll h;
     cin>>h;
     ll moves=0;
     ll i=0;
     while(h)
     {
        h=h/2;
        moves+=pow(2,i);
        i++;
	 }
	 cout<<moves<<endl;
    
	return 0;
	
	
}

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

int main() {
  ll n,m,k=0;
  cin>>n>>m>>k;
  vector<ll> sumofa(n+1),sumofb(m+1);
  rep(i,0,n+1){
    if(i==0){
      sumofa.at(i)=0;
    }else{
      ll aa=0;
      cin>>aa;
      sumofa.at(i)=sumofa.at(i-1)+aa;
    }
  }
  rep(i,0,m+1){
    if(i==0){
      sumofb.at(i)=0;
    }else{
      ll bb=0;
      cin>>bb;
      sumofb.at(i)=sumofb.at(i-1)+bb;
    }
  }
  
  ll ans=0;
  
  rep(i,0,n+1){
    if(sumofa.at(i)>k){
      break;
    }
    if(ans-i>0){
      rep(j,ans-i,m+1){
        if(sumofa.at(i)+sumofb.at(j)>k){
          //cout<<"a";
          break;
        }else if(i+j>ans){
          ans=i+j;
        }
      }
    }else{
      rep(j,0,m+1){
        if(sumofa.at(i)+sumofb.at(j)>k){
          //cout<<"a";
          break;
        }else if(i+j>ans){
          ans=i+j;
        }
      }
    }
  }
  cout<<ans;
}

Measured memory_bytes: 6388
import java.util.Scanner;
import java.util.TreeSet;

public class Main {
	static long getGcd(long a, long b){
		if(a > b){
			return getGcd(b, a);
		}
		long c = b % a;
		if(c == 0){
			return a;
		}else{
			return getGcd(c, a);
		}
	}
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long a = sc.nextLong();
		long b = sc.nextLong();
		long gcd = getGcd(a, b);
		TreeSet<Long> set = new TreeSet<>();
		for(long i = 2; i * i <= gcd; i++){
			set.add(i);
		}
		long count = 0;
		while(set.size() != 0){
			long n = set.pollFirst();
			for(long i = n * 2; i * i <= gcd; i = i + n){
				set.remove(i);
			}
			boolean flag = false;
			while(gcd % n == 0){
				flag = true;
				gcd /= n;
			}
			if(flag){
				count++;
			}
		}
		if(gcd != 1){
			count++;
		}
		System.out.println(count + 1);
	}
}



Measured memory_bytes: 130804
import numpy as np
N = int(input())
H = np.array([int(v) for v in input().split()])
hm = np.max(H)
cnt = 0
for h in range(1, hm + 1):
    hh = H >= h
    f = False
    for n in range(N):
        # H[n] がh以上の区間が連続する回数を数える
        if not f and hh[n]:
            cnt += 1
            f = True
        elif not hh[n]:
            f = False
print(cnt)


Measured memory_bytes: 20072
var N,i,j,s,t:Longint;
A:Array[1..100]of Longint;
begin
read(N);
for i:=1 to N do begin
read(A[i]);
for j:=1 to i-1 do begin
t:=A[i]-A[j];
if t<0 then t:=-t;
if s<t then s:=t;
end;
end;
writeln(s);
end.

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;

#define REP(i,n) for(long long i = 0; i < (n); i++)
#define FOR(i, m, n) for(long long i = (m);i < (n); ++i)
#define ALL(obj) (obj).begin(),(obj).end()

template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;

const ll MOD = (ll)1e9 + 7;
const ll MOD2 = 998244353;
const ll LLINF = (ll)1e18;
const ll INTINF = (ll)1e9;
const long double PI = 3.1415926535897932384626433;

template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "{" << obj.first << ", " << obj.second << "}"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print(void) {cout << endl;}
template <class Head> void print(Head&& head) {cout << head;print();}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head << " ";print(forward<Tail>(tail)...);}
template <class T> void chmax(T& a, const T b){a=max<T>(a,b);}
template <class T> void chmin(T& a, const T b){a=min<T>(a,b);}
void YN(bool flg) {cout << ((flg) ? "YES" : "NO") << endl;}
void Yn(bool flg) {cout << ((flg) ? "Yes" : "No") << endl;}
void yn(bool flg) {cout << ((flg) ? "yes" : "no") << endl;}

int main() {
	int H,W,h,w; cin >> H >> W >> h >> w;
	cout << H*W-h*W-H*w+h*w << endl;



	return 0;
}


Measured memory_bytes: 256
/*Hey, What's up?*/

#include<bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
vector<long long>v;
int main()
{
    fastio;
    long long a=0,b=0,c,d,e,f=0,l,g,m,n,k,i,j,t,p,q;
    char ch;
    cin>>ch;
    ch++;
    cout<<ch<<'\n';
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for(int i=0;i<(n);++i)
#define per(i, n) for(int i=(n)-1;i>=0;--i)
#define repa(i, n) for(int i=1;i<(n);++i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
using ll = long long;
//const ll MOD = (ll)1e9+7;
const ll MOD = 998244353;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}

ll modpow(ll x, ll b){
	ll res = 1;
	while(b){
		if(b&1)res = res * x % MOD;
		x = x * x % MOD;
		b>>=1;
	}
	return res;
}

ll modinv(ll x){
	return modpow(x, MOD-2);
}

bool was_output = false;
template<class t>
void output(t a){
	if(was_output)cout << " ";
	cout << a;
	was_output = true;
}
void outendl(){
	was_output = false;
	cout << endl;
}

class arr{
public:
	int n;
	map<int, int> num;
	arr(){}
	arr(int n_):n(n_){}
	int get(int i){
		if(num.count(i))return num[i];
		return -1;
	}
	int set(int i, int k){
		if(i<0||i>=n)return -1;
		num[i] = k;
		return 0;
	}
};

bool func(){
	string op;
	int cnt = 0;
	int ans = INF;
	map<char, arr> m;
	function<int(string)> cul = [&](string str){
		if('0'<=str[0]&&str[0]<='9'){
			return stoi(str);
		}
		char c = str[0];
		return m[c].get(cul(str.substr(2, str.size()-3)));
	};
	while(cin>>op&&op!="."){
		++cnt;
		int assign = -1;
		rep(i, op.size()){
			if(op[i]=='='){
				assign = i;
				break;
			}
		}
		if(assign==-1){
			int num = cul(op.substr(2, op.size()-3));
			m[op[0]] = arr(num);
			continue;
		}
		int l = cul(op.substr(2, assign-3));
		int num = cul(op.substr(assign+1, op.size()-assign-1));
		if(num==-1){
			chmin(ans, cnt);
		}
		if(m[op[0]].set(l, num)==-1){
			chmin(ans, cnt);
		}
	}
	if(cnt==0)return false;
	if(ans==INF){
		cout << 0 << endl;
	}else{
		cout << ans << endl;
	}
	return true;
}

int main(){
	while(func());
}



Measured memory_bytes: 3216
n,x = map(int, input().split())
l = list(map(int, input().split()))

d = [0]*(n+1)
for i in range(1,n+1):
  d[i] = d[i-1]+l[i-1]
  
d = sorted(d)
count = 0
for i in range(n+1):
  if d[i]>x:
    break
  count += 1
  
print(count)

Measured memory_bytes: 3064
import numpy as np
import sys

if __name__ == "__main__":
    read = sys.stdin.buffer.read
    readline = sys.stdin.buffer.readline
    readlines = sys.stdin.buffer.readlines

    n, k = map(int, readline().split())
    p = np.array(readline().split(), np.int64)

    p = np.sort(p)
    print(p[:k].sum())


Measured memory_bytes: 27064
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <algorithm>
#include <bitset>
#include <numeric>
#include <cmath>
#include <tuple>
#include <queue>
#include <set>

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

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


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

    int x1, y1, x2, y2, x3, y3, x4, y4;

    cin >> x1 >> y1 >> x2 >> y2;

    x3 = x2 + (y1 - y2);
    y3 = y2 + (x2 - x1);

    x4 = x1 + (y1 - y2);
    y4 = y1 + (x2 - x1);

    cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;

    return 0;
}


Measured memory_bytes: 256
module Main where

import Data.Maybe (fromJust)
import Data.List
import qualified Data.ByteString.Char8 as BS


bytestr2Int = fst . fromJust . BS.readInt
getInt = bytestr2Int <$> BS.getLine
getIntL_H = map bytestr2Int. BS.words <$> BS.getLine
getIntL_V n = replicate n $ getInt
getInt2D n = replicate n $ getIntL_H


main :: IO ()
main = do
    [_,k] <- getIntL_H
    hs <- getIntL_H
    print $ check k hs

check k = length . filter (k<=)


Measured memory_bytes: 1660
import bisect

def main():
    N = int(input())
    A = sorted(list(map(int, input().split())))
    B = sorted(list(map(int, input().split())))
    C = sorted(list(map(int, input().split())))
    # print(N, A, B, C)
    # print(A)
    # print(B)
    # print(C)
    B1 = [0]*N
    for i in range(N):
        b = B[i]
        B1[i] = N - bisect.bisect_right(C, b)
        if i != 0:
            B1[i] += B1[i - 1]
    A1 = [0]*N
    for i in range(N):
        a = A[i]
        index = bisect.bisect_right(B, a)
        if index == 0:
            A1[i] = B1[-1]
        elif index < N:
            A1[i] = B1[-1] - B1[index - 1]
    ans = sum(A1)
    # print(B1, A1)
    print(ans)

if __name__ == '__main__':
    main()


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

int main(){
        int N;
        int A[200];
        cin >> N;
        for(int i = 0; i<N; i++) cin >> A[i];
        int res = 0;

        while(true) {
                bool exist_odd = false;
                for (int i = 0; i < N; i++) {
                        if(A[i]%2 != 0) exist_odd = true;
                }
                if(exist_odd) break;
                for (int i = 0; i < N; i++) {
                        A[i] /= 2;
                }
                res++;
        }
        cout << res << endl;
        return 0;
}

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

#define ed cout << "\n";
#define speed                         \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define ll long long
#define ffor(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(i, n) ffor(i, 0, n)
#define All(obj) (obj).begin(), (obj).end()
#define INF ((ll)1e9 + 7)
#define c(a) cout << a << "\n";
using namespace std;
const int N = 100005;

int main()
{
    speed;
    cout << fixed << setprecision(6);
    /*start*/
    int n, m;
    cin >> n >> m;
    vector<ll> a(n);
    vector<ll> b(n);
    vector<ll> s(m);
    vector<ll> t(m);

    for (int i = 0; i < n; i++)
    {
        cin >> a[i] >> b[i];
    }
    for (int i = 0; i < m; i++)
    {
        cin >> s[i] >> t[i];
    }
    for (int i = 0; i < n; i++)
    { //sturdent
        ll k = abs(a[i] - s[0]) + abs(b[i] - t[0]);
        int memNum = 1;
        for (int j = 1; j < m; j++)
        { //checkPoint
            ll mem = abs(a[i] - s[j]) + abs(b[i] - t[j]);
            if (mem < k)
            {
                k = mem;
                memNum = j + 1;
            }
        }
        c(memNum); //変数の名前がかぶってた…orz
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    cin.tie(0);
    ios::sync_with_stdio(false);<- これら、printfとかと併用しない方が良さそう

*/

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n==0) return 1;
    ll res=modpow(x, n/2);

    if(n%2==0) return res*res%mod;
    else return res*res%mod*x%mod;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };


// 線分 ab の偏角 返り値は[-π, π]
double argument(const pair<double, double> &a, const pair<double, double> &b){
    double ax=a.first, ay=a.second, bx=b.first, by=b.second;
    return atan2(by-ay, bx-ax);
}

/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */

// 有向グラフでの閉路検出
// O(V+E)
// 0:New, 1:Active, 2:Finished
// Activeは行きがけ順序、Finishedは帰り掛け順序

const int NMAX = 1010;
vector<pair<int, int>> G[NMAX][NMAX];
vector<vector<int>> status(NMAX, vector<int>(NMAX, 0));

bool IsAcyclicDFS(int i, int j){
    status[i][j] = 1;
    for(auto p : G[i][j]){
        int ni = p.first, nj = p.second;
        if(status[ni][nj] == 1) return false;
        else if(status[ni][nj] == 0){
            if(IsAcyclicDFS(ni, nj) == false) return false;
        }
    }
    status[i][j] = 2;
    return true;
}

bool IsAcyclic(){
    rep(i, NMAX) rep(j, NMAX) status[i][j] = 0;
    rep(i, NMAX) rep(j, NMAX) {
        if(status[i][j] == 0){
            if(IsAcyclicDFS(i, j) == false) return false;
        }
    }
    return true;
}


vector<vector<int>> memo(1010, vector<int>(1010, -1));

int rec(int i, int j){
    if(memo[i][j] != -1) return memo[i][j];
    
    int res = 1;
    for(auto p : G[i][j]){
        int ni = p.first, nj = p.second;{
            chmax(res, rec(ni, nj)+1);
        }
    }
    return memo[i][j] = res;
}


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

    int n; cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];

    ll ans = 0;
    ll bit = 0;
    ll right = 0;
    for(ll left=0; left<n; ++left){
        while(right<n && (bit^a[right])==bit+a[right]) { bit ^= a[right]; ++right; }
        ll len = right-left;
        ans += len;
        bit = (bit^a[left]);
    }
    cout << ans << endl;

    return 0;
}

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

#define fi first
#define se second
#define pb push_back
#define int long long
#define all(x) (x).begin(), (x).end()

using LL = long long;
using LD = long double;
using pii = pair<int, int>;
using vii = vector<pii>;

const int INF = 1e18;
const int MOD = 1e9 + 7;
const int N = 1e5 + 5;

int cc = 0;
vector<int> g[N];
bool vis[N];

void dfs(int x) {
	vis[x] = 1;

	for (int y: g[x]) {
		if (!vis[y]) {
			dfs(y);
		}
	}
}

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

	int n, m;
	cin >> n >> m;

	for (int i = 1; i <= m; i++) {
		int x, y, z;
		cin >> x >> y >> z;
		g[x].pb(y);
		g[y].pb(x);
	}

	for (int i = 1; i <= n; i++) {
		if (!vis[i]) {
			dfs(i);
			cc++;
		}
	}

	cout << cc << "\n";
    return 0;
}


Measured memory_bytes: 8960
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vi2 = vector<vector<int>>;
using vb = vector<bool>;
using vb2 = vector<vector<bool>>;
using vc = vector<char>;
using vc2 = vector<vector<char>>;
using vs = vector<string>;
using si = set<int>;
using vs2 = vector<vector<string>>;
using pii = pair<int, int>;
using mii = map<int, int>;
const int INF = 1e9+1;
const ll LINF = 1e18+1;
const long double PI = acos(-1.0);

#define MP(a,b) make_pair((a),(b))
#define MT(...) make_tuple(__VA_ARGS__)
#define sz(x) (int)(x).size()
 
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
 
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define SORT(v) sort(ALL(v));
#define RSORT(v) sort(RALL(v));
#define IN(type,a) type a;cin >> a;
#define VIN(type,a,n) vector<type> a(n);cin >> a;
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl;
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl;
#define COUT(x) cout << (x) << endl;
#define DCOUT(x,n) cout << fixed << setprecision(n) << (x) << endl;
#define ENDL cout << endl;
#define DB(s,x) cout << (s) << " : " << x << endl;
 
#define HOGE COUT("HOGE")
 
template<typename T>inline istream& operator>>(istream&i,vector<T>&v)
{REP(j,sz(v))i>>v[j];return i;}
 
template<typename T> bool chmax(T& a, const T& b){if(a<b){a=b;return true;}return false;}
template<typename T> bool chmin(T& a, const T& b){if(a>b){a=b;return true;}return false;}
template<typename T> T gcd(T a,T b){if(b==0){return a;}else{return gcd(b, a%b);}}
template<typename T> T lcm(T a,T b){return a*b/gcd(a, b);}


const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}


int main() {
    int n;
    string s;
    cin >> n >> s;
    if (n%2) {
        COUT("No");
        return 0;
    }
    Yes(s.substr(0,n/2)==s.substr(n/2,n/2));
}


Measured memory_bytes: 3580
#include "bits/stdc++.h"
#define ALL(x) x.begin(), x.end()
#define iostreamBooster() do{ cin.tie(nullptr); ios_base::sync_with_stdio(false); }while(0)
#define rep(i, s, n) for(i64 i=(s); i < (n); ++i)
using namespace std;
using i64 = long long;
using pii = pair<int, int>;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
constexpr int INF  = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD  = int(1e9) + 7;

int N;
i64 H;
i64 a[100010];
i64 b[100010];

struct P {
  i64 x;
  bool inf;
  P(i64 x=0, bool inf=false) : x(x), inf(inf) {}

  bool operator< (const P &that) const { return x < that.x; }
};


signed main()
{
  cin >> N >> H;
  priority_queue<P> pq;

  rep(i, 0, N) {
    cin >> a[i] >> b[i];
    pq.emplace(a[i], true);
    pq.emplace(b[i], false);
  }

  i64 rem = H;
  i64 ans = 0;
  while(rem > 0 && pq.size() && !pq.top().inf)
  {
    const auto p = pq.top(); pq.pop();
    rem -= p.x;
    ++ans;
  }

  chmax(rem, 0);
  const auto p = pq.top(); pq.pop();
  const i64 cnt = (rem + p.x - 1) / p.x;
  ans += cnt;

  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 7152
#include <bits/stdc++.h>
#define rep(i, s, n) for(int i = s; i < n; i++)
#define rrep(i, s, n) for(int i = s; i > (s)-(n); i--)
#define pr(s) std::cout << s << std::endl
#define prb(s) std::cout << s
using namespace std;



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


  int a, b, c;
  cin >> a >> b >> c;

  if(a+b >= c) {
    pr("Yes");
  } else {
    pr("No");
  }

  return 0;
}


Measured memory_bytes: 256