akhauriyash/Code-Regression huggingface dataset:
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <ctime>
#include <iterator>
#include <bitset>
#include <numeric>
#include <list>
#include <iomanip>
#include <cassert>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#define ALL(v) begin(v),end(v)
#else
#define ALL(v) (v).begin(),(v).end()
#endif

using namespace std;


namespace{
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
	v.assign(a, vector<T>(b, t));
}
template <class T> inline T &chmin(T &x, const T &y){ return x = min(x, y); }
template <class T> inline T &chmax(T &x, const T &y){ return x = max(x, y); }
template <class F, class T>
void convert(const F &f, T &t){
	stringstream ss;
	ss << f;
	ss >> t;
}


#define REP(i,n) for(int i=0;i<int(n);++i)
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8


void mainmain(){
	int n;
	scanf("%d", &n);
	vector<LL> as(n);
	for(int i = 0; i < n; ++i){
		scanf("%lld", &as[i]);
	}
	vector<LL> cnt1(n + 1), cnt2(n + 1);
	vector<LL> cap1(n + 1), cap2(n + 1);
	multiset<LL> st1, st2;
	for(int i = 0; i + 1 < n; ++i){
		int c = 0;
		for(LL x = as[i]; x < as[i + 1]; x *= 4){ ++c; }
		cnt1[i] = c;

		c = 0;
		for(LL x = as[i + 1]; x * 4 <= as[i]; x *= 4){ ++c; }
		cap1[i] = c;

		c = 0;
		for(LL x = as[i + 1]; x < as[i]; x *= 4){ ++c; }
		cnt2[i + 1] = c;

		c = 0;
		for(LL x = as[i]; x * 4 <= as[i + 1]; x *= 4){ ++c; }
		cap2[i + 1] = c;
	}

	LL sum1 = 0, sum2 = 0;
	vector<LL> dp1(n + 1), dp2(n + 1);
	for(int i = 1; i <= n; ++i){
		for(int j = 0; j < cnt1[i - 1]; ++j){
			LL p = -1;
			if(!st1.empty()){
				auto it = --st1.end();
				p = *it;
				st1.erase(it);
			}
			sum1 += i - 1 - p;
		}
		for(int j = 0; j < cap1[i - 1]; ++j){ st1.insert(i - 1); }
		dp1[i] = sum1;
	}
	for(int i = n - 1; i >= 0; --i){
		for(int j = 0; j < cnt2[i + 1]; ++j){
			LL p = n;
			if(!st2.empty()){
				auto it = st2.begin();
				p = *it;
				st2.erase(it);
			}
			sum2 += p - i - 1;
		}
		for(int j = 0; j < cap2[i + 1]; ++j){ st2.insert(i + 1); }
		dp2[i] = sum2;
	}

	LL ans = LLONG_MAX;
	for(int i = 0; i <= n; ++i){
		LL t = i + (dp1[i] + dp2[i]) * 2;
		chmin(ans, t);
	}
	printf("%lld\n", ans);
}



}
int main() try{
//	ios::sync_with_stdio(false); cin.tie(0);
	cout << fixed << setprecision(10);
	cerr << fixed << setprecision(4);
	mainmain();
}
catch(...){}


