akhauriyash/Code-Regression huggingface dataset:
// template version 1.11
using namespace std;
#include <iostream>
#include <bits/stdc++.h>

// varibable settings {{{
#define infile "../test/sample-1.in"
#define int long long
const int INF=1e18;
const int MOD=1e9+7;
// }}}

// define basic macro {{{
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ub upper_bound
#define lb lower_bound
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

#if defined(PCM) || defined(LOCAL)
  #include "lib/dump.hpp"
#else
  #define dump(...) 42
  #define dump_1d(...) 42
  #define dump_2d(...) 42
#endif
//}}}

int solve(){
  int n,a,b,c,d;cin>>n>>a>>b>>c>>d;
  a--;b--;c--;d--;
  string s;cin>>s;

  if (c < b){
    rep(i, a+1, c-1){
      if (s[i]=='#' and s[i+1]=='#'){
        cout << "No" << endl;
        return 0;
      }
    }
    rep(i, b+1, d-1){
      if (s[i]=='#' and s[i+1]=='#'){
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  }

  else if (c<d){
    rep(i, a+1, d-1){
      if (s[i]=='#' and s[i+1]=='#'){
        cout << "No" << endl;
        return 0;
      }
    }
    cout << "Yes" << endl;
    return 0;
  }
  else if (d<c){
    rep(i, a+1, c-1){
      if (s[i]=='#' and s[i+1]=='#'){
        cout << "No" << endl;
        return 0;
      }
    }

    rep(i, b-1, d){
      if (s[i]=='.' and s[i+1]=='.' and s[i+2]=='.'){
        cout << "Yes" << endl;
        return 0;
      }
    }
    cout << "No" << endl;
    return 0;
  }
  else{
    assert(false);
  }
  return 0;
}

signed main() { //{{{
#ifdef INPUT_FROM_FILE
  std::ifstream in(infile);
  std::cin.rdbuf(in.rdbuf());
#endif
  solve();
  return 0;
} //}}}


Measured memory_bytes: 592
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

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

int main(){
  ll n,d;
  cin>>n>>d;
  
  ll cnt=0,x,y;
  rep(i,n){
    cin>>x>>y;
    if(x*x+y*y<=d*d) cnt++;
  }
  
  cout<<cnt<<endl;

  return 0;
}

Measured memory_bytes: 3556
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
using namespace std;
#define MOD @
#define ADD(X,Y) ((X) = ((X) + (Y)%MOD) % MOD)
typedef long long i64; typedef vector<int> ivec; typedef vector<string> svec;

typedef bitset<1000002> bs;

int N, K;
string S[2020];
string Sc;
int idx[2020];

char in[1010101];

bool dp[2020][10101];
bs state;

bs finder[64];

char smallest()
{
	int pos = 1;
	while (pos < 32) {
		if ((state & finder[pos * 2]).none()) pos = pos * 2 + 1;
		else pos *= 2;
	}
	return (pos - 32) + 'a';
}

int main()
{
	/*
	bitset<1000005> bs;
	bs.set(1, true);
	int a = 0;
	for (int i = 0; i < 100000; ++i) {
		bs = bs & bs;
		a += bs.none() ? 1 : 0;
	}
	printf("%d\n", a);

	return 0;
	*/

	scanf("%d%d", &N, &K);
	for (int i = 0; i < N; ++i) {
		scanf("%s", in);
		S[i] = in;
	}

	dp[N][0] = true;
	for (int i = N - 1; i >= 0; --i) {
		for (int j = 0; j <= K; ++j) if (dp[i + 1][j]) {
			dp[i][j] = true;
			if (j + S[i].size() <= K) dp[i][j + S[i].size()] = true;
		}
	}
	for (int i = 0; i < N; ++i) {
		idx[i] = Sc.size();
		for (char c : S[i]) Sc.push_back(c);
	}
	idx[N] = Sc.size();

	for (int i = 0; i < 64; ++i) finder[i].reset();
	for (int i = 0; i < Sc.size(); ++i) {
		finder[Sc[i] - 'a' + 32].set(i);
	}
	for (int i = 31; i >= 1; --i) finder[i] = finder[i * 2] | finder[i * 2 + 1];

	state.reset();
	state.set(0, true);

	string ret;

	for (int i = 0; i < K; ++i) {
		for (int j = 0; j < N; ++j) {
			if (state[idx[j]]) state.set(idx[j + 1]);
		}
		for (int j = 0; j < N; ++j) {
			if (K - i - (int)S[j].size() < 0 || !dp[j + 1][K - i - S[j].size()]) state.reset(idx[j]);
		}

		char nxt = smallest();
		ret.push_back(nxt);
	//	printf("%d %c %d\n", i, nxt, (int)nxt);
		state &= finder[(nxt - 'a') + 32];
		state <<= 1;
	}

	puts(ret.c_str());

	return 0;
}


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

const int mxN=3000;
int n, a[mxN];
long long dp[mxN+1][mxN+1];

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

	cin >> n;
	for(int i=0; i<n; ++i)
		cin >> a[i];
	for(int i=n-1; i>=0; --i) {
		for(int j=i+1; j<=n; ++j) {
			dp[i][j]=max(a[i]-dp[i+1][j], a[j-1]-dp[i][j-1]);
		}
	}
	cout << dp[0][n];
}


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

int main(){
	int a, b, c, d;
  	cin >> a >> b >> c >> d;
  	
  	ll ans = (ll)a * c;
  	ans = max(ans, (ll)a*d);
    ans = max(ans, (ll)b*c);
  	ans = max(ans, (ll)b*d);
  
  	cout << ans << endl;
}

Measured memory_bytes: 3632
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        if (s.charAt(0) == s.charAt(2)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 21972
from sys import stdin


def main():
    readline = stdin.readline
    read = stdin.read
    N, Q = map(int, readline().split())
    S = readline().strip()
    LR = [int(x) - 1 for x in  read().split()]
    AC = []
    pre = None
    cnt = 0
    for c in S:
        if c == "A":
            pre = "A"
        elif pre == "A" and c == "C":
            cnt += 1
            pre = None
        elif pre == "A":
            pre = None
        AC.append(cnt)
    for l, r in zip(*[iter(LR)] * 2):
        print(AC[r] - AC[l])
    return


main()


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

int main()
{
    int n;
    cin>>n;
    int a[n];
    int sum =0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        sum += a[i];
    }
    sum /= n;
    int sum1 = sum+1;
    int ans =0;
    int ans2 = 0;
    for(int i=0;i<n;i++)
    {
        ans += ( sum - a[i] )*( sum - a[i] );
        ans2 += ( sum1 -a[i])*( sum1 -a[i] );
    }
    cout<<min( ans , ans2);
}

Measured memory_bytes: 3576
#include<stdio.h>
int a[10001][10001];
int d[10001];
int pi[10001];
char color[10001];
int n,mincost;

void dijkstra(void);

int main(){
  int i,j,u,k,v;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      a[i][j]=0;
    }
  }

  for(i=0;i<n;i++){
    scanf("%d %d" ,&u,&k);      
  for(j=1;j<=k;j++){
     scanf("%d",&v);
     scanf("%d",&a[u][v]);   
    }
  }
  dijkstra();

  for(i=0;i<n;i++){
    printf("%d %d\n",i,d[i]);
  }

  return 0;
}

