akhauriyash/Code-Regression huggingface dataset:
#include <iostream>

using namespace std;
#include <string>
typedef long long int ll;
#include <algorithm>
#include <stack>
#include <vector>
#include <array>
#include <queue>

int main(){

  int a,b,c;
  cin >>a>>b>>c;
  if(a+b+c>21){
    cout << "bust";
  }else{
    cout <<"win";
  }


  return 0;

}


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

class Dice{
	int _num[6];
	public:
		void set(int num[6]){
			for(int i = 0; i < 6; i++) _num[i] = num[i];
		}
		void N(){
			swap(_num[0],_num[4]);
			swap(_num[0],_num[5]);
			swap(_num[0],_num[1]);
		}
		void S(){
			swap(_num[0],_num[1]);
			swap(_num[0],_num[5]);
			swap(_num[0],_num[4]);
		}
		void W(){
			swap(_num[0],_num[3]);
			swap(_num[0],_num[5]);
			swap(_num[0],_num[2]);
		}
		void E(){
			swap(_num[0],_num[2]);
			swap(_num[0],_num[5]);
			swap(_num[0],_num[3]);
		}
		void printTop(){
			cout << _num[0] << endl;
		}
		void printRight(){
			cout << _num[2] << endl;
		}
		void SetTop(int m){
			if(_num[2] == m) W();
			else if(_num[3] == m) E();
			else{
				while(1){
					if(_num[0] == m) break;
					S();
				}
			}
		}
		void SetFront(int m){
			while(1){
				if(_num[1] == m) break;
				S();
				W();
				N();
			}
		}
};

int main(){
	int num[6];
	for(int i = 0; i < 6; i++) 
		cin >> num[i];
	
	Dice d;
	d.set(num);
	
	int q;
	cin >> q;
	
	for(int i = 0; i < q; i++){
		int top,front;
		cin >> top >> front;
		
		d.SetTop(top);
		d.SetFront(front);
		
		d.printRight();
	}
	return 0;
}

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

using namespace std;
using ll = long long int;
using pii = pair<int, int>;
int INF = 1e9;
int N;
vector<vector<int> > yR(220000), yL(220000), xU(220000), xD(220000);
vector<vector<int> > txR(420000), txL(420000), txU(420000), txD(420000);
vector<vector<int> > tyU(420000), tyD(420000), tyR(420000), tyL(420000);

void input(){
	cin >> N;
	for (int i = 0; i < N; i++)
	{
		int _x, _y;
		char _u;
		cin >> _x >> _y >> _u;
		int _tx = _x - _y + 200000;
		int _ty = _x + _y;
		if(_u=='R') {
			yR[_y].push_back(_x);
			tyR[_ty].push_back(_tx);
			txR[_tx].push_back(_ty);
		}
		else if(_u=='L') {
			yL[_y].push_back(_x);
			tyL[_ty].push_back(_tx);
			txL[_tx].push_back(_ty);
		}
		else if(_u=='U') {
			xU[_x].push_back(_y);
			tyU[_ty].push_back(_tx);
			txU[_tx].push_back(_ty);
		}
		else if(_u=='D') {
			xD[_x].push_back(_y);
			tyD[_ty].push_back(_tx);
			txD[_tx].push_back(_ty);
		}
	}
}

void chmin(int &a, int b){if(a>b)a=b;}

int cof(vector<int> toR, vector<int> toL){
	int ret = INF;
	if(toL.size()==0 || toL.size()==0) return ret;
	toL.push_back(INF);
	sort(toL.begin(), toL.end());
	for(auto x_tor:toR) {
		int x_tol = *lower_bound(toL.begin(), toL.end(), x_tor);
		if(x_tol == INF) continue;
		chmin(ret, (x_tol - x_tor)*5);
	}
	return ret;
}

int solve(){
	int ans = INF;
	// yが同じもの同士

	for (int y = 0; y <= 200000; y++)
	{
		// if(yR[y].size()==0 || yL[y].size()==0) continue;
		// yL[y].push_back(INF);
		// sort(yL[y].begin(),yL[y].end());
		chmin(ans, cof(yR[y], yL[y]));
	}
	// xが同じもの同士
	for (int x = 0; x <= 200000; x++)
	{
		// if(xU[x].size()==0 || xD[x].size()==0) continue;
		// xD[x].push_back(INF);
		// sort(xD[x].begin(),xD[x].end());
		chmin(ans, cof(xU[x], xD[x]));
	}
	// 45度回転
	// yが同じもの同士
	for (int y = 0; y <= 400000; y++)
	{
		chmin(ans, cof(tyR[y], tyU[y]));
		chmin(ans, cof(tyD[y], tyL[y]));
		// if(tyR[y].size() && tyU[y].size()) {
		// 	// tyU[y].push_back(INF);
		// 	// sort(tyU[y].begin(),tyU[y].end());
		// }
		// if(tyL[y].size() && tyD[y].size()) {
		// 	// tyL[y].push_back(INF);
		// 	// sort(tyL[y].begin(),tyL[y].end());
		// }
	}
	// xが同じもの同士
	for (int x = 0; x <= 400000; x++)
	{
		chmin(ans, cof(txR[x], txD[x]));
		chmin(ans, cof(txU[x], txL[x]));
		// if(txR[x].size() && txD[x].size()) {
		// 	// txD[x].push_back(INF);
		// 	// sort(txD[x].begin(), txD[x].end());
		// }
		// if(txU[x].size() && txL[x].size()) {
		// 	// txL[x].push_back(INF);
		// 	// sort(txL[x].begin(), txL[x].end());
		// }
	}

	if(ans == INF) cout << "SAFE" << endl;
	else cout << ans << endl;
	return 0;
}

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

Measured memory_bytes: 121400
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B,L,R;
string S,T;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;

typedef vector<P> vp;
typedef vector<vp> matP;

int main(){
    cin>>N>>M>>A;
    cout<<max({N,M,A}) - min({N,M,A})<<endl;
}


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

using namespace std;

