akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<double,ll> mp;
#define inf 1e9
#define EPS 1e-10
struct point{
    double x,y;
    point(){}
    point(double x,double y):x(x),y(y){}
    point operator + (point p){ return point(x+p.x,y+p.y) ; }
    point operator - (point p){ return point(x-p.x,y-p.y) ; }
    double norm() { return x*x + y*y;}
    double abs() { return sqrt(norm());}
    void input() { cin>>x>>y; }
    bool operator < (point p) { return x!=p.x ? x <p.x : y < p.y ;}
    bool operator == (point p) { return x==p.x && y==p.y ; }
};
bool sort_y(point a,point b){
    return a.y != b.y ? a.y < b.y : a.x < b.x;
}
double dot(point a,point b){ return a.x*b.x + a.y * b.y ;}
double cross(point a,point b){ return a.x*b.y-a.y*b.x; }
int ccw(point p0,point p1,point p2){
    point a = p1-p0;
    point b = p2-p0;
    if(cross(a,b)  > EPS) return 1;
    if(cross(a,b) < -EPS) return -1;
    if(dot(a,b) < -EPS ) return 2;
    if(a.norm() < b.norm() ) return -2;
    return 0;
}

typedef vector<point> polygon;
polygon andrewscan(polygon ps){
    polygon u,l;
    if(ps.size() < 3) return ps;
    sort(ps.begin(),ps.end() ,sort_y);
    u.push_back(ps[0]);
    u.push_back(ps[1]);
    l.push_back(ps[ps.size()-1]);
    l.push_back(ps[ps.size()-2]);
    for(int i=2;i<ps.size();i++){
	for(int n = u.size();n>=2&&ccw(u[n-2],u[n-1],ps[i] ) == 1; n-- )u.pop_back();
	u.push_back(ps[i]);
    }
    for(int i=ps.size()-3;i>=0;i--){
	for(int n=l.size();n>=2&&ccw(l[n-2],l[n-1],ps[i]) ==1 ;n--)l.pop_back();
		l.push_back(ps[i]);
    }
    reverse(l.begin(),l.end() );
    for(int i=u.size()-2;i>=1;i--) l.push_back( u[i] );
    return l;
}

int main(){
	int v,r;
	cin>>v>>r;
	polygon ps(v);
	for(int i=0;i<v;i++) ps[i].input();
	vector<vector<mp> > g(v);
	for(int i=0;i<r;i++){
	    int s,t;
	    cin>>s>>t;
	    s--,t--;
	    g[s].push_back(mp( ( ps[s]-ps[t]).abs() ,t) );
	    g[t].push_back(mp( (ps[s]-ps[t] ).abs() ,s) );
	}
	/*for(int i=0;i<v;i++){
	    for(int j=0;j<g[i].size();j++){
		cout<<g[i][j].first<<' '<<g[i][j].second<<':';
	    }
	    cout<<endl;
	}*/
	polygon res = andrewscan(ps);
	vector<bool> used(v,false);
	ll cnt =0;
	double ans = 0;
	priority_queue<mp,vector<mp>,greater<mp> > q;
	for(int i=0;i<res.size();i++) ans += ( res[i] - res[(i+1)%res.size()] ).abs();
	for(int i=0;i<res.size();i++){
	    for(int j=0;j<v;j++){
		if( res[i].x ==ps[j].x && res[i].y == ps[j].y ){
		    used[j] = true;
		    for(int k = 0;k<g[j].size();k++){
			q.push(g[j][k]);
		    }
		    break;
		}
	    }
	}

	/*for(int i=0;i<v;i++){
	    if(used[i])cout<<i<<endl;
	}*/
	//for(int i=0;i<res.size();i++)cout<<' '<<res[i].x<<' '<<res[i].y<<endl;
	//cout<<ans<<endl;
	while( !q.empty() && cnt != v){
	    mp now = q.top();
	    q.pop();
	    ll nn = now.second;
	    double cost = now.first;
	 //   cout<<nn<<' '<<cost<<endl;
	    if(used[nn])continue;
	 //   cout<<"OK"<<endl;
	    used[nn] = true;
	    ans+= cost;
	    for(int i=0;i<g[nn].size();i++){
		ll next = g[nn][i].second;
		if(used[next])continue;
		q.push(g[nn][i]);
	    }
	}
	printf("%0.10lf\n",ans);
	return 0;
}



Measured memory_bytes: 3308
import java.io.PrintWriter;
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);
		//String S = sc.next();
		//int N = Integer.parseInt(sc.next());
		//out.println();
		// ArrayList<String> list = new ArrayList<String>();
		// list.stream().sorted().distinct();
		int N = Integer.parseInt(sc.next());
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		if(A>=B){
			out.println("delicious");
		}else if(N>=(B-A)){
			out.println("safe");
		}else if(N < (B-A)){
			out.println("dangerous");
		}
		out.flush();	
	}
}


Measured memory_bytes: 23124
#include<iostream>
using namespace std;
#define ll long long
int main() {
  ll N;
  cin >> N;
  ll p = 1;
  const ll mod = 1000000000+7;
  for (ll i = 1; i <= N; ++i) {
    p *= i;
    p = p%mod;
  }
  cout << p%mod << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main()
{
string s[7]={"SUN", "MON", "TUE", "WED", "THU", "FRI","SAT" };
string ss;
cin >> ss;
for(int i = 0 ; i < 7 ; i++){
    if (ss==s[i] ){cout << (7-i ) <<endl; }
}

    return 0;
}

Measured memory_bytes: 3628
#include "bits/stdc++.h"

using namespace std;
using ll = long long;
using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;

const ll linf = 1LL << 62;
const int inf = 99999999;
const int dx[4] = { 1,0,-1,0 };
const int dy[4] = { 0,1,0,-1 };
const ll atcoder = 1e9 + 7;

#define Endl endl
#define mp make_pair
#define all(v) v.begin(),v.end()
#define pb push_back
#define pr(x) cout << x << endl
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
#define rep(i,n) for(int i= 0;i<n;i++)
#define FOR(i,a,b) for(int i = a;i<b;i++)

template<typename A, size_t N, typename T>
void Fill(A(&array)[N], const T &val) {
	std::fill((T*)array, (T*)(array + N), val);
}

ll gcd(ll a, ll b) {//最大公約数
	if (a < b)swap(a, b);
	if (a%b == 0)return b;
	else gcd(b, a%b);
}

ll lcm(ll a, ll b) {//最小公倍数
	if (a < b)swap(a, b);
	return (a / gcd(a, b))*b;
}

int main() {

	string s;
	cin >> s;
	sort(all(s));

	if (s == "abc")pr("Yes");
	else pr("No");

	return 0;
}

Measured memory_bytes: 256
#![allow(
    non_snake_case,
    unused_variables,
    unused_assignments,
    unused_mut,
    dead_code
)]
use proconio::fastout;
use proconio::input;
//use proconio::marker::Usize1;
//use proconio::marker::Chars;
//use std::collections::HashSet;
// use std::cmp::*;
//use std::collections::VecDeque;