Measured memory_bytes: 11136
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
template<class T> inline bool chmax(T &a, T b) { if (a<b) {a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, T b) { if (b<a) {a=b; return 1;} return 0;}

const int mod = 998244353;
struct mint {
    long long x;
    mint(long long 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(long long t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    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, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n, s;
    cin >> n >> s;
    vi a(n);
    rep(i, n) cin >> a[i];
    vector<vector<mint>> dp(n+1, vector<mint>(s+1));
    dp[0][0] = mint(2).pow(n);
    rep(i, n) rep(j, s+1) {
        dp[i+1][j] += dp[i][j];
        if (j+a[i] <= s) dp[i+1][j+a[i]] += dp[i][j]/2;
    }
    cout << dp[n][s] << endl;
}

Measured memory_bytes: 73664
import math


def solve():
    A, B, H, M = map(int, input().split())
    Aa = H * (360 / 12) + M * (30 / 60)
    Ba = M * (360 / 60)
    a = abs(Aa - Ba)
    a = min(a, 360 - a)

    if a == 0:
        print(abs(A - B))
    elif a == 180:
        print(A + B)
    else:
        print(
            math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(math.radians(a))))


if __name__ == '__main__':
    solve()


Measured memory_bytes: 9580
#include <iostream>
#include <cassert>
#include <cmath>
//#define NDEBUG
int main(void){
	using namespace std;
	static const int INPUT_MAX = 20000;
	static const int INPUT_MIN = 0;
	int input_a = 0;
	int input_b = 0;
	int ans = 0;			/* 解 */
	char op = 0;	    	/* 演算子 */

	while(1){
		cin >> input_a >> op >> input_b;
		
		/* 入力値の前提条件 最大・最小の制限*/
		assert (INPUT_MIN <= input_a && input_a <= INPUT_MAX);
		assert (INPUT_MIN <= input_b && input_b <= INPUT_MAX);
		/* 入力値の前提条件 0の割り算でないこと*/
		assert (!(input_b == 0 && op == '/'));
		
		/* Calculation */
		if(op == '+'){
			ans = input_a + input_b;
			cout  << ans << endl;
		}
		else if(op == '-'){
			ans = input_a - input_b;
			cout  << ans << endl;
		}
		else if(op == '*'){
			ans = input_a * input_b;
			cout  << ans << endl;
		}
		else if(op == '/'){
			ans = input_a / input_b;
			cout  << ans << endl;
		}
		else if(op == '?'){
			break;
		}
		else{
			cout  << "Input Error" << endl;
			break;
		}
	}
		
	return 0;
}



Measured memory_bytes: 3068
<?php
$n = (int)trim(fgets(STDIN));
$array = explode(' ', trim(fgets(STDIN)));

$cand1 = 0;
$tmp_sum = $array[0];
if ($tmp_sum <= 0) {
	$cand1 = abs($tmp_sum) + 1;
	$tmp_sum = 1;
}
for ($i=1; $i < $n; $i++) { 
	$tmp=$array[$i];
	if ($tmp_sum > 0) {
		$tmp_sum += $tmp;
		if ($tmp_sum>=0) {
			$cand1 += $tmp_sum + 1;
			$tmp_sum = -1;
		}
	}else{
		$tmp_sum += $tmp;
		if ($tmp_sum<=0) {
			$cand1 += abs($tmp_sum) + 1;
			$tmp_sum = 1;
		}

	}
}

$cand2 = 0;
$tmp_sum = $array[0];
if ($tmp_sum >= 0) {
	$cand2 = abs($tmp_sum) + 1;
	$tmp_sum = -1;
}
for ($i=1; $i < $n; $i++) { 
	$tmp=$array[$i];
	if ($tmp_sum > 0) {
		$tmp_sum += $tmp;
		if ($tmp_sum>=0) {
			$cand2 += $tmp_sum + 1;
			$tmp_sum = -1;
		}
	}else{
		$tmp_sum += $tmp;
		if ($tmp_sum<=0) {
			$cand2 += abs($tmp_sum) + 1;
			$tmp_sum = 1;
		}

	}
}

echo min($cand1, $cand2);

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

int main() {
  int w,h,x,y; cin >> w >> h >> x >> y;
  double a = w; double b = h;
  double ans = a*b/2;
  cout << ans << " ";
  if (x == w/2 && y == h/2 && w%2 == 0 && h%2 == 0) cout << 1;
  else cout << 0;
  return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <list>
#include <set>
using namespace std;
typedef long long ll;


int main(int argc, char *args[]) {
	int N;
	int A[201];
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
	}
	for (int counter = 0;; counter++) {
		for (int i = 0; i < N; i++) {
			if (A[i] % 2 == 0) {
				A[i] = A[i] / 2;
			}
			else {
				cout << counter << endl;
				return 0;
			}
		}
	}
}


Measured memory_bytes: 256
import java.util.Scanner;

class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h=sc.nextInt(),w=sc.nextInt();
		String[] s=new String[h];
		StringBuilder[] sb=new StringBuilder[h];
		String[] ans=new String[h];
		int[] x={-1,-1,-1,0,0,1,1,1};
		int[] y={1,0,-1,1,-1,1,0,-1};

		for(int i=0;i<h;i++){
			s[i]=sc.next();
			ans[i]="";
		//j	sb[i].append(s[i]);
		}
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				int cnt=0;
				//System.out.println("---"+i+j+"---");
				if(s[i].substring(j,j+1).equals(".")){
					for(int k=0;k<8;k++){
						int xx=j+x[k];
						int yy=i+y[k];
						//System.out.println(xx+" "+yy);
						if(xx<0||xx>=w||yy<0||yy>=h){
							continue;
						}
						if(s[yy].substring(xx,xx+1).equals("#")){
							cnt++;
						}
					}
					ans[i]+=cnt;
					//sb[i].replace(j, j+1, String.valueOf(cnt));
				}else{
					ans[i]+="#";
				}

			}
		}

		for(int i=0;i<h;i++){
				System.out.println(ans[i]);
		}
	}

}


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

#define rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);++i)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;i>=(int)(m);--i)
#define REP(i,n) rep(i,0,n)
#define REP2(i,n) rep2(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll) 1e9 + 7;
//constexpr long long MOD = 998244353LL;
using ld=long double;
static const ld pi = 3.141592653589793L;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

struct Edge {
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
	to = _to; cap = _cap; rev = _rev;
	}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}


void solve(){
    ll n;
    cin>>n;
    vec<P> a(n);
    REP(i,n){
        cin>>a[i].first;
        a[i].second=i;
    }
    sort(all(a));

    set<ll> pos;
    ll ans=0;
    REP(i,n){
        ll aa=a[i].first;
        ll pp=a[i].second;
        auto s=pos.lower_bound(pp);
        ll l=-1;
        if(s!=pos.begin()){
            s--;
            l=*s;
        }
        auto t=pos.upper_bound(pp);
        ll r=n;
        if(t!=pos.end()) r=*t;
        ans+=(r-pp)*(pp-l)*aa;
        pos.insert(pp);
    }
    cout<<ans<<en;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
	
	solve();
	//ll t;cin>>t;REP(i,t) solve();

    return 0;
}

Measured memory_bytes: 12800
import java.util.Scanner;
 
class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int a[] = new int[6];
    for(int i = 0; i < 6; i++){
      a[i] = sc.nextInt();
    }
    String str = sc.next();
    for(int i = 0; i < str.length(); i++){
      char c = str.charAt(i);
      int a0 = a[0];
      if(c == 'N'){
        a[0] = a[1];
        a[1] = a[5];
        a[5] = a[4];
        a[4] = a0;
      }else if(c == 'S'){
        a[0] = a[4];
        a[4] = a[5];
        a[5] = a[1];
        a[1] = a0;
      }else if(c == 'E'){
        a[0] = a[3];
        a[3] = a[5];
        a[5] = a[2];
        a[2] = a0;
      }else{
        a[0] = a[2];
        a[2] = a[5];
        a[5] = a[3];
        a[3] = a0;
      }
    }
    System.out.println(a[0]);
  }
}