void dijkstra(void){
  int i,j,u;
  for(i=0;i<n;i++){
    d[i]=100000000;
    pi[i] = -1;
    color[i]='W';
  }
  d[0]=0;
  while(1){
    mincost = 50000000;
    for(i=0;i<n;i++){
      if(color[i]!='B' && d[i] < mincost){
	mincost = d[i];
        u = i;
      }
    }
    if(mincost==50000000) break;
    color[u]='B';
  
  for(i=0;i<n;i++){
    if(color[i]!='B' && a[u][i]!=0  && d[u]+a[u][i]<d[i]){
      pi[i] = u;
      d[i]=d[u]+a[u][i];
     }
  }
  }
}

Measured memory_bytes: 2884
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <chrono>
#include <queue>
#include <functional>

using namespace std;

typedef long long ll;

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

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

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

    vector<int> B(N);
    vector<int> C(N);

    B[0] = A[0];
    C[N - 1] = A[N - 1];

    for (int i = 1; i < N; ++i) {
        B[i] = gcd(B[i - 1], A[i]);
        C[N - 1 - i] = gcd(C[N - i], A[N - 1 - i]);
    }

    int ans = max(C[1], B[N - 2]);

    for (int i = 1; i < N - 1; ++i) {
        ans = max(ans, gcd(B[i - 1], C[i + 1]));
    }

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

Measured memory_bytes: 1408
/*
{By GWj

*/
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define rb(a,b,c) for(int a=b;a<=c;++a)
#define rl(a,b,c) for(int a=b;a>=c;--a)
#define LL long long
#define IT iterator
#define PB push_back
#define II(a,b) make_pair(a,b)
#define FIR first
#define SEC second
#define FREO freopen("check.out","w",stdout)
#define rep(a,b) for(int a=0;a<b;++a)
#define SRAND mt19937 rng(chrono::steady_clock::now().time_since_epoch().count())
#define random(a) rng()%a
#define ALL(a) a.begin(),a.end()
#define POB pop_back
#define ff fflush(stdout)
#define fastio ios::sync_with_stdio(false)
#define R(a) cin>>a
#define R2(a,b) cin>>a>>b
#define check_min(a,b) a=min(a,b)
#define check_max(a,b) a=max(a,b)
using namespace std;
const int INF=0x3f3f3f3f;
typedef pair<int,int> mp;
/*}
*/
const int MAXN=100000+20;
int dp[MAXN][2];
vector<int> g[MAXN];
int n,m;
int save=0;
int main(){
	fastio;
	R2(n,m);
	rb(i,1,m){
		int u,v;
		R2(u,v);
		g[u].PB(v);
		g[v].PB(u);
	}
	set<pair<int,pair<int,bool> >> heap;
	memset(dp,63,sizeof(dp));
	rb(i,1,n)
		dp[i][0]=i,heap.insert(II(i,II(i,0)));
	while(!heap.empty()){
		pair<int,pair<int,bool> > now=*heap.begin();
		heap.erase(heap.begin());
		int i,j,val;
		i=now.SEC.FIR;
		j=now.SEC.SEC;
		val=now.FIR;
		if(dp[i][j]!=val) continue;
		for(auto it:g[i]){
			if(dp[it][j^1]>dp[i][j]){
				dp[it][j^1]=dp[i][j];
				heap.insert(II(val,II(it,j^1)));
			}
		}
	}
	int N=0;
	rb(i,1,n){
		N+=g[i].empty();
	}
	int save1=0,save0=0,save3=0;
	rb(i,1,n){
		if(g[i].size()){
			if(dp[i][0]==i){
				save3+=dp[i][1]>=i;
				save0++;
			}
			if(dp[i][1]>=i){
				save1++;
			}
		}
		
	}
	LL rest=1ll*N*n*2-1ll*N*N;
	rb(i,1,n){
		if(g[i].size())
		if(min(dp[i][0],dp[i][1])==i){
			if(dp[i][0]==i&&dp[i][1]==i){
				rest+=save3;
			}
			else{
				rest+=save0;
			}
		}
	}
	cout<<rest<<endl;
	return 0;
}

Measured memory_bytes: 22120
#include <bits/stdc++.h>
#define fo(a,b,c) for (a=b; a<=c; a++)
#define fd(a,b,c) for (a=b; a>=c; a--)
#define mod 1000000007
#define Mod 1000000005
#define ll long long
//#define file
using namespace std;

ll p[250001],P[250001],pp[250001],PP[250001],hs[250001],Hs[250001],s,S,p1,p2,p3,p4,ans;
int sum[250001],n,i,j,k,l;
char st[250001];
map<pair<int,int>,int> mp;
map<pair<int,int>,int> :: iterator I;

ll qpower(ll a,int b) {ll ans=1; while (b) {if (b&1) ans=ans*a%mod;a=a*a%mod;b>>=1;} return ans;}
ll Pow(int t) {return (t>=0)?p[t]:P[-t];}
ll Pow2(int t) {return (t>=0)?pp[t]:PP[-t];}