#[fastout]
fn main() {
    input! {
       k: usize
    }
    let mut g = vec![vec![1; 201]; 201];
    for i in 1..201 {
        for j in i..201 {
            if i == j {
                g[i][j] = i;
            }
            g[i][j] = gcd(j, i);
            g[j][i] = g[i][j];
        }
    }
    let mut ans = 0;
    for i in 1..k + 1 {
        for j in 1..k + 1 {
            for l in 1..k + 1 {
                ans += g[i][g[j][l]];
            }
        }
    }
    println!("{}", ans);
    //    // 同じ数
    //    let ans1 = k * (k + 1) / 2;
    //    // 2つが同じ数。
    //    // 各ペアの6倍。
    //    let mut ans2 = 0;
    //    for i in 1..k {
    //        for j in i + 1..k + 1 {
    //            ans2 += g[i][j];
    //        }
    //    }
    //    ans2 *= 6;
    //    let mut ans3 = 0;
    //    for i in 1..k - 1 {
    //        for j in i + 1..k {
    //            for l in j + 1..k + 1 {
    //                ans3 += g[i][g[j][l]];
    //            }
    //        }
    //    }
    //    ans3 *= 6;
    //
    //    println!("{}", ans1 + ans2 + ans3);
}

fn gcd(a: usize, b: usize) -> usize {
    if a % b == 0 {
        b
    } else {
        gcd(b, a % b)
    }
}


Measured memory_bytes: 2328
#include <stdio.h>

int search(int arr[], int val, int n)
{
  int i;

  for (i = 0; i < n; i++)
    if (arr[i] == val)
      return i;
  return -1;
}

int postorder[45];

int N;


void po(int inorder[], int preorder[], int n) {

  int rootIndex = search(inorder, preorder[0], n);

  if (rootIndex > 0)
    po(inorder, preorder + 1, rootIndex);

  if (rootIndex != n - 1)
    po(inorder + rootIndex + 1, preorder + rootIndex + 1, n - rootIndex - 1);

  if (n == N)
    printf("%d\n", preorder[0]);
  else
    printf("%d ", preorder[0]);
}

int main() {
  int i;

  scanf("%d", &N);

  int preorder[N];
  int inorder[N];

  for (i = 0; i < N; i++)
    scanf("%d", &preorder[i]);

  for (i = 0; i < N; i++)
    scanf("%d", &inorder[i]);

  po(inorder, preorder, N);
}



Measured memory_bytes: 2100
n,k=map(int,input().split())
a=list(map(int,input().split()))
dp=[0]*(k+1+1234)

for i in range(0,k+1):
    if dp[i] == 0:
        for x in a:
            dp[min(i+x,k+1)] =1

print("First" if dp[k] else "Second")

Measured memory_bytes: 40432
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;
#define rep(i, n)  for (int i = 0; i <  (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(x) (x).begin(), (x).end()
const ll INF = ll(1e18)+1;

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

    string S,T;
    cin >> S >> T;
    
    if(S.size()+1 == T.size()){
        bool flag = true;
        rep(i,S.size()){
            if(S[i] != T[i]){
                flag = false;
            }
        }
        if(flag) {
            cout << "Yes";
            return 0;
        }
    }

    cout << "No";
    return 0;
}

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