Measured memory_bytes: 26100
#include <iostream>
#include <stdio.h>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <stack>
#include <queue>
#include <algorithm>
#include <string.h>
#include <string>
#include <math.h>
#include <iomanip>
using namespace std;

#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define pb push_back

typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

const int mod = (int)1e9 + 7;
const int mod2 = 998244353;

ll exp(ll taban, ll us) {
    ll carpan = taban % mod;
    ll temp = us;
    ll res = 1;
    while(temp){
        if(temp % 2) res = (res*carpan) % mod;
        temp /= 2;
        carpan = (carpan*carpan) % mod;
    }
    return res;
}
 
ll ebob(ll a, ll b){
    if(!a)return b;
    return ebob(b%a, a);
}

ll ekok(ll a, ll b){
    return (a*b)/ebob(a, b);
}

int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL);
	int k, a, b; cin>>k>>a>>b;
	bool ans = false;
	for(int i = a; i <= b; i++) if(i % k == 0) ans = true;
	ans ? cout<<"OK" : cout<<"NG";
}

Measured memory_bytes: 3640
x1, y1, x2, y2 = map(int, input().split())

y3 = y2 + (x2 - x1)
x3 = x2 - (y2 - y1)
y4 = y3 - (y2 - y1)
x4 = x3 - (x2 - x1)

print(x3, y3, x4, y4)

Measured memory_bytes: 2940
n,a,b,c = map(int,input().split())
l = []
for i in range(n):
    l0 = int(input())
    l.append(l0)
