akhauriyash/Code-Regression huggingface dataset:
//author : akashksinghal
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fasino ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
#define input(A) for(auto &i:A) cin>>i;
signed main()
{
    fasino
    int n;
    cin >> n;
    if(n==1) cout << 0 ;
    else cout << 1;
    return 0;
}

Measured memory_bytes: 3624
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long lint;
int const N=2e5+10;
int const S=1<<19;
int n,V;
lint d[N];
int logV,a[25][N];
int U,f1[S],f2[S];
int upFind(int a[],int x)
{
    int L=1,R=a[0];
    while(L<R-1)
    {
        int mid=(L+R)>>1;
        if(a[mid]<=x) L=mid+1;
        if(a[mid]>x) R=mid;
    }
    if(a[L]>x) return a[L];
    else return a[R];
}
int lowFind(int a[],int x)
{
    int L=1,R=a[0];
    while(L<R-1)
    {
        int mid=(L+R)>>1;
        if(a[mid]<x) L=mid;
        if(a[mid]>=x) R=mid-1;
    }
    if(a[R]<x) return a[R]+1;
    else return a[L]+1;
}
int main()
{
    scanf("%d%d",&n,&V);
    logV=0;
    while((1<<logV)<=V) logV++;
    logV++;
    for(int i=1;i<=n;i++) scanf("%lld",&d[i]),d[i-1]=d[i]-d[i-1];
    d[n]=0;
    for(int i=1;i<=logV;i++)
    {
        a[i][0]=1;
        for(int j=1;j<=n;j++)
        {
            a[i][a[i][0]]=j;
            if(d[j]>(V>>(i-1))) a[i][0]++;
        }
    }
    if(a[1][0]>logV)
    {
        for(int i=1;i<=n;i++) printf("Impossible\n");
        return 0;
    }
    U=(1<<logV)-1;
    for(int s=0;s<=U;s++) f1[s]=0,f2[s]=n+1;
    for(int s=0;s<=U;s+=2)
        for(int i=2;i<=logV;i++)
        {
            int s0=1<<(i-1);
            if(s&s0) continue;
            f1[s|s0]=max(f1[s|s0],upFind(a[i],f1[s]));
            f2[s|s0]=min(f2[s|s0],lowFind(a[i],f2[s]-1));
        }
    for(int i=1;i<=a[1][0];i++)
    {
        bool f=false;
        int fr=a[1][i-1]+1,to=a[1][i];
        if(i==1) fr=1;
        for(int s=0;s<=U&&!f;s+=2)
            if(fr<=f1[s]+1 && f2[U-s-1]-1<=to) f=true;
        if(f) for(int j=fr;j<=to;j++) printf("Possible\n");
        else for(int j=fr;j<=to;j++) printf("Impossible\n");
    }
    return 0;
}

Measured memory_bytes: 25472
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
ll mod = 1e9 + 7;

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

ll sum(ll l, ll r) {
  return (l + r) * (r - l + 1) / 2;
}

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

  mint ans = 0;
  for (int i = k; i <= n + 1; i++) {
    ll l = sum(0, i - 1);
    ll r = sum(n - i + 1, n);
    ans += r - l + 1;
  }

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

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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
bool chmin(T &a,T b){if(a>b){a=b;return true;}else return false;}
template<typename T>
bool chmax(T &a,T b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
ostream &operator<<(ostream &os, pair<ll, ll>&p){
  return os << p.first << " " << p.second;
}  
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  ll a,b;cin>>a>>b;
  ll sz=1000000;
  rep(i,1,sz){
    if(i*8/100==a&&i*10/100==b){
      cout<<i<<endl;
      break;
    }
    if(i==sz-1)cout<<-1<<endl;
  }
  return 0;
}

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

int main() {
	vector<int> n(3);
	cin >> n[0] >> n[1] >> n[2];
	sort(n.begin(), n.end());

	int ans = 0;
	while (true) {
		if (n[0] + 2 > n[2])	break;
		n[0] += 2;
		ans++;
	}
	
	while (true) {
		if (n[1] + 2 > n[2])	break;
		n[1] += 2;
		ans++;
	}
	
	sort(n.begin(), n.end());
	if (n[0] == n[1] && n[1] + 1 == n[2])
		cout << ans + 1 << endl;
	else if (n[0] + 1 == n[1] && n[1] == n[2])
		cout << ans + 2 << endl;
	else
		cout << ans << endl;
	
	return 0;

}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>

/*
 *変数
 */
int ans,a,b;

/*
 *解 
 */
void solve(){
    ans=std::max(std::max(a+b,a-b),a*b);
    printf("%d",ans);
}

/*
 *入力 
 */