int main()
{
	#ifdef file
	freopen("arc099f.in","r",stdin);
	#endif
	
	scanf("%d",&n);
	scanf("%s",st+1);
	p1=123456789,p2=qpower(p1,Mod);
	p3=114514191,p4=qpower(p3,Mod);
	p[0]=P[0]=pp[0]=PP[0]=1;
	fo(i,1,n) p[i]=p[i-1]*p1%mod,P[i]=P[i-1]*p2%mod,pp[i]=pp[i-1]*p3%mod,PP[i]=PP[i-1]*p4%mod;
	
	fd(i,n,1)
	{
		switch (st[i])
		{
			case '>':{sum[i]=1,s=s*p1%mod;break;}
			case '<':{sum[i]=-1,s=s*p2%mod;break;}
			case '+':{s=(s+1)%mod;break;}
			case '-':{s=(s-1)%mod;break;}
		}
		s=(s+mod)%mod;
		hs[i]=s;
	}
	s=0;
	fd(i,n,1)
	{
		switch (st[i])
		{
			case '>':{sum[i]=1,s=s*p3%mod;break;}
			case '<':{sum[i]=-1,s=s*p4%mod;break;}
			case '+':{s=(s+1)%mod;break;}
			case '-':{s=(s-1)%mod;break;}
		}
		s=(s+mod)%mod;
		Hs[i]=s;
	}
	fo(i,1,n) sum[i]+=sum[i-1];
	
	mp[pair<int,int>(0,0)]=1;
	fd(i,n,1)
	{
		s=((hs[i]-hs[1])*Pow(sum[i-1])%mod+mod)%mod;
		S=((Hs[i]-Hs[1])*Pow2(sum[i-1])%mod+mod)%mod;
		I=mp.find(pair<int,int>(s,S));
		if (I!=mp.end())
		ans+=I->second;
		++mp[pair<int,int>(hs[i]*Pow(sum[i-1])%mod,Hs[i]*Pow2(sum[i-1])%mod)];
	}
	printf("%lld\n",ans);
	
	fclose(stdin);
	fclose(stdout);
	return 0;
}

Measured memory_bytes: 32260
#include <iostream>
#include <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <sstream>
#include <istream>
#include <cmath>
#include <cstdio>

using namespace std;

#define vci vector<int>
#define vcs vector<string>
#define pb push_back
#define sz size()
#define mapii map<int, int>
#define mapci map<char, int>
#define mapsi map<string, int>
#define all(x) x.begin(), x.end()
#define minit(a, i) memset(a, i, sizeof(a));

#define for_(i, a, b) for (int i=(int)a; i<(int)b; i++)
#define for_d(i, a, b) for (int i=(int)a-1; i>=b; i--)
#define for_r(i, a, b, c) for (int i=(int)a; i<(int)b; i += c)
#define for_dr(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

typedef long long ll;
typedef double D;

const int iINF = 2147483647;
const ll lINF = 9223372036854775807;

template <class T> inline void dbg(T t) { cout << t << endl; }


bool reach(vcs& bar, int S, int G) {
	int n = (int)bar[0].sz + 1;
	vci perm(n);
	for_(i, 0, n) perm[i] = i + 1;
	
	int d = (int)bar.sz;
	for_(i, 0, d) {
		for_(j, 0, n - 1) {
			if (bar[i][j]=='1') swap(perm[j], perm[j+1]);
		}
	}
	
	return perm[G-1]==S;
}


int main() {
	int n, m, G, d;
	
	while (1) {
		cin >> n; if (n==0) break;
		cin >> m >> G >> d;
		
		vcs bar(d);
		for_(i, 0, d) cin >> bar[i];
		
		if (reach(bar, m, G)) cout << 0 << endl;
		else {
			bool flag = false;
			for_(i, 0, d) {
				for_(j, 0, n - 1) {
					if (bar[i][j]!='0') continue;
					if (j>0 && bar[i][j-1]=='1') continue;
					if (j<n-1 && bar[i][j+1]=='1') continue;
					
					bar[i][j] = '1';
					
					if (reach(bar, m, G)) {
						cout << i+1 << " " << j+1 << endl;
						flag = true;
						break;
					}
					
					bar[i][j] = '0';
				}
				if (flag) break;
			}
			if (!flag) cout << 1 << endl;
		}
	}
	
	
	return 0;
}

Measured memory_bytes: 1212
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
using namespace std;

int main() {
	long long int n=0,m,a,b,c,d,e;
	long double z,w;
	string str,str2,str3;
	char ch;
	long long int x[130]={};
	cout << fixed << setprecision(10);
	cin>>str;
	if(str[0]=='1'){
		n++;
	}
	if(str[1]=='1'){
		n++;
	}if(str[2]=='1'){
		n++;
	}
	cout<<n;






	cout<<endl;
} 


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

#define inf  	 1e18
#define int  	 long long
#define float	  double
#define endl 	 "\n"
#define w(t) 	 int t;cin>>t;while(t--)
#define str  	 to_string
#define vci  	 vector<int>
#define vcs  	 vector<string> 
#define mp   	 make_pair
#define pb   	 push_back
#define pii  	 pair<int,int>
#define pis  	 pair<int,string>
#define fastio() ios::sync_with_stdio(0);cin.tie(0)
#define mod   	 1000000007
random_device rd;
mt19937 rand_gen(rd());
#define setbits(x)     __builtin_popcountll(x)
#define trailzero(x)   __builtin_ctzll(x)
#define shuffle(vc) shuffle(vc.begin(), vc.end(), rand_gen);
#define decimal(x,value)  cout<<fixed<<setprecision(x)<<value
void io()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	#ifndef ONLINE_JUDGE
		freopen("/home/kashif/cp/input.txt","r",stdin);
		
		freopen("/home/kashif/cp/output.txt","w",stdout);
	#endif

}
int n,W;
int v[101]={0};
int weight[101]={0};
int dp[100001][101]={0};
int solve(int w,int k)
{
	
	if(k>n) 
		return 0;
	int &ans=dp[w][k];
	if(ans!=-1)
		return ans;
	if(weight[k]>w)
		return ans=solve(w,k+1);
	else
	{
		int t=solve(w-weight[k],k+1);
		int g=solve(w,k+1);
		ans=max(v[k]+t,g);	
	}
	return ans;



}
int32_t main()
{
	
	fastio();
	io();
	memset(dp,-1,sizeof(dp));
	cin>>n>>W;
	for(int i=1;i<=n;i++)
		cin>>weight[i]>>v[i];
	
	cout<<solve(W,1)<<endl;

	
	
}


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