bitl = []
for i in range(4**n):
    bit = [0 for i in range(n)]
    p = i
    q = 1
    for j in range(n):
        bit[j] = (p//q) % 4
        q *= 4
    bitl.append(bit)
mpl = []
for i in range(4**n):
    bit = bitl[i]
    takel = [[],[],[]]
    for j in range(n):
        if bit[j] > 0:
            takel[bit[j]-1].append(l[j])
    mp = 0
    al = len(takel[0])
    bl = len(takel[1])
    cl = len(takel[2])
    if al > 0:
        take = takel[0][0]
        for j in range(al-1):
            take += takel[0][j+1]
            mp += 10
        mp += abs(a - take)
        if bl > 0:
            take = takel[1][0]
            for j in range(bl-1):
                take += takel[1][j+1]
                mp += 10
            mp += abs(b - take)
            if cl > 0:
                take = takel[2][0]
                for j in range(cl-1):
                    take += takel[2][j+1]
                    mp += 10
                mp += abs(c - take)
                mpl.append(mp)
print(min(mpl))

Measured memory_bytes: 14772
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
typedef pair<int,int> PP;
typedef long long ll;
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define OREP(i,n) for(int i=1;i<=(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE cout << -1 << endl;return 0
#define Endl endl


signed main(void){
    int N,M;
    int a[114514];
    map<int,bool> broken;
    cin >> N >> M;
    REP(i,N){
        cin >> a[i];
        broken[a[i]]=1;
    }
    int dp[114514]={};
    dp[0]=1;
    if(broken[1]==0)dp[1]=1;
    for(int i=2;i<=N;i++){
        if(broken[i]==0){
            dp[i]=(dp[i-1]+dp[i-2])%MOD;
        }else{
            dp[i]=0;
        }
        
    }
    //REP(i,N+1){cout << dp[i] << " ";}cout << endl;
    cout << dp[N] << endl;
    
    return 0;
}



Measured memory_bytes: 8192
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
const lint mod = 998244353;
#define all(x) (x).begin(), (x).end()
#define bitcount(n) __builtin_popcountl((lint)(n))
#define fcout cout << fixed << setprecision(15)
#define highest(x) (63 - __builtin_clzl(x))
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T = string, class U = char>int character_count(T text, U character){ int ans = 0; for(U i: text){ ans += (i == character); } return ans; }
lint power(lint base, lint exponent, lint module){ if(exponent % 2){ return power(base, exponent - 1, module) * base % module; }else if(exponent){ lint root_ans = power(base, exponent / 2, module); return root_ans * root_ans % module; }else{ return 1; }}
struct position{ int y, x; }; position mv[4] = {{0, -1}, {1, 0}, {0, 1}, {-1, 0}}; // double euclidean(position first, position second){ return sqrt((second.x - first.x) * (second.x - first.x) + (second.y - first.y) * (second.y - first.y)); }
template<class T, class U> string to_string(pair<T, U> x){ return to_string(x.first) + "," + to_string(x.second); } string to_string(string x){ return x; }
template<class itr> void array_output(itr start, itr goal){ string ans; for(auto i = start; i != goal; i++) ans += to_string(*i) + " "; if(!ans.empty()) ans.pop_back(); cout << ans << endl; }
template<class itr> void cins(itr first, itr last){ for(auto i = first; i != last; i++){ cin >> (*i); } }
template<class T> T gcd(T a, T b){ if(a && b){ return gcd(min(a, b), max(a, b) % min(a, b)); }else{ return a; }} template<class T> T lcm(T a, T b){ return a / gcd(a, b) * b; }
struct combination{ vector<lint> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2, mod); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } lint C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };
template<class itr> bool next_sequence(itr first, itr last, int max_bound){ itr now = last; while(now != first){ now--; (*now)++; if((*now) == max_bound){ (*now) = 0; }else{ return true; } } return false; }
template<class itr, class itr2> bool next_sequence2(itr first, itr last, itr2 first2, itr2 last2){ itr now = last; itr2 now2 = last2; while(now != first){ now--, now2--; (*now)++; if((*now) == (*now2)){ (*now) = 0; }else{ return true; } } return false; }

int main(){
    int N;
    cin >> N;
    lint back;
    cin >> back;
    int ans = 0;
    for(int i = 1; i < N; i++){
        lint A;
        cin >> A;
        ans += (back < A);
        back = A;
    }
    cout << ans << endl;
}



Measured memory_bytes: 3120
def Base_10_to_n(x,n):
	if (int(x/n)):
		return Base_10_to_n(int(x/n),n)+str(x%n)
	return str(x%n)
	
n=int(input())
l=len(str(n))

res=0

for i in range(4**l):
	x=Base_10_to_n(i,4)
	cnt=0
	if not "0" in x: 
		if ("3" in x) and ("2" in x) and ("1" in x):
			for j in range(len(x)):
				if x[j]=="1":
					cnt+=3*(10**j)
				elif x[j]=="2":
					cnt+=5*(10**j)
				elif x[j]=="3":
					cnt+=7*(10**j)
			if cnt<=n:
				res+=1
			
print(res)
		

Measured memory_bytes: 3064
from collections import defaultdict
N = int(input())
A = list(map(int,input().split()))
dic = defaultdict(int)

for t in A:
  dic[t] += 1
#print(dic)
ans = 0
for n,i in dic.items(): #key value
  if n > i:
    ans += i
  elif n < i:
    ans += (i-n)
print(ans)

Measured memory_bytes: 22228
//This code was made by Chinese_zjc_.
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#define int long long
#define INF 0x3fffffffffffffff
using namespace std;
int a,b,c;
signed main()
{
	std::ios::sync_with_stdio(false);
	cin>>a>>b>>c;
	cout<<(a+b+c<22?"win":"bust");
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cstdio>
#include<cmath>
using namespace std;
long long n, s;
int main() {
	cin >> n >> s; if (n == s) { cout << n + 1 << endl; return 0; }
	for (long long i = 2; i <= min(n + 1, 3000000LL); i++) {
		long long sum = 0; long long g = 1;
		while (g <= 1000000000000LL) {
			sum += (n / g) % i; g *= i;
		}
		if (sum == s) { cout << i << endl; goto E; }
	}
	for (long long i = min(s, n / 1000000); i >= 1; i--) {
		long long A = i, B = s - i;
		if ((n - B) % A != 0)continue;
		long long C = (n - B) / A; if (C <= B || C <= 1)continue;
		cout << C << endl; goto E;
	}
	cout << "-1" << endl; E:;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    // オリジナルの回答
    int num, a, b;
    cin >> num >> a >> b;
    string s;
    cin >> s;

    int winNum = 0;
    int pos = 0;
    for (int i = 0; i < num; i++) {
        bool win = true;
        const char c = s[i];

        switch (c) {
        case 'a':
            win = winNum < a + b;
            if (win) {
                winNum++;
            }
            break;

        case 'b':
            pos++;
            win = winNum < a + b && pos <= b;
            if (win) {
                winNum++;
            }
            break;

        default:
            win = false;
            break;
        }

        cout << (win ? "Yes" : "No") << endl;
    }

    return 0;
}


Measured memory_bytes: 896
#include <cctype>
#include <cfloat>
#include <climits>
#include <cmath>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <ios>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <forward_list>
#include <random>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <unordered_map>
#include <unordered_set>
#endif

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define lcm( a, b ) (a)/__gcd((a),(b))*(b)
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
typedef pair< int, P > iP;
typedef pair< P, P > PP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 100005;

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

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

    LL n, m;
    cin >> n >> m;
    string s, t;
    cin >> s >> t;
    if( s[0] != t[0] ) {
        cout << -1 << endl;
        return 0;

    }
    map< LL, char > res;
    LL len = lcm( n, m );
    
    for( int i = 1; i < n; ++i ) {
        res[len / n * i] = s[i];

    }

    for( int i = 1; i < m; ++i ) {
        if( res[len / m * i] != 0 && res[len / m * i] != t[i] ) {
            cout << -1 << endl;
            return 0;

        }
    }
   
    cout << len << endl;
    return 0;
}


Measured memory_bytes: 10880
#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;

typedef long long ll;
ll n;
ll ans;
ll v[55];

int main()
{
//    freopen("input.txt", "r", stdin);
    scanf("%lld", &n);
    for(ll i = 0; i < n; i++)
    {
        scanf("%lld", &v[i]);
    }
    sort(v, v + n);
    ans += v[0];
    for(ll i = 1; i < n; i++)
    {
        ans += v[i] * (1ll << (i - 1));
    }
    printf("%.9llf", (long double)ans / (1ll << (n - 1)));
    return 0;
}


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

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

	int ans = 0;
	rep(i,N) {
		string sl = S.substr(0,i);
		string sr = S.substr(i,N-1);

		int al[26] = {0};
		int ar[26] = {0};
		for (char s : sl) al[s-'a']++;
		for (char s : sr) ar[s-'a']++;

		int sum = 0;
		rep(j,26) sum += al[j]*ar[j]>0;
		ans = max(ans,sum);
	}

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


Measured memory_bytes: 3584
N,K = map(int, input().split())
A = [*map(lambda x:int(x)-1, input().split())]
index = [-1]*N
path = []
pre = 0
while index[pre] < 0:
    index[pre] = len(path)
    path += [pre]
    pre = A[pre]
one = index[pre]
loops = len(path) - one

k = max(0, K-one) % loops + min(K, one)
pre = 0
for _ in range(k): pre = A[pre]
print(pre + 1)

# if K <= one: print(path[K])
# else: print(path[(K-one) % loops + one]+1)


Measured memory_bytes: 32448
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

from collections import deque
sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

while True:
    w, h = na()
    if w == 0 and h == 0:
        break
    maze = [
        [0] * (w - 1) + [1], 
        *[na() if x % 2 != 0 else [1] + na() + [1] for x in range(2 * h - 1)],
        [1] + [0] * (w - 1)
    ]
    d = [[0] * w for _ in range(h)]
    que = deque()
    d[0][0] = 1
    que.append((0, 0))
    while que:
        y, x = que.popleft()
        t = y * 2 + 1
        t1 = t - 1
        t2 = t
        t3 = t + 1
        if maze[t1][x] == 0 and y-1 >= 0 and d[y-1][x] == 0:
            que.append((y-1, x))
            d[y-1][x] = d[y][x] + 1
        if maze[t2][x] == 0 and x-1 >= 0 and d[y][x-1] == 0:
            que.append((y, x-1))
            d[y][x-1] = d[y][x] + 1
        if maze[t2][x+1] == 0 and x+1 < w and d[y][x+1] == 0:
            que.append((y, x+1))
            d[y][x+1] = d[y][x] + 1
        if maze[t3][x] == 0 and y+1 < h and d[y+1][x] == 0:
            que.append((y+1, x))
            d[y+1][x] = d[y][x] + 1
    print(d[h-1][w-1])



Measured memory_bytes: 9100
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;

#define BIG_NUM 2000000000

using namespace std;

int main(){

	double number;

	scanf("%lf",&number);

	printf("%.10lf\n",max(number*sqrt(2),(double)((int)number+1)));

	return 0;
}

Measured memory_bytes: 2712
N = int(input())
A = list(map(int, input().split(' ')))
B = list(map(int, input().split(' ')))
C = list(map(int, input().split(' ')))
m = 0
pre = -1
for a in A:
    m += B[a-1]
    if a - pre == 1:
        m += C[pre-1]
    pre = a
print(m)

Measured memory_bytes: 3060
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException{
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int k = Integer.parseInt(str[0]);
    int x = Integer.parseInt(str[1]);
    System.out.println(500 * k >= x ? "Yes":"No");
  }
}

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