int main(){
       std::cin.tie(0);
       std::ios::sync_with_stdio(false);
       std::cin>>a>>b;
       solve();
       return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <complex>
#include <iostream>
#include <string>
#include <vector>

using std::cin;
using std::cout;
using std::endl;

using std::min;
using std::max;
using std::abs;

using std::string;
using std::to_string;

using std::sort;

using std::vector;

const long MOD = 1000000007;

int main(void) {
    int n;
    cin >> n;

    string s1, s2;
    cin >> s1;
    cin >> s2;


    int i = 0;
    int left_pat = 0;
    long comb = 1;
    while (i < n) {
        if (s1[i] == s2[i]) {
            int c;
            if (left_pat == 0) {
                c = 3;
            } else if (left_pat == 1) {
                c = 2;
            } else {
                c = 1;
            }
            comb = comb * c % MOD;
            left_pat = 1;
            i += 1;
        } else {
            int c;
            if (left_pat == 0) {
                c = 6;
            } else if (left_pat == 1) {
                c = 2;
            } else {
                c = 3;
            }
            comb = comb * c % MOD;
            left_pat = 2;
            i += 2;
        }
    }

    cout << comb << endl;

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
class Main{
    public static void main(String[] args) {
        Scanner scn=new Scanner(System.in);
        int age=scn.nextInt();
        if(age==1){
            System.out.println("Hello World");
        }else{
            int a=scn.nextInt();
            int b=scn.nextInt();
            System.out.println(a+b);
        }
    }
}

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


signed main(){

    // omajinai
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    // omajinai

    string s;
    cin >> s;
    int a;
    a = s.size();
    int ans = 0;

    for(int i = 0;i < a / 2;i ++){
        if(s.at(i) != s.at(a-1-i)) ans ++;
    }

    cout << ans << endl;
}



Measured memory_bytes: 256
import queue

# http://vartkw.hatenablog.com/entry/2016/12/02/002703


class Dinic:
    """Implementation of Dinic's Alogorithm"""

    def __init__(self, v, inf = 1000000007):
        self.V = v
        self.inf = inf
        self.G = [[] for _ in range(v)]
        self.level = [0 for _ in range(v)]
        self.iter = [0 for _ in range(v)]

    def add_edge(self, from_, to, cap):
        # to: 行き先, cap: 容量, rev: 反対側の辺
        self.G[from_].append({'to':to, 'cap':cap, 'rev':len(self.G[to])})
        self.G[to].append({'to':from_, 'cap':0, 'rev':len(self.G[from_])-1})

    # sからの最短距離をbfsで計算
    def bfs(self, s):
        self.level = [-1 for _ in range(self.V)]
        self.level[s] = 0;
        que = queue.Queue()
        que.put(s)
        while not que.empty():
            v = que.get()
            for i in range(len(self.G[v])):
                e = self.G[v][i]
                if e['cap'] > 0 and self.level[e['to']] < 0:
                    self.level[e['to']] = self.level[v] + 1
                    que.put(e['to'])

    # 増加バスをdfsで探す
    def dfs(self, v, t, f):
        if v == t: return f
        for i in range(self.iter[v], len(self.G[v])):
            self.iter[v] = i
            e = self.G[v][i]
            if e['cap'] > 0 and self.level[v] < self.level[e['to']]:
                d = self.dfs(e['to'], t, min(f, e['cap']))
                if d > 0:
                    e['cap'] -= d
                    self.G[e['to']][e['rev']]['cap'] += d
                    return d

        return 0

    def max_flow(self, s, t):
        flow = 0
        while True:
            self.bfs(s)
            # bfsで到達不可
            if self.level[t] < 0 : return flow
            self.iter = [0 for _ in range(self.V)]
            f = self.dfs(s, t, self.inf)
            while f > 0:
                flow += f
                f = self.dfs(s,t, self.inf)


N = int(input())
red = []
blue = []
for _ in range(N):
    red.append(tuple(map(int, input().split())))
for _ in range(N):
    blue.append(tuple(map(int, input().split())))

dinic = Dinic(2*N+2)
for i in range(N):
    dinic.add_edge(0, i+1, 1)
    dinic.add_edge(N+i+1, 2*N+1, 1)
for i in range(N):
    for j in range(N):
        if red[i][0] < blue[j][0] and red[i][1] < blue[j][1]:
            dinic.add_edge(i+1, N+j+1, 1)

print(dinic.max_flow(0, 2*N+1))


Measured memory_bytes: 50264
#include <bits/stdc++.h>
#define N 100007
using namespace std;

int n, m, a, b, ans, dp[N];
vector<int> graph[N];

int maxdist(int node) {
	if (dp[node]>=0) return dp[node];
	dp[node]=0;
	for (int i=0; i<graph[node].size(); i++) {
		int nbr = graph[node][i];
		dp[node]=max(dp[node],maxdist(nbr)+1);
	}
	return dp[node];
}

int main() {
	cin>>n>>m;
	for (int i=0; i<m; i++) {
		cin>>a>>b;
		graph[a].push_back(b);
	}
	memset(dp,-1,sizeof(dp));
	for (int i=1; i<=n; i++) {
		ans=max(ans,maxdist(i));
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 8192
#include <iostream>
using namespace std;
int main(){
  int n;
  cin >> n;
  n %= 10;
  if(n == 3){
    cout << "bon\n";
  }else if(n == 0 || n == 1 || n == 6 || n == 8){
    cout << "pon\n";
  }else{
    cout << "hon\n";
  }
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define ALL(a) (a).begin(),(a).end()
#define rALL(a) (a).rbegin(),(a).rend()
typedef pair<int, int> Pint;
typedef pair<int64_t, int64_t> Pll;

int main() {
    int N, sum = 0;
    cin >> N;
    vector<int> a(100000);
    for (int i = 0; i < N; i ++) {
        int b;
        cin >> b;
        a.at(b)++;
    }
    for (int i = 1; i < 100000 - 1; i++) {
        int b = a.at(i - 1) + a.at(i) + a.at(i + 1);
        sum = max(sum, b);
    }
    cout << sum << endl;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <string>
#include <unordered_map>
#include <queue>
#include <set>
#include <iomanip>

using namespace std;

#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;


int main(){
    int a, b, x;
    cin >> a >> b >> x;
    double rate = x * 1. / (a * a * b);
    double tangent, y, z;
    if (rate > 0.5) {
        y = (1. - rate) * 2 * b;
        z = a;
        tangent = y / z;
    }
    else{
        y = b;
        z = rate * 2 * a;
        tangent = y / z;
    }
    cout << fixed << setprecision(10) << atan(tangent) * 180 / M_PI << endl;
    return 0;
}




Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <string.h>
#define s(n)                        scanf("%d",&n)
#define sc(n)                       scanf("%c",&n)
#define sl(n)                       scanf("%I64d",&n)
#define sf(n)                       scanf("%lf",&n)
#define ss(n)                       scanf("%s",n)
#define INF                         (int)1e9
#define EPS                         1e-9
#define bitcount                    __builtin_popcount
#define gcd                         __gcd
#define forall(i,a,b)               for(int i=a;i<b;i++)
#define foreach(v, c)               for( typeof( (c).begin()) v = (c).begin();  v != (c).end(); ++v)
#define all(a)                      a.begin(), a.end()
#define in(a,b)                     ( (b).find(a) != (b).end())
#define pb                          push_back
#define fill(a,v)                    memset(a, v, sizeof a)
#define sz(a)                       ((int)(a.size()))
#define mp                          make_pair
#define MOD                         1000000007
typedef long long ll;
/*For you see , each day i love you
 more.Today more than yesterday
  less than tomorrow.*/
using namespace std;

int main()
{
	int n;s(n);
	
	int ac = 0 , wa = 0 , tle = 0 , re = 0;
	
	for(int i = 0;i<n;i++)
	{
		string str;cin>>str;
		
		
		if(str == "AC") ac++;
		else if(str == "TLE") tle++;
		else if(str == "RE") re++;
		else if(str == "WA") wa++;	
	}
	
	
	printf("AC x %d\n" , ac);
	printf("WA x %d\n" , wa);
	printf("TLE x %d\n" , tle);
	printf("RE x %d\n" , re);
	return 0;
}

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

ll n, k;
vector<ll> a, b;

ll solve(ll k){
    ll ret = 0;
    REP(i, n){
        if((a.at(i) & k) == a.at(i)){
            ret += b.at(i);
        }
    }
    return ret;
}

int main(){
    cin >> n >> k;
    a.resize(n); b.resize(n);
    REP(i, n){
        cin >> a.at(i) >> b.at(i);
    }

    ll ans = solve(k);
    REP(i, 35){
        if(!((k >> i) & 1)){
            continue;
        }
        ll k2 = k;
        k2 = k2 ^ (1LL << i);
        REP(j, i){
            k2 = k2 | (1LL << j);
        }
        ans = max(ans, solve(k2));
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define all(v) v.begin(), v.end()
    
int main(){
    long long a,b,x;
    cin >> a >> b>> x;
    if(a==0 && b==0) cout << 1 << endl;
    else if(a==0){
        cout << b/x + 1 << endl;
    }
    else{
        cout << b/x - (a-1)/x << endl;
    }
}


Measured memory_bytes: 3624
t=gets.chomp
dp=[]
t.size.times{|i|
	dp[i]=[0,0,0,0]
}


free0=0
free1=1
not0=2
not1=3

dp[0][free0]=1
dp[0][not1]=2
m1=1000000007
(t.size-1).times{|i|
	p1=i+1
	a=t[p1]
	if a=='1'
		dp[p1][not1]=dp[i][not1]*2+dp[i][not0]*2
		dp[p1][free1]=dp[i][free0]*2+dp[i][free1]*2
		dp[p1][free0]=dp[i][free0]+dp[i][free1]+dp[i][not0]+dp[i][not1]
	else
		dp[p1][free0]=dp[i][free0]+dp[i][free1]
		dp[p1][free1]=dp[i][free0]*2+dp[i][free1]*2
		dp[p1][not0]=dp[i][not1]+dp[i][not0]
	end
	
	dp[p1][free0]=(dp[p1][free0])%m1
	dp[p1][free1]=(dp[p1][free1])%m1
	dp[p1][not0]=(dp[p1][not0])%m1
	dp[p1][not1]=(dp[p1][not1])%m1
}
p (dp.last.inject{|sum,e| sum+e})%m1

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

int main()
{
  ll h, n;
  cin >> h >> n;
  for (ll i = 0; i < n; i++)
  {
    ll a;
    cin >> a;
    h -= a;
  }
  if (h > 0)
  {
    cout << "No" << endl;
  }
  else
  {
    cout << "Yes" << endl;
  }
}


Measured memory_bytes: 3624
from heapq import heapify, heappop, heappush, heappushpop

def next_int(n):
    nums = {0: [0, 1],
            1: [0, 1, 2],
            2: [1, 2, 3],
            3: [2, 3, 4],
            4: [3, 4, 5],
            5: [4, 5, 6],
            6: [5, 6, 7],
            7: [6, 7, 8],
            8: [7, 8, 9],
            9: [8, 9]}
    return nums[n]


K = int(input())
queue = [1, 2, 3, 4, 5, 6, 7, 8, 9]
heapify(queue)
for _ in range(K-1):
    now = heappop(queue)  # 最小値を取り出す
    for next_i in next_int(int(str(now)[-1])):
        heappush(queue, int(str(now)+str(next_i)))

print(heappop(queue))


Measured memory_bytes: 10720
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<int> a(N);
    map<int, int> mp;
    for (int i = 0; i < N; i++){
        cin >> a.at(i);
    }
    for (int i = 0; i < N; i++){
        if (mp.count(a.at(i))) mp.at(a.at(i))++;
        else mp[a.at(i)] = 1;
    }
    int ans = 0;
    for (auto p : mp){
        int x = p.first;
        int y = p.second;
        if (y >= x) ans += y - x;
        else ans += y;
    }
    cout << ans << endl;
}

Measured memory_bytes: 5120
#include<stdio.h>


int main(void)
{   
    int d,n,i;
    scanf("%d%d",&d,&n);
    
    if(n==100) n++;
    if(d==0) i=n;
    else if(d==1) i=n*100;
    else i=n*10000;
    printf("%d\n",i);
    
    return 0;
}



Measured memory_bytes: 128
#include <iostream>
#include <unordered_map>

using namespace std;

const int W = 4, H = 5;
unordered_map<string, int> memo;

inline int next(int pos, int dy, int dx)
{
    if (dy == 0 && dx == 0)
        return -1;
    int x = (pos % W) + dx, y = (pos / W) + dy;
    if (x < 0 || y < 0 || x >= W || y >= H)
        return -1;
    return y * W + x;
}

int Rec(string s)
{
    if (memo.end() != memo.find(s))
        return memo[s];

    int res = s.size();

    for (int i = 0; i < s.size(); ++i) {
        for (int dy = -1; dy <= 1; ++dy) {
            for (int dx = -1; dx <= 1; ++dx) {
                int nx = next(i, dy, dx);
                if (nx == -1 || nx >= s.size())
                    continue;
                if (s[i] != s[nx])
                    continue;

                string tmp("", (int)s.size() - 2);
                int index = 0;
                for (int l = 0; l < s.size(); ++l)
                    if (l != i && l != nx)
                        tmp[index++] = s[l];

                res = min(res, Rec(tmp));
            }
        }
    }

    memo.insert(unordered_map<string, int>::value_type(s, res));
    return res;
}

int main()
{
    int N;

    cin >> N;
    while (N--) {
        // Input
        char ch;
        string card;

        for (int i = 0; i < H * W; ++i) {
            cin >> ch;
            card += ch;
        }
        // Solve
        memo.clear();
        cout << Rec(card) << endl;
    }

    return 0;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;

#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define all(v) v.begin(),v.end()

const int maxn = 1e5 + 100;
const ll inf = 2e18, mod = 1e9 + 7;

ll aI, aO, aT, aJ, aL, aS, aZ, ans;

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

	cin >> aI >> aO >> aT >> aJ >> aL >> aS >> aZ;
	ll cntI = (aI / 2) * 4, cntJ = (aJ / 2) * 4, cntL = (aL / 2) * 4;
	ans = cntI + cntJ + cntL;
	//cerr << '#' << ans << endl;
	if (aI && aJ && aL)
	{
		aI--, aJ--, aL--;
		cntI = (aI / 2) * 4, cntJ = (aJ / 2) * 4, cntL = (aL / 2) * 4;
		ans = max(ans, cntI + cntJ + cntL + 6);
	}
	cout << (ans + aO * 2) / 2 << endl;
}


Measured memory_bytes: 256
/* include c++ libraries */
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <map>
#include <queue>
#include <set>

/* include c-lang libraries */
#include <climits>
#include <cmath>

/* include my libraries */
//#include <show_vec.hh>

using namespace std;

#define LINE DEBUG{ printf("LINE : %d\n", __LINE__); }
#define DEBUG if(false)

using ll = long long;
template<class T> using vec = vector<T>;

const int MOD = 1000000007;

template<class T> void show_vec0(std::vector<T> v){
  int s = v.size();
  for(int i = 0; i < s-1; i++){
    std::cout << v[i] ;
  }
  std::cout << v[s-1];
  return;
}

template<class T> void show_mat(std::vector<std::vector<T>> v){
  int size = v.size();
  for(int i = 0; i < size; i++){
    show_vec0(v[i]);
    cout << endl;
  }
}

int count(vec<vec<char>> v){
  int H = v.size();
  int W = v[0].size();
  int cnt = 0;
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      if(v[i][j] == '#'){
        cnt++;
      }
    }
  }
  return cnt;
}

int main(){

  int H, W, K;
  cin >> H >> W >> K;
  vec<vec<char>> c(H);
  int Black = 0;
  int Ans = 0;
  for(int i = 0; i < H; i++){
    c[i].resize(W);
    for(int j = 0; j < W; j++){
      cin >> c[i][j];
      if(c[i][j] == '#'){
        Black++;
      }
    }
  }

  for(int h = 0; h < pow(2, H); h++){
    vec<vec<char>> copy1 = c;
    for(int i = 0; i < H; i ++){
      if(((h>>i)&1) == 1){
        for(int ww = 0; ww < W; ww++){
          copy1[i][ww] = '-';
        }
      }
    }

    for(int w = 0; w < pow(2, W); w++){
      vec<vec<char>> copy2 = copy1;
      for(int j = 0; j < W; j++){
        if(((w>>j)&1) == 1){
          for(int hh = 0; hh < H; hh++){
            copy2[hh][j] = '-';
          }
        }
      }
      if(count(copy1) < K){
        continue;
      }
      // count
      if( count(copy2) == K ){
        Ans++;
      }
      //show_mat(copy2);
      //printf("\n");
    }
  }
  cout << Ans << endl;

  return 0;
}


Measured memory_bytes: 4088
#include<bits/stdc++.h>
typedef  long long int ll;
typedef  long double ld;
#define sync ios_base::sync_with_stdio(false); cin.tie(NULL) 
#define input(arr,n) for(ll i1=0;i1<n;i1++ )cin>>arr[i1]
#define mod 1000000007
#define F first
#define S second 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
//recursions\
#pragma comment(linker, "/stack:200000000")
//loops\
#pragma GCC optimize("unroll-loops")
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type,greater_equal<ll>, rb_tree_tag,tree_order_statistics_node_update>//s.order_of_key(val) *s.find_by_order(ind)
using namespace std;
int main()
{
	sync;	
	ll n;
	cin>>n;
	for(ll i=1;i<=9;i++)
	{
		for(ll j=1;j<=9;j++)
		{
			if(i*j==n)
			return cout<<"Yes",0;
		}
	}
	cout<<"No";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
 
int main() {
    int cnt;cnt = 0;
  vector<int> in(6);
  for(int i=0;i<5;i++){
      cin >> in[i];
  }
  vector<int> ama;
  vector<int> ant(6);
  for(int j=0;j<5;j++){
      ant[j] = in[j]%10;
      if(ant[j]==0){
          continue;
      }else{
          ama.push_back(ant[j]);
      }
  }
  int shou;shou = 0;
  for(int k=0;k<5;k++){
      shou += in[k]/10;
  }

  sort(ama.begin(),ama.end());
  size_t size = ama.size();

  for(int l=0;l<5;l++){
      if(ant[l]==0){
          continue;
      }else{
          cnt++;
      }
  }
  if(cnt==0){
      cout << shou*10  << endl;
  }else{
      cout << shou*10 + (size-1)*10 + ama[0] << endl;
  }
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl

using namespace std;

typedef long long ll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

template<typename T>
ostream& operator << (ostream& os, const vector<T>& vec) {
    os << "[ ";
    REP(i, vec.size()) {
        os << vec[i] << " ";
    }
    os << "]";

    return os;
}

ll pow_mod(ll a, ll p) {
    ll res = 1;
    while(p) {
        if (p & 1) res = (res * a) % MOD;
        a = (a * a) % MOD;
        p >>= 1;
    }

    return res;
}


ll mod_inv(ll a, ll m) {
    ll b = m, u = 0, v = 1;
    while(a) {
        ll t = b / a;
        swap(b -= t * a, a);
        swap(u -= t * v, v);
    }

    return (u % m + m) % m;
}

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


int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    
    int N, M;
    cin >> N >> M;

    int m[N];
    REP(i, N) m[i] = N;
    REP(i, M) {
        int a, b;
        cin >> a >> b;
        --a; --b;
        m[a] = min(m[a], b);
    }

    int ans = 1;
    int l = -1, r = N;
    REP(i, N) {
        if (m[i] == N) continue;

        l = i;

        if (i < r) {
             r = min(r, m[i]);
            continue;
        }

        r = m[i];
        ++ans;
    }

    cout << ans << endl;

}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;

struct object {
    int64_t weight;
    int64_t value;
};

int main(void) {
    int64_t N, W;
    cin >> N >> W;
    vector< object > v(N);
    for(int64_t i=0; i<N; i++) {
        cin >> v[i].weight >> v[i].value;
    }
    vector< vector<int64_t> > v2(4);
    for(int64_t i=0; i<N; i++) {
        int64_t d = v[i].weight - v[0].weight;
        v2[d].push_back(v[i].value);
    }
    for(int64_t i=0; i<4; i++) {
        sort(v2[i].rbegin(), v2[i].rend());
        partial_sum(v2[i].begin(), v2[i].end(), v2[i].begin());
        v2[i].insert(v2[i].begin(), 0);
    }

    int64_t ans = 0;
    for(int64_t i=0; i<v2[0].size(); i++) {
        for(int64_t j=0; j<v2[1].size(); j++) {
            for(int64_t k=0; k<v2[2].size(); k++) {
                for(int64_t l=0; l<v2[3].size(); l++) {
                    if(v[0].weight*(i+j+k+l) + j + 2*k + 3*l <= W) {
                        ans = max(ans, v2[0][i] + v2[1][j] + v2[2][k] + v2[3][l]);
                    }
                }
            }
        }
    }

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


Measured memory_bytes: 256
N = int(input())
CSF = [list(map(int, input().split())) for _ in range(N-1)]
for i in range(N):
    ans = 0
    for j in range(i, N-1):
        if ans >= CSF[j][1]:
            ans = -(-ans//CSF[j][2]*CSF[j][2]) + CSF[j][0]
        else:
            ans = CSF[j][1] + CSF[j][0]
    print(ans)


Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int i=(a);i<(n);++i)
#define eFOR(i,a,n) for(int i=(a);i<=(n);++i)
#define rFOR(i,a,n) for(int i=(n)-1;i>=(a);--i)
#define erFOR(i,a,n) for(int i=(n);i>=(a);--i)
#define each(i, a) for(auto &i : a)
#define SORT(a) sort(a.begin(),a.end())
#define rSORT(a) sort(a.rbegin(),a.rend())
#define fSORT(a,f) sort(a.begin(),a.end(),f)
#define all(a) a.begin(),a.end()
#define out(y,x) ((y)<0||h<=(y)||(x)<0||w<=(x))
#define tp(a,i) get<i>(a)
#define line cout << "-----------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define elif else if
#define stop system("pause")
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
template<class T>inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; }return false; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& a : v)is >> a; return is; }
template<class T>inline istream& operator>>(istream& is, deque<T>& v) { for (auto& a : v)is >> a; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }
template<class T>inline void print(const T& a) { cout << a << "\n"; }
template<class T, class... Ts>inline void print(const T& a, const Ts&... ts) { cout << a << " "; print(ts...); }
template<class T>inline void print(const vector<T>& v) { for (int i = 0; i < v.size(); ++i)cout << v[i] << (i == v.size() - 1 ? "\n" : " "); }
template<class T>inline void print(const vector<vector<T>>& v) { for (auto& a : v)print(a); }
inline string reversed(const string& s) { string t = s; reverse(all(t)); return t; }

int main() {
    init();

    string s; cin >> s;
    if (s.back() != 's')print(s + "s");
    else print(s + "es");

    return 0;
}

Measured memory_bytes: 3620
H, W = map(int, input().split())
S = [input() for _ in range(H)]

yoko = [[0]*W for _ in range(H)]
tate = [[0]*W for _ in range(H)]

def f(l):
    print("\n".join("".join(map(str, row)) for row in l))

for h in range(H):
    if S[h][0] == ".":
        yoko[h][0] = 1
    else:
        yoko[h][0] = 0

for h in range(H):
    for w in range(1, W):
        if S[h][w] == ".":
            yoko[h][w] = yoko[h][w-1]+1
        else:
            yoko[h][w] = 0

for h in range(H):
    for w in range(W-2, -1, -1):
        if S[h][w]=="." and S[h][w+1]==".":
            yoko[h][w] = yoko[h][w+1]

for w in range(W):
    if S[0][w] == ".":
        tate[0][w] = 1
    else:
        tate[0][w] = 0

for w in range(W):
    for h in range(1, H):
        if S[h][w] == ".":
            tate[h][w] = tate[h-1][w]+1
        else:
            tate[h][w] = 0

for w in range(W):
    for h in range(H-2, -1, -1):
        if S[h][w]=="." and S[h+1][w]==".":
            tate[h][w] = tate[h+1][w]

ans = 0

for h in range(H):
    for w in range(W):
        ans = max(yoko[h][w]+tate[h][w]-1, ans)

print(ans)

Measured memory_bytes: 142836
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
typedef long double llf;
typedef pair<lint, lint> pi;
const int mod = 1e9 + 7;

lint ipow(lint x, lint p){
	lint ret = 1, piv = x % mod;
	while(p){
		if(p&1) ret *= piv;
		piv *= piv;
		ret %= mod;
		piv %= mod;
		p >>= 1;
	}
	return ret % mod;
}

lint fact[1005], invf[1005];

int n, a, b, c, d;
int dp[1005][1005];
int bino[1005][1005];
lint prec[1005][1005];

lint partition(int x, int s, int c){
	if(~prec[x][s]) return prec[x][s];
	lint ret = 1;
	for(int i=0; i<c; i++){
		ret *= bino[x - s * i][s];
		ret %= mod;
	}
	return prec[x][s] = ret;
}

int f(int x, int s){
	if(s < a) return x == 0;
	if(~dp[x][s]) return dp[x][s];
	int ret = f(x, s-1);
	if(c * s <= x){
		lint ppart = partition(x, s, c);
		for(int i=c; i<=d && i * s <= x; i++){
			ret += 1ll * f(x - i * s, s - 1) * (ppart * invf[i] % mod) % mod;
			ret %= mod;
			ppart *= bino[x - s * i][s];
			ppart %= mod;
		}
	}
	return dp[x][s] = ret;
}

int main(){
	cin >> n >> a >> b >> c >> d;
	memset(dp, -1, sizeof(dp));
	memset(prec, -1, sizeof(prec));
	for(int i=0; i<=n; i++){
		bino[i][0] = 1;
		for(int j=1; j<=i; j++){
			bino[i][j] = (bino[i-1][j-1] + bino[i-1][j]) % mod;
		}
	}
	fact[0] = invf[0] = 1;
	for(int i=1; i<=n; i++){
		fact[i] = fact[i-1] * i % mod;
		invf[i] =ipow(fact[i], mod-2);
	}
	cout << f(n, b);
}



Measured memory_bytes: 16128
from fractions import gcd

N = int(input())
A = list(map(int, input().split()))
if N == 1:
    print('1')
else:
    g = gcd(A[0],A[1])
    lcm = (A[0]*A[1]) // g
    for x in A[2:]:
        lcm = (lcm * x) // gcd(lcm,x)
    print(sum((lcm//x) for x in A)%1000000007)

Measured memory_bytes: 6112
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111; 
using namespace std;
using lint = long long;

lint gcd(lint a, lint b) { return b ? gcd(b, a%b) : a; }
lint num(lint a, lint b, lint div) { return b / div - a / div + (a%div == 0); }

int main() {

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

	lint A, B, C, D;
	cin >> A >> B >> C >> D;

	const lint lcm = C * D / gcd(C, D);

	cout << B - A + 1 - num(A,B,C) - num(A,B,D) +num(A,B,lcm)  << "\n";

	return 0;

}

Measured memory_bytes: 256
import java.util.*;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		
		Scanner s=new Scanner(System.in);
		int K=s.nextInt();
		int S=s.nextInt();
		int count=0;
		int i=0,j=0;
		
		for(i=0;i<=K;i++){
			for(j=0;j<=K;j++){
				if(S-i-j<=K&&S-i-j>=0)count++;
			}
		}
		
		System.out.print(count);
	}

}

Measured memory_bytes: 21716
n, m, c = map(int, input().split())
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(n)]
ans = 0

for i in range(n):
    sum = 0

    for j in range(m):
        sum = sum + A[i][j] * B[j]

    sum = sum + c

    if sum > 0:
        ans = ans + 1

print(ans)

Measured memory_bytes: 3064
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>


int main(){
    int a,b;
    scanf("%d %d",&a,&b);
    printf("%d",(a+b)%24);
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pii pair<int,int>
#define ll long long int
#define ull unsigned long long int
#define inf LONG_MAX;
using namespace std;
ll n;
ll a[4][100005],dp[4][100005];
int main()
{
    fast_io
    cin>>n;
    for(int i=1;i<=n;i++)
        cin>>a[1][i]>>a[2][i]>>a[3][i];
    dp[1][1]=a[1][1];
    dp[2][1]=a[2][1];
    dp[3][1]=a[3][1];
    for(int i=2;i<=n;i++)
    {
        dp[1][i]=a[1][i]+max(dp[2][i-1],dp[3][i-1]);
        dp[2][i]=a[2][i]+max(dp[1][i-1],dp[3][i-1]);
        dp[3][i]=a[3][i]+max(dp[1][i-1],dp[2][i-1]);
    }
    cout<<max(dp[1][n],max(dp[2][n],dp[3][n]))<<endl;
}


Measured memory_bytes: 8244
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <bits/stdc++.h>
#include<queue>
#include <numeric>
#include<stdio.h>
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define fore(i,a) for(auto &i:a)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))
 
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
 

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

LL lcm(LL a, LL b){
    LL g = gcd(a,b);
    return a/g *b;
}

int main(){
    int N,A,B;
    cin >> N >> A >> B;
    int num=min(A*N,B);
    cout << num;
    }

Measured memory_bytes: 384
import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

		final long n = sc.nextLong();
		
		long min = Integer.MAX_VALUE;
		long max = Integer.MIN_VALUE;
		long sum = 0;
		for(int i = 0; i < n; i++){
			final int input = sc.nextInt();
			
			min = Math.min(min, input);
			max = Math.max(max, input);
			sum += input;
		}
		
		System.out.println(min + " " + max + " " + sum);
	}

}

Measured memory_bytes: 31764
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ld INF = (ld)10000000000000;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
int n, m;
int x[1 << 17];

int ans[1 << 17];

priority_queue<int, vector<int>, greater<int>>q;
vector<P> vr;

int main() {
	cin >> n >> m;
	rep(i, m) {
		cin >> x[i];
	}
	ans[1] = n - m;
	rep(i, m - 1) {
		if (x[i + 1] - x[i]-1 > 0)q.push(x[i + 1] - x[i] - 1);
	}
	//if (x[0] > 1)q.push(x[0] - 1);
	if (n - x[m - 1] > 0)q.push(n - x[m - 1]);
	Rep1(i, 2, n) {
		ans[i] = ans[i - 1] - q.size();
		while (!q.empty() && q.top() < i)q.pop();
		//cout << i << " " << ans[i] << endl;
	}
	rep1(i, n) {
		vr.push_back({ ans[i],i });
	}
	sort(vr.begin(), vr.end());
	int q; cin >> q;
	rep(aa, q) {
		int l; cin >> l;
		int id = lower_bound(vr.begin(), vr.end(), P{ l+1,-1 }) - vr.begin();
		if (id == 0)cout << -1 << endl;
		else {
			id--;
			int out = n - id;
			cout << out << endl;
		}
	}
	//stop
	return 0;
}


Measured memory_bytes: 4648
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <map>
#include <utility>
#include <stack>
#include <queue>
typedef long long ll;
using namespace std;

int main(){
  ll i,j,k,n,m;
  cin >> n >> m;
  if(n>=m)cout << 10 << endl;
  else cout << 0 << endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
        int H,N,A,i;
        scanf("%d%d",&H,&N);
        for(i=0;i<N;i++){
                scanf("%d",&A);
                H=H-A;
        }
        if(H<=0) printf("Yes\n");
        else     printf("No\n");
}


Measured memory_bytes: 128
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
vector<ll> parent;
vector<ll> depth;
vector<vector<ll>> graph;
ll n;
using P = pair<ll,ll>;
void bfs(){
    queue<P> que;
    for(ll i = 0; i < n; i++){
        depth[i] = 1145141919810;
    }
    depth[0] = 0;
    que.push(P(0,depth[0]));
    while(que.size()){
        P p = que.front();
        que.pop();
        for(ll i = 0; i < graph[p.first].size(); i++){
            if(p.second + 1 < depth[graph[p.first][i]]){
                
                parent[graph[p.first][i]] = p.first + 1;
                depth[graph[p.first][i]] = p.second + 1;
                que.push(P(graph[p.first][i],depth[graph[p.first][i]]));
            }
        }
    }
    return ;
}
int main()
{
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    ll m;
    cin >> n >> m;
    graph.resize(n);
    parent.resize(n,0);
    depth.resize(n);
    for(ll i = 0; i < m; i++){
        ll a,b;
        cin >> a >> b;
        a--;
        b--;
        graph[a].emplace_back(b);
        graph[b].emplace_back(a);
    }
    bfs();
    cout << "Yes" << endl;
    for(ll i = 1; i < n; i++)
        cout << parent[i] << endl;
}

Measured memory_bytes: 14436
#include <bits/stdc++.h>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define pb push_back
#define all(r) (r).begin(),(r).end()
#define rall(r) (r).rbegin(),(r).rend()
#define fi first
#define se second
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll LINF = 1e18;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

int main(){
	int n;
	cin>>n;
	map<int, int> m;
	rep(i, n) {
		int a, b;
		cin>>a>>b;
		m[a+b]++;
	}
	bool update = true;
	while(update) {
		update = false;
		map<int, int> _m;
		for(auto& p : m) {
			if(p.se > 1) _m[p.fi +1] += p.se/2, _m[p.fi] += p.se % 2, update = true;
			else _m[p.fi] += p.se;
		}
		m = _m;
	}
	for(auto& p : m) {
		if(p.se > 0) cout<<p.fi<<" "<<0<<endl;
	}
}

Measured memory_bytes: 11344
import java.io.*
import java.util.*

fun solve(a: Int, b: Int, x: Int){
    val V = a * a * b
    val ans = if (x >= V / 2){
        Math.atan(
            2.0 * (V.toDouble() - x )/ (a * a * a).toDouble()
        )
    }else{
        Math.atan(
            (b * b * a).toDouble() / (2.0 * x.toDouble())
        )
    }
    println(Math.toDegrees(ans))
    return
}


fun main(args: Array<String>) {
    fun StringArray(size: Int, init: (Int) -> String = { "\u0000" }): Array<String> {
        return Array<String>(size, init)
    }
    class Scanner(stream: InputStream) {
        private val reader = BufferedInputStream(stream).bufferedReader()
        private var st: StringTokenizer? = null
        fun next(): String {
            while (!(st?.hasMoreTokens() ?: false)) st = StringTokenizer(reader.readLine())
            return st!!.nextToken()
        }
    }
    val sc = Scanner(System.`in`)
    val a = sc.next().toInt()
    val b = sc.next().toInt()
    val x = sc.next().toInt()
    solve(a, b, x)
}



Measured memory_bytes: 31528
#include<bits/stdc++.h>
#include<cctype>
using namespace std;
#define rep(i,n) for (int i=0;i<(n);i++)
#define all(v) (v).begin(),(v).end()
typedef long long int ll;
#define pi 3.1415926535897932384
#define E9 1000000000
#define eps 1e-4
#define pii pair<int,int>


int main(){
  int N; cin >> N;
  ll A[N];
  ll R[N];
  rep(i,N) {
    cin >> A[i];

    if (i==0) R[i] = A[i];
    else R[i] = R[i-1] + A[i];
  }

  ll retval = 2020202020ll*200000ll+10;
  rep(i,N) retval = min(retval, abs(2*R[i]-R[N-1]));
  cout << retval << endl;


  // cout << fixed << setprecision(6);
  return 0;
}



Measured memory_bytes: 3328
#include <iostream>

using namespace std;

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

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

    int diff = b - a;

    int sum_a = 0;
    for (int i = 0; i < diff; i++) {
        sum_a += i;
    }

    cout << sum_a - a << '\n';
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define f(i,a,b) for(int i=(int)a;i<(int)b;i++)
#define ppi pair<int,pair<int,int> >
#define ll long long
#define pb push_back
#define mk make_pair
int i=0;int j=0;
int main()
{
 
    int n;cin>>n;vector<pair<int,int> >v;int c=0;
    f(i,0,n)
    {
        int d,k;
        cin>>d>>k;
        v.pb(mk(d,k));
    }
    for(int i=0;i<v.size()-2;i++)
    {
        if(v[i].first==v[i].second && v[i+1].first==v[i+1].second && v[i+2].first==v[i+2].second)
        c++;
    }
    if(c>0)
    cout<<"Yes"<<"\n";
    else
    cout<<"No"<<"\n";
     
 
    return 0;
}

Measured memory_bytes: 3600
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define INF (1LL<<57)
#define MV 200001
#define LMV 21
#define ff first
#define ss second
#define pb push_back
#define eb emplace_back
#define emp emplace
#define whoami(x) cerr<<#x<<" "<<x<<"\n";
#define mp make_pair
#define ins insert
#define sz size

void FLASH() {ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);}
void SETF() {cout.ios_base::setf(ios_base::fixed);}
void UNSETF() {cout.ios_base::unsetf(ios_base::fixed);}

