akhauriyash/Code-Regression huggingface dataset:
///スマホコーディング
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
typedef long long ll;
const int inf=1e9;
int main(){
  int a;cin>>a;
  int t=24-a;
  t+=24;
  cout<<t<<endl;
  return 0;
}

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

using namespace std;

int main()
{
    int N;
    cin >> N;
    vector<int> p(N);
    for (int i = 0; i < N; i++) cin >> p[i];

    int count = 0;
    for (int i = 0; i < N; i++) {
        if (p[i] == i+1) {
            int temp = p[(i+1)%N];
            p[(i+1)%N] = p[i];
            p[i] = temp;
            count++;            
        }
    }

    cout << count << endl;
}

Measured memory_bytes: 640
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
in(string a, b)
string s << a + b
x << stoi(s)
for(i in (1~sqrt(x))){
    if(i*i==x) yes() return 0
}
no()
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <algorithm>
#include <functional>
#include <deque>
#include <cctype>
#include <ctime>
#include <cstdlib>
#include <iomanip>
using namespace std;

;;

int main(){
  ;;
    string a, b;
    cin >> a >> b;
    ;
    string s = a + b;;
    int x = stoi(s);;
    if(1<sqrt(x)){;
        for(int i = 1; i <= sqrt(x); ++i){;;;
        if(i*i==x) {;cout << "Yes" << endl; return (0);};
    }
    ;}
    else {;
        for(int i = 1; i >= sqrt(x); --i){;;;
        if(i*i==x) {;cout << "Yes" << endl; return (0);};
    }
    ;};;;;
    cout << "No" << endl;;
}

Measured memory_bytes: 256
N = int(input())

polls = {}
result = []

for k in range(N):
    S_k = input()
    if (S_k in polls):
        # 既に存在する場合 -> 値を+1
        polls[S_k] = str(int(polls[S_k]) + 1)
    else:
        # 存在していない場合 -> キーを新規作成し値を1にする
        polls[S_k] = "1"

max = 0
# 最大の値を取得する
for key in polls:
    if(max < int(polls[key])):
        max = int(polls[key])

for key in polls:
    if(max == int(polls[key])):
        result.append(key)

result.sort()
for ans in result:
    print(ans)


Measured memory_bytes: 32096
#include<stdio.h>
int main(void){
   int i = 0, x = -1;
   while(i < 10000){
       while(x < 0 || 10000 < x) scanf("%d", &x);
       if(x == 0) break;
       printf("Case %d: %d\n",i + 1, x);
       i++;
       x = -1;
   } 
   return 0;
}


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

int main()
{
    int h, w;
    while (true)
    {
        cin >> h >> w;
        if (h == 0 && w == 0)
        {
            break;
        }
        for (int i = 0; i != h; ++i)
        {
            for (int j = 0; j != w; ++j)
            {
                if (j == 0 || j == w-1)
                {
                    cout << "#";
                }
                else
                {
                    if (i == 0 || i == h-1)
                    {
                        cout << "#";
                    }
                    else
                    {
                        cout << ".";
                    }
                    
                }
                
            }
            cout << endl;
        }
        cout << endl;
    }
    return 0;
}



Measured memory_bytes: 3080
<?php

$input = explode(' ', trim(fgets(STDIN)));
$n = (int)$input[0];
$k = (int)$input[1];
$ws = [];
$max = 0;
for ($m=0; $m < $n; $m++) { 
	$input = (int)trim(fgets(STDIN));
	$ws[] = $input;
	$max = max($max,$input);
}

$p_min = $max;
$p_max = 100000 * 10000;
$p = solve($k, $ws, $p_min, $p_max);
echo $p .PHP_EOL;

function can($p, $array){
	$sum = 0;
	$len = count($array);
	$tmp_sum = 0;
	$check = [];
	for ($i=0; $i < $len; $i++) { 
		if ($tmp_sum + $array[$i] > $p) {
			$check[] = $tmp_sum;
			$tmp_sum = $array[$i];
			++$sum;
		}else{
			$tmp_sum += $array[$i];
		}
		if ($i === $len-1) {
			$check[] = $tmp_sum;
			++$sum;
			break;
		}
	}
	// echo '[' . implode(' , ', $check) . ']' . PHP_EOL;
	return $sum;
}
function solve($k, $array, $p_min, $p_max){
	$left = $p_min;
	$right = $p_max;
	$min = $right;
	while ($left < $right) {
		$mid = (int)floor(($left+$right)/2);
		$can = can($mid, $array);
		// echo 'left: ' . $left . ' / right: ' . $right . ' / mid: ' . $mid . ' / can: ' .$can.PHP_EOL;
		if ($can <= $k) {
			$min = min($min, $mid);
			$right = $mid;
		}else{
			$left = $mid+1;
		}
	}
	return $min;
}



Measured memory_bytes: 33536
using System;
using System.Collections.Generic;