#define int long long
#define flash ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define all(x) begin(x),end(x)

int mod = 1e9+7;
int inf = 4e18;
const int N = 5e5+5;
		
signed main()
{
    flash
    int tt = 1;
    //cin>>tt;
    while(tt--)
    {
		int n;
		cin>>n;
		string s;
		cin>>s;
		int ct1 = 0;
		int ct2 = 0;
		for(auto it:s)
		{
			if(it=='W')
			++ct1;
			else
			++ct2;
		}
		int ct3  =0;
		for(int i=ct2;i<n;++i)
		{
			if(s[i]=='R')
			++ct3;
		}
		cout<<min({ct1,ct2,ct3});
    }
    return 0;
}


Measured memory_bytes: 3772
using System;

namespace ABC135
{
    class Program
    {
        static int Main(string[] args)
        {
            problemA();
            return 0;
        }

        static void problemA()
        {
            string[] input = Console.ReadLine().Split(' ');

            int A = int.Parse(input[0]);
            int B = int.Parse(input[1]);

            int C = Math.Abs(A - B);

            if (C % 2 != 0)
            {
                Console.WriteLine("IMPOSSIBLE");
            }
            else
            {
                if(A > B)
                {
                    Console.WriteLine(A - C/2);
                }
                else if (B > A)
                {
                    Console.WriteLine(B - C/2);
                }
            }

        }
    }
}

Measured memory_bytes: 11092
n = int(input())
a = list(map(int,(input().split())))
#a2 = sort(a)

count = 1
nocount = 0
for i in a:
  if i == count:
    count += 1
  else:
    nocount += 1 
    
    
#print(count,nocount)    
ans = -1 if nocount == n else  nocount
print(ans)

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

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a, b, x;
    cin >> a >> b >> x;
    cout << fixed << setprecision(7);

    double S = 1. * x / a;
    if(a * b >= S * 2)
    {
        double e = S * 2 / b;
        cout << atan2(b, e) * 180. / M_PI << endl;
    }
    else // S = (b + e) * a / 2
    {
        double e = 2. * S / a - b;
        cout << atan2(b-e, a) * 180. / M_PI << endl;
    }
    

    return 0;
}


Measured memory_bytes: 4128
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll (i) = 0; (i) < (n); (i)++)
#define rep1(i, n) for(ll (i) = 1; (i) <= (n); (i)++)
#define rrep(i, n) for(ll (i) = (n) - 1; (i) >= 0; (i)--)
#define rrep1(i, n) for(ll (i) = (n); (i) >= 1; (i)--)
const ll INF = 1145141919;
const ll MOD = 1000000007;
template<class T> void chmax(T &a, const T &b){if(a < b){a = b;}}
template<class T> void chmin(T &a, const T &b){if(a > b){a = b;}}

int main(){

    string s;
    cin >> s;
    ll ans = 0;
    rep(i, s.size()){
        ll j = s.size() - 1 - i;
        if(s[j] != s[i])ans++;
        s[j] = s[i];
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
import math

def main():
    A,B,H,M=map(int, input().split())
    H=(H*60+M)/720*360
    M=M/60*360
    k=abs(H-M)
    ans=(A**2+B**2-2*A*B*math.cos(math.radians(k)))**0.5
    print(ans)
    return

if __name__=='__main__':
    main()


Measured memory_bytes: 9532
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define _USE_MATH_DEFINES
#include <math.h>
#define rep(i,n) for(int i = 0;i < n;i++)
#define NIL = -1;
#define all(x) x.begin(),x.end()
const ll INF = 1e9;
const ll mod = 1e9 + 7;

int digit(ll x) {
    if (x / 10 == 0) return 1;
    return digit(x / 10) + 1;
}

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

ll lcm(ll a,ll b){
    return ((a * b == 0)) ? 0 : (a / gcd(a,b) * b);
}

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


/////////////////////////////////////////////////////////////////////////////////////////

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

    int n;
    cin >> n;

    if (n % 2 == 0) cout << n / 2 << endl;
    else cout << n / 2 + 1 << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int INF=1001001001;

int main(){
  int h, n;
  cin >> h >> n;
  vector<int> dp(h+1, INF);
  dp.at(0)=0;
  for(int i=0; i<n; ++i){
    int a, b;
    cin >> a >> b;
    for(int j=1; j<=h; ++j){
      if(j-a <0) dp.at(j)= min(dp.at(j), dp.at(0)+b);
      else dp.at(j)= min(dp.at(j), dp.at(j-a)+b);
    }
  }
  cout << dp.at(h) << endl;
}

Measured memory_bytes: 256
wide = []
high = []
count = 0

while wide[count-1] != 0 && high[count-1] != 0
	high[count],wide[count] = gets.split().map(&:to_i)
	count += 1
end 

for countC in 0...count-1
	for countH in 0...high[countC]
		for countW in 0...wide[countC]
			print '#'
		end
		puts ""
	end
	puts "\n"
end

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

ll solve() {
    ll N;
    cin >> N;
    map<ll, int> num;
    ll a;
    for ( int i = 0; i < N; i++ ) {
        cin >> a;
        a = -a;
        auto x = num.upper_bound(a);
        if ( x == num.end() ) {
            num[a]++;
        } else {
            num[a]++;
            num[x->first]--;
            if ( num[x->first] == 0 ) {
                num.erase(x->first);
            }
        }
    }
    ll s = 0;
    for( auto x : num ) {
        s += x.second;
    }
    return s;
}

int main() {
    auto ans = solve();
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 6400
import java.util.*;
import static java.lang.Math.*;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		int[] a = new int[n];
		for(int i = 0; i < n; i++){
		    a[i] = sc.nextInt();
		}
		
		// 計算
		String result = "No";
		int cnt4 = 0;
		int cnt2 = 0;
		for(int i = 0; i < n; i++){
		    if(a[i]%4 == 0){
		        cnt4++;
		    }else if(a[i]%2 == 0){
		        cnt2++;
		    }
		}
		if(cnt4 >= n/2) result = "Yes";
		if(cnt2 >= (n-cnt4*2)) result = "Yes";
		
		// 出力
		System.out.println(result);
	}
}



Measured memory_bytes: 50232
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod;assert(b>=0);for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s,t;cin>>s>>t;
	int ans=0;
	rep(i,0,SZ(s)) if(s[i]!=t[i]) ans++;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 3888
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define mp make_pair
#define pp pair<ll,ll>
#define vi vector<pair<pp,pp> >
#define pq_min priority_queue<ll,vector<ll>,greater<ll>>
#define pq_max priority_queue<ll>
#define forx(i,a,b) for(ll i=0;i<a;i++)
#define precision(x,d) cout<<fixed<<setprecision(d)<<x
#define fill(a,b) memset((a),(b),sizeof((a)))
#define ld long double
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef pair<pp,pp> ppll;
const ll mod=1e9+7;
 
 bool check(string s)
 {
 	string h=s;
 	reverse(h.begin(),h.end());
 	if(s==h)
 	{
 		return true;
    }
    return false;
 }
 int main()
 {
 	fast;
 	ld x;
 	cin>>x;
 	ld y=x/3;
 	 y=y*y*y;
 	 precision(y,10);
 }

Measured memory_bytes: 256
wo=0
ho=0
w,h,n=map(int, input().split())

for i in range(n):
    x,y,a=map(int, input().split())
    if a==1:
        if x>wo: wo=x
    if a==2:
        if x<w: w=x
    if a==3:
        if y>ho: ho=y
    if a==4:
        if y<h: h=y

ans=(w-wo)*(h-ho)

if wo>=w or ho>=h: print(0)
else: print(ans)

Measured memory_bytes: 3064
/******************************************
* AUTHOR : SOMU KUMAR *
* INSTITUTION : IIT BHUBANESWAR *
******************************************/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N 100005
#define MOD 1000000007
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
//code here...............//
ll n,k;
cin>>n>>k;
ll arr[n];
for(int i=0;i<n;i++)cin>>arr[i];
sort(arr,arr+n);
ll i1=1;
ll j=arr[n-1];
while(i1<j){
	ll mid=(i1+j)/2;
	ll sum=0;
	for(int m=n-1;m>=0;m--){
         if(arr[m]>mid)sum+=(arr[m]/mid);
         else break;
	}
	if(sum<=k)j=mid;
	else i1=mid+1;
}
cout<<i1<<endl;
return 0;
}