int main()
{
    int n;
    cin >> n;
    
    int a[n];
    for(int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    int cnt = 0;
    int r = 0;
    
    while(1)
    {
        for(int i = 0; i < n; i++)
        {
            if(a[i] % 2 == 0)
            {
                a[i]/=2;
                cnt++;
            }
            else break;
        }
        if(cnt == n)
        {
            r++;
            cnt = 0;
        }
        else break;
    }
    cout << r << endl;
    
    
    return 0;
}



Measured memory_bytes: 256
#pragma region
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <iomanip>
#include <cstdint>
#include <bitset>

using namespace std;
typedef long long ll;
//#define rep(i, s, e) for (int(i) = (s); (i) < (e); ++(i))
#define rep(i, e) for (int(i) = 0; (i) < (e); ++(i))
#define rrep(i, s) for (int(i) = (s) - 1; (i) >= 0; --(i))
#define all(x) x.begin(),x.end()

#pragma region UnionFind
struct UnionFind
{
	vector<int> par;

	UnionFind(int n) : par(n, -1) {}
	void init(int n) { par.assign(n, -1); }

	int root(int x)
	{
		if (par[x] < 0) return x;
		else return par[x] = root(par[x]);
	}

	bool issame(int x, int y)
	{
		return root(x) == root(y);
	}

	bool merge(int x, int y)
	{
		x = root(x); y = root(y);
		if (x == y) return false;
		if (par[x] > par[y]) swap(x, y);
		par[x] += par[y];
		par[y] = x;
		return true;
	}

	int size(int x)
	{
		return -par[root(x)];
	}
};
#pragma endregion
#pragma region GCD
int gcd(int a, int b)
{
	if (a%b == 0)return b;
	return gcd(b, a%b);
}
#pragma endregion
#pragma region chmin
template<class T> inline bool chmin(T& a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma region chmax
template<class T> inline bool chmax(T& a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}
#pragma endregion
#pragma endregion


int main()
{
	int n; cin >> n;
	vector<ll> c(n); rep(i, n)cin >> c[i];
	sort(all(c));
	ll MOD = 1e9 + 7;
	vector<ll> v(n + 1);
	v[0] = 1;
	rep(i, n)v[i + 1] = (v[i] * 2) % MOD;
	ll res = 0;
	rep(i, n)
	{
		ll tmp;
		if (i != n - 1) tmp = v[i] * ((v[n - 1 - i] + (n - 1 - i)*v[n - 2 - i]) % MOD);
		else tmp = v[i];
		tmp %= MOD;
		tmp *= v[n];
		tmp %= MOD;
		tmp *= c[i];
		tmp %= MOD;
		res += tmp;
		res %= MOD;
	}
	cout << res << endl;
}

Measured memory_bytes: 3328
using namespace std;
#include<bits/stdc++.h>
#define BEGIN ios_base::sync_with_stdio(0);cin.tie(0);
#define END return EXIT_SUCCESS;
#define FOR(I,A,B) for((I)=(A);(I)<(B);(I)++)
#define REP(I,N) FOR((I),0,(N))
#define UP(I,A,B) for((I)=(A);(I)<=(B);(I)++)
#define DW(I,A,B) for((I)=(A);(I)>=(B);(I)--)
#define IN(P) cin>>(P)
#define IN2(P1,P2) cin>>(P1)>>(P2)
#define IN3(P1,P2,P3) cin>>(P1)>>(P2)>>(P3)
#define INS(I,N,V) REP((I),(N)) cin>>(V[I])
#define INS2(I,N,V1,V2) REP((I),(N)) cin>>(V1[I])>>(V2[I]);
#define INS3(I,N,V1,V2,V3) REP((I),(N)) cin>>(V1[I])>>(V2[I])>>(V3[I]);
#define OUT(P) cout<<(P)<<endl
#define OUT2(P1,P2) cout<<(P1)<<" "<<(P2)<<endl
#define OUT3(P1,P2,P3) cout<<(P1)<<" "<<(P2)<<" "<<(P3)<<endl
#define OUTS(I,N,V) REP((I),(N)) cout<<(V[i])<<endl
#define ALL(C) (C).begin(),(C).end()
#define RALL(C) (C).rbegin(),(C).rend()
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
template<class T>inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}

int N,i;
inline void solve(){
  IN2(N,i);
  OUT(N-i+1);
}

int main(int argc,char**argv){
  BEGIN
  solve();
  END
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <utility>
#include <iomanip>
#include <tuple>
#include <set>
#define ll long long int
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()
using namespace std;


int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	vector<int> id(n+1);
	rep(i,0,n){
		int tmp;
		cin >> tmp;
		id[tmp] = i + 1; //はいれつの中=つよさ,id[i]=順番
	}
	multiset<ll> ms;
	ms.insert(0);
	ms.insert(0);
	ms.insert(n+1);
	ms.insert(n+1);
	ll ans = 0;
	rel(i,n+1,1){
		auto c = ms.lower_bound(id[i]);
		auto d = c; ++d;
		auto b = c; --b;
		auto a = b; --a;
		ll add = (*b - *a)*(*c - id[i]) + (id[i] - *b)*(*d - *c);
		ans += add * i;
		ms.insert(id[i]);
	}
	cout << ans << endl;
	return 0;

}


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

int main() {
  int a;
  cin>>a;
  long long int b=0;
  for (int i=1;i<=a;++i){
    if (i%3!=0 & i%5!=0) {
      b+=i;
    }
  }
  cout<<b<<endl;
}

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

using namespace std;
using ll = long long;
using P = pair<ll, ll>;

const ll INF64 = 1LL << 60;
const int INF32 = 1 << 29;
const int MOD = 1000000007;

const int CASES = 4;

void solve(){
    string S; cin >> S;
    int n = S.size();

    set<char> se;
    for(int i = 0; i < n; ++i){
        se.insert(S[i]);
    }
    if(se.size() == 26){
        int point = INF32;
        for(int i = n-1; i > 0; --i){
            if(S[i] > S[i-1]){
                point = i-1;
                break;
            }
        }

        if(point == INF32){
            cout << -1 << endl;
            return;
        }

        int minpoint = INF32;
        for(int i = n-1; i > point; --i){
            if(S[i] > S[point]){
                if(minpoint != INF32 && S[minpoint] < S[i]){
                    continue;
                }
                minpoint = i;
            }
        }
        string ans = S.substr(0, point);
        ans += S[minpoint];
        cout << ans << endl;
    }
    else{
        char tmp;
        for(int i = 0; i < 26; ++i){
            tmp = (char)('a' + i);
            if(se.count(tmp) == 0){
                break;
            }
        }
        S += tmp;
        cout << S << endl;
    }

    return;
}

int main() {
    #ifdef MYLOCAL
    vector<string> filenames {"input1.txt", "input2.txt", "input3.txt", "input4.txt"};
    cout << "------------\n";
    for(int i = 0; i < CASES; ++i){
        ifstream in(filenames[i]);
        cin.rdbuf(in.rdbuf());
        solve();
        cout << "------------\n";
    }
    #else

    solve();

    #endif
    return 0;
}



Measured memory_bytes: 256
import java.util.*; 
import java.io.*;


// 
public class Main {
    static StringTokenizer st;
    static BufferedReader br;  
    static PrintWriter out;
 
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
 
        int N = nextInt();
        int K = nextInt();

        int[] input = new int[N+1];

        for (int x=1; x<=N; x++) {
            input[x] = nextInt();
        }

        for (int x=K+1; x<=N; x++) {
            if(input[x]>input[x-K]){
                System.out.println("Yes");
                
            }
            else{
                System.out.println("No");
            }
        }


    }

      
      
    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

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

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }
}