namespace AtCoder_ABC_B
{
    class Program
    {
        static void Main(string[] args)
        {
            var numsList = new List<int>();
            int ans = 0;
            int n = int.Parse(Console.ReadLine());
            String[] inputLine = Console.ReadLine().Split(' ');
            for (int i = 0; i < n; i++)
            {
                numsList.Add(int.Parse(inputLine[i]));
            }

            for (int i = 1; i < n - 1; i++)
            {
                if(numsList[i] < numsList[i + 1] && numsList[i] > numsList[i - 1])
                {
                    ans++;
                }else if(numsList[i] < numsList[i - 1] && numsList[i] > numsList[i + 1])
                {
                    ans++;
                }
            }
            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = (n); i >= 0; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 25;
const int MOD = 1e9+7;
const int S = 1e9;
int main() {
	ll s;
	cin >> s;
	ll x3, y3;
	y3 = (s + S - 1) / S;
	x3 = S * y3 - s;
	cout << 0 << " " << 0 << " ";
	cout << S << " " << 1 << " ";
	cout << x3 << " " << y3 << endl;
 	return 0;
}

Measured memory_bytes: 3620
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>

short dk[10001][1001];

int main(){
	int i,j,takara[1001][2],w,n,c,maxv;
	c=0;
	while(0<=scanf("%d",&w)){
		if(w==0)break;
		scanf("%d",&n);
		++c;
		
		for(i=1;i<=n;i++){
			scanf("%d,%d",&takara[i][0],&takara[i][1]);
		}
		
		memset(dk,0,sizeof(dk));
		
		for(i=1;i<=n;i++){
			for(j=1;j<=w;j++){
				if(j>=takara[i][1]){
					dk[i][j]=(dk[i-1][j-takara[i][1]]+takara[i][0]>dk[i-1][j] ? dk[i-1][j-takara[i][1]]+takara[i][0]:dk[i-1][j]);
					continue;
				}
				dk[i][j]=dk[i-1][j];
			}
		}
		
		maxv=dk[n][w];
		
		for(i=0;i<=w;i++){
			if(maxv==dk[n][i])break;
		}
		
		printf("Case %d:\n",c);
		printf("%d\n%d\n",maxv,i);
	}
	return 0;
}

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

bool freq[26];
int nr, n;

int main()
{
    cin >> n;
    for(int i = 1; i <= n; i++) {
        char c;
        cin >> c;
        if(freq[c - 'A'] == 0) {
            nr++;
            freq[c - 'A'] = 1;
        }
    }
    if(nr == 3) {
        cout << "Three";
    } else {
        cout << "Four";
    }
    return 0;
}


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

int main(){
    ll x;
    cin >> x;
    ll ans = 0;
    ans += 1000 * (x / 500);
    x %= 500;
    ans += 5 * (x/5);
    cout << ans << endl;
}

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

#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;

int main() {
    int n, y; cin >> n >> y;
    for(int i = 0; i <= n; i++) {
        for(int j = 0; j <= n - i; j++) {
            int k = n - i - j;
            if(y == i * 10000 + j * 5000 + k * 1000) {
                cout << i << " " << j << " " << k << endl;
                return 0;
            }
        }
    }
    cout << "-1" << " " << "-1" << " " << "-1" << endl;
}


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

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;

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

constexpr int dx[4] = {-1, 0, 0, 1}, dy[4] = {0, -1, 1, 0};
constexpr int INF = 1e9;
constexpr long long LINF = 1e18;
#pragma endregion

constexpr ll mod = 1e9 + 7;

void solve() {
    int n;
    cin >> n;
    vector<ll> c(n);
    for (int i=0; i<n; i++) {
        cin >> c.at(i);
    }
    sort(c.begin(), c.end(), greater<ll>());
    ll ans = 0;
    for (ll i=0; i<n; i++) {
        ans += c.at(i) * (i+2) % mod;
        ans %= mod;
    }
    for (int i=0; i<n-1; i++) {
        ans *= 4;
        ans %= mod;
    }

    cout << ans << "\n";
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout << fixed << setprecision(20);

    solve();

    return 0;
}


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





int main(){
	int a,b;
	cin>>a>>b;
	int ans =0;
	if(a>=13)ans=b;
	if(a<=12 && a>=6)ans=b/2;
	if(a<5)ans=0;
	cout<<ans;
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
using namespace std;

#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define RFOR(i, a, b) for (int i = a; i > b; --i)
#define REP(i, n) for (int i = 0; i < n; ++i)

typedef long long ll;

const int kMaxN = 100000;
const int kMaxM = 100000-1;

int N, M;
int a[kMaxN];
int x[kMaxM], y[kMaxM];
string ans;


// ---
// union_find_tree

int par[kMaxN];
int treerank[kMaxN];

void Init(int n) {
  REP(i, n) {
    par[i] = i;
    treerank[i] = 0;
  }
}

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

void Unite(int x, int y) {
  x = Find(x);
  y = Find(y);
  if (x == y) { return; }
  if (treerank[x] < treerank[y]) {
    par[x] = y;
  } else {
    par[y] = x;
    if (treerank[x] == treerank[y]) { ++treerank[x]; }
  }
  return;
}

bool Same(int x, int y) { return Find(x) == Find(y); }

// union_find_tree
// ---


string Solve() {
  if (M == N-1) { return "0"; }
  if (N < 2*(N-M-1)) { return "Impossible"; }

  Init(N);
  REP(i, M) { Unite(x[i], y[i]); }
  map<int, priority_queue<int, vector<int>, greater<int>>> ques;
  REP(i, N) { ques[Find(i)].push(a[i]); }
  priority_queue<int, vector<int>, greater<int>> que;
  ll a = 0;
  int c = 0;
  for (auto i = ques.begin(); i != ques.end(); ++i) {
    priority_queue<int, vector<int>, greater<int>> q = i->second;
    a += q.top();
    q.pop();
    ++c;
    while (!q.empty()) {
      que.push(q.top());
      q.pop();
    }
  }
  while (c < 2*(N-M-1)) {
    a += que.top();
    que.pop();
    ++c;
  }

  return to_string(a);
}

int main() {
  cin >> N >> M;
  REP(i, N) { cin >> a[i]; }
  REP(i, M) { cin >> x[i] >> y[i]; }

  ans = Solve();

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


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

ll fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i-1] * (ll)i % mod;
        inv[i] = mod - inv[mod%i] * (mod/(ll)i) % mod;
        finv[i] = finv[i-1] * inv[i] % mod;
    }
}

ll COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % mod) % mod;
}

int main(){
  ll n, k;
  cin >> n >> k;
  ll a[n];
  rep(i,n) cin >> a[i];
  sort(a,a+n);
  ll ans = 0;
  COMinit();
  for(int i = 1; i <= n; i++) {
    (ans += COM(i-1,k-1)*a[i-1]) %= mod;
    (ans -= COM(n-i,k-1)*a[i-1]) %= mod;
  }
  cout << (ans+mod)%mod << endl;
  return 0;
}