Measured memory_bytes: 5136
class SegmentTree:
    # 初期化処理
    # f : SegmentTreeにのせるモノイド
    # default : fに対する単位元
    def __init__(self, size, f=lambda x, y: x+y, default=0):
        self.size = 2**(size-1).bit_length()  # 簡単のため要素数Nを2冪にする
        self.default = default
        self.dat = [default]*(self.size*2)  # 要素を単位元で初期化
        self.f = f

    def update(self, i, x):
        i += self.size
        self.dat[i] = x
        while i > 0:
            i >>= 1
            self.dat[i] = self.f(self.dat[i*2], self.dat[i*2+1])

    def query(self, l, r):
        l += self.size
        r += self.size
        lres, rres = self.default, self.default
        while l < r:
            if l & 1:
                lres = self.f(lres, self.dat[l])
                l += 1

            if r & 1:
                r -= 1
                # モノイドでは可換律は保証されていないので演算の方向に注意
                rres = self.f(self.dat[r], rres)
            l >>= 1
            r >>= 1
        res = self.f(lres, rres)
        return res


N, K = map(int, input().split())

A = [int(input()) for _ in range(N)]

st = SegmentTree(300000+10, f=max)

res = 0
for sa in A:
    L = max(sa-K, 0)
    R = min(sa+K, 300001)

    tmp = st.query(L, R+1)+1
    st.update(sa, tmp)
    res = max(tmp, res)

print(res)


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

#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REP1(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREP1(i, x) for (int i = ((int)(x)); i > 0; i--)
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << ": " << x << '\n'
#define pb(x) push_back(x)
#define mp(x, y) make_pair(x, y)
const int MOD = (int)1e9 + 7;
const int INF = 1145141919;
using ll = long long;
using ull = unsigned long long;
using i_i = pair<int, int>;
using l_l = pair<ll, ll>;
using d_d = pair<double, double>;
using vint = vector<int>;

int main() {
    int N;
    cin >> N;
    // vector<vector<bool>> F(N, vint(10));
    vector<vint> F(N, vint(10));
    REP(i, N) {
        REP(j, 10) {
            cin >> F[i][j];
        }
    }
    vector<vint> P(N, vint(11));
    REP(i, N) {
        REP(j, 11) {
            cin >> P[i][j];
        }
    }
    int ans = -INF;

    // bit全探索:2^10=1024
    //何個の時間帯がかぶっているか→それぞれのand=N*10
    // O(N*10240)
    REP(ptrn, 1 << 10) {
        if (ptrn == 0)
            continue;
        int tans = 0;
        REP(i, N) {
            int samen = 0;
            REP(j, 10) {
                bool b = ptrn & (1 << j);
                if (F[i][j] && b)
                    samen++;
            }
            tans += P[i][samen];
        }
        // if (ans < tans) {
        //     debug(bitset<10>(ptrn));
        //     cout << "update: " << ans << " to " << tans << endl;
        // }
        ans = max(ans, tans);
    }
    cout << ans;
}

Measured memory_bytes: 256
import sys
n,y=map(int, input().split())

for i in range(n+1):
  for j in range(n-i+1):
    if i*10000+j*5000+(n-i-j)*1000 == y:
      print(i, j, n-i-j)
      sys.exit()

print(-1, -1, -1)

Measured memory_bytes: 3060
#include <iostream>
#include <iomanip>
#include <ios> 
#include <vector>
#include <string>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <map>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)

using namespace std;
typedef long long int lli;
typedef vector<int> vi;
//const int MAX=;
const int MOD=1e9+7;

int main(){
	string s;
	cin>>s;
	int l=s.size();
	
	string t={};
	vi v;
	int c=0;
	rep(i,l){
		if(s[i]=='x'){
			c++;
		}
		else{
			v.push_back(c);
			c=0;
			t.push_back(s[i]);
		}
	}
  	int k=v.size();
  	v.push_back(c);
	
	//回文判定
	bool pl=true;
	rep(i,k)if(t[i]!=t[k-1-i])pl=false;
	if(!pl){
		cout<<-1;
		return 0;
	}
	int ans=0;
	rep(i,(k+1)/2){
		int a=v[i];
		int b=v[k-i];
		ans+=abs(a-b);
	}
	cout<<ans;
}

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