Measured memory_bytes: 58056
#include<bits/stdc++.h>
#define LL long long 
using namespace std;
LL a,b,c,d,e,f;
LL maxx1,maxx2;
double ans,hh;
int main()
{
	ans=-1;
	cin>>a>>b>>c>>d>>e>>f;
	hh=(double)e/100;
	for(int i=0;i<=f/(a*100);++i)
	 for(int j=0;j<=f/(b*100);++j)
	  for(int k=0;k<=f/c;++k)
	   for(int l=0;l<=f/d;++l)
	  {
	  	 LL water=a*i*100+b*j*100;
	  	 LL suger=k*c+l*d;
	  	 if(water+suger<=f)
	  	 {
	  	 	if((double)suger/(suger+water)>ans&&(double)suger/water<=hh)
	  	 	{
	  	 	   ans=(double)suger/(suger+water);
	  	 	   maxx1=water+suger;
			   maxx2=suger; 
	  	 	}
	  	 }
	  }
	cout<<maxx1<<" "<<maxx2;
	return 0;
}
/*
1 2 10 20 15 200

*/

Measured memory_bytes: 256
#include <algorithm>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#define SREP(s,i,m) for(unsigned int i = s; i < m; ++i)
#define REP(i,m) SREP(0,i,m)
using namespace std;
#ifdef _MSC_VER
using LONG = __int64;
using ULONG = unsigned __int64;
#else
using LONG = long long int;
using ULONG = unsigned long long int;
#endif
int main(void) {
  string str;
  cin >> str;
  int cnt = 0;
  for (int i = 0; i < str.size(); i++) {
    if (cnt == 0 && str[i] == 'C') cnt++;
    else if (cnt == 1 && str[i] == 'F') cnt++;
  }
  cout << (cnt == 2 ? "Yes" : "No") << endl;
  return 0;
}