int main(){
	int x, deg = 360, times = 0;
	cin >> x;
  	while(deg){
    	times++;
      	deg -= x;
      	if(deg < 0)
          deg += 360;
    }
	cout << times;
}

Measured memory_bytes: 3632
#include<stdio.h>

int main(void){
    int n, x, c;
    while(1){
        scanf("%d%d", &n, &x);
        if(!n && !x) break;
        c = 0;
        for(int i=1; i<=n; i++) for(int l=i+1; l<=n; l++) for(int m=l+1; m<=n; m++) if(i+l+m==x) c++;
        printf("%d\n", c);
    }
    return 0;
}


Measured memory_bytes: 2040
#include<bits/stdc++.h>
#define eps 1.0E-14
using namespace std;

int main(){
    long double a,b,c;
    cin>>a>>b>>c;
    if(sqrt(a)+sqrt(b)+eps<sqrt(c)) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
//    long long d =c-a-b;
//    if(d>0&&d*d>4*a*b) cout<<"Yes"<<endl;
//    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
gets
points = gets(nil).split.map(&:to_i)
max = points.inject(:+)

if max % 10 != 0
  puts max
else
  x = points.select{|x| x % 10 != 0}.sort
  if x == []
    puts 0
  else
    puts max - x[0]
  end
end


Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)
#define pb push_back
#define deb(x) cout<<#x<<" "<<x<<endl;
#define deb2(x, y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define deb3(x, y, z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define all(x) x.begin(), x.end()
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> pii;
const int mod = 1e9 + 7;
template<class T, class U> inline void add_self(T &a, U b){a += b;if (a >= mod) a -= mod;if (a < 0) a += mod;}
template<class T, class U> inline void min_self(T &x, U y) { if (y < x) x = y; }
template<class T, class U> inline void max_self(T &x, U y) { if (y > x) x = y; }

template <typename T>void print(T v, bool show_index = false){int w = 2;if(show_index){for(int i=0; i<v.size(); i++)cout<<setw(w)<<i<<" ";cout<<endl;}for(auto i= v.begin(); i!=v.end(); i++)cout<<setw(w)<<*i<<" ";cout<<endl;}
template <typename T>void print_vv(T v){if(v.size()==0) {cout<<"Empty"<<endl; return;} int w = 3;cout<<setw(w)<<" ";for(int j=0; j<v[0].size(); j++)cout<<setw(w)<<j<<" ";cout<<endl;for(auto i= 0; i<v.size(); i++){cout<<i<<" {";for(auto j = 0; j!=v[i].size(); j++){cout<<setw(w)<<v[i][j]<<",";}cout<<"},"<<endl;}cout<<endl;}
template <class T, class U> void print_m(map<T,U> m, int w=3){if(m.empty()){cout<<"Empty"<<endl; return;}for(auto x: m)cout<<"("<<x.first<<": "<<x.second<<"),"<<endl;cout<<endl;}

int main(){
    ll n,m;
    while(cin>>n>>m){
        vl a(m);
        forn(i,m) cin>>a[i];
        ll tot = accumulate(all(a),0ll);
        ll d = n - tot;
        if(d<0){
            cout<<-1<<endl;
        }else{
            cout<<d<<endl;
        }
    }
    return 0;
}

Measured memory_bytes: 3708
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for(int i=a;i<n;i++)
#define int long long
const int INF=1e18;
signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n,W,w,v,val=0,N;
    cin>>n>>W;
    N=n*1000+1;
    vector<int>dp(N);
    rep(i,0,N){
        dp[i]=INF;
    }
    dp[0]=0;
    rep(i,0,n){
        cin>>w>>v;
        for(int j=N;j>=v;j--){
            dp[j]=min(dp[j],dp[j-v]+w);
        }
    }
    for(int j=0;j<N;j++){
        if(dp[j]<=W){
            val=j;
        }
    }
    cout<<val;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main()
{
    vector<pair<int,int> > v;
    int sum = 0;
    for(int i = 0;i < 5;i++)
    {
        int x;
        cin >> x;
        if(x % 10 == 0)
        {
            sum += x;
        }
        else
        {
            v.push_back(make_pair(x % 10,x));
        }
    }
    if(!v.empty())
    {
        sort(v.begin(),v.end());
        sum += v[0].second;
        for(int i = 1;i < v.size();i++)
        {
            sum += ceil(v[i].second / 10.0) * 10;
        }
    }
    cout << sum;

    return 0;
}

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

int main() {
    string s;
    cin >> s;
    
    for (char i = 'a'; i <= 'z'; i++) {
        bool f = false;
        
        rep(ii, s.length()) {
            if (s[ii] == i) {
                f = true;
                break;
            }
        }
        
        if (!f) {
            cout << i << endl;
            return 0;
        }
    }
    
    cout << "None" << endl;
    return 0;
}

Measured memory_bytes: 512
s = input()

#文字列を1文字ずつリストにする！
moji = list(s)
#リストをそーとする！
moji.sort()

if moji[0] == moji[1]:
    if moji[2] == moji[3]:
        if moji[0] != moji[2]:
            print('Yes')
        else:
            print('No')
    else:
        print('No')
else:
    print('No')


Measured memory_bytes: 2940
(n,k),*td=$<.map{|s|s.split.map &:to_i}
td.sort_by!{|t,d|[-d,t]}
h=[]
v=[]
x=s=0
td[0,k].map{|t,d|h[t]?v<<d:x+=1;h[t]=1;s+=d}
r=s+=x**2
td[k..-1].map{|t,d|v.empty?||h[t]||(r<s+=d-v.pop-1+2*x+=1)&&r=s;h[t]=1}
p r

Measured memory_bytes: 15096
N, M = map(int, input().rstrip().split())
AC = 0
WA = 0
data = {}
for _ in range(M):
    tmp = input().rstrip().split()
    p, S =  int(tmp[0]), tmp[1]
    if p not in data.keys():
        if S == 'AC':
            data[p] = {'AC': True, 'WA': 0}
            AC += 1
        elif S == 'WA':
            data[p] = {'AC': False, 'WA': 1}
    else:
        if S == 'AC':
            if data[p]['AC'] is True:
                continue
            elif data[p]['AC'] is False:
                data[p]['AC'] = True
                WA += data[p]['WA']
                AC += 1
        elif S == 'WA':
            if data[p]['AC'] is True:
                continue
            elif data[p]['AC'] is False:
                data[p]['WA'] += 1