int main() {
  int N, M;
  cin >> N >> M;
  
  int a[M] = {0};

  for (int i = 0; i < N; i++) {
    int K;
    cin >> K;
    for (int j = 0; j < K; j++) {
      int x;
      cin >> x;
      a[x-1]++;
    }
  }
  
  int ans = 0;
  for (int i = 0; i < M; i++) {
    if (a[i] == N)
      ans++;
  }
  
  cout << ans << endl;
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define _GLIBCXX_DEBUG
const ll MOD = 1000000007;
const ll Mod = 998244353;
const int MAX = 510000;
const double PI = 3.14159265358979323846;

// (10進法での)桁数
ll dignum10(ll n) {
  ll res = 0;
  while (n>0) {
    res++;
    n /= 10;
  }
  return res-1;
}

int main() {
  int N;
  cin >> N;
  vector<ll> A(N);
  for (int i=0; i<N; i++) cin >> A[i];
  ll res = 1;
  sort(A.begin(), A.end());
  if (A[0]==0) res = 0;
  else {
    reverse(A.begin(), A.end());
    for (int i=0; i<N; i++) {
      if (res*A[i]!=(ll)1e18&&dignum10(res)+dignum10(A[i])>=18) {
        res = -1;
        break;
      }
      else res *= A[i];
      if (res>(ll)1e18) {
        res = -1;
        break;
      }
    }
  }
  cout << res << endl;
}

Measured memory_bytes: 4052
n,x = map(int,input().split())

def f(N,X):
    if N == 0:
        return 0 if X <= 0 else 1
    elif X <= 4*(2**(N-1))-2:
        return f(N-1,X-1)
    elif X == 4*(2**(N-1))-1:
        return 2**N
    elif X <= 4*2**N - 3:
        return 2**N + f(N-1,X - 4*(2**(N-1)) + 1)
    else:
        return 2**(N+1) - 1

print(f(n,x))
            

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

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

void solve() {
    ll N;
    cin >> N;
    ll ans = 0;
    for (ll i = 1; i <= N; i++) {
        for (ll j = i; j <= N; j += i) {
            ans += j;
        }
    }
    cout << ans << "\n";
}

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

int main() {
#ifdef FASTIO
    cin.tie(0), cout.tie(0);
    ios::sync_with_stdio(false);
#endif
#ifdef FILEINPUT
    ifstream ifs("./in_out/input.txt");
    cin.rdbuf(ifs.rdbuf());
#endif
#ifdef FILEOUTPUT
    ofstream ofs("./in_out/output.txt");
    cout.rdbuf(ofs.rdbuf());
#endif
    solve();
    cout << flush;
    return 0;
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define endl    '\n'
using namespace std;

typedef long long ll;

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

    int a, b;

    for (int i = 0; i < 7; ++i) {
        cin >> a >> b;

        cout << a - b << endl;
    }

    return 0;
}




Measured memory_bytes: 3152
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep2(i,n,m) for (int i = (n); i <= (m); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;

int main() {
    int h1, m1, h2, m2, k;
    cin >> h1>>  m1>>  h2>>  m2>>  k;

    cout << (h2-h1)*60 +(m2-m1) - k << endl;
}


Measured memory_bytes: 3640
#include<iostream>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
double pi= 3.14159265358979323846;
int main(){
	int R;
	cin>>R;
	printf("%.20lf\n",2*pi*R);
	return 0;
} 
//458.67252742410977361942
//458.67252742410977361942

//6.28318530717958623200
//6.28318530717958623200

Measured memory_bytes: 3756
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define ll long long
#define Di 3.1415926
#include<math.h>
#include<string>
#include<stack>
#define INF 0x3f3f3f3f
using namespace std;
ll  gcd(ll a,ll b)
{
    return a%b? gcd(b,a%b):b;
}
int main()
{   stack<char>w;
      string s;
      cin>>s;
      char a[20];
     int len =s.length();
     for(int i=0;i<len;i++)
     {
         if(s[i]=='0')
            w.push('0');
         else if(s[i]=='1')
            w.push('1');
            else if(s[i]=='B')
            {
              if(!w.empty())
              {
                  w.pop();
              }
            }

     }
     int i=0;
     while(!w.empty() )
     {
         a[i]=w.top();
         w.pop();
         i++;

     }
     for(int j=i-1;j>=0;j--)
        cout<<a[j];
     cout<<endl;

 return 0;
}


Measured memory_bytes: 888
#include<iostream>
using namespace std;
typedef long long int ll;

int main(){
	int N;
	int A[100000];
	cin >> N;
	for(int i = 0; i < N; i++) cin >> A[i];
	int res = 0;
	for(int i = 0; i < N; i++){
		int cnt = 1;
		while(A[i + 1] == A[i]){
			cnt++;
			i++;
		}
		res += cnt / 2;
	}
	cout << res << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <map>
#include <queue>
#include <functional>
#include <vector>
#include <stack>
#include <set>
using namespace std;
typedef long long ll;
const int maxn=3e5+50;
const int inf=0x3f3f3f3f;
const int MOD=1e9+7;
const int HASH=131;

int main()
{
    int k;
    cin>>k;
    int ans=1;
    for(int i=7;i%k;i=(i*10+7)%k)
    {
        if(++ans>k) {ans=-1;break;}
    }
    cout<<ans;
}


Measured memory_bytes: 3596
//author:luckYrat(twitter:@luckYrat_)
//#include <bits/stdc++.h>

//def
#include <iostream>

#include <cmath>
#include <algorithm>
#include <iomanip>

//array
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <utility>
#include <climits>



using namespace std;

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

#define anyfill(n,s) setw(n) << setfill(s)
#define loop(s) for(int i = 0; s > i; i++)
#define rep(i,q) for(int i = 0; (q) > i; i++)
#define repp(i,n,q) for(int i = n; (q) > i; i++)
#define dep(i,q) for(int i = (q); 0 < i; i--)


#define MAX 1000000000
const int mod = 1000000007;
#define EPS (1e-10)

#define pb push_back
#define fir first
#define scn second
#define ednl endl

#define YesNo(a) (a?"Yes":"No")
#define YESNO(a) (a?"YES":"NO")
#define yesno(a) (a?"yes":"no")


P ar4[4] = {{0,1},{0,-1},{1,0},{-1,0}};
P ar8[8] = {{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
/*
確認ポイント
cout << fixed << setprecision(n) << 小数計算//n桁の小数表記になる
vector.unique()は隣接した同じ要素を削除するので先にソートをする

計算量は変わらないが楽できるシリーズ
C++11以降でmin({a,b,c...})で複数個のmic,maxを処理できる
min(max)_element(iter,iter)で一番小さい(大きい)値のポインタが帰ってくる
count(iter,iter,int)でintがiterからiterの間にいくつあったかを取得できる

*/
__attribute__((constructor))
void initial() {
 cin.tie(0);
 ios::sync_with_stdio(false);
}



int main(){
  int n;cin>>n;
  for(int i = 0; n > i; i++){
    int t;cin>>t;
    if(!(t%2)){
      if(!(!(t%3) || !(t%5))){
        cout << "DENIED" << endl;
        return 0;
      }
    }
  }
  cout << "APPROVED" << endl;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
#define REP(i,x) for(int i=0;i<x;i++)
unsigned int res;
int W,H;
int MAP[20][20];
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
bool valid(int x,int y){ return 0<=x&&x<W&&0<=y&&y<H; }
void change(int x,int y,unsigned int d=0){
  if(d==10)return;
  REP(k,4){
    int nx=x+dx[k],ny=y+dy[k];
    if(!valid(nx,ny)||MAP[nx][ny]==1)continue; // can't move
    while(valid(nx,ny)&&MAP[nx][ny]!=1){
      if(MAP[nx][ny]==3)res=min(res,d+1);
      nx+=dx[k],ny+=dy[k];
    }
    if(valid(nx,ny)){
      MAP[nx][ny]=0;
      change(nx-dx[k],ny-dy[k],d+1);
      MAP[nx][ny]=1;
    }
  }
}

int main(){
  while(cin>>W>>H,W){
    REP(y,H)REP(x,W)cin>>MAP[x][y];
    res=-1;
    REP(x,W)REP(y,H)if(MAP[x][y]==2)change(x,y);
    cout<<(int)res<<endl;
  }
}

Measured memory_bytes: 1160
#ifdef LOCAL
#include <cstdio>
#include <vector>
#include <algorithm>
#include <iostream>
#include <cstring>
#else
#include <bits/stdc++.h>
#endif
using namespace std ;

typedef long long ll ;
#define rep(i , n ) for ( int i =0; i < n ; i++)
#define _sort(arg) sort(begin(arg), end(arg))
#define MOD 1000000007
#define pb push_back
#define DEBUG(x) cout << #x << ": " << x << endl;

/*
__attribute__((constructor))
void initial()
{
	cin.tie(NULL);
	ios::sync_with_stdio(false);
}
*/

ll is_prime(ll m)
{
	if (m < 2)
	{
		return false;
	}

	for(int i=2; i * i <= m; i++)
	{
		if(m % i == 0)
		{
			return false;
		}
	}

	return true;
}

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

	int n;
	
	cin >> n;

	std::vector<int> v;
	rep(i, 55556)
	{
		if (is_prime(i) && (i % 5 == 1))
		{
			v.pb(i);
			if (v.size() >= n)
			{
				break;
			}
		}
	}

	rep(i, n)
	{
		cout << v[i] << " ";
	}


	
	return 0;
}


Measured memory_bytes: 896
// Problem Code: abc176_a

#include <iostream>

using namespace std;

int takoyaki(int N, int X, int T) {
	return (N + X - 1) / X * T;
}

int main() {
	int N, X, T;
	cin >> N >> X >> T;
	cout << takoyaki(N, X, T);
	return 0;
}

Measured memory_bytes: 3664
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int MAX_N = 55;
int D[MAX_N],cnt[13],temp[MAX_N];

int main()
{
	int N;
	cin >> N;
	rep(i,N)
	{
		cin >> D[i];
	}

	int ans = 0;
	if (N >= 24)
	{
		cout << "0" << endl;
		return 0;
	}
	else if (N >= 12)
	{
		cnt[0]++;
		rep(i,N)
		{
			cnt[D[i]]++;
		}
		for (int i = 1; i <= 11; ++i)
		{
			if (cnt[i] >= 3)
			{
				cout << "0" << endl;
				return 0;
			}
		}
		if (cnt[0] >= 2 || cnt[12] >= 2)
		{
			cout << "0" << endl;
			return 0;
		}
		cout << "1" << endl;
		return 0;
	}
	else
	{
		for (int i = 0; i < (1 << N); ++i)
		{
			rep(j,N)
			{
				if ((1 << j) & i)
				{
					temp[j] = 24 - D[j];
				}
				else
				{
					temp[j] = D[j];
				}
			}
			temp[N] = 0;
			int s = 100;
			for (int j = 0; j <= N; ++j)
			{
				for (int k = j+1; k <= N; ++k)
				{
					int t = abs(temp[j] - temp[k]);
					s = min(s,min(t,24-t));
				}
			}
			ans = max(ans,s);
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef unsigned long long int ll;
const int INF = 1<<30;

int main(){
  int n, m;cin>>n>>m;
  vector<bool> a(n, false);
  for(int i=0;i<m;i++){
  	int tmp;cin>>tmp;
    a[tmp]=true;
  }
  vector<ll> dp(n+1);
  dp[0]=(ll)1;
  for(int i=1;i<=n;i++){
  	if(a[i]){
      dp[i]=(ll)0;
    }else{
      if(i==1){
      	dp[i]=dp[0];
      }else{
      	dp[i]=ll(dp[i-1]+dp[i-2])%ll(1e9+7);
      }
    }
  }
  cout<<dp[n]<<endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
int main()	{
    int A,i;
    int num=0;
    cin>>A;
    for(i=1;i<=9;i++){
        if(A%i==0 && (A/i)<10){
            num++;
        }
    }
    if(num){
        cout<<"Yes"<<endl;
    }
    else{
        cout<<"No"<<endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<vector>
#include<functional>
#include<stack>
#include<utility>
#include<map>
#include <queue>
#include <set>

using namespace std;


int main(){
	string s, t;
	cin >> s >> t;
	for (int i = 0; i < s.size(); i++) {
		cout << s[i];
		if (i < t.size())
			cout << t[i];
	}
	cout << endl;
 	return 0;
}



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

int main(){
  int A, B ,C;
  cin >> A>>B>>C;
  if(A>C){
    if(C>B)cout <<"Yes" <<endl;else {cout <<"No" <<endl;}
  }else if(A<C){
    if(C<B){cout <<"Yes" <<endl;}else {cout <<"No" <<endl;}
  }
}

Measured memory_bytes: 256
#include <iostream>
#include<iomanip>
#include <string>
#include<vector>
#include<algorithm>
#include<utility>
#include<queue>
#include<math.h>
#include<stack>
#include<set>
#include<map>
#define INF  int(1e6+1)
#define rep(i,n,m) for(int i=n;i<m;i++)

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<pair<int,int>>a(n);
	rep(i, 0, n) {
		cin >> a[i].first;
		a[i].second = i + 1;
	}
	sort(a.begin(), a.end());
	int x = 1, ans = 0, now = 0;
	rep(i, 0, n){
		if (a[i].first == x) {
			if (a[i].second > now) {
				now = a[i].second;
				ans++;
				x++;
			}
		}
	}
	if (ans == 0)cout << -1 << endl;
	else cout << n - ans << endl;
}




Measured memory_bytes: 4840
#include<bits/stdc++.h>
using namespace std;
int main(){
 int d[30],b[30],c[30],n,k;
  cin>>n;
  for(int i=1;i<=n;i++)
    cin>>d[i];
  for(int i=1;i<=n;i++)
    cin>>b[i];
   for(int i=1;i<n;i++)
    cin>>c[i];
  int count=0;
  for(int i=1;i<=n;i++){
   
    if(i!=1){
     if(d[i-1]+1==d[i])
       count+=c[d[i-1]];
    }
    count+=b[d[i]];
  
  }
  
  cout<<count;
  
  
  
  
  
  
}

Measured memory_bytes: 384
#![allow(unused_imports)]
#![allow(unused_macros)]
use std::cmp::{max, min};
use std::collections::*;
use std::io::{stdin, Read};

#[allow(unused_macros)]
macro_rules! parse {
    ($it: ident ) => {};
    ($it: ident, ) => {};
    ($it: ident, $var:ident : $t:tt $($r:tt)*) => {
        let $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
    ($it: ident, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
}

#[allow(unused_macros)]
macro_rules! parse_val {
    ($it: ident, [$t:tt; $len:expr]) => {
        (0..$len).map(|_| parse_val!($it, $t)).collect::<Vec<_>>();
    };
    ($it: ident, ($($t: tt),*)) => {
        ($(parse_val!($it, $t)),*)
    };
    ($it: ident, u1) => {
        $it.next().unwrap().parse::<usize>().unwrap() -1
    };
    ($it: ident, $t: ty) => {
        $it.next().unwrap().parse::<$t>().unwrap()
    };
}

#[cfg(debug_assertions)]
macro_rules! debug {
    ($( $args:expr ),*) => { eprintln!( $( $args ),* ); }
}

#[cfg(not(debug_assertions))]
macro_rules! debug {
    ($( $args:expr ),*) => {
        ()
    };
}

fn solve(s: &str) {
    let mut it = s.split_whitespace();
    parse!(it, n: usize, k: usize, ab: [(usize, usize); n]);
    let ab: Vec<(usize, usize)> = ab;
    let mut ret = 0usize;
    let mut msb = 0;
    for i in 0..40 {
        if (k >> i) & 1 == 1 {
            msb = i
        }
    }
    if k == 0 {
        for &(a, b) in &ab {
            if a == 0 {
                ret += b;
            }
        }
        println!("{}", ret);
        return;
    }
    for i in 0..(msb + 2) {
        if i > 0 && k >> (i - 1) & 1 == 0 {
            continue;
        }
        let mut p = 0;
        for &(a, b) in &ab {
            if (((k | a) >> i) == (k >> i)) && (i == 0 || (((a >> (i - 1)) & 1) == 0)) {
                p += b;
            }
        }
        ret = max(p, ret);
    }
    println!("{}", ret);
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    solve(&s);
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_input() {
        let s = "
        ";
        solve(s);
    }
}


Measured memory_bytes: 5584
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int n = Integer.parseInt(scan.next());
		for( int i = 0; i < n; i++ ){
			int[] num = new int[9];	//?????????????????????
			char[] color = new char[9];	//??????????????????
			boolean[] left = new boolean[9];	//???????????§???????????????????????£?????????????????????
			for( int j = 0; j < 9; j++ ){
				num[j] = Integer.parseInt(scan.next());
			}
			for( int j = 0; j < 9; j++ ){
				String temp = scan.next();
				color[j] = temp.charAt(0);
			}
			for( int j = 0; j < 9; j++ ){
				left[j] = true;
			}
			System.out.println(Check(num, color, left));
		}
		return;
	}
	
	public static int Check(int num[], char color[], boolean left[]){
		int count = 0;
		int re = 0;
		for( int i = 0; i < 9; i++ ){
			if( left[i] ){
				count++;
			}
		}
		if( count == 0 ){
			return 1;
		}
		for( int i = 0; i < 9; i++ ){
			for( int j = i+1; j< 9; j++ ){
				for( int k = j+1; k < 9; k++ ){
					if( left[i]  && left[j] && left[k] ){
						if( color[i] == color[j] && color[j] == color[k] ){
							//??¨?????????????????????????????????
							if( CheckSN(num[i], num[j], num[k]) || (num[i] == num[j] && num[j] == num[k]) ){
								left[i] = left[j] = left[k] = false;
								if( Check(num, color, left) > 0 ){
									return 1;
								}
								left[i] = left[j] = left[k] = true;
							}
						}
					}
				}
			}
		}
		
		return 0;
	}
	
	public static boolean CheckSN(int a, int b, int c){
		//????????????????????£???????¢?????????????
		int temp = 0;
		for( int i = 0; i < 2; i++ ){
			if( a > b ){
				temp = a;
				a = b;
				b = temp;
			}
			if( b > c ){
				temp = b;
				b = c;
				c = temp;
			}
		}
		if( a == b-1 && b == c-1 ){
			return true;
		}
		return false;
	}
}

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

int main(){
    string s,t,u;
    cin >> s >> t;
    int a,b;
    cin >> a >> b >> u;
    if(u==s){
        cout << a-1 << " " << b << endl;
    }else{
        cout << a << " " << b-1 << endl;
    }
}

Measured memory_bytes: 3608
from heapq import heappush, heappop
from collections import deque

def main():
    INF = float('inf')
    V = int(input())
    dist = [INF] * V
    visited = [False] * V
    graph = [None] + [deque() for i in range(V-1)]
    
    q = []
    tmp = list(map(int, input().split()))
    for i in range(tmp[1]): heappush(q, (tmp[2+2*i+1], tmp[2+2*i]))
        
    for i in range(1, V):
        tmp = list(map(int, input().split()))
        
        for j in range(tmp[1]):
            graph[i].append((tmp[2+2*j+1], tmp[2+2*j]))
        
    dist[0], visited[0] = 0, True
        
    while q:
        cost, v = heappop(q)
        if visited[v]: continue
    
        visited[v] = True
        dist[v] = cost
        
        for c, u in graph[v]:
            if visited[u] or dist[u] < cost + c: continue
            heappush(q, (cost+c, u))
    
    for i in range(V): print(i, dist[i])
        
if __name__ == '__main__':
    main()


Measured memory_bytes: 6636
import sys

input = sys.stdin.readline


class Solution:
    def main(self):
        N, D = map(int, input().split())
        X = [list(map(int, input().split())) for _ in range(N)]

        ans = 0
        for i in range(N):
            for j in range (i + 1, N):
                d = 0
                for k in range(D):
                    d += (X[i][k] - X[j][k]) ** 2
                if (d ** 0.5).is_integer():
                    ans += 1

        print(ans)


# Run main
if __name__ == '__main__':
    Solution().main()


Measured memory_bytes: 38588
#include <bits/stdc++.h>
#define int long long
#define ld long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define ff first
#define ss second
#define frr(i,n) for(int i=0;i<n;i++)
#define td(v) v.begin(),v.end()
#define M   1000000007 // 1e9 + 7
#define MAXN 500100
using namespace std;
typedef pair<int,int> pii;
const int inf = 1e18;
inline int mod(int n, int m){ int ret = n%m; if(ret < 0) ret += m; return ret; }
int gcd(int a, int b){return (b == 0 ? a : gcd(b, a%b));}
int exp(int a,int b,int m){
    if(b==0) return 1;
    if(b==1) return mod(a,m);
    int k = mod(exp(a,b/2,m),m);
    if(b&1){
        return mod(a*mod(k*k,m),m);
    }
    else return mod(k*k,m);
}

int32_t main(){
	fastio;
	int n;
	cin>>n;
	vector<int> a(n);
	frr(i,n)cin>>a[i];
	int best=1e9;
	frr(i,101){
		int cost=0;	  		
		frr(j,n)cost+=(a[j]-i)*(a[j]-i);
		best = min(best,cost);
	}
	cout<<best<<endl;
}

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

int main () {
  int N, A = 0, B = 0, mi, ma;
  cin >> N;
  vector<int> X(N);
  for (int i = 0; i < N; i++) {
    cin >> X.at(i);
  }
  sort(X.begin(), X.end());
  for (int i = 0; i < N; i++) {
    if (i % 2 == 0) {
      A += X.at(i);
    }
    else{
      B += X.at(i);
    }
  }
  ma = max(A, B);
  mi = min(A, B);
  cout << ma - mi;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
int n;
int flag=0;
string str1,str_1,str_2,str2;
string s[100000]={"ABCD"};
int num;
int main()
{
    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>str1;
        num=0;
        for(int j=1;j<str1.size();j++)
        {
            str_1=str1.substr(0,j);
            str_2=str1.substr(j);
            str2=str_1+str_2;
            for(int k=0;k<num;k++)
            {
                if(strcmp(str2.c_str(),s[k].c_str())==0)
                flag=1;
            }
            if(flag!=1)
            {
                num++;
                s[num-1]=str2;
            }
            flag=0;
            reverse(str_2.begin(),str_2.end());
            str2=str_1+str_2;
            for(int k=0;k<num;k++)
            {
                if(strcmp(str2.c_str(),s[k].c_str())==0)
                flag=1;
            }
            if(flag!=1)
            {
                num++;
                s[num-1]=str2;
            }
            flag=0;
            reverse(str_1.begin(),str_1.end());
            str2=str_1+str_2;
            for(int k=0;k<num;k++)
            {
                if(strcmp(str2.c_str(),s[k].c_str())==0)
                flag=1;
            }
            if(flag!=1)
            {
                num++;
                s[num-1]=str2;
            }
            flag=0;
            reverse(str_2.begin(),str_2.end());
            str2=str_1+str_2;
            for(int k=0;k<num;k++)
            {
                if(strcmp(str2.c_str(),s[k].c_str())==0)
                flag=1;
            }
            if(flag!=1)
            {
                num++;
                s[num-1]=str2;
            }
            flag=0;
            str2=str_2+str_1;
            for(int k=0;k<num;k++)
            {
                if(strcmp(str2.c_str(),s[k].c_str())==0)
                flag=1;
            }
            if(flag!=1)
            {
                num++;
                s[num-1]=str2;
            }
            flag=0;
            reverse(str_1.begin(),str_1.end());
            str2=str_2+str_1;
            for(int k=0;k<num;k++)
            {
                if(strcmp(str2.c_str(),s[k].c_str())==0)
                flag=1;
            }
            if(flag!=1)
            {
                num++;
                s[num-1]=str2;
            }
            flag=0;
            reverse(str_2.begin(),str_2.end());
            str2=str_2+str_1;
            for(int k=0;k<num;k++)
            {
                if(strcmp(str2.c_str(),s[k].c_str())==0)
                flag=1;
            }
            if(flag!=1)
            {
                num++;
                s[num-1]=str2;
            }
            flag=0;
            reverse(str_1.begin(),str_1.end());
            str2=str_2+str_1;
            for(int k=0;k<num;k++)
            {
                if(strcmp(str2.c_str(),s[k].c_str())==0)
                flag=1;
            }
            if(flag!=1)
            {
                num++;
                s[num-1]=str2;
            }
            flag=0;
        }
        cout<<num<<endl;
    }
    return 0;
}



Measured memory_bytes: 4024
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


int main(){
  int L, R;
  cin >> L >> R;

  vector<int> v;
  int base = L;
  rep(i,2019*2){
    if(base+i > R) break;
    v.push_back(base+i);
  }

  int ret = 2020;
  rep(i,v.size()){
    REP(j,i+1,v.size()){
      int x = v[i] % 2019;
      int y = v[j] % 2019;
      //cout << x << " " << y << " " << ((x*y)%2019) << endl;
      ret = min(ret, (x * y) % 2019);
    }
  }

  cout << ret << endl;
  
  return 0;
}



Measured memory_bytes: 256
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));
var mod = 1e9+7;

console.log(main());
function main(){
  var s = o.a(1);
  var a = s.match(/[ACGT]+/g);
  return a ? Math.max(...(a.map(a=>a.length))) : 0;
}

Measured memory_bytes: 9420
# include<iostream>
# include<queue>
# include<stack>
# include<algorithm>
# include<cmath> 
# include<cstring>
# include<map>
# include<iomanip>
using namespace std;
const int INF =pow(10,9)+7;
int a[1000000];

struct P{
	int x,y;
};
bool cmp(P a,P b)
{
	 return 1;
}

void update(int a,int b,int k,int l,int r)
{
	 
}
double sum(int i)
{
	 double s=1.0*(i+1)/2;
	 return s;
}
int main ()
{
	 int t=1;
	 //cin>>t;
	 while(t>0)
	 {
	 	  t--;
	      int n,k;
	      cin>>n>>k;
	      int a[n];
	      for(int i=0;i<n;i++)
	      {
	      	  cin>>a[i];
		  }
		  double ans =0;
		  for(int i=0;i<k;i++)
		  {
		  	  ans+=sum(a[i]);
		  }
		  double MAX = ans;
		  for(int i=k;i<n;i++)
		  {
		  	  ans+=sum(a[i]);
		  	  ans-=sum(a[i-k]);
		  	  MAX =max(MAX,ans);
		  	
		  	
		  }
		  cout<<setprecision(10)
		      <<setiosflags(ios::fixed)<<MAX<<endl;
	 }
    	
	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
using namespace std;
int main(){
//	int UBW;
	int N,pro, ans[365],x[365], y[365], b[365], p[365];
	cin >> N;
	for (int i = 0; i < N; i++){
		cin >> x[i] >> y[i] >> b[i] >> p[i];
		ans[i] = (x[i] * b[i] + y[i] * p[i]);
	}
	for (int i = 0; i < N; i++){
		if (b[i] > 4 && p[i] > 1){
			pro = (x[i] * b[i] + y[i] * p[i]) *  0.8;
			if (ans[i] > pro)	ans[i] = pro;
		}
		else if (b[i] > 4){
			pro = (x[i] * b[i] + y[i] * 2) * 0.8;
			if (ans[i] > pro)	ans[i] = pro;
		}
		else if (p[i] > 1){
			pro = (x[i] * 5 + y[i] * p[i]) * 0.8;
			if (ans[i] > pro)	ans[i] = pro;
		}
		else{
			pro = (x[i] * 5 + y[i] * 2) *  0.8;
			if (ans[i] > pro)	ans[i] = pro;
		}
	}
	for (int i = 0; i < N; i++)	cout << ans[i] << endl;
	
//	cin >> UBW;
	return 0;
}

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

#define ll long long



int main() {
	// your code goes here
	
	
	ll N, W;
	cin>>N>>W;
	
	
	ll w[N], v[N];
	for(ll i = 0; i< N; i++) cin>>w[i]>>v[i];
	
	ll maxValue = N * 1000;
	
	ll dp[N+1][maxValue+1];
	
	for(ll j = 0; j <= maxValue; j++) dp[1][j] = W+1;

	dp[1][0] = 0;
	dp[1][v[0]] = w[0];
	
	for(ll i = 2; i <= N; i++) {
	    for(ll val = 0; val <= maxValue ; val++) {
	        dp[i][val] = dp[i-1][val];
	        
	        if(val < v[i-1]) continue;
	        
	        dp[i][val] = min(dp[i][val], w[i-1] + dp[i-1][val - v[i-1]]);
	    }
	}
	
	ll ans  = 0;
	for(ll val = 0; val <= maxValue; val++) {
	 //   cout<<dp[N][val]<<" ";
	    if(dp[N][val] <= W) {
	        ans = val;
	       // cout<<dp[N][val]<<" ";
	    }
	    
	}
	
	cout<<ans<<endl;
	
	
	
	return 0;
}


Measured memory_bytes: 78336
#include <bits/stdc++.h>
//#include <ext/numeric>


using namespace std;
//using namespace __gnu_cxx;



int main() {
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
//    freopen("fence.out", "w", stdout);
#endif

    int n, a;
    cin >> n >> a;
    vector<int> arr(n);
    for (int &x : arr) {
        cin >> x;
        x -= a;
    }
    int m = 2500;

    vector<vector<long long>> dp(n + 1, vector<long long>(m * 2 + 1, -1));
    function<long long(int, int)> solve = [&](int idx, int sum) {
        if (idx == n)
            return sum == m ? 1LL : 0LL;
        long long &ret = dp[idx][sum];
        if (~ret)
            return ret;
        ret = solve(idx + 1, sum + arr[idx]) + solve(idx + 1, sum);
        return ret;
    };

    cout << solve(0, m) - 1 << '\n';

    return 0;
}

Measured memory_bytes: 5372
#include<iostream>
#include<cmath>
using namespace std;
#define LIMIT 35
struct Puzzle{char cont[8]; int space; };
Puzzle puzzle;
int limit,path[LIMIT],MD[8][8];
static const int dx[4] = {-1,0,1,0};
static const int dy[4] = {0,-1,0,1};
static const char direction[4] = {'d','r','u','l'};
 
int getHeuristic(){
  int sum = 0;
  for(int i=0;i<8;i++){
    if(puzzle.cont[i]=='0')continue;
    sum += MD[i][puzzle.cont[i]-'0'];
  }
  return sum;
}
 
bool isTarget(){
  for(int i=0;i<8;i++){
    if(puzzle.cont[i] != '0' + i )return false;
  }
  return true;
}
 
bool dfs(int depth,int prev){
  if(isTarget())return true;
  if(depth+getHeuristic()>limit)return false;
 
  int px,py,tx,ty;
  Puzzle tmp;
  px = puzzle.space%4;
  py = puzzle.space/4;
   
   
  for(int r=0;r<4;r++){
 
    tx=px+dx[r];
    ty=py+dy[r];
 
    if(max(prev,r)-min(prev,r)==2)continue;
    if(tx<0||ty<0||tx>=4||ty>=2)continue;
 
    tmp=puzzle;
 
    puzzle.cont[py*4+px] = puzzle.cont[ty*4+tx];
    puzzle.cont[ty*4+tx] = '0';
    puzzle.space = ty*4+tx;
 
    if(dfs(depth+1,r)){path[depth]=r;return true;}
    puzzle=tmp;
  }
  return false;
}
 
void solve(){
  for(limit=getHeuristic();limit<=LIMIT;limit+=2){
    if(dfs(0,-100)){
      cout<<limit<<endl;
      //for(int i=0;i<limit;i++)cout<<direction[path[i]];cout<<endl;
       
      return;
    }
  }
  cout<<"unsolvable"<<endl;
}
 
bool input(){
  for(int i=0;i<8;i++){
    if(cin>>puzzle.cont[i]){}else return false;
    if(puzzle.cont[i]=='0')puzzle.space = i;
  }
  return true;
}
 
int main(){
  for(int i=0;i<8;i++){
    for(int j=0;j<8;j++){
      MD[i][j]=abs(i/4-j/4)+abs(i%4-j%4);
    }
  }
  while(input()){
    solve();
  }
  return 0;
}


Measured memory_bytes: 3016
#!/usr/bin/env python3

N, K = list(map(int, input().split()))
p_list = list(map(int, input().split()))
c_list = []

k_list = []
total = 0
for x in range(1001):
    total += x
    if x == 0:
        k_list.append(0)
    else:
        k_list.append(total / x)

max_t = -float("inf")
max_kp = -float("inf")
kp_list = []
t_list = []
for i, p in enumerate(p_list):  # 200000
    kp = k_list[p]
    if i != 0:
        c_list.append(c_list[i - 1] + p)
        kp_list.append(kp_list[i - 1] + kp)
    else:
        c_list.append(p)
        kp_list.append(kp)

    if i >= K - 1:
        if i - K < 0:
            t = c_list[i]
        else:
            t = c_list[i] - c_list[i - K]
        t_list.append(t)

        if t > max_t:
            if i - K < 0:
                max_kp = kp_list[i]
            else:
                max_kp = kp_list[i] - kp_list[i - K]
            max_t = t

ans = max_kp
print(ans)


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

int main()
{
  string s;
  cin >> s;

  int i, j;

  for(i = 0; i < s.size(); i++){
    if(s[i] == 'A') break;
  }

  for(j = s.size()-1; j > i; j--){
    if(s[j] == 'Z') break;
  }

  cout << j - i + 1 << endl;

  return 0;

}



Measured memory_bytes: 640
#include <cstdio>
#include <cmath>
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
using namespace std;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define REP(i,n) for(ll i=0;i<n;i++)
#define REPR(i,n) for(ll i=n-1;i>=0;i--)

typedef long long ll;
#define INF 1e18

int main(){
	ll A,B,C;
	cin>>A>>B>>C;
	if(A+B+C>=22){
		cout<<"bust"<<endl;
	}else{
		cout<<"win"<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n, k;
    cin >> n >> k;
    vector<ll> t(30, k);
    for (int i = 1; i < 30; i++) {
        if (t[i] & (1LL << i)) {
            t[i] >>= i;
            t[i] <<= i;
            t[i]--;
        }
    }
    debug(t);
    vector<ll> ans(30);
    for (int i = 0; i < n; i++) {
        ll a, b;
        cin >> a >> b;
        for (int j = 0; j < 30; j++) {
            if ((t[j] | a) == t[j]) {
                ans[j] += b;
            }
        }
    }
    cout << *max_element(ans.begin(), ans.end()) << '\n';
    return 0;
}

Measured memory_bytes: 3688
//CODING ME ACCHHA KARNEKA HAI TERKO TO BAS PRACTICE KARTE REH
#include <bits/stdc++.h>
#define pragma
using namespace std;
#define ll unsigned long long
#define ld long double
#define pb push_back
#define pf push_front
#define aisort sort(a,a+n)
#define adsort sort(a,a+n,greater<ll>())
#define PI 2 * acos(0)

typedef pair<ll, ll> pii;
typedef pair<ll, pii> piii;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef vector<pii> vii;
typedef vector<piii> viii;
typedef set<ll> Set;

const ll maxs = 1e5+3;
const ll maxs1 = 1e3+4;
const ll mod = 1e9 + 7;

//MODULO OPEARTIONS
    inline ll add(ll a, ll b) { return (mod + a + b) % mod; }
    inline ll sub(ll a, ll b) { return (a - b + mod) % mod; }
    inline ll mul(ll a, ll b) { return (1ll * a * b) % mod; }

//POWER
    ll fastpow(ll x,ll y)
    {ll res = 1;x = x % mod;while (y > 0){ if (y & 1)res = (res * x) % mod; y = y >> 1 ; x = (x * x) % mod; } return res;}

//MODULAR INVERSE
    ll inv(ll x){ return fastpow(x , mod - 2);}
    
//PRIME
    bool isPrime(ll n) { if (n <= 1)  return false; if (n <= 3)  return true;if (n%2 == 0 || n%3 == 0) return false; for (int i=5; i*i<=n; i=i+6) if (n%i == 0 || n%(i+2) == 0) return false; return true; } 


int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll a[3][3];
    ll i,j;
    for(i=0;i<3;i++)
    {
        for(j=0;j<3;j++)
        cin>>a[i][j];
    }
    map<ll,ll>mp;
    ll n,x,flg=0;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>x;
        mp[x]++;
    }
    for(i=0;i<3;i++)
    {
        x=0;
        for(j=0;j<3;j++)
        {
            if(mp[a[i][j]]>0)
            {
                a[i][j]=-1;
                x++;
            }
            
        }
        if(x==3)
        flg=1;
    }
    if(a[0][0]==-1&&a[1][0]==-1&&a[2][0]==-1)
    flg=1;
    if(a[0][1]==-1&&a[1][1]==-1&&a[2][1]==-1)
    flg=1;
    if(a[0][2]==-1&&a[1][2]==-1&&a[2][2]==-1)
    flg=1;
    if(a[0][0]==-1&&a[1][1]==-1&&a[2][2]==-1)
    flg=1;
    if(a[0][2]==-1&&a[1][1]==-1&&a[2][0]==-1)
    flg=1;
    
    if(flg==0)
    cout<<"No";
    else
    cout<<"Yes";
}



Measured memory_bytes: 3656
#include <iostream>
using namespace std;
int main() {
	int n, i, j, k;
	int a[200][3], point[1000] = { 0 };
	cin >> n;
	for (i = 0; i < n; i++) {
		for (j = 0; j < 3; j++) {
			cin >> a[i][j];
		}
	}
	for (j = 0; j < 3; j++) {
		for (i = 0; i < n; i++) {
			bool b = true;
			for (k = 0; k < n; k++) {
				if (i != k) {
					if (a[i][j] == a[k][j]) {
						b = false;
						break;
					}
				}
			}
			if (b) point[i] += a[i][j];
		}
	}
	for (i = 0; i < n; i++) {
		cout << point[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 3008
#include <bits/stdc++.h>
#define itn int
#define REP(i, n) for (ll i = 0; i < n; i++)
#define IREP(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(a, b) for (ll i = a; i < b + 1; i++)
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template<class T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}
template<class T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}


int main(){
    int h,a;
    cin >> h >> a;
    if(h%a==0){
        cout << h/a << endl;
    }
    else{
        cout << h/a+1 << endl;
    }
}

Measured memory_bytes: 256
def L(cake1,cake2):
	return ((cake1+cake2)**2-abs(cake1-cake2)**2)**0.5
 
while 1:
	try:
		Cakes=map(int,raw_input().split())
		size_max=Cakes.pop(0)
		size_min=999
		for j in range(len(Cakes)):
			cakes=Cakes[:]
			size=cake1=cakes.pop(j)
			while cakes:
				cos,idx=min([(L(cake1,cakes[i])/(cake1+cakes[i]),i) for i in range(len(cakes))])
				cake2=cakes.pop(idx)
				size+=L(cake1,cake2)
				cake1=cake2
			size+=cake1
			size_min=min(size,size_min)
		print "OK" if size_min<=size_max else "NA"
	except:
		break

Measured memory_bytes: 4328
#include <iostream> // cout, endl, cin
#include <iomanip>
#include <string>        // string, to_string, stoi
#include <vector>        // vector
#include <algorithm>     // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility>       // pair, make_pair
#include <tuple>         // tuple, make_tuple
#include <cstdint>       // int64_t, int*_t
#include <cstdio>        // printf
#include <map>           // map
#include <queue>         // queue, priority_queue
#include <set>           // set
#include <stack>         // stack
#include <deque>         // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset>        // bitset
#include <cctype>        // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <numeric>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
const int INF = 1001001001;
const int BG = 1000000007;

int main()
{
    int X, Y, Z;
    cin >> X >> Y >> Z;
    X -= Z;
    cout << X / (Y + Z) << endl;
}


Measured memory_bytes: 256
n,m = map(int, input().split())
h = list(map(int, input().split()))
t = [1 for i in range(n)]
for i in range(0,m):
    a,b = map(int, input().split())
    if h[a-1] >= h[b-1]:
        t[b-1] = 0
    if h[a-1] <= h[b-1]:
      t[a-1] = 0
print(sum(t))

Measured memory_bytes: 20124
/*input
6
eleven
5
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}

//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const ld PI=acos(-1);
const ld eps=1e-9;
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		
		b>>=1;
	}
	return res;
}

int main(){
	IOS;
	int n,k;
	string s;
	cin>>n>>s>>k;
	k--;
	REP(i,n) if(i!=k) if(s[i]!=s[k]) s[i]='*';
	cout<<s<<'\n';
	return 0;
}


Measured memory_bytes: 256