Measured memory_bytes: 256
//----------------------Shanu Garg here---------------------
//-------------Search on youtube : Shanu Garg---------------
//-Studying at National Institute of Technology Delhi(NITD)-
//---------------------From Delhi, India--------------------

#include<bits/stdc++.h>
#include<algorithm>
using namespace std;

#define f(i,n) for(auto i=0;i<n;i++)
#define fr(i,n) for(auto i=n-1;i>=0;i--)
#define fs(i,a,b,c) for(auto i=a;i!=b;i+=c)
#define fl(i,x) for(auto i : x)
#define nl cout<<"\n";
#define chk(x) cout<<#x<<x<<" ", nl
#define ll long long int
#define ull unsigned long long int
#define vi vector<int>
#define vvi vector<vi>
#define pr pair<ll, ll>
#define vii vector<pair<int, int>>
#define vll vector<pr>
#define vl vector<ll>
#define m(a,b) map<a, b>
#define mid(a,b) ((a+b)/2)
#define pb push_back
#define LCM(a,b) ((a*b)/__gcd(x,y))
const int INF = 0x3f3f3f3f, mod = 1e9 + 7;

class triplet{
    ll f, s, t;};

vl in(ll n){vl v;ll x;
    f(i,n)
    cin>>x, v.pb(x);
    return v;}

vll in_pr(ll n){
    vll ar;
    ll x,y;
    f(i,n)
    {cin>>x>>y;
    ar[i]={x,y};
    }
    return ar;
}
void out(vl v, char ch='\0'){
    fl(i,v)
    cout<<i<<ch;
}

void solve(){
    double a,b,x,ans;
    cin>>a>>b>>x;
    if(x>(a*a*b)/2)
    {ans = atan(((b/a)-(x/(a*a*a)))*2);}
    else{ans=atan(a*b*b/(2*x));}
    ans*=180;
    ans/=3.1415926535897932;
    cout<<setprecision(8)<<ans;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    solve();
   return 0;
}

Measured memory_bytes: 4052
#include<iostream>
#include<climits>
#include<vector>
#include<list>
#include<functional>
#include<algorithm>
#include<string>
#include<cmath>
#include<complex>
#include<set>
#include<map>
#include<stack>
#include<queue>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

static vector<vector<int>> memo(1000, vector<int>(1000, -1));

class question {
public:
	string S;
	ll merge_sort(vector<int> &a, int l, int r) {
		if (r - l <= 1) return 0;
		int m = (l + r) / 2;
		ll rev = merge_sort(a, l, m) + merge_sort(a, m, r);
		vector<int> b(a.begin() + l, a.begin() + m);
		vector<int> c(a.begin() + m, a.begin() + r);
		b.push_back(2);
		c.push_back(2);
		int i = 0, j = 0;
		for (int k = l;k < r;k++) {
			if (b[i] <= c[j]) {
				a[k] = b[i++];
			}
			else {
				rev += m - l - i;
				a[k] = c[j++];
			}
		}
		return rev;
	}

	void ans() {
		cin >> S;
		int N = S.size();
		vector<int> v(N);
		REP(i, N) {
			if (S[i] == 'B') v[i] = 1;
			else v[i] = 0;
		}
		ll res = merge_sort(v, 0, N);
		cout << res << "\n";
	}
};

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

	question q;
	q.ans();

	return 0;
}

Measured memory_bytes: 6788
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ABC100_B solver = new ABC100_B();
        solver.solve(1, in, out);
        out.close();
    }

    static class ABC100_B {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int d = in.nextInt();
            int n = in.nextInt();

            if (d == 0) {
                if (n == 100) {
                    out.print(101);
                    return;
                }
                out.print(n);
                return;
            }

            if (n == 100) {
                out.print((int) Math.pow(100, d) * 101);
                return;
            }
            out.print((int) Math.pow(100, d) * n);
        }

    }
}



Measured memory_bytes: 23252
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
  