print('{} {}'.format(AC, WA))



Measured memory_bytes: 42088
using System;
using System.Linq;
using System.Collections.Generic;

    public class Program
    {
        public static void Main(string[] args)
        {
            List<int> input = Console.ReadLine().Split(' ').Select(int.Parse).ToList();

            Console.WriteLine(input[0] - input[1] + 1);
        }
    }

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


//SHORTCUTS

#define ll long long
#define endl '\n'
#define i1(a) cin>>a
#define i2(a,b) cin>>a>>b
#define i3(a,b,c) cin>>a>>b>>c
#define o1(a) cout<<a<<endl
#define o2(a,b) cout<<a<<" "<<b<<endl
#define o3(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl
#define f(i,a,b) for(int i = a;i<b;i++)
#define fe(i,a,b) for(int i = a;i<=b;i++)
#define fi(i,a,b) for(i=a;i<b;i++)
#define eb emplace_back
#define pb push_back
#define pob pop_back
#define mp make_pair


// DEBUG CODE & FAST OUTPUT

#define printv(a) for (int i = 0; i < a.size(); i++) cout << a[i] << ' ';
#define printvl(a) for (int i = 0; i < a.size(); i++) cout << a[i] << endl;
#define printa(a, n) for (int i = 0; i< n; i++) cout << a[i] << ' ';
#define printal(a, n) for (int i = 0; i < n; i++) cout << a[i] << endl;


//DATA STRUCTURES

#define pq priority_queue
#define ms multiset
// #define y0 _y0_
// #define y1 _y1_
// #define div divi

typedef long double ld;
typedef vector <int> vi;
typedef vector <ll> vll;
typedef vector <ld> vld;
typedef vector <string> vs;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <vi > vvi;
typedef vector <vll > vvll;
typedef vector <pii > vpii;
typedef vector <pll > vpll;

//IMP CONSTANT
const int mod = 1e9 + 7, inf = 1e9 + 7;
const ll infll = 1e18 + 7;
bool google_contest = false;


//MODULAR OPERATIONS
ll myadd(ll a,ll b){
    ll ans = a+b;
    ans-= ans>=mod ? mod : 0;
    return ans; 
}
ll mysub(ll a, ll b){
    return (a-b+mod)%mod;
}
ll mymul(ll a,ll b){
    return (a*b)%mod;
}
ll mypow(ll a, ll b){
    ll ans = 1;
    while(b>0)
        if(b&1) ans = mymul(ans,a),b--;
        else a = mymul(a,a),b >>= 1;
    return ans;
}
ll nCr(ll n,ll r){
    if(r==0)return 1;
    if(r==1)return n;
    if(n==0)return 0;
    return mymul(n,mymul(nCr(n-1,r-1),mypow(r,mod-2)));
}

//    /\    |  |\  /|                      
//   /__\   |  | \/ |           
//  /    \  |  |    | 



int main(){

ios_base::sync_with_stdio(0);
cin.tie(0); 
cout.tie(0);

int t,tt;
t=1;
// i1(t);
if(google_contest)tt=1;

while(t--){

string s;
i1(s);
int n = s.length();
int cnt=0;

for(int i= n-1;i>=0;i--){
    if(s[i]=='?' ){
        s[i] = 'D';
    }
}

o1(s);

if(google_contest){
    cout<<"Case "<<tt++<<": ";
}
}

return 0;   
}


//    /\    |  |\  /|                      
//   /__\   |  | \/ |           
//  /    \  |  |    |   OVER!!!!