Measured memory_bytes: 12928
//verma_ankit484

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define pb push_back
const int mod = (int) 1e9+7;

using namespace std;
//using namespace __gnu_pbds;

//#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>


int32_t main() {
  IOS
  #ifdef AV
  freopen("input.txt", "r", stdin);
  #endif
  int n;
  cin >> n;
  vector<int> vc(n);
  for (auto &i: vc) cin >> i;
  sort(vc.begin(), vc.end());
  int ans = INT_MAX;
  for (int i = 1; i <= 110; i++) {
    int sum = 0;
    for (int j = 0; j < n; j++) {
      int p = abs(i - vc[j]);
      sum += (p * p);
    }
    ans = min(ans, sum);
  }
  cout << ans << endl;
  return 0;
}


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

int main(){
  int n, q;
  cin >> n >> q;
  vector<long long> v(n);

  for(int i=0;i<n;i++) cin >> v[i];

  for(int j=0;j<q;j++){
    long long x; cin >> x;
    long long res = 0;

    int right = 0;
    long long sum = 0;
    for (int left = 0; left < n; left++ ){
      while ( right < n && sum + v[right] <= x ){
        sum += v[right];
        right++;
      }
      res += ( right - left );
      
      if( left == right ) right++;
      else sum -= v[left];
    }

    cout << res << endl;
  }
  
  return 0;
}



Measured memory_bytes: 3584
Imports System

Module Program
    Sub Main(args As String())
        Dim N As Long = Console.ReadLine()
        Dim tmpX As String() = Split(Console.ReadLine(), " ")

        Dim X As Long = 0
        Dim i As Long = 0
        For i = 0 To N - 1
            X = X + CLng(tmpX(i))
        Next

        Dim ave As Long = X / N
        Dim ans As Long = 0

        For i = 0 To N - 1
            ans = ans + (CLng(tmpX(i)) - ave) ^ 2
        Next

        Console.WriteLine(ans)
    End Sub
End Module




Measured memory_bytes: 13536
import java.util.*;
 
public class Main {

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

        boolean ok = true;

        if (S.length() == 1 || S.length() % 2 != 0) {
            System.out.println("No");
            return;
        }

        for (int i = 0; i < S.length(); i++) {
            char c = S.charAt(i);
            if (i % 2 == 0) {
                if (c != 'h') ok = false;
            } else {
                if (c != 'i') ok = false;
            }
        }
        if (ok) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }

    }

} 

Measured memory_bytes: 21844
/*
	Name:
	Author: xiaruize
	Date:
*/

#include<bits/stdc++.h>
using namespace std;
#define ull unsigned long long
#define MOD 1000000007
#define ALL(a) (a).begin(), (a).end()
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define ll long long
#define form(i,j,n) for(int i=int(j);i<=int(n);i++)
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define pis pair<int,string>
#define sec second
inline ll read() {
	ll f=1,x=0;
	char ch=getchar();
	while(!isdigit(ch))
	{
	 	if(ch=='-')
		 	f=-1;
		ch=getchar();
	}
	while(isdigit(ch))
	{
	 	x=x*10+ch-'0';
		ch=getchar();
	}
	return x*f;
}