int main() {
  vl D(3);
  rep(i,3) {
    cin >> D[i];
  }
  sort(rng(D));
  if(D[0]%2==0||D[1]%2==0||D[2]%2==0) {
    cout << 0 << endl;
    return 0;
  }
  cout << (D[2]%2) * D[0] * D[1] << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define REP(i,n) for (int i = 1; i < (int)(n); i++)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define vout(x) rep(i,x.size()) cout << x[i] << " "
template<class T> bool chmin(T &a, T b) {if(a>b) {a=b;return 1;}return 0;}
template<class T> bool chmax(T &a, T b) {if(a<b) {a=b;return 1;}return 0;}
using namespace std;
using vint = vector<int>;
using vvint = vector<vector<int>>;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<int,int>;
const int inf = 1e9;
const ll inf_l = 1e18;
const int MAX = 1e5;


int main() {
    int n; cin >> n;
    vint h(n);
    rep(i,n) cin >> h[i];
    vint dp(n);
    dp[n-1] = 0;
    dp[n-2] = abs(h[n-2]-h[n-1]);
    for (int i = n-3; i >= 0; i--) {
        dp[i] = min(dp[i+1]+abs(h[i]-h[i+1]),dp[i+2]+abs(h[i]-h[i+2]));
    }
    cout << dp[0] << endl;
}

Measured memory_bytes: 1024
s=input()
li = [s[i] for i in range(2,len(s)-1) if s[i] == "C"]
alphabet = [chr(i) for i in range(97, 97+26)]
if s[0] != "A" or len(li) != 1:
  print("WA")
else:
  for i in range(1,len(s)):
    if s[i]=="C" or s[i] in alphabet:
      continue
    else:
      print("WA")
      exit()
  print("AC")

Measured memory_bytes: 3064
def kumiawase(num):
    return num + 3*num*(num-1) + num*(num-1)*(num-2)

n, k = list(map(int, input().split()))
if k%2 == 1:
    ans = kumiawase(n//k)
else:
    m = k//2
    if m % k == 0:
        ans = kumiawase(n//m)
    else:
        ans = kumiawase(n//k) + kumiawase(n//m - n//k)
print(ans)

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

//0011
int main(){
	int w, n;

	int a[30]={0};
	for(int i=0; i<30; ++i){
		a[i] = i+1;
	}

	cin >> w >> n;
	for(int i=0; i<n; ++i){
		pair<int,int> p;
		char comma;
		cin >> p.first >> comma >> p.second;

		//swap		
		int temp = a[p.first-1];
		a[p.first-1] = a[p.second-1];
		a[p.second-1]= temp;
	}

	for(int i=0; i<w; ++i){
		cout << a[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<tuple>
#include<algorithm>
#include<cmath>
#include<limits>
#include<set>
#include<deque>
#include<queue>
#include<stack>
using namespace std;
#define int long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define dup(x,y) (((x)+(y)-1)/(y))
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef pair<int, int>P;
const int MOD = 1e9 + 7;
//const int MOD = 998244353;
const int INF = 1e18;
const long double PI = (acos(-1));


signed main() {
	int N, M, K;
	cin >> N >> M >> K;
	rep(i, N + 1)rep(j, M + 1) {
		int black = i * M + (N - 2 * i) * j;
		if (black == K) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
}

Measured memory_bytes: 3596
#include <iostream>
#include<vector>
int main(void){
    int a,b,c;
    int oto = 0;
    std::cin>>a>>b>>c;
    oto = b / a;
    if (oto > c){
        oto = oto-(oto-c);
    }
    std::cout<<oto<<std::endl;
    return 0;
}

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

typedef long long STATES;

int main( void )
{
	int n;
	while ( cin >> n && n )
	{
		STATES goal_state = 0;
		for ( int i = 0; i < n; i++ ) goal_state |= 1LL << i;

		vector <STATES> free_days( 30+1, 0 );
		for ( int i = 0; i < n; i++ )
		{
			int k; cin >> k;
			for ( int j = 0; j < k; j++ )
			{
				int free_day; cin >> free_day;
				free_days[free_day] |= 1LL << i;
			}
		}

		int answer = -1;
		vector <STATES> dp( n, 0 );
		for ( int i = 0; i < n; i++ ) dp[i] = 1LL << i;
		for ( int i = 1; answer == -1 && i <= 30; i++ )
		{
			STATES next = 0;
			for ( int j = 0; j < n; j++ ) if ( free_days[i] & ( 1LL << j ) ) next |= dp[j];
			for ( int j = 0; j < n; j++ ) if ( free_days[i] & ( 1LL << j ) ) dp[j] |= next;
			if ( next == goal_state ) answer = i;
		}

		cout << answer << endl;
	}

	return 0;
}

Measured memory_bytes: 904
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
// memo  fixed  setprecision(20);
using vvll = vector<vector<ll>>;
ll mod =1000000007;
/*"itob" int to "N"base */           template<typename TypeInt> string itob(const TypeInt v, int base){static const char table[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";string ret;static numeric_limits<TypeInt> t;TypeInt n = v;if (t.is_signed) {if (v < 0) n *= -1;}while (n >= base) {ret += table[n%base];n /= base;}ret += table[n];if (t.is_signed) {if (v < 0 && base == 10) ret += '-';}reverse(ret.begin(), ret.end());return ret;}
/*"chmin" a = MAX*/                  template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
/*"chmax" a = MIN*/                  template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
/*"ctoi"  char to int*/              int ctoi(char c) {return c-'0';}
/*"gcd"   MAX*/                      int gcd(ll a,ll b){return b?gcd(b,a%b):a;}
/*"lcm"   MIN*/                      int lcm(ll a,ll b){return a*b/gcd(a,b);}
/*"primecheck"If prime,return true.*/bool primecheck(ll n){if(n < 2) return false;else{for(int i = 2; i * i <= n; i++){if(n % i == 0) return false;}return true;}}
string  reverserange(string s,ll a,ll b){reverse(s.begin()+a-1,s.begin()+b); return s;}
int main(){
    string m,r,l;
    cin >> m;
    int q;
    cin >> q;
    ll riba = 0;
    for(int i=0;i<q;i++){
            int che;
            cin >> che;
        if(che==1){
            riba++;
            continue;
        }
        int d;char z;
        cin >> d >> z;
       if(d==1){
           if(riba%2==0){
               l+=z;
           }
           else{
               r+=z;
           }
           continue;
       }
       if(riba%2==0){
           r+=z;
       }
       else l+=z;
    }
    reverse(l.begin(),l.end());
    string ans= l+m+r;
    if(riba%2==1)reverse(ans.begin(),ans.end());
    cout<<ans<<endl;
}
  


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

public class Main {

    static Scanner sc = new Scanner(System.in);
    static int n;
    static int[] x;

    public static void main(String[] args) {
        n = sc.nextInt();
        x = new int[n];
        int[] y = new int[n];
        for (int i = 0; i < n; i++) {
            int num = sc.nextInt();
            x[i] = num;
            y[i] = num;

        }
        Arrays.sort(x);
        int mid = n / 2;
        for (int i = 0; i < n; i++) {
            if (y[i] <= x[mid - 1]) {
                System.out.println(x[mid]);
            } else {
                System.out.println(x[mid - 1]);
            }
        }
    }
}


Measured memory_bytes: 95464