int n, k;
ll a[200200], sum[200200];
set<ll> sums;
map<ll, ll> mp;
ll bit[200200];
int cnt = 0;
void update(int pos){
	while(pos <= cnt){
		bit[pos]++;
		pos += (pos & -pos); 
	}
}
ll query(int pos){
	ll sum = 0;
	while(pos >= 1){
		sum += bit[pos];
		pos -= (pos & -pos); 
	}
	return sum;
}

int main(){
	scanf("%d%d", &n, &k);
	ll ans = 0;
	rep(i, n){
		scanf("%d", &a[i]);
		a[i] -= k;
		sum[i+1] = sum[i] + a[i];
		sums.insert(sum[i]);
	}
	sums.insert(sum[n]);
	for(set<ll>::iterator it = sums.begin(); it != sums.end(); it++){
		mp[*it] = ++cnt;
	}
	rep(i, n+1) sum[i] = mp[sum[i]];
	rep(i, n+1){
		ans += query(sum[i]);
		update(sum[i]);	
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 26880
#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

int main(){
	vector<int> a(5);
	for( auto &k : a ) cin >> k;
	vector<int> p = {0, 1, 2, 3, 4};
	int ans = INF;
	do {
		int sum = 0;
		for( int i = 0; i < 4; ++i ){
			sum += a[p[i]] + (( 10 - a[p[i]] % 10 )) % 10;
		}
		sum += a[p[4]];
		ans = min( ans, sum );
    } while( next_permutation( p.begin(), p.end()) );
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
n, m = map(int, input().split())
mod = 10**9 + 7
x = [1] * (n + 1)
for i in range(m):
    a = int(input())
    x[a] = 0
for i in range(2, n + 1):
    if x[i] == 0:
        continue
    x[i] = (x[i - 1] + x[i - 2]) % mod
print(x[n])


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

int best(int index, int val){


}

int main(){
    int a, b, i;
    cin >> a;
    vector<int> v;
    for(i = 0; i < a; i++){
        cin >> b;
        v.push_back(b);
    }

    sort(v.begin(), v.end());

    double value = (double) v.at(0);
    for(i = 1; i < a; i++){
        value = (value+v.at(i))/2;
    }
    cout << value << endl;
}

Measured memory_bytes: 764
#include <bits/stdc++.h> 
using namespace std;
using ll = long long;
template<typename T> using v2 = vector<vector<T>>;
template<typename T> inline v2<T> fill(int r, int c, const T& t){ return v2<T>(r, vector<T>(c, t)); }
#define F first
#define S second

void solve(){
    int x;
    cin >> x;
    cout << (x >= 30 ? "Yes\n" : "No\n");
}

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

Measured memory_bytes: 3568
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
void ABC50(void);
void ABC51(void);
void ABC52(void);
void ABC53(void);
void ABC54(void);
void ABC55(void);
void ABC56(void);
void ABC57(void);
void ABC58(void);
void ABC59(void);

int main(void){
    ABC58();
}

void ABC58(){
    string o,e;
    cin>>o>>e;
    int i;
    for(i=0;i<e.length();i++){
        cout<<o[i]<<e[i];
    }
    if(o.length()==e.length())cout<<endl;
    else cout<<o[i]<<endl;
}


Measured memory_bytes: 256
N = input()
Ai = input()
A = Ai.split(" ")
Bi= input()
B = Bi.split(" ")
Ci = input()
C = Ci.split(" ")
C.append(0)
A.append(0)
B.append(0)
ans = 0
for i in range(int(N)):
  if (int(A[i]) + 1) == int(A[i + 1]):
    ans = ans + int(B[int(A[i]) - 1]) + int(C[int(A[i]) - 1])
  else:
    ans = ans + int(B[int(A[i]) - 1])
print(ans)

Measured memory_bytes: 3064
#include<stdio.h>

int main(){
  int a,b,c,max,k,sum,i;
  scanf("%d %d %d",&a,&b,&c);
  scanf("%d",&k);
  max=a;
  if(max<b) max=b;
  if(max<c) max=c;
  sum=a+b+c-max;
  for(i=0;i<k;i++)
    max*=2;
  sum+=max;
  printf("%d\n",sum);

}

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

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

# Summarize count of factor within list
def summarize_list(l):
  sl=sorted(l)

  a=sl[0]
  c=1
  res=[]

  for x in sl[1:]:
    if x==a:
      c+=1
    else:
      res.append([a,c])
      a=x
      c=1
  res.append([a,c])

  return res

def main():
  n=I()
  l=[I() for _ in range(n)]

  ans=0
  l=summarize_list(l)

  for x in l:
    if x[1]%2!=0:
      ans+=1
  return ans

# main()
print(main())


Measured memory_bytes: 21240
#include <iostream>
using namespace std;
int main(void){
    int n,r,b;
    r=0;b=0;
    string s;
    cin>>n>>s;
    for (int i =0;i<n;i++){
        r+=(s[i]=='R');
        b+=(s[i]=='B');
    }
    if (r>b){
        cout<<"Yes";
    }
    else{
        cout<<"No";
    }
    cout<<endl;
}


Measured memory_bytes: 3624
/*-------------------------------*
| Name: Ayush Kumar              |
| College: SOE, CUSAT            |
| Dept: CSE                      |
| Site: atcoder                  |
| Email: ayushkr667@gmail.com    |
*-------------------------------*/

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define INF (ll) 1e18
const double PI = 3.141592653589793238460;
ll n, m, t;
int main()
{
    ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    cin>>n;
    ll arr[n+1];
    for (ll i = 1; i <= n; i++)
    {
        cin>>arr[i];
    }
    ll dp[n+1];
    dp[1] = 0;
    dp[2] = abs(arr[2] - arr[1]);
    for (ll i = 3 ; i <= n; i++)
    {
        dp[i] = min((dp[i-1] + abs(arr[i] - arr[i-1])), (dp[i-2] + abs(arr[i] - arr[i-2])) );
    }
    cout<<dp[n];
    return 0;
}


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

int main() {
	int N;
	cin >> N;
	int ans=0;
	for(int i=1; i<=N; ++i){
	    int dig=0, now=i;
	    while(now>0){
	        ++dig;
	        now /= 10;
	    }
	    if(dig%2==1) ++ans;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <numeric>
#include <bitset>
#include <vector>
#include <queue>

using namespace std;

typedef long long ll;
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define REP(i,n)   FOR(i,0,n)
typedef pair< ll,ll > cp2;
typedef pair<ll,cp2 > cp3;
#define fi first
#define se second
#define sec se.fi
#define thr se.se
const ll mod = 1000000007;
//              123456789

int n[105];
int m[105];

int main(){
	int N, M;
	
	cin >> N;
	
	REP(i,N){
		int h, min;
		
		cin >> h >> min;
		
		n[i] = 60*h+min;
	}
	
	cin >> M;
	
	REP(i,M){
		int h, min;
		
		cin >> h >> min;
		
		m[i] = 60*h+min;
	}
	
	int in = 0, im = 0;
	
	while(in < N && im < M){
		if (n[in] < m[im]){
			if (in || im) cout << " ";
			cout << n[in]/60 << ":";
			if (n[in]%60 < 10) cout << 0;
			cout << n[in]%60;
			in++;
		}
		else if (n[in] > m[im]){
			if (in || im) cout << " ";
			cout << m[im]/60 << ":";
			if (m[im]%60 < 10) cout << 0;
			cout << m[im]%60;
			im++;
		}
		if (n[in] == m[im]){
			if (in || im) cout << " ";
			cout << m[im]/60 << ":";
			if (m[im]%60 < 10) cout << 0;
			cout << m[im]%60;
			im++;
			in++;
		}
	}
	
	if (in == N){
		while (im < M){
			cout << " " << m[im]/60 << ":";
			if (m[im]%60 < 10) cout << 0;
			cout << m[im]%60;
			im++;
		}
	}
	else {
		while (in < N){
			cout << " " << n[in]/60 << ":";
			if (n[in]%60 < 10) cout << 0;
			cout << n[in]%60;
			in++;
		}
	}
	
	puts("");
	
	return 0;
}

Measured memory_bytes: 3096
#include <algorithm>
#include <iostream>
#include <queue>
#include <string>

using namespace std;

bool check(string s) {
  if (s == "A" || s == "T" || s == "G" || s == "C") {
    return true;
  } else {
    return false;
  }
}

void solve(string s) {
  int ans = 0;
  int cur = 0;
  int n = s.length();
  for (int i = 0; i < n; i++) {
    if (check(s.substr(i, 1))) {
      cur += 1;
    } else {
      ans = max(ans, cur);
      cur = 0;
    }
  }
  ans = max(ans, cur);

  cout << ans << endl;
}

int main() {
  string s;
  cin >> s;
  solve(s);
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>

#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long int
#define MAX 1000000007

using namespace std;


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


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

using namespace std;
//FILE *fi=freopen("1.txt","r",stdin);
long long n,a,b;
int main()
{
    cin>>a>>b>>n;
    n = min(n,b-1);
    cout<<(a*n)/b - a*(n/b);
    return 0;
}


Measured memory_bytes: 3652
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };
const int c_div = 1000000007; //10^9 + 7


int main() {

	int A, B;
	scanf("%d%d", &A, &B);


	if (A == B) {
		printf("Draw");
	}
	else if (A == 1) {
		printf("Alice");
	}
	else if (B == 1) {
		printf("Bob");
	}
	else if (A > B) {
		printf("Alice");
	}
	else {
		printf("Bob");
	}





}

Measured memory_bytes: 128
// in the name of Allah

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

#define endl '\n'
#define pb push_back
#define ll long long
#define double long double
#define sz(x) ((int) (x.size()))

#define fr first
#define se second

#define inf 1e9
#define max_n 123456
#define mod 1000000007

ll add(ll a, ll b) {
	a += b;
	if(a >= mod) return a - mod;
	return a;
}

ll mul(ll a, ll b) {
	a *= b;
	if(a >= mod) return a % mod;
	return a;
}

ll power(ll a, ll b) {
	ll p = 1;
	while(b) {
		if(b&1) p = mul(p, a);
		a = mul(a, a);
		b /= 2;
	}
	return p;
}

int n, W;
ll a[123456];
ll b[123456];
ll dp[123][123456];

ll memo(int idx, int V) {
	if(V <= 0) return 0;
	if(idx == -1) return 1e18;
	if(dp[idx][V] != -1) return dp[idx][V];
	return dp[idx][V] = min(memo(idx-1, V), memo(idx-1, V-b[idx]) + a[idx]);
}

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> n >> W;
	int sum = 0;
	for(int i=0; i<n; i++) {
		cin >> a[i] >> b[i];
		sum += b[i];
	}
	memset(dp, -1, sizeof dp);
	for(int i=sum; i>=0; i--) {
		if(memo(n-1, i) <= W) {
			cout << i << endl;
			break;
		}
	}
	return 0;
}

Measured memory_bytes: 119040
import java.util.*;
 
class Main{
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long m = sc.nextLong();
      	long h = sc.nextLong();
      	long z = m * h;
      	long N = z / 2;
     	if(z % 2 != 0){
         	N += 1; 
        }
        if(m == 1 || h == 1){
N = 1;
       }
        System.out.println(N);
	}
 
}

Measured memory_bytes: 23636
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
	int a,b;
	scanf("%d %d",&a,&b);
	int jia=a+b;
	int jian=a-b;
	int chen=a*b;
	printf("%d",max(max(jia,jian),chen));
}

Measured memory_bytes: 128
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner in = new Scanner(System.in);

		while(true){

			int H = in.nextInt();
			int W = in.nextInt();

			if(H == 0 && W == 0){break;};

			for(int i = 0; i < H; i++){

				if(i == 0 || i == (H-1)){
					for(int k = 0; k < W; k++){
						System.out.print("#");
					}
				}else{
					System.out.print("#");
					for(int j = 0; j < (W-2); j++){
						System.out.print(".");
					}
					System.out.print("#");
				}
				System.out.println();
			}
			System.out.println();

		}
	}
}