typedef long long ll;
typedef long double ld;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;
typedef pair<PII, int> PPII;
typedef pair<PLL, ll> PPLL;
typedef map<int, int> MII;

const int MOD = 1000000007;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T>
using ordered_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

struct h_llint {
  static uint64_t splitmix64(uint64_t x) {    // http://xorshift.di.unimi.it/splitmix64.c
    x += 0x9e3779b97f4a7c15;
    x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
    x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
    return x ^ (x >> 31);
  }
  size_t operator()(uint64_t x) const {
    static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
    return splitmix64(x + FIXED_RANDOM);
  }
};

struct h_pair{
  size_t operator()(const PLL&x)const{
    return hash<ll>()(((ll)x.ff)^(((ll)x.ss)<<32));
  }
};

typedef map<ll, ll> MLL;
typedef map<PII, int> MPII;
typedef map<PLL, ll> MPLL;
typedef set<int> SI;
typedef set<ll> SL;
//ordered_set = order_of_key(.)
//ordered_set = find_by_order(.)
typedef ordered_set<int> OSI;
typedef ordered_set<ll> OSL;
typedef ordered_multiset<int> MOSI;
typedef ordered_multiset<ll> MOSL;
typedef unordered_map<ll, int, h_llint> UMLI;
typedef unordered_map<ll, ll, h_llint> UMLL;
typedef unordered_map<PLL, int, h_pair> UMPI;
typedef unordered_map<PLL, ll, h_pair> UMPL;

int ar[MV];
ll arr[MV];

void solve(int T)
{
	int n,m;
	cin>>n>>m;
	int sx = 0;
	for(int i=0;i<n;i++)
	{
		cin>>ar[i];
		sx += ar[i];
	}
	int cnt = 0;
	for(int i=0;i<n;i++)
	{
		if((ar[i] * m * 4) >= sx)
		cnt++;
	}
	if(cnt >= m)
	cout<<"Yes\n";
	else cout<<"No\n";
	return;	
}

int main(void)
{
	FLASH();
	int T;
	T = 1;

// #ifndef ONLINE_JUDGE
// 	time_t time_t1, time_t2;
// 	time_t1 = clock();
// #endif

	while(T--)
	solve(T);

// #ifndef ONLINE_JUDGE
// 	time_t2 = clock();
// 	SETF();
// 	cout<<"Time taken: "<<setprecision(7)<<(time_t2 - time_t1)/(double)CLOCKS_PER_SEC<<"\n";
// 	UNSETF();
// #endif

	return 0;
}

Measured memory_bytes: 256