int main()
{
 	ios::sync_with_stdio(false);
	cin.tie(0);
 	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	ll h,n;
    cin>>h>>n;
	ll a;
	ll sum=0;
	for(int i=1;i<=n;i++)
	{
		cin>>a;
		sum+=a;
	}
	if(sum>=h)
	{
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define repr(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
const ll mod = 1e9 + 7;

int main() {
  int n, ans = 0;
  string s;
  cin >> n >> s;
  rep(i, s.length() - 2) {
    if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:


        while flg:

            data = input()

            array_temp = []

            if(data != ""):
                
                array_result.append(data.split(" "))

                flg = 1

            else:

                flg = 0
    finally:


        return array_result

arr_data = getinputdata()

#0.25リットルサイズ
q = int(arr_data[0][0])

#0.5リットルサイズ
h = int(arr_data[0][1])

#1リットルサイズ
s = int(arr_data[0][2])

#2リットルサイズ
d = int(arr_data[0][3])

#買いたいicetea
n = int(arr_data[1][0])

arr = [q * 4, h * 2, s, d / 2]


if n == 1:
    
    kingaku = min(arr[0:3])
    
else:
    
    if arr.index(min(arr)) == 3:
        
        kingaku = d * (n // 2)
        n -= 2 * (n // 2)
        kingaku += n * min(arr[0:3])
    else:
        kingaku = n * min(arr)
        
    
print(kingaku)
    
    
    



Measured memory_bytes: 3064
#include <iostream>
#include <numeric>
#include <bits/stdc++.h>
using namespace std;
// long long -> lint
using lint = long long;
// fast cin and cout from hitonanode-san's code
// w/o 71 ms -> w/ 18 ms (tested on ABC148-D with C++14(GCC 5.4.1))
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;


int main(){
    // input
    int N, M;
    cin >> N >> M;

    // out
    printf( N==M ? "Yes" : "No" );
} 

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
 
#define fi first
#define se second
#define FIO {ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);}
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
 
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef long double ld;

int main(){
  FIO
  int n;
  cin>>n;
  cout<<ceil(n/2.0);
  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define SZ(x) ((int)(x).size())
typedef long long ll;
typedef long double ld;
using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cout.setf(ios::fixed); cout.precision(20);
    int s; cin >> s;
    auto get = [&](int x) {
        return (x & 1 ? 3 * x + 1 : x / 2);
    };
    set<int> were;
    int x = s;
    int res = 1;
    while (!were.count(x)) {
        res++;
        were.insert(x);
        x = get(x);
    }
    cout << res << "\n";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define srt(i) sort(i.begin(), i.end())
#define rvt(i) sort(i.begin(), i.end(), greater<int>())
 
int main() {
  int n;
  cin >> n;

  vector<pair<string, int> > pi;
  rep(i,n) {
    string s;
    int p;
    cin >> s >> p;
    pi.push_back(make_pair(s,100-p));
  }
 
  vector<pair<string, int> > pi2 = pi;
  srt(pi);

  rep(i,n) { 
    auto pair = pi.at(i);
    rep(j,n){ 
      auto pair2 = pi2.at(j);
      if(pair==pair2){
        cout << j+1 << endl;
        break;
      }
    }
  }
}

Measured memory_bytes: 256
def f(v,i):s,n=4*2**v-3,2*2**v-1;m=s/2+1;return 0 if(i<1)+(i>s)else[f(v-1,i-1),n/2+1,f(v-1,i-m)+n/2+1,n,1][(i>=m)+(i>m)+(i>=s)+(v==0)*2]
print f(*map(int,raw_input().split()))

Measured memory_bytes: 2568
n=int(input())
xu=[]
ans=0
for i in range(n):
    xutemp=list(input().split())
    xu.append(xutemp)

for i in range(n):
    if xu[i][1]=='JPY':
        ans+=int(xu[i][0])
    else:
        ans+=float(xu[i][0])*380000.0

print(ans)

Measured memory_bytes: 3060
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long int ll;
static const int MAX_N = 100;

int N;
int C[MAX_N][MAX_N];

int main(){
	scanf("%d", &N);
	for(int i = 0; i < N; i++){
		for(int j = 0; j < N; j++){
			scanf("%d", &C[i][j]);
		}
	}
	ll res = 0;
	for(int i = 0; i < N; i++){
		for(int j = 0; j < i; j++){
			res += (ll)min(C[i][j], C[j][i]);
		}
	}
	printf("%lld\n", res);
	return 0;
}



Measured memory_bytes: 2784
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() { 
  ios::sync_with_stdio(false); cin.tie(0);
  //b
  int n, k;
  cin >> n >> k;
  int ans = 0;
  for (int i = 0; i < n; i++) {
    int h;
    cin >> h;
    ans += h >= k;
  }
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
constexpr auto X_max = 1'000'000;

int solve (int x){
  if (x >= 2100)
    return 1;
  auto n = x/100;
  if (x <= n * 105)
    return 1;
  return 0;
}

int main(){
  int x;
  cin >> x;
  cout << solve(x);
  return 0;
}

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

#define pi acos(-1)


int main() {
  int n,m; cin >>n>>m;
  if (n==1&&m==0) {
    cout << 0 << endl;
    return 0;
  }

  vector<int> res(n, -1);
  for (int i = 0; i < m; i++) {
    int s,c; cin >> s >> c;
    if ((n!=1&&s==1&&c==0) || (res[s-1] != -1 && res[s-1] != c)) {
      cout << -1 << endl;
      return 0;
    }
    res[s-1] = c;
  }
  if (res[0] == -1 || res[0] == 0) res[0] = (n==1?0:1);
  int ans = 0;
  for (auto i : res) {
    ans = ans*10 + (i<0?0:i);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3596
///
// File:  1277.cpp
// Author: ymiyamoto
//
// Created on Mon Dec 11 22:08:53 2017
//

#include <algorithm>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <vector>

using namespace std;

int32_t main()
{
  while (true) {
    uint32_t N, T, L, B;
    cin >> N >> T >> L >> B;

    if (N == 0) break;

    vector<uint32_t> lose(L);
    for (uint32_t i = 0; i < L; i++) {
      cin >> lose[i];
    }

    vector<uint32_t> back(B);
    for (uint32_t i = 0; i < B; i++) {
      cin >> back[i];
    }

    vector<vector<double>> dp(T + 1, vector<double>(N + 1, 0.0));
    dp[0][0] = 1;
    for (uint32_t i = 0; i < T; i++) {
      for (uint32_t j = 0; j < N; j++) {
        for (uint32_t k = 1; k <= 6; k++) {
          uint32_t next;
          if (j + k <= N) {
            next = j + k;
          } else {
            next = 2 * N - (j + k);
          }

          if (find(lose.begin(), lose.end(), next) != lose.end()) {
            if (i + 2 <= T) {
              dp[i + 2][next] += dp[i][j] / 6;
            }
          } else if (find(back.begin(), back.end(), next) != back.end()) {
            dp[i + 1][0] += dp[i][j] / 6;
          } else {
            dp[i + 1][next] += dp[i][j] / 6;
          }
        }
      }
      dp[i + 1][N] += dp[i][N];
    }

    cout << fixed << setprecision(6);
    cout << dp[T][N] << endl;
  }

  return 0;
}

Measured memory_bytes: 3372
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int g=0;
  int p=0;
  int w=0;
  int y=0;
  cin >> N;
  string s;
  
  for (int i=0; i<N; i++) {
    cin >> s;
    if (s == "G") {
      g = 1; 
    }
    if (s == "P") {
      p = 1; 
    }
    if (s == "W") {
      w = 1; 
    }
    if (s == "Y") {
      y = 1; 
    }
  }
  
  int x=g+p+w+y;
  if (x== 4) {
    cout << "Four" << endl;
  }
  else {
    cout << "Three" << endl;
  }
    
}

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

using namespace std;

typedef long long ll;

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    ll a, b;
    cin >> n >> a >> b;
    ll fatigue = 0;
    ll prev = 0;
    for (int i = 0; i < n; ++i) {
        ll x;
        cin >> x;
        if (i) {
            fatigue += min(a * (x - prev), b);
        }
        prev = x;
    }
    cout << fatigue;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main()
{
	int n;
	int i;
	int East,West,South,North,Top,Bottom;
	while(scanf("%d",&n),n)
	{
		int East=3,West=4,South=2,North=5,Top=1,Bottom=6;
		int sum = 1;
		char command[6];
		int tmp;
		for(i = 0;i < n;i++)
		{
			scanf("%s",command);
			if(strcmp(command,"East") == 0)
			{
				tmp = Top;
				Top = West;
				West = Bottom;
				Bottom = East;
				East = tmp;
			}
			else if(strcmp(command,"West") == 0)
			{
				tmp = Top;
				Top = East;
				East = Bottom;
				Bottom = West;
				West = tmp;
			}
			else if(strcmp(command,"South") == 0)
			{
				tmp = Top;
				Top = North;
				North = Bottom;
				Bottom = South;
				South = tmp;
			}
			else if(strcmp(command,"North") == 0)
			{
				tmp = Top;
				Top = South;
				South = Bottom;
				Bottom = North;
				North = tmp;
			}
			else if(strcmp(command,"Left") == 0)
			{
				tmp = South;
				South = West;
				West = North;
				North = East;
				East = tmp;
			}
			else
			{
				tmp = South;
				South = East;
				East = North;
				North = West;
				West = tmp;
			}
			sum += Top;
		}
		printf("%d\n",sum);
	}
	return 0;
}

Measured memory_bytes: 0
import java.util.*;
public class Main {
	
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        
        int ans = 0;
        int now = sc.nextInt();
        int max = Integer.MAX_VALUE;
        for (int i = 1; i < N; i++) {
        	int a = sc.nextInt();
        	if (a == now) {
        		ans++;
        		now = max;
        	} else {
        		now = a;
        	}
        }
        
        System.out.println(ans);
    }
}

Measured memory_bytes: 23636
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int main(int argc,char *argv[]){
  int h;
  int w;
  char snk[10];
  int tate=0;
  int sharp=0;
  char ansx='A',ansy=1;
  char isrd = 0;
  short int wch[10][10];
  memset(wch,0,sizeof(wch));
  int i;
  int j;
  scanf("%d",&h);
  scanf("%d",&w);
  for(j=0;j < h;j++){
    for(i = 0;i < w;i++){
      scanf("%s",snk);
      if(!strcmp("snuke",snk)){
	isrd = 1;
	break;
      }
      ansx++;
    }
    if(isrd)break;
    ansx='A';
    ansy++;
  }
  printf("%c%d",ansx,ansy);
  return 0;
}


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

int main(){
  string S, T;
  cin >> S >> T;

  int min = 9999999;
  for (int i = 0; i < S.size() - T.size() + 1; i++){
    int cnt = 0;
    for (int j = 0; j < T.size(); j++){
      if (S.at(i + j) != T.at(j)){
        cnt += 1;
      }
    }
    if (cnt < min) min = cnt;
  }

  cout << min << endl;
}

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define int ll
#define pb push_back
#define setbits(x)          __builtin_popcountll(x)
#define endl "\n"
typedef long long ll;
ll gcd(ll a,ll b)
{
	//Write your code here
    if(b==0)
        return a;
    return gcd(b,a%b);
}


int32_t main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n,m;
cin>>n>>m;
int arr[n];
for(int i=0;i<n;i++)
    cin>>arr[i];
    set<int> s;
for(int i=0;i<n;i++)
{
    int val=0;
    while(arr[i]%2==0)
    {
        arr[i]/=2;
        val++;
    }
    s.insert(val);
}
if(s.size()!=1)
{
    cout<<0<<endl;
    return 0;
}

int ans=0;
int val=(*(s.begin()));
val-=1;
int cnt=1;
while(val--)
{
    cnt*=2;
}
val=cnt;
int res=pow(10,18);

for(int i=0;i<n;i++)
{
    int g=gcd(arr[i],val);
    int r=res/arr[i];
    val*=arr[i];

    val/=g;
    if(val>m)
    {
        cout<<0<<endl;
        return 0;
    }
}
ans=m/val;
ans+=1;
ans/=2;
cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <tuple>
#include <vector>
#include <string>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <cassert>

using namespace std;
using ll = long long;

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()
{
    string s;
    cin >> s;
    for(int i = 0; i < s.size(); i++){
        if(s[i] == ',') s[i] = ' ';
    }
    cout << s << endl;
    return 0;
}

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

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	int n;
	cin >> n;
	vector<int> arr(n);
	for(int& x : arr) cin >> x;
	int ans = 0;
	sort(arr.begin(), arr.end());
	
	for(int i = 0; i < n; i++) {
		for(int j = i + 1; j < n; j++) {
			int a = arr[i], b = arr[j];
			ans += lower_bound(arr.begin()+j+1, arr.end(), a + b) 
					- upper_bound(arr.begin()+j+1, arr.end(), b - a);
			//$ ans--;
		}
	}
	
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <stdio.h>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional> //operator[]
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;

signed main(){
    int a,b,m; cin >> a >> b >> m;
    vector<ll> aa(a),bb(b);
    rep(i,a) cin >> aa[i];
    rep(i,b) cin >> bb[i];
    ll ans=10010010010;
    rep(i,m){
        int x,y,c; cin >> x >> y >> c;
        x--; y--;
        chmin(ans,aa[x]+bb[y]-c);
    }
    sort(ALL(aa));
    sort(ALL(bb));
    chmin(ans,aa[0]+bb[0]);
    cout << ans;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
const double pi=3.14159265358979323846;
int ctoi(const char c) {
    if ('0' <= c && c <= '9') return (c - '0');
    return -1;
}
vector<int> input(int n) {
    vector<int> vec(n);
    for (int i = 0; i < n; i++) {
        cin >> vec.at(i);
    }
    return vec;
}
void output(vector<int> vec) {
    for (int i = 0; i < vec.size(); i++) {
        cout << vec[i] << " ";
    }
    return;
}
vector<vector<int>> input(int n, int m) {
    vector<vector<int>> table(n, vector<int>(m));
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            cin >> table. at(i).at(j);
        }
    }
    return table;
}
void output(vector<vector<int>> table) {
    for (int i = 0; i < table.size(); i++) {
        for (int j = 0; j < table.at(0).size(); j++) {
            cout << table.at(i).at(j) << " ";
        }
        cout << endl;
    }
}
long long perm(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long perm = 1;
    for (int i = n; i > n - r; i--) {
        perm *= i;
    }
    return perm;
}
long long comb(int n, int r) {
    if (n < r) {
        cout << "error" << endl;
        return 0;
    }
    long long comb = perm(n,r);
    for (int i = r; i > 0; i--) {
        comb /= i;
    }
    return comb;
}
long long homo(int n, int r) {
    return comb(n + r - 1, n - 1);
}
long long fact(int n) {
    long long fact = 1;
    for (int i = n; i > 0; i--) {
        fact *= i;
    }
    return fact;
}
int gcd(int a, int b){
    if (a % b == 0){
        return(b);
    }else{
        return(gcd(b, a % b));
    }
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
bool isprime(int n){
    if (n < 2) return false;
    else if (n == 2) return true;
    else if (n % 2 == 0) return false;

    for (int i = 3; i <= sqrt(n); i += 2){
        if (n % i == 0){
            return false;
        }
    }
    return true;
}
void sayYes(bool f) {
    if (f) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}
void sayYES(bool f) {
    if (f) {
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }
}

int main() {
  int a,b;
  cin >> a >> b;
  cout << a*b << endl;
}


Measured memory_bytes: 3728
#include<stdio.h>

int main (void)
{
  long long int a,b,v,w,t;
  
  scanf("%lld %lld %lld %lld %lld", &a,&v,&b,&w,&t);
  
  if(a<b){
    if(a+v*t >= b+w*t)
      printf("YES");
    else
      printf("NO");
  }else{
    if(a+v*t*-1 <= b+w*t*-1 && b<a)
        printf("YES");
    else
        printf("NO");
  }
  
  return 0;
}


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

int main() {
  int n, S = 0;
  string s;
  cin >> n >> s;
  for(int i = 0;i < n - 2;i++) {
    if(s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') S++;
  }
  cout << S << endl;
}

Measured memory_bytes: 3624
import java.util.*;

class Main {

    static int gcd(int a, int b) {
        return b > 0 ? gcd(b, a % b) : a;
    }

    static int lcm(int a, int b) {
        return a * b / gcd(a, b);
    }

    public static void main(String[] args) {

        long res = 0;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();

        boolean[] flg = new boolean[n + 1];
        long[] h = new long[n + 1];
        for (int i = 1; i <= n; i++) {
            flg[i] = true;
            h[i] = sc.nextLong();
        }

        for (int i = 0; i < m; i++) {
            int a = sc.nextInt();
            int b = sc.nextInt();
            if (h[a] > h[b]) {
                flg[b] = false;
            } else if (h[a] < h[b]) {
                flg[a] = false;
            } else {
                flg[a] = false;
                flg[b] = false;
            }
        }
        for (int i = 1; i <= n; i++) {
            if (flg[i]) {
                res++;
            }
        }

        System.out.println(res);
        sc.close();
    }
}


Measured memory_bytes: 61000
def Collatz(n) :
    if n % 2 == 0 :
        return n // 2
    else :
        return n * 3 + 1

while True :
    n = int(input())
    if n == 0 :
        break
    
    count = 0
    while n != 1 :
        n = Collatz(n)
        count += 1
    print(count)


Measured memory_bytes: 5588
A, B, m = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
ans = 1e18
ans = min(a) + min(b)
for i in range(m):
  x, y, c = list(map(int, input().split()))
  x -= 1
  y -= 1
  ans = min(ans, a[x]+b[y]-c)
print(ans)

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

const int maxN = 55;
const int maxB = 18;
typedef long long ll;

int A[maxN], as[maxB];
ll C[maxN][maxN], ans;
map<int, int> M;

void init(){
	int i, j;
	for(i = 0; i < maxN; ++i)
		for(C[i][0] = C[i][i] = j = 1; j < i; ++j)
			C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
	for(i = 0; i < maxN; ++i)
		for(j = 2; j < maxN; ++j)
			C[i][j] += C[i][j - 1];
}

int main (){
	int n, k, S, T, i, j, c = 0, b, a;
	scanf("%d%d%d%d", &n, &k, &S, &T);
	for(init(), i = 0; i < n; ++i) scanf("%d", A + i);
	for(i = 0; i < maxB; ++i){
		b = 1 << i;
		if((S & b) && !(T & b)) { puts("0"); return 0; }
		if(!(S & b) && (T & b)) as[c++] = i;
		else { for(j = a = 0; j < n; ++j) if((A[j] & b) + (S & b) != b) A[a++] = A[j]; n = a; }
	}
	for(b = 0; b < (1 << c); ++b){
		int sgn = 1, s = 0;
		for(i = 0; i < c; ++i) if(b & (1 << i)) s |= (1 << as[i]), sgn *= -1;
		for(M.clear(), i = 0; i < n; ++i) ++M[A[i] & s];
		for(auto it : M) ans += sgn * C[it.second][k];
	}
	printf("%lld\n", ans);
	return 0;
}


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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

int N, Q;
std::vector<int> G[200100];
ll cnt[400100];
int l[200100], r[200100];
int p, x;

void dfs(int v, int p, int &c){
    l[v] = c;
    c += 1;

    for(int w : G[v]){
        if(w == p){continue;}
        dfs(w, v, c);
    }

    r[v] = c;
    c += 1;
}

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

  std::cin >> N >> Q;

  for(int i=0;i<N-1;++i){
      int A, B;
      std::cin >> A >> B;

      G[A].emplace_back(B);
      G[B].emplace_back(A);
  }

  int c = 0;
  dfs(1, -1, c);

  for(int i=0;i<Q;++i){
      std::cin >> p >> x;

      cnt[l[p]] += x;
      cnt[r[p]] -= x;
  }

  for(int i=1;i<c;++i){
      cnt[i] += cnt[i-1];
  }

  for(int i=1;i<=N;++i){
      std::cout << cnt[l[i]] << " \n"[i == N];
  }
}


Measured memory_bytes: 30592
#include <iostream>

using namespace std;

int main() {
  int n, t;
  cin >> n >> t;
  
  int ans = 0;
  int d = 0;
  int nt = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    ans += min(t, x - nt);
    nt = x;
  }

  cout << ans + t << endl;

  return 0;
}

Measured memory_bytes: 256
def nearest_int(f):
  if f - int(f) < 0.5:
    return int(f)
  else:
    return int(f) + 1

N = int(input())
X = list(map(lambda x: int(x), input().split(" ")))
ave = sum(X) / N
avei = nearest_int(ave)

print(sum([(x - avei) ** 2 for x in X]))

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

using namespace std;

typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll, ll> pii;
typedef vector<pii> vpii;

int main() {
  ll N;
  cin >> N;

  vi X(N), Y(N);
  for (ll i = 0; i < N; i++) cin >> X[i] >> Y[i];

  for (ll i = 0; i < N - 1; i++) {
    if ((X[i] + Y[i] + X[i + 1] + Y[i + 1]) % 2 != 0) {
      cout << -1 << endl;
      return 0;
    }
  }

  bool flag = false;

  if ((X[0] + Y[0]) % 2 == 0) {
    flag = true;
  }

  ll m = 31;

  if (flag) {
    cout << m + 1 << endl;
    cout << 1;
    for (ll i = 0; i < m; i++) {
      cout << ' ' << (1ll << i);
    }
    cout << endl;

    for (ll i = 0; i < N; i++) {
      X[i] -= 1;
    }
  } else {
    cout << m << endl;
    for (ll i = 0; i < m; i++) {
      if (i > 0) {
        cout << ' ';
      }

      cout << (1ll << i);
    }
    cout << endl;
  }

  for (ll i = 0; i < N; i++) {
    ll x = X[i], y = Y[i];
    ll u = x + y, v = x - y;
    vi v1(m, 1), v2(m, 1);

    {
      ll k = (1ll << m) - 1 - u;
      for (ll j = m - 1; j >= 0; j--) {
        if (k >= (1ll << j) * 2) {
          k -= (1ll << j) * 2;
          v1[j] = -1;
        }
      }
    }

    {
      ll k = (1ll << m) - 1 - v;
      for (ll j = m - 1; j >= 0; j--) {
        if (k >= (1ll << j) * 2) {
          k -= (1ll << j) * 2;
          v2[j] = -1;
        }
      }
    }

    string s;

    if (flag) {
      s += 'R';
    }

    for (ll j = 0; j < m; j++) {
      if (v1[j] == 1) {
        if (v2[j] == 1) {
          s += 'R';
        } else {
          s += 'U';
        }
      } else {
        if (v2[j] == 1) {
          s += 'D';
        } else {
          s += 'L';
        }
      }
    }

    cout << s << endl;
  }
}


Measured memory_bytes: 256
#include<iostream>
#include<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<stdio.h>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;
double dat[100][100];
int dp[6][1010];//動的計画法
int prime[10000001];
char str[1010][1010];
vector<pair<int,int> > pc[100001];
int ABS(int a){return max(a,-a);}
int main(){
	int a,b;
	cin>>a>>b;
	if(a==b) cout<<"Draw"<<endl;
	else if(a==1||b==1){
		if(a==1) cout<<"Alice"<<endl;
		else cout<<"Bob"<<endl;
	}else if(a<b) cout<<"Bob"<<endl;
	else cout<<"Alice"<<endl;
	return 0;
}

Measured memory_bytes: 4352
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>
#include<cassert>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define rep(i,s,n) for(int i=(s); i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))
#define print(x) printf("%d\n",x)

using namespace std;

typedef unsigned int uint;
typedef long long ll;

const int _dx[] = {0,1,0,-1};
const int _dy[] = {-1,0,1,0};

int getInt(){
  int ret = 0,c;
  c = getchar();
  while(!isdigit(c)) c = getchar();
  while(isdigit(c)){
    ret *= 10;
    ret += c - '0';
    c = getchar();
  }
  return ret;
}

int dp[1<<6][120];

int main(){
  int m,n,k,d;
  while(scanf("%d%d%d%d",&m,&n,&k,&d), m+n+k+d){
    int cal[m];

    vector<vector<pair<int,int> > > l(n+m+2);
    //REP(i,n+m+2) REP(j,n+m+2) l[i][j] = 0;

    REP(i,m) scanf("%d ",&cal[i]);

    REP(i,d){
      char at[10],bt[10];
      int aa,bb,dd;
      int s,t;
      scanf("%s %s %d ",at,bt,&dd);
      if(at[0] == 'H')
        s = 0;
      else if(at[0] == 'D')
        s = 1;
      else{
        sscanf(at+1,"%d",&aa);
        if(at[0] == 'C') s = aa + 1;
        else         s = aa + m + 1;
      }

      if(bt[0] == 'H')
        t = 0;
      else if(bt[0] == 'D')
        t = 1;
      else{
        sscanf(bt+1,"%d",&bb);
        if(bt[0] == 'C') t = bb + 1;
        else         t = bb + m + 1;
      }

      //l[s][t] = l[t][s] = dd;
      //printf("s=%d t=%d dd=%d\n",s,t,dd);
      l[s].push_back(mp(t,dd*k));
      l[t].push_back(mp(s,dd*k));
    }

    REP(i,1<<m) REP(j,n+m+2) dp[i][j] = INT_MAX;

    typedef pair<int,pair<int,int> > data;
    priority_queue<data,vector<data>,greater<data> > q;
    q.push(mp(0,mp(0,0)));

    while(q.size()){
      data dd = q.top();
      int cost = dd.f;
      int pos  = dd.s.f;
      int flag = dd.s.s;

      //printf("cost:%d pos:%d flag:%d\n",cost,pos,flag);

      q.pop();

      if(pos < m + 2 && pos > 1){
        int pp = pos - 2;
        if((flag & (1 << pp)) != 0)
          continue;
      }

      if(dp[flag][pos] < cost) continue;
      dp[flag][pos] = cost;

      if(pos < m + 2 && pos > 1){
        int pp = pos - 2;
        if((flag & (1 << pp)) == 0){
          cost -= cal[pp];
          flag |= (1 << pp);
        }
      }

      FOR(it,l[pos]){
        int next = it->f;
        int cc   = it->s;

        //printf("cc = %d\n",cc);

        if(dp[flag][next] > cost + cc)
          q.push(mp(cost + cc, mp(next, flag)));
      }
    }

    int ans = INT_MAX;
    REP(i,1<<m) ans = min(ans, dp[i][1]);

    print(ans);
  }
  return 0;
}

Measured memory_bytes: 1676
a = input().split()
a = [int(i) for i in a]
amax = a[0]
count = 0
for i in range(1,3):
    if a[i] > amax:
        amax = a[i]
        count = i
    else:
        pass
a.pop(count)
print(amax*10+a[0]+a[1])

Measured memory_bytes: 3060
#include<iostream>
#include<math.h>
#include<string.h>
#include<vector>
#include<algorithm>
#include<iomanip>
using namespace std;

int main(){
	long n;
	cin >> n;
	vector<long long> a(n,0);
	
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	
	sort(a.begin(),a.end(),greater<int>());
	
	for(int i=0;i<a.size();i++){
		if(a[i]==a[i+1]){
			a[i]=0;
			a[i+1]=0;
			//i=i+2;
		}
	}

	sort(a.begin(),a.end(),greater<int>());
	
	int cnt=0;
	for(int i=0;i<n;i++){
		if(a[i]!=0)cnt++;
	}		
	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 1024
def solver(a, b, c, d, e, f)
  if a * b * d * e != 0
    return ((c - f * (b / e)) / (a - d * (b / e))), ((c - f * (a / d)) / (b - e * (a / d)))
  else
    if a == 0
      return ((f - e * (c / b)) / d), (c / b)
    elsif b == 0
      return (c / a), ((f - d * (c / a)) / e)
    elsif d == 0
      return ((c - b * (f / e)) / a), (f / e)
    else
      return (f / d), ((c - a * (f / d)) / b)
    end
  end
end

gets.to_i.times do
  a, b, c, d, e, f = gets.split(" ").map(&:to_f)
  x, y = solver(c - a, d - b, (c ** 2 - a **2 + d ** 2 - b ** 2) / 2, c - e,d - f, (c ** 2 - e ** 2 + d ** 2 - f ** 2) / 2)
  puts [sprintf("%.3f", x), sprintf("%.3f", y), sprintf("%.3f", ((x - a) ** 2 + (y - b) ** 2) ** 0.5)].join(" ")
end

Measured memory_bytes: 6224
//----------------------------templates
    #pragma GCC optimize ("Ofast")
    #pragma GCC target ("tune=native")
    #pragma GCC target ("avx")
    //----------------------------
    #include <bits/stdc++.h>
    using namespace std;

    typedef long long ll;
    typedef unsigned long long ull;
    #define int ll

    #define FOR(i,j,n) for (int i=(int)(j);i<(n);i++)
    #define REP(i,n) for (int i=0;i<(int)(n);i++)
    #define REPS(i,n) for (int i=1;i<=(int)(n);i++)
    #define REPN(i,n) for (int i=(int)(n)-1;i>=0;i--)
    #define REPNS(i,n) for (int i=(int)(n);i>0;i--)

    #define I(n) scanf("%lld", &(n))
    #define LL(n) scanf("%lld", &(n))
    #define pb(n) push_back((n))
    #define mp(i,j) make_pair((i),(j))
    #define eb(i,j) emplace_back((i),(j))
    #define y0 y3487465
    #define y1 y8687969
    #define j0 j1347829
    #define j1 j234892
    #define uniq(v) v.erase( unique(v.begin(), v.end()), v.end() )

    #define all(x) (x).begin(),(x).end()
    #define sz(x) ((int)(x).size())

    typedef vector<int> vi;
    typedef pair<int,int> pi;
    typedef vector<pi> vpi;
    typedef vector<vi> vvi;
    typedef vector<vpi> vvpi;
    typedef vector<vvi> vvvi;

    const int mod = 1000000007;

//--------------------------------------------

int n;
signed main(){
    I(n);
    vi l(n);
    REP(i,n) I(l[i]);
    sort(all(l));
    int ans = 0;
    REP(i,n) FOR(j,i+1,n){
        ans += max(0LL, (int)(lower_bound(all(l), l[i] + l[j]) - l.begin()) - j - 1);
    }
    cout << ans << endl;
}

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

using namespace std;

/**/
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define wt(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define wt(x...)
#endif
/**/

#define LL long long
const int MAXN = 212345;
const int INF  = 0x3f3f3f3f;



int main () {

	ios_base::sync_with_stdio(false);  cin.tie(NULL); 

	int a;
	string s;
	cin >> a >> s;

	if (a >= 3200) cout << s << endl;
	else cout << "red" <<endl;



	return 0;
}



Measured memory_bytes: 256
using System;
 
class Program {
	static void Main(string[] args) {
		string input = Console.ReadLine();
		string[] inputs = input.Split(' ');
		
		int number = int.Parse(inputs[0]);
		int height = int.Parse(inputs[1]);
		int width = int.Parse(inputs[2]);
	    int count = 0;
		
		for (int i = 0; i < number; i++) {
		    input = Console.ReadLine();
		    inputs = input.Split(' ');
		    int h = int.Parse(inputs[0]);
		    int w = int.Parse(inputs[1]);
		    
		    if ((h >= height) && (w >= width)) count++;
		}
		
		string output = count.ToString();
		Console.WriteLine(output);
	}
}

Measured memory_bytes: 13140