Measured memory_bytes: 3776
{-# LANGUAGE BangPatterns #-}
import           Control.Exception           (assert)
import           Control.Monad
import           Control.Monad.Primitive
import qualified Control.Monad.ST            as ST
import qualified Data.Array.IO               as IO
import qualified Data.Array.ST               as ST
import qualified Data.Array.Unboxed          as A
import           Data.Bits
import qualified Data.ByteString.Char8       as BS
import           Data.Char
import           Data.Foldable
import           Data.List
import qualified Data.Map.Strict             as Map
import           Data.Maybe
import qualified Data.Sequence               as Seq
import qualified Data.Set                    as Set
import qualified Data.Vector                 as VB
import qualified Data.Vector.Mutable         as VBM
import qualified Data.Vector.Unboxed         as V
import qualified Data.Vector.Unboxed.Mutable as VM
import           Debug.Trace

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine
getIntVec n = V.unfoldrN n (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine

readInteger = fst . fromJust . BS.readInteger
readIntegerList = map readInteger . BS.words
getInteger = readInteger <$> BS.getLine
getIntegerList = readIntegerList <$> BS.getLine

inf :: Int
inf = 10^18

main = do
  [d, t, s] <- getIntList
  let ans = if (d + s - 1) `div` s <= t then "Yes" else "No"
  putStrLn ans


Measured memory_bytes: 3736
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
const ll INF = 1LL<<60;

const ll MOD=998244353;
ll mod(ll x){
    ll res=x%MOD;
    return res+(res<0?MOD:0);
}
ll power(ll a, ll n){
    ll res=1;
    a=mod(a);
    for(;n>0;n>>=1){
        if(n&1)res=mod(res*a);
        a=mod(a*a);
    }
    return res;
}

int main(){
    ll n; cin>>n;
    vector<ll> val(n,0);
    rep(i,n){ll a;cin>>a;if(i==0&&a!=0){cout<<0;return 0;}val[a]++;}
    if(val[0]!=1){cout<<0;return 0;}
    ll ans = 1;
    ll num = val[0];
    for(int i=1; i<n; i++){
        //ans *= power(val[i-1],val[i]);
        //ans = mod(ans);
        rep(j,val[i])ans=mod(ans*val[i-1]);
        //num+=val[i];
        //if(val[i]==n)break;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
#define PIGRECO 3.141592653589793
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
///////////////////////////////////////////////////////////////////////////
//////////////////// DO NOT TOUCH BEFORE THIS LINE ////////////////////////
///////////////////////////////////////////////////////////////////////////


int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s,t;
    cin>>s>>t;

    int n=s.length();
    int m=t.length();

    int ans=m;

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

        string temp=s.substr(i,m);
        int curr=0;

        for(int j=0;j<m;j++){
            if(temp[j]==t[j]){
                curr++;
            }
        }

        ans=min(ans,m-curr);


    }

    cout<<ans<<endl;





}


Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
const int MAXN = 1e5+5, MAXM = 3e4 + 5, BOUND = 2e5, MOD = 1e9 + 7, INF = 0x3f3f3f3f, base = 10000;
const ll INFL = 0x3f3f3f3f3f3f3f3f;
const double PI = acos(-1.0), eps = 1e-9;
#define mid l + ((r-l)>>1)
#define lson o<<1,l,m
#define rson o<<1|1,m+1,r
#define lc(x) ch[x][0]
#define pii pair<int,int>
#define vi vector<int>
#define R register
#define RR register int
#define rc(x) ch[x][1]
#define rep(i,a,b) for(RR i=(a);i<=(b);++i)
#define random(a,b) ((a)+rand()%((b)-(a)+1))
int n, m, l, r;
int b[MAXN];
int main() {
	ios::sync_with_stdio(false); cin.tie(0);
	cin >> n >> m;
	rep(i, 1, m) {
		cin >> l >> r;
		b[l]++; b[r + 1]--;
	}
	int ans = 0;
	rep(i, 1, n) {
		b[i] += b[i - 1];
		if (b[i] == m)ans++;
	}
	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 640
n,y=map(int,input().split())
f=True
for i in range(n+1):
  for j in range(n-i+1):
    if 10000*i+5000*j+1000*(n-i-j)==y:
      print(i,j,n-i-j)
      f=False
      break
  if not f:break
if f:print(-1,-1,-1)

Measured memory_bytes: 3060
/// Rustで競技プログラミングの入力をスッキリ記述するマクロ
///
/// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[inline]
#[allow(dead_code)]
fn gcd(mut m: u64, mut n: u64) -> u64 {
    if m < n {
        std::mem::swap(&mut m, &mut n);
    }

    loop {
        let k = m % n;
        if k == 0 {
            return n;
        }

        m = n;
        n = k;
    }
}

#[inline]
#[allow(dead_code)]
fn lcm(m: u64, n: u64) -> u64 {
    m / gcd(m, n) * n
}

fn main() {
    input!{
        n: usize,
        f_a: [[[usize; 2]; 5]; n],
        p_a: [[i64; 11]; n],
    }



    let mut max_profit = None;
    for flag in 1..(1 << 10) {
        let mut c_a = [0usize; 1000];
        for digit in 0..10 {
            if flag & (1 << digit) != 0 {
                // joisino お姉ちゃんは 曜日j の 時間帯k にお店を営業する
                let j = digit / 2;
                let k = digit % 2;

                // お姉ちゃんと同じ時間に営業するお店の数を調べる
                for i in 0..n {
                    c_a[i] += f_a[i][j][k];
                }
            }
        }

        let mut profit = 0;
        for i in 0..n {
            profit += p_a[i][c_a[i]];
        }

        max_profit = if let Some(max_profit) = max_profit {
            Some(std::cmp::max(max_profit, profit))
        } else {
            Some(profit)
        }
    }

    println!("{}", max_profit.unwrap());
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n=0,m=0,i=0,j=0,c=0,ans=0,sum=0;
	cin>>n;
	int t[n];
	

	for(i=0;i<n;i++){
	  cin>>t[i];
	  sum+=t[i];
    }
     cin>>m;
    int p[m];                                
	int x[m];
    
	 for ( j=0;j<m;j++){
		cin>>p[j]>>x[j];
	
	 }	
	  for ( c=0;c<m;c++){
		ans=(sum-(t[p[c]-1])+x[c]);
         	cout<<ans<<endl;
        

	}
}

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

int main(){
    int N, K;
    cin >> N >> K;
    int L = (N+1)*N/2;
    vector<LL> a(N+1), bea(L), sum(N+1, 0);
    for(int i = 1;i <= N;i++)    cin >> a[i];
    for(int i = 1;i <= N;i++)   sum[i] = sum[i-1]+a[i];
    int id = 0;
    for(int i = 1;i <= N;i++){
        for(int j = i;j <= N;j++){
            bea[id++] = sum[j]-sum[i-1];
        }
    }
    // for(int i = 0;i < L;i++)    cout << bea[i] << endl;
    vector<vector<int>> bit(L, vector<int>(40, 0));
    for(int i = 0;i < L;i++){
        LL b2 = 1;
        for(int j = 0;j < 40;j++){
            bit[i][j] = (bea[i]/b2)&1;
            b2 *= 2;
        }
    }
    vector<int> use(L, 1), cnt(40, 0);
    for(int i = 39;i >= 0;i--){
        int kcnt = 0;
        for(int j = 0;j < L;j++)    kcnt += bit[j][i]&use[j];
        if(kcnt >= K){
            cnt[i] = 1;
            for(int j = 0;j < L;j++){
                if(!(bit[j][i]&use[j])) use[j] = 0;
            }
        }
    }
    LL ans = 0;
    LL d = 1;
    for(int i = 0;i < 40;i++){
        ans += d*cnt[i];
        d *= 2;
    }
    cout << ans << endl;
}

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

int main() {
  int K, S;
  cin >> K >> S;

  int ans = 0;
  rep(i, K + 1) rep(j, K + 1) {
    int tmp = S - i - j;
    if (0 <= tmp && tmp <= K)
      ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define loop(i,a,b) for(i=a;i<b;i++)
#define pb push_back
#define mp make_pair
#define mod 1000000007
using namespace std;
int main()
{
ll n,i,j;
cin>>n;
ll a[n],dp[n+3];
loop(i,0,n)
cin>>a[i];
dp[0]=0;
dp[1]=abs(a[0]-a[1]);
dp[2]=abs(a[2]-a[0]);

loop(i,3,n)
dp[i]=min(dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i]-a[i-2]));
cout<<dp[n-1]<<endl;
return 0;}

Measured memory_bytes: 1792
#include <stdio.h>
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <math.h>
#include <map>
using namespace std;
//整形Shift + alt + f　2回
//int x[101],y[101],h[101];
//int koya[100001][];
/*
//ユークリッドの互除法
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
*/

/*
//桁数取得
unsigned GetDigit(unsigned num)
{
    unsigned digit = 0;
    while (num != 0)
    {
        num /= 10;
        digit++;
    }
    return digit;
}
*/

/*
//素数の真偽
vector<bool> IsPrime;
//素数のリスト
vector<int> PrimeList;
//素数の出現回数
map<int, int> CountPrime;

void sieve(int max)
{
    IsPrime.resize(max + 1, true); // IsPrimeに必要な要素数を確保
    IsPrime[0] = false;
    IsPrime[1] = false;

    for (int i = 2; i * i <= max; i++)         // 0からsqrt(max)まで調べる
        if (IsPrime[i])                        // iが素数ならば
            for (int j = 2; i * j <= max; j++) // (max以下の)iの倍数は
                IsPrime[i * j] = false;        // 素数ではない
}

void mkPrimeList()
{
    for (int i = 2; i <= IsPrime.size() - 1; i++)
    {
        if (IsPrime[i])
        {
            PrimeList.push_back(i);
        }
    }
}

void factor(int n)
{

    for (auto e : PrimeList)
    {
        int ct = 0;
        int tmp = n;
        while (tmp % e == 0)
        {
            tmp = tmp / e;
            ct++;
        }
        CountPrime.insert(make_pair(e, ct));
    }
}
*/

/*
// index が条件を満たすかどうか
bool isOK(int index)
{
    long double tmp = pow((double)index, n);
    //i^n が pを超えるか
    if (p < tmp)
        return true;
    else
        return false;
}

//二分探索
int binary_search()
{
    int left = 1;
    int right = p;

    while (right - left > 1)
    {
        long long int mid = left + (right - left) / 2;
        if (isOK(mid))
            right = mid;
        else
            left = mid;
    }

    //left は条件を満たさない最大の値、right は条件を満たす最小の値になっている
    return right;
}
*/

int main()
{
    int tmp;
    int f[4] = {0,
                0,
                0,
                0};

    for (int i = 0; i < 4; i++)
    {
        cin >> tmp;
        if (tmp == 1)
        {
            f[0]++;
        }
        else if (tmp == 9)
        {
            f[1]++;
        }
        else if (tmp == 7)
        {
            f[2]++;
        }
        else if (tmp == 4)
        {
            f[3]++;
        }
    }

    if (f[0] == 1 && f[1] == 1 && f[2] == 1 && f[3] == 1)
    {
        cout << "YES";
    }
    else
    {
        cout << "NO";
    }

    return 0;
}


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

#define ll long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define debug3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define debugB(x, y) cerr<<#x<<": "<<bitset<y>(x) << endl;
#define line() cerr << "---------------" << endl;

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

template<typename T>
void printA(vector<T> &printArray, char between = ' ') {
   int paSize = printArray.size();
   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
   if (between != '\n') {cerr << endl;}
}

// ------------------------------------------------------------------------------------------
const int INF = 1e9+1000;
ll n, a, b;
ll h[111111];

int main() {
   cin >> n >> a >> b;
   rep (i, n) cin >> h[i];

   ll c = a - b;
   ll left = 0, right = INF;
   while (left+1 < right) {
      ll mid = (left+right)/2;
      ll t = 0;
      rep (i, n) {
         ll x = max(h[i]-b*mid, 0LL);
         t += (x+c-1)/c;
      }
      if (t <= mid) {
         right = mid;
      } else {
         left = mid;
      }
   }
   cout << right << endl;

   return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <iomanip>
 
using namespace std;
 
typedef long long ll;
typedef pair <long long, long long> pll;
 
ll mod = 1000000000;
 
int main(){
  ios_base::sync_with_stdio(false);
  ll n;
  cin >> n;
  vector <char> c(n);
  for (int i = 0; i < n; i++)
   cin >> c[i];
  ll buc = 0, bb = 0;
  for (int i = 0; i < n; i++)
   if (c[i] == 'R')
    buc++;
  for (int i = 0; i < n; i++){
    if (buc == bb){
      cout << bb;
      return 0;
    }
    if (c[i] == 'R')
     buc--;
    else
     bb++;
    if (buc == bb){
      cout << bb;
      return 0;
    } 
  }
}

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

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) {os << "["; for (const auto &v : vec) {os << v << ","; } os << "]"; return os;}
template <typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &p) {os << "(" << p.first << ", " << p.second << ")"; return os;}

void solve() {
    int N;
    cin >> N;
    vector<int> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

    ll ans = 0;
    for (int h = 1; h <= 100; h++) {
        int c = 0, now = 0;
        for(int i = 0; i < N; i++) {
            if (A[i] >= h) {
                now++;
            } else {
                if (now > 0) c++;
                now = 0;
            }
        }
        if (now > 0) c++;
        ans += c;
    }
    cout << ans << endl;

}

int main() {
    #ifdef LOCAL_ENV
    cin.exceptions(ios::failbit);
    #endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    
    solve();

    #ifdef LOCAL_ENV
    assert(cin.rdstate() & ios_base::eofbit);
    #endif
}

Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int h = Integer.parseInt(sc.next());
        int w = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int result = (n - h + 1) * (n - w + 1);

        // 出力
        System.out.println(result);
    }
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
int k,s,ans;
int main(void)
{
	scanf("%d%d",&k,&s);
	for(int x=0;x<=k;x++) for(int y=0;y<=k;y++) if(s-x-y>=0&&s-x-y<=k) ans++;
	printf("%d",ans);
}

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

int main () {
  int N;
  cin >> N;
  int buka_no = N - 1;
  vector<int> A(buka_no);

  for(int i = 0; i<buka_no; i++) cin >> A[i];
  map<int,int> res;

  for(int i = 0; i<buka_no; i++) {
    res[A[i]]++;
  }

  for(int i = 1; i<=N; i++) {
    if(res[i]) cout << res[i] << endl;
    else cout << "0" << endl;
  }
}

Measured memory_bytes: 13492
// 作者：杨成瑞先生
import java.io.*;
import java.util.*;

public class Main {

	static class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        public FastScanner() {
            try {
                br = new BufferedReader(new InputStreamReader(System.in));
                st = new StringTokenizer(br.readLine());
            } catch (Exception e){e.printStackTrace();}
        }

        public String next() {
            if (st.hasMoreTokens()) return st.nextToken();
            try {st = new StringTokenizer(br.readLine());}
            catch (Exception e) {e.printStackTrace();}
            return st.nextToken();
        }

        public int nextInt() {return Integer.parseInt(next());}

        public long nextLong() {return Long.parseLong(next());}

        public double nextDouble() {return Double.parseDouble(next());}

        public String nextLine() {
            String line = "";
            if(st.hasMoreTokens()) line = st.nextToken();
            else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
            while(st.hasMoreTokens()) line += " "+st.nextToken();
            return line;
        }
    }

	public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter pw = new PrintWriter(System.out);

        int n = sc.nextInt(), k = sc.nextInt();
        pw.println((n + 1) / 2 >= k ? "YES" : "NO");

        pw.close();
	}

}