Measured memory_bytes: 34988
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
#define int ll
#define pb push_back
using pii = pair<int,int>;
const int N = 100005;
const int Inf = 1e9+7;

int p[N], q[N];

signed main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	cerr.tie(NULL);
	int x, y, a, b, c, sm=0;
	cin >> x >> y >> a >> b >> c;
	vector<int> r(c);
	for (int i = 0; i < a; ++i)
	{
		cin >> p[i];
	}
	for (int i = 0; i < b; ++i)
	{
		cin >> q[i];
	}
	for (int i = 0; i < c; ++i)
	{
		cin >> r[i];
	}
	sort(p, p + a);
	sort(q, q + b);
	vector<int> v, s;
	for (int i = a - x; i < a; ++i)
	{
		sm += p[i];
		v.push_back(p[i]);
	}
	for (int i = b - y; i < b; ++i)
	{
		sm += q[i];
		v.push_back(q[i]);
	}
	sort(v.begin(), v.end());
	sort(r.begin(), r.end());
	reverse(r.begin(), r.end());
	int ptr = 0, cnt = 0;
	while (ptr < c)
	{
		while (ptr < c && r[ptr] <= v[cnt])
		{
			++ptr;
		}
		if (ptr != c)
		{
			sm -= v[cnt];
			sm += r[ptr];
		}
		++ptr;
		++cnt;
	}
	cout << sm;
}