Measured memory_bytes: 24404
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
    }
    
    Scanner sc;
    int D;
    int N;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        D = sc.nextInt();
        N = sc.nextInt();
    }
    
    //解答処理
    int solve() {
        int num = 1;
        
        for(int i=0; i<D; i++){
            num *= 100;
        }
        
        if (N == 100){
            num *= (N+1);
        } else {
            num *= N;
        }
        
        return num;
    }
    
    //出力
    void show(int answer) {
        System.out.println(answer);
    }
}


Measured memory_bytes: 35560
#include <bits/stdc++.h>
using namespace std;
int n,m,A[15],B[101];

int mem[101][1<<15],used[101][1<<15],sum[1<<15];
int dfs(int idx,int sta){
  if(idx==m) return 0;
  if(used[idx][sta]++)return mem[idx][sta];
  int &res=mem[idx][sta]=abs(sum[sta]-B[idx])+dfs(idx+1,sta);
  for(int i=0;i<n;i++)
    if((sta>>i)&1)res=min(res,dfs(idx,~((~sta)|(1<<i))));
  return res;
}

int main(){
  while(1){
  cin>>n>>m;
  if(!n&&!m)break;
  for(int i=0;i<n;i++) cin>>A[i];
  for(int i=0;i<m;i++) cin>>B[i];
  sort(A,A+n);
  sort(B,B+m,greater<int>());
  memset(used,0,sizeof(used));
  memset(sum,0,sizeof(sum));

  for(int i=0;i<(1<<n);i++)
    for(int j=0;j<n;j++)if((i>>j)&1)sum[i]+=A[j];
 
  cout<<dfs(0,(1<<n)-1)<<endl;
  }
  return 0;
}

Measured memory_bytes: 28984
#include <bits/stdc++.h>
using namespace std;
int dp[1000][1000];   // dp[i] denotes the longest path starting at node i
char a[1000][1000];
int n,m;
const int N=1e9+7;
void solve(){
   for(int i=0;i<m;++i){
       if(a[0][i]=='#'){
           break;
       }
       dp[0][i]=1;
   }
   for(int i=0;i<n;++i){
       if(a[i][0]=='#'){
           break;
       }
       dp[i][0]=1;
   }

   for(int i=1;i<n;++i){ 
   for(int j=1;j<m;++j){
       if(a[i][j]=='#'){
           dp[i][j]=0;
           continue;
       }
       dp[i][j]=(dp[i-1][j]+dp[i][j-1])%N;     
   }
   }
   return;
}

int32_t main() {
     // int n,m;
       memset(dp,0,sizeof dp);
      cin>>n>>m;
      
      for(int i=0;i<n;++i){ 
      for(int j=0;j<m;++j){
        cin>>a[i][j];
      }
      }
      //int ans=0;
      solve();
    cout<<dp[n-1][m-1];
    return 0;
}


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

int main() {
    int n; cin>>n;
    double sum=0;
    rep(i,n) {
      int a; cin>>a; sum+=1.0/a;
    }
    double ans=1.0/sum;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define leading zero str.erase(0, min(str.find_first_not_of('0'), str.size()-1));
using namespace __gnu_pbds;
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
string text="abcdefghijklmnopqrstuvwxyz";
const int maxn=1e6+7;
//        .--------------.
//        | Try First One|
//        '--------------'
//                |     .--------------.
//                |     |              |
//                V     V              |
//              .--------------.       |
//              |      AC.     |<---.  |
//              '--------------'    |  |
//              (True)|  |(False)   |  |
//           .--------'  |          |  |
//           |           V          |  |
//           |  .--------------.    |  |
//           |  |   Try Again  |----'  |
//           |  '--------------'       |
//           |                         |
//           |  .--------------.       |
//           '->| Try Next One |-------'
//              '--------------'
ll bin_pow(ll a,ll b,ll m)
{
    ll res=1;
    a%=m;
    while(b>0)
    {
        if(b&1)
            res=res*a%m;
        b>>=1;
        a=a*a%m;
    }
    return res;
}
bool miller_rabin(ll d,ll n)
{
    ll a=2+rand()%(n-4);
    ll x=bin_pow(a,d,n);
    if(x==1 || x==n-1)
        return true;
    while(d!=n-1)
    {
        x=(x*x)%n;
        d*=2;
        if(x==1)
            return false;
        if(x==n-1)
            return true;
    }
    return false;
}
bool prime(ll n,ll k)
{
    if(n==1 || n==4)
        return false;
    if(n<=3)
        return true;
    ll d=n-1;
    while(d%2==0)
        d/=2;
    for(int i=0; i<k; i++)
    {
        if(!miller_rabin(d,n))
            return false;
    }
    return true;
}
int n;
string s;
ll ans = 0;

void solve(ll x,ll y){
    if(x==n+1){
        ans += y;
        return;
    }
    ll cur = 0;
    for(ll i=x;i<=n;i++){
        cur = (10*cur) + (s[i]-'0');
        solve(i+1,y+cur);
    }
}
struct node
{
    ll to;
    ll cost;
};
vector<node>v[100005];
ll depth[100005];
void dfs(ll u,ll p, ll d)
{
    depth[u]=d;
    for(auto &x: v[u]){
        if(x.to==p)continue;
        dfs(x.to,u,x.cost+d);
    }
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n;
    cin>>n;
    for(int i=0;i<n-1;i++){
        ll a,b,c;
        cin>>a>>b>>c;
        v[a].push_back({b,c});
        v[b].push_back({a,c});
    }
    ll q,k;
    cin>>q>>k;
    dfs(k,-1,0);
    while(q-->0){
        ll a,b;
        cin>>a>>b;
        cout<<depth[a]+depth[b]<<endl;
    }
}


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

int main(){
  long long W, H, x, y;
  cin >> W >> H >> x >> y;

  // 長方形を均等に分割する方法は必ずあるはずなので、面積については半分の面積を返せば良い
  // (x, y) が長方形の中心の場合、分割する方法が複数存在するそれ以外で分割する方法が複数あるかどうか
  // if (W % 2 == 0 || H % 2 ==0){
  //   // 面積は整数
  //   long long ans = W * H / 2;
  //   if ((x == W / 2) && (y == H / 2)){
  //     printf("%lld %c", ans, '1');
  //     // cout << ans << " " << '1' << endl;
  //   } else{
  //     printf("%lld %c", ans, '0');
  //     // cout << ans << " " << '0' << endl;
  //   }
  // } else{
  //   long double ans = (long double)W * (long double)H / 2.0L;
  //   printf("%.1Lf %c", ans, '0');
  //   // cout << ans << " " << '0' << endl;
  // }
  printf("%lf %d", double(W)*double(H) / 2.0, x + x == W && y + y == H);
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep_(i, n, m) for (int i = n; i < (int)(m); i++)
#define all(v) v.begin(), v.end()
#define int long long
#define stoi stoll
//#define _GLIBCXX_DEBUG

signed main() {
  int N; cin >> N;
  vector<int> A(N);
  rep(i, N) cin >> A[i];
  
  int k = A[0];
  rep(i, N) k = gcd(k, A[i]);
  
  cout << k << endl;

}


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

// 1206

// --------------------------------------------------------------------------------
#define fastio	ios_base::sync_with_stio(false),cin.tie(NULL),cout.tie(NULL)
#define ll long long 
#define mset(arr,val) memset(arr,val,sizeof(arr))
#define deb(name,value) cout <<"->>  "<<name<< "= " <<value<<" "
#define frepi(a,b,k) for(int i=a;i<=b;i+=k)
#define frepj(a,b,k) for(int j=a;j<=b;j+=k)
// --------------------------------------------------------------------------------


void solve_main()
{
    ll n,k;cin>>n>>k;
    if(k==1)
    {
    	cout<<"0\n";
    	return;
    }
    ll ans = min(n,k);
    if(k>n)
    {
    	n = abs(n-k);
    	ans = min(n,ans);
    	cout<<ans;
    	return;
    }

    n =  n%k;
    ans = min(n,ans);
    n = abs(n-k);
    ans = min(n,ans);
    cout<<ans;
}

int main()
{
	// #ifndef ONLINE_JUDGE
 //    	freopen("/home/suryakant/input.txt","r",stdin);
 //        freopen("/home/suryakant/output.txt","w",stdout);
 //    #endif
    int t=1;
    // cin>>t;
    while(t--)
    {
        solve_main();
    }
    
}

Measured memory_bytes: 3596
package main

import (
	"fmt"
)

func main() {
	var a, b int
	fmt.Scan(&a, &b)

	ans := 0
	n := 2
	for i := 0; i < n; i++ {
		if a > b {
			ans += a
			a--
		} else {
			ans += b
			b--
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 1772
N = int(input())
xyh = [list(map(int, input().split())) for i in range(N)]

for cx in range(101):
    for cy in range(101):
        needH = -1

        for x, y, h in xyh:
            if h > 0:
                # この頂点から見て、頂上がcx, cyのときどのくらいの高さがあってほしいか
                tmp = h + abs(cx - x) + abs(cy - y)
                if needH == -1:
                    needH = tmp
                else:
                    if needH != tmp:
                        needH = -2
                        break

        if needH == -2:
            continue

        for x, y, h, in xyh:
            if h == 0:
                dist = abs(cx - x) + abs(cy - y)
                if needH - dist > 0:
                    needH = -2
                    break
        if needH == -2:
            continue

        print(cx, cy, needH)
        exit()


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for(ll i=0; i<n; i++)
#define repr(i, s, e) for(ll i=s; i>=e; i--)
#define reps(i, s, e) for(ll i=s; i<=e; i++)
#define inf 1e18
#define all(v) v.begin(),v.end()
#define ok cout << "ok" << endl;
#define sp << " " <<
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename T> void vdeb(T v){
    cout << "#vector set debug" << endl;
    for(auto vv : v) cout << vv << " ";
    cout << endl;
}
template<typename T1, typename T2> void adeb(T1 arr[], T2 n){
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}
template<typename T1> void mdeb(T1 mp){
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){ fill((T*)array, (T*)(array+N), val); }
void ans(bool b){ cout << (b ? "Yes" : "No") << endl; }
void ans2(bool b){ cout << (b ? "YES" : "NO") << endl; }
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};


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

    int a, b, c;
    cin >> a >> b >> c;
    
    bool res;
    if(a==b && b==c && c==a) res = true;
    else res = false;

    ans(res);

    return 0;
}


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

int main()
{
  ll n;
  cin >> n;
  vector<ll> a(n);
  rep(n) cin >> a[i];
  ll cur = 1;
  for (ll i = 0; i < n; i++)
  {
    if (cur==a[i]) cur++;
  }
  if (cur == 1) cout << -1 << endl;
  else cout << n + 1 - cur << endl;
  return 0;
}

Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;
#define pb push_back
#define ll long long int
# define pll pair<ll,ll>
# define pii pair<int,int>
# define fio ios_base::sync_with_stdio(false); cin.tie(NULL)
int main()
{
    int x;
    cin>>x;
    if(x<600) cout<<8;
    else if(x<800) cout<<7;
    else if(x<1000) cout<<6;
    else if(x<1200) cout<<5;
    else if(x<1400) cout<<4;
    else if(x<1600) cout<<3;
    else if(x<1800) cout<<2;
    else cout<<1;
}


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

//動画見て別解

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

    vector<int> h(n);
    rep(i,n) cin >> h[i];
    
    int ans=0;
    int active=0;
    
    rep(i,n){
        if(active>=h[i]){
            active = h[i];
        } else{
            ans+=h[i]-active;
            active=h[i];
        }
    }
    
    cout << ans << endl;
}

Measured memory_bytes: 256
n, k = map(int, input().split())
mod = 10 ** 9 + 7

cnt = [0] * (k + 1)

for i in range(k, 0, -1):
    c = pow(k // i, n, mod)
    for j in range(2, k + 1):
        if i * j > k:
            break
        c -= cnt[i * j]
        c %= mod

    cnt[i] = c

ans = 0
for i in range(1, k + 1):
    ans += i * cnt[i]
    ans %= mod

print(ans)


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

template <long long mod, long long primitive_root>
struct NTT {
private:
    static long long mod_pow(long long n, long long p, long long m) {
        long long ret = 1;
        while (p > 0) {
            if (p & 1) ret = ret * n % m;
            n = n * n % m;
            p >>= 1;
        }
        return ret;
    }

    static pair<long long, long long> extgcd(long long a, long long b) {
        long long s = a, sx = 1, sy = 0, t = b, tx = 0, ty = 1;
        while (t) {
            long long q = s / t;
            s -= t * q;
            swap(s, t);
            sx -= tx * q;
            swap(sx, tx);
            sy -= ty * q;
            swap(sy, ty);
        }
        return {sx, sy};
    }

    static long long mod_inv(long long a, long long m) {
        long long inv = extgcd(a, m).first;
        return (inv % m + m) % m;
    }

    static void ntt(vector<long long>& f, int sign) {
        int n = f.size();
        if (n == 1) return;
        vector<long long> a(n / 2), b(n / 2);
        for (int i = 0; i < n / 2; i++) {
            a[i] = f[2 * i];
            b[i] = f[2 * i + 1];
        }
        ntt(a, sign);
        ntt(b, sign);
        long long cur = 1;
        long long omega = mod_pow(primitive_root, (mod - 1) / n, mod);
        if (sign == -1) omega = mod_inv(omega, mod);
        for (int i = 0; i < n; i++) {
            f[i] = (a[i % (n / 2)] + cur * b[i % (n / 2)]) % mod;
            cur = cur * omega % mod;
        }
    }

public:
    static vector<long long> convolution(const vector<long long>& a, const vector<long long>& b) {
        int size = a.size() + b.size() - 1;
        int n = 1;
        while (n < size) n <<= 1;

        vector<long long> na = a, nb = b;
        na.resize(n);
        nb.resize(n);

        ntt(na, 1);
        ntt(nb, 1);
        for (int i = 0; i < n; i++) na[i] = na[i] * nb[i] % mod;
        ntt(na, -1);
        na.resize(size);
        long long n_inv = mod_inv(n, mod);
        for (int i = 0; i < size; i++) na[i] = na[i] * n_inv % mod;
        return na;
    }
};

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

    int N, M;
    cin >> N >> M;
    vector<ll> a(N), b(M);
    for (int i = 0; i < N; i++) cin >> a[i];
    for (int i = 0; i < M; i++) cin >> b[i];
    vector<ll> c = NTT<998244353, 3>::convolution(a, b);
    for (int i = 0; i < N + M - 1; i++) cout << c[i] << (i < N + M - 2 ? " " : "\n");
}

Measured memory_bytes: 44240
abc=list(map(int,input().split()))
abc.sort()

n1=abc[2]-abc[0]
n2=abc[2]-abc[1]

if (n1-n2)%2==0:
    print((n1-n2)//2+n2)
else:
    print((n1-n2+1)//2+n2+1)


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

int main(){
  while(1){
    int h,w;
    cin>>w>>h;
    if(h==0&&w==0) break;
    int a[h][w];
    bool used[h][w];
    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
        cin>>a[i][j];
        used[i][j]=0;
      }
    }
    int ans=0;
    queue<pair<int,int>> q;
    for(int i=0;i<h;i++){
      for(int j=0;j<w;j++){
        if(a[i][j]&&!used[i][j]){
          //cout<<i<<" "<<j<<endl;
          ans++;
          q.push(make_pair(i,j));
          while(!q.empty()){
            pair<int,int> p=q.front();
            q.pop();
            int x=p.first, y=p.second;
            if(used[x][y]) continue;
            used[x][y]=1;
            for(int i=-1;i<2;i++){
              for(int j=-1;j<2;j++){
                if(x+i==-1||x+i==h) continue;
                if(y+j==-1||y+j==w) continue;
                if(a[x+i][y+j]&&!used[x+i][y+j]){
                  q.push(make_pair(x+i,y+j));
                }
              }
            }
          }
        }
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}



Measured memory_bytes: 3140