Measured memory_bytes: 4852
n=int(input())
t=0
h=0
for i in range(n):
    word=list(map(str,input().split()))
    if word[0]==word[1]:
        t+=1
        h+=1
    elif word[0]>word[1]:
        t+=3
    else:
        h+=3
print(f'{t} {h}')


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

int main() {
  ll n,a,b,loop_cnt,last_cnt,ans;
  cin>>n>>a>>b;
  loop_cnt=n/(a+b);
  last_cnt=n%(a+b);
  ans=loop_cnt*a + min(last_cnt,a);
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define pb push_back
#define fi first
#define se second
#define ALL(a) (a.begin(), a.end())
using ll = long long;
template<typename T> void Out(T x) { cout << x << endl; }
int gcd(int a, int b) {
  return (a % b) ? gcd(b, a%b) : b;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int k;
  cin >> k;
  unsigned long long res = 0;
  for (int a = 1; a <= k; a++) {
    for (int b = 1; b <= k; b++) {
      for (int c = 1; c <= k; c++) {
        res += gcd(a, gcd(b,c));
      }
    }
  }
  cout << res << endl;

}


Measured memory_bytes: 3648
#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

#define pb push_back
#define mp make_pair
#define ff first
#define ss second

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
typedef vector<pii> vii;
typedef priority_queue<ll> pq;

const int MOD = 1e9+7;
const int INF = 2e9;
const int MAX_N = 1;

int main() {
  int N, A; cin >> N;
  ll ans = 0;
  for (int i = 0; i < N; i++) {
    cin >> A;
    while ((A & 1) == 0) {
      ans++;
      A /= 2;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
	int n;
	scanf("%d", &n);
	int a = 0;
	int f = 0;
	while(a * 4 <= n){
		if((n - a * 4) % 7 == 0){
			f = 1;
			break;
		}
		a++;
	}
	if(f)
		printf("Yes\n");
	else
		printf("No\n");
	return 0;
}


Measured memory_bytes: 128
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<n;i++)
#include <bits/stdc++.h>
#include <numeric>
using namespace std;
typedef long long ll;
const int mod= 1e+9+7;

int main() {
    int H,W; cin>>H>>W;
    vector<vector<char>>a(H,vector<char>(W));
    rep(i,H){
        rep(j,W)cin>>a[i][j];
    }
    int cnt=0;
    bool judge;
    bool out;
    int b;
    rep(i,H){
        judge=false;
        out=false;
        for(int j=cnt;j<W;j++){
            while(a[i][j]=='#'){
                j++;
                cnt++;
                if(judge){
                    cout<<"Impossible"<<endl;
                    return 0;
                }
                  b=cnt;
                if(j==W){
                    out=true;
                    break;
                }
              
            }
            judge=true;
            if(i<=H-2){
                if(a[i+1][b-1]!='#'){
                cout<<"Impossible"<<endl;
                return 0;
            }
            }
            if(out)break;
        }
        if(i<=H-2){
            rep(k,cnt-1){
            if(a[i+1][k]=='#'){
                cout<<"Impossible"<<endl;
                return 0;
            }
        }
        }
    }
    cout<<"Possible"<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
#include<fstream>
#include<set>
using namespace std;
typedef long long ll;

#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 out(str) cout << str << endl
#define ALL(a) (a).begin(),(a).end()
#define INF (1<<29)

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

ll N,ans=1;

int main(){
    cin>>N;
    rep(i,N){
        ans=(ans*(i+1))%1000000007;
    }
    out(ans);
    

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ALL(c) (c).begin(),(c).end()
#define EACH(i,c) for(auto i=(c).begin();i!=(c).end();++i)
using namespace std;
#define int long long

signed main(){
	int N, M;
	cin >> N >> M;

	if (2 * N >= M) {
		cout << M / 2 << endl;
	} else {
		int cnt = N;
		M -= 2 * N;
		cnt += M / 4;
		cout << cnt << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N, K; cin >> N >> K;
    vector<bool> cnt(N);
    int d;
    int count = 0;
    for (int i = 0; i < K; i++) {
        cin >> d;
        vector<int> A(d);
        for (int j = 0; j < d; j++) {
            cin >> A.at(j);
            cnt.at(A.at(j) - 1) = true;
        }
    }
    for (int i = 0; i < N; i++) {
        if (cnt.at(i) == false) {
            count++;
        }
    }
    cout << count << endl;
}


Measured memory_bytes: 3600
#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <math.h>
#include <algorithm>
#include <map>
#include <sstream>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <functional>
#include <utility>
#include <stdio.h>
#define ll long long
#define MP make_pair
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define PLI pair<ll, int>
#define PIL pair<int, ll>
#define STR string
#define Fst first
#define Snd second
#define SHN 1e9
#define LSHN 1e18
using namespace std;
int n,m;
int main()
{
	cin >>n>>m;
	if (n>9 || m>9) cout <<"-1";
	else cout <<n*m;
	return 0;
} 

Measured memory_bytes: 256