akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define erep(i,a,b) for(int i=a;i<=(int)(b);++i)
#define per(i,a,b) for(int i=(a);i>(b);--i)
#define eper(i,a,b) for(int i=(a);i>=b;--i)
#define fore(x, a) for(auto &x : a)
#define pb push_back
#define mp make_pair
#define INF 100100100100
#define inf 2001001001
#define MOD 1000000007
#define ALL(x) begin(x),end(x)
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using vii = vector<int>;
using vll = vector<ll>;
template<class T>using vv = vector<T>;
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; }
template<class T>void show(const vector<T> &a) { for (int i = 0; i < (int)a.size(); ++i) cout << a[i] << (i != (int)a.size()-1 ? " " : "\n"); }
template<class T>T gcd(T a, T b){ return b ? gcd(b, a % b) : a; }
template<class T>T lcm(T a, T b){ return a / gcd(a, b) * b; }
int dy[]={0, 1, -1, 0};
int dx[]={1, 0, 0, -1};
ll x;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
    cin >> x;
    ll ans = x / 11;
    x -= ans * 11;
    if (x == 0) ans *= 2;
    else if (x > 6) ans = ans * 2 + 2;
    else if (0 < x) ans = ans * 2 + 1;
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <functional>

using namespace std;

int main()
{
	int n;

	cin >> n;

	vector<int> a(n);

	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	sort(a.begin(), a.end());
	cout << a[a.size() - 1] - a[0] << endl;

	return (0);
}

Measured memory_bytes: 256
//include
//------------------------------------------
#include <bits/stdc++.h> // only for GCC

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

//container util
//------------------------------------------
#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair

//repetition
//------------------------------------------
#define loop(i,a,b) for(ull i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)
#define iter(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define riter(i,c) for(auto i=(c).rbegin(); i!=(c).rend(); ++i)

//constant
//--------------------------------------------
const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

// output vector
// ------------------------------------------
namespace std {
    template<typename T>ostream&operator<<(ostream&os, vector<T>const&v){
        iter(it,v) os<<*it<<(it+1==v.end()?"":",");
        return os;
    }
    template<typename T, typename U>ostream&operator<<(ostream&os,const pair<T,U>&p){
        return os << "[" << p.dirst << "," << p.second << "]";
    }
}

//clear memory
// ------------------------------------------
#define clr(a,i) memset((a), (i) ,sizeof(a))
vb pn(999984,1);
void prime_number(ull n){
   pn[0]=false;pn[1]=false;
   loop(i,2,n){
      if(!pn[i]) continue;
      for(ull j=i*i;j<=n;j+=i){
         pn[j]=false;
      }
   }
}

int main(){
   int n;
   prime_number(999983);
   while(cin >> n && n){
      int ans=0;
      for(int i=2;i<=n/2;i++){
         if(pn[i]==true&&pn[n-i]==true){
            ans++;
            //cout << i << " " << n-i << endl;
         }
      }
      cout << ans << endl;
   }
}

Measured memory_bytes: 1316
n = int(input())
List = list(map(int, input().split()))

def euclid(a, b):
  while True:
    r = a % b
    a, b = b, r
    if r == 0:
  	  return(a)
    
List.sort(reverse = True)
res = euclid(List[0], List[1])
for i in range(1, n):
  res = euclid(res, List[i])
  if res == 1:
    break
    
print(res)

Measured memory_bytes: 14224
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
using namespace std;

#define ll long long
#define pb push_back

ll MAX(ll a, ll b) {

	if (a > b)return a;
	else return b;

}
ll MIN(ll a, ll b) {

	if (a < b)return a;
	else return b;

}
ll powsur(ll a, ll b, ll p) {

	if (b == 0) {

		return 1;

	}
	else if (b % 2 == 0) {

		ll d = powsur(a, b / 2, p);
		return ((d%p)*(d%p)) % p;

	}
	else {

		return ((a%p)*powsur(a, b - 1, p) % p) % p;

	}

}//pは素数,aのb乗をpで割った余り
ll CMOD(ll n, ll r, ll p) {

	ll a = 1, b = 1, c = 1, re;
	for (int i = 1; i <= n; i++) {

		a *= i;
		a = a%p;

	}
	for (int i = 1; i <= r; i++) {

		b *= i;
		b = b%p;

	}
	for (int i = 1; i <= n - r; i++) {

		c *= i;
		c = c%p;

	}
	b = powsur(b, p - 2, p);
	c = powsur(c, p - 2, p);
	re = ((a%p)*(b%p)) % p;
	re = ((re%p)*c%p) % p;

	return re;

}//pは素数,(nCr)%p
ll gcd(ll a, ll b) {

	if (a < b) {

		ll tmp = a;
		a = b;
		b = tmp;

	}
	if (a%b == 0)return b;
	return gcd(b, a%b);

}//最大公約数
ll lcm(ll a, ll b) {

	return a / gcd(a, b)*b;

}//最小公倍数

int main() {
	
	while(1){
		int N,R;
		cin>>N>>R;
		if(N==0&&R==0)break;
		vector<int> V;
		for(int i=0;i<N;i++){
			V.pb(N-i);
		}
		for(int i=0;i<R;i++){
			int p,c;
			cin>>p>>c;
			vector<int> tmp;
			for(int j=0;j<c;j++){
				tmp.pb(V[p-1+j]);
			}
			for(int j=0;j<p-1;j++){
				tmp.pb(V[j]);
			}
			for(int j=0;j<N-(p-1)-c;j++){
				tmp.pb(V[p-1+c+j]);
			}
			V=tmp;
		}
		cout<<V[0]<<endl;
	}

	return 0;
}


Measured memory_bytes: 3060
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<utility>
#include<algorithm>
#include<cstdio>
#include<iomanip>
#include<queue>
#include<stack>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)

using namespace std;

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

    ll H, W;
    cin >> H >> W;
    vector<vector<char>> s(H, vector<char>(W));

    ll white = 0;
    Rep (i, H) {
        Rep (j, W) {
            cin >> s[i][j];
            if (s[i][j] == '.') {
                white++;
            }
        }
    }

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

    vector<vector<ll>> d(H, vector<ll>(W, -1));
    d[0][0] = 0;
    queue<pair<ll, ll>> q;
    q.push(make_pair(0, 0));
    while (!q.empty()) {
        auto e = q.front();
        q.pop();
        ll nowy = e.first;
        ll nowx = e.second;
        Rep (i, 4) {
            ll y = nowy + dy[i];
            ll x = nowx + dx[i];
            if (y < 0 || y > H-1 || x < 0 || x > W-1 || d[y][x] >= 0 || s[y][x] == '#') continue;
            // cout << y << " " << x << "\n";
            d[y][x] = d[nowy][nowx] + 1;
            q.push(make_pair(y, x));
        }
    }

    // Rep (i, H) {
    //     Rep (j, W) {
    //         cout << d[i][j] << " ";
    //     }
    //     cout << "\n";
    // }

    // cout << d[H-1][W-1] << "\n";
    if (d[H-1][W-1] < 0) cout << -1 << "\n";
    else cout << white - d[H-1][W-1] - 1 << "\n";
}

Measured memory_bytes: 256
from itertools import accumulate
from bisect import bisect_right

N, M, K = map(int, input().split())
A = [0] + list(map(int, input().split()))
A = list(accumulate(A))
B = [0] + list(map(int, input().split()))
B = list(accumulate(B))

ans = 0
for i, a in enumerate(A):
    if a > K:
        break
    n = bisect_right(B, K-a) - 1
    ans = max(ans, i+n)

print(ans)

Measured memory_bytes: 42708
#include "bits/stdc++.h"
#include <cmath>

#define fi first
#define se second
#define all(x) x.begin(), x.end()
using namespace std;
using ull = unsigned long long;
using ll = long long;
constexpr int I_INF = INT_MAX;
constexpr ll L_INF = LLONG_MAX;

struct __INIT {
    __INIT() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
    }
} __init;

int main() {
    int N, M;
    cin >> N >> M;
    vector<vector<int>> S(M);
    for (int i = 0; i < M; i++) {
        int k;
        cin >> k;
        S[i].resize(k);
        for (int j = 0; j < k; j++) cin >> S[i][j];
    }
    vector<int> P(M);
    for (int i = 0; i < M; i++) cin >> P[i];

    ll sum = 0;
    for (int bit = 0; bit < (1 << N); bit++) {
        bool exist = true;
        for (int i = 0; i < M; i++) {
            int on = 0;
            for (int j : S[i]) {
                if (bit & (1 << (j - 1))) on++;
            }
            if (on % 2 != P[i]) {
                exist = false;
                break;
            }
        }
        if(exist) sum++;
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define INF 1e8
typedef long long int ll;
const double PI = acos(-1);

using Graph = vector<vector<int>>;
int main() {
  ll n, a, b;
  cin >> n >> a >> b;
  ll ans = (n / (a + b)) * a;
  if ((n % (a + b)) >= a)
    ans += a;
  else
    ans += (n % (a + b));
  cout << ans << endl;
}


Measured memory_bytes: 3552
import sys

s = input()
if len(s) == 4:
    if s.count(s[0]) == 2:
        if s.count(s[1]) == 2:
            if s.count(s[2]) == 2:
                if s.count(s[3]) == 2:
                    print("Yes")
                    exit()
print("No")


Measured memory_bytes: 2940
#include<iostream>

using namespace std;

int main(){
  int n,d,x,a[109], cnt=0;
  cin >> n >> d >> x;
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  cnt+=n;
  for(int i=0;i<n;i++){
    cnt += (d-1)/a[i];
  }
  cout << cnt + x << endl;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.nextLine();
        String ans = sc.nextLine();
        int mid = n/2;
        System.out.println(ans.substring(0, mid).equals(ans.substring(mid)) ? "Yes" : "No");
    }
}

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

using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;

template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (int i=(int)from; i<(int)to; i++)
#define all(vec) vec.begin(), vec.end()
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (int i=(int)N-1; i>=0; i--)

const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const int INF = pow(2,30)-1;

vector<ll> fac;
void c_fac(int x=pow(10,6)+10) { fac.resize(x,true); rep(i,x) fac[i] = i ? (fac[i-1]*i)%MOD : 1; }
ll inv(ll a, ll m=MOD) { ll b = m, x = 1, y = 0; while (b!=0) { int d = a/b; a -= b*d; swap(a,b); x -= y*d; swap(x,y); } return (x+m)%m; }
ll nck(ll n, ll k) { return fac[n]*inv(fac[k]*fac[n-k]%MOD)%MOD; }
ll gcd(ll a, ll b) { if (a<b) swap(a,b); return b==0 ? a : gcd(b, a%b); }
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; }


int main() {
  ll N, K; cin >> N >> K;
  ll A[N]; rep(i,N) cin >> A[i]; sort(A,A+N,[](const ll &x, const ll &y){ return abs(x)>abs(y)||(abs(x)==abs(y)&&x>y); });
  // debug(A,A+N);

  if (A[K-1]==0) { cout << 0 << endl; return 0; }

  bool allm = true; rep(i,N) allm &= A[i]<0;
  if (allm&K%2==1) { // 絶対に負
    ll result = 1; rep(i,K) result = result * A[(N-1)-i] % MOD;
    cout << (result + MOD) % MOD << endl;
    return 0;
  }

  ll pl = -1*LLINF, ml = LLINF, pr = -1*LLINF, mr = LLINF;
  rep(i,K) {
    if (A[i]>=0) pl = A[i];
    else ml = A[i];
  }

  repr(i,K,N) {
    if (A[i]>=0&&pr==-1*LLINF) pr = A[i];
    if (A[i]<=0&&mr==LLINF) mr = A[i];
  }

  bool isplus = true; rep(i,K) isplus ^= A[i]<0;

  // cout << pl << "," << ml << " " << pr << "," << mr << endl;
  // cout << isplus << endl;

  ll result = 1; rep(i,K) result = result * A[i] % MOD;
  if (!isplus) {
    bool c1 = pl!=-1*LLINF && mr!=LLINF;
    bool c2 = pr!=-1*LLINF && ml!=LLINF;
    // cout << c1 << " " << c2 << endl;
    if (c1) {
      if (c2) {
        if (pl*pr>=ml*mr) result = result * inv(-1*ml) * -1 % MOD * pr % MOD;
        else result = result * inv(pl) % MOD * mr % MOD;
      }
      else result = result * inv(pl) % MOD * mr % MOD;
    }
    else {
      if (c2) result = result * inv(-1*ml) * -1 % MOD * pr % MOD;
      else result = (result+MOD) % MOD;
    }
  }

  cout << result << endl;
  return 0;
}

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

int64_t MOD = 1000000007;
int64_t MAX = 9223372036854775807;
double PI = 3.141592653589793;

int main()
{
    string S;
    cin >> S;
    map<char, int> list;
    for (int i = 0; i < S.size(); i++)
        list[S[i]]++;
    bool x = true;
    for (auto y = 'a'; y <= 'z'; y++)
        if (list.find(y) == list.end())
        {
            cout << y;
            x = false;
            break;
        }
    if (x)
        cout << "None";
}


Measured memory_bytes: 512
parseInt(x)=parse(Int,x)
parseMap(x::Array{SubString{String},1})=map(parseInt,x)

function main()
	n = readline() |> parseInt
	t = Tuple[]
	for i in 1:n
		a,b = readline() |> split
		push!(t,(i,a,parseInt(b)))
	end
	t = sort(t,by=x->x[3],rev=true)
	t = sort(t,by=x->x[2])
	for i in 1:n
		println(t[i][1])
	end	
end

main()


Measured memory_bytes: 150612
import java.util.Scanner;

public class Main {
    static final int MODULUS = 1_000_000_007;

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

        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] S = new int[N];
        for (int i = 0; i < S.length; ++i) {
            S[i] = sc.nextInt();
        }
        int[] T = new int[M];
        for (int i = 0; i < T.length; ++i) {
            T[i] = sc.nextInt();
        }

        System.out.println(solve(S, T));

        sc.close();
    }

    static int solve(int[] S, int[] T) {
        int[][] wayNums = new int[S.length + 1][T.length + 1];
        for (int i = 0; i <= S.length; ++i) {
            int matchedSum = 0;
            for (int j = 0; j <= T.length; ++j) {
                if (i == 0 || j == 0) {
                    wayNums[i][j] = 1;
                } else {
                    if (T[j - 1] == S[i - 1]) {
                        matchedSum = addMod(matchedSum, wayNums[i - 1][j - 1]);
                    }

                    wayNums[i][j] = addMod(wayNums[i - 1][j], matchedSum);
                }
            }
        }

        return wayNums[S.length][T.length];
    }

    static int addMod(int x, int y) {
        return (x + y) % MODULUS;
    }
}

Measured memory_bytes: 66324
N=int(input())
A=list(map(int,input().split()))
A.sort(reverse=True)
A.append(0)
i=0
ans=1
d=0
while i<N:
  b=A[i]
  c=0
  while i<N and b==A[i]:
    i+=1
    c+=1
  if 2<=c<=3:
    d+=1
    ans*=b
    if d==2:
      break
  elif 4<=c:
    if d==0:
      ans*=b*b
      d=2
      break
    else:
      ans*=b
      d+=1
      break
if d!=2:
  print(0)
else:
  print(ans)

Measured memory_bytes: 20424
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>

using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f3f3f3f3fLL
#define SIZE 8080
#define REP(i,n) for(int i=0;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()

typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
ll MOD=1e9+7;
typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
int main(){
	string X,Y;
	cin>>X>>Y;
	int N;
	cin>>N;
	int cntX[114514]={0};
	int cntY[114514]={0};
	int sum=0;
	for(int i=0;i<X.size();i++){
		sum+=X[i]-'A'+1;
		sum%=3;
		cntX[i+1]=sum;
	}
	sum = 0;
	for(int i=0;i<Y.size();i++){
		sum+=Y[i]-'A'+1;
		sum%=3;
		cntY[i+1]=sum;
	}
	int a,b,c,d;
	for(int i=0;i<N;i++){
		cin>>a>>b>>c>>d;
		if((cntX[b]-cntX[a-1]+3)%3==(cntY[d]-cntY[c-1]+3)%3){
			cout<<"YES"<<endl;
		}else{
			cout<<"NO"<<endl;
		}
	}
}

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

#include <atcoder/all>

// #LIB#

using namespace std;
using namespace atcoder;
using ll = long long;
#define double long double
#define rep(i, n) for (long long i = 0; i < (n); ++i)
#define repr(i, a, b) for (auto i = (a); i < (b); ++i)
#define itr(x, c) for (auto&& x : (c))
#define updatemax(t, v) ((t) = std::max((t), (v)))
#define updatemin(t, v) ((t) = std::min((t), (v)))
#ifdef ONLINE_JUDGE
#define endl _endl
const char _endl = (cin.tie(0), cout.tie(0), ios::sync_with_stdio(0), cout.precision(16), '\n');
#endif

int main() {
  ll n, m;
  cin >> n >> m;
  scc_graph g(n);
  rep(i, m) {
    ll a, b;
    cin >> a >> b;
    g.add_edge(a, b);
  }
  auto ans = g.scc();
  cout << ans.size() << endl;
  itr(l, ans) {
    cout << l.size();
    bool f = true;
    itr(x, l) cout << ' ' << x;
    cout << endl;
  }
}


Measured memory_bytes: 40132
use std::io::{stdin, BufReader, StdinLock, BufRead};

fn main() {
    let std_in = stdin();
    let mut br = BufReader::new(std_in.lock());

    let s = rs(&mut br);
    let f = s[0].to_digit(10).unwrap() * 10 + s[1].to_digit(10).unwrap();
    let b = s[2].to_digit(10).unwrap() * 10 + s[3].to_digit(10).unwrap();
    let fb = f > 0 && f < 13;
    let bb = b > 0 && b < 13;
    if fb && bb {
        println!("AMBIGUOUS");
    } else if fb {
        println!("MMYY");
    } else if bb {
        println!("YYMM");
    } else {
        println!("NA");
    }
}


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

fn rs(br: &mut BufReader<StdinLock>) -> Vec<char> {
    let mut buf = String::new();
    br.read_line(&mut buf).ok();
    buf.trim().chars().collect()
}

#[allow(dead_code)]
fn rn<T: std::str::FromStr>(br: &mut BufReader<StdinLock>) -> T {
    let mut buf = String::new();
    br.read_line(&mut buf).ok();
    buf.trim().parse().ok().unwrap()
}

fn rvs(br: &mut BufReader<StdinLock>) -> Vec<Vec<char>> {
    let mut buf = String::new();
    br.read_line(&mut buf).ok();
    buf.trim().split_whitespace().map(|e| e.chars().collect()).collect()
}

fn rvn<T: std::str::FromStr>(br: &mut BufReader<StdinLock>) -> Vec<T> {
    let mut buf = String::new();
    br.read_line(&mut buf).ok();
    buf.trim().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}



Measured memory_bytes: 4352
#include <iostream>
#include <math.h>

using namespace std;

int main()
{
    char b;
    cin >> b;

    switch (b) {
        case 'A':
            cout << 'T';
            break;
        case 'C':
            cout << 'G';
            break;
        case 'G':
            cout << 'C';
            break;
        case 'T':
            cout << 'A';
            break;
        default:
            break;
    }

    return 0;
}   


Measured memory_bytes: 256
import Data.List
f _ [] = 0
f l (d:ds) = (l*d) + (f (l-1) ds)

ans [] = []
ans (_:d:ds) = 
    let s = sort d
        l = length d
        a = f l s
    in
        a:(ans ds)

main = do
    c <- getContents
    let i = map (map read) $ map words $ lines c :: [[Int]]
        o = ans i
    mapM_ print o


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

int main(){
  long long X,Y,A,B,C,i,x=0,y=0,z=0,temp,ans=0;
  pair<long long,long long> ptemp;
  priority_queue<pair<long long,long long> > Q;
  cin>>X>>Y>>A>>B>>C;
  for(i=0;i<A;i++){
    cin>>temp;
    Q.push(pair<long long,long long>(temp,0));
  }
  for(i=0;i<B;i++){
    cin>>temp;
    Q.push(pair<long long,long long>(temp,1));
  }
  for(i=0;i<C;i++){
    cin>>temp;
    Q.push(pair<long long,long long>(temp,2));
  }
  
  while(x+y+z<X+Y){
    ptemp=Q.top();
    if(ptemp.second==0 && X>x){
      x++;
      ans+=ptemp.first;
    }
    if(ptemp.second==1 && Y>y){
      y++;
      ans+=ptemp.first;
    }
    if(ptemp.second==2){
      z++;
      ans+=ptemp.first;
    }
    Q.pop();
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 10604
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1e18+7;
const int inf=1e9+7;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};



int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    int a,b,k;
    cin>>a>>b>>k;
    int cnt=0;
    int n=min(a,b);
    for(int i=n;i>0;i--){
        if(a%i==0&&b%i==0) cnt ++;
        if(cnt==k){
            cout<<i<<endl;
            return 0;
        }
    }
}
//./problem.exe

Measured memory_bytes: 256
import java.util.*;
 
public class Main{
  public static void main(String[]args){
    Scanner sc =  new Scanner(System.in);
    String S = sc.nextLine();
    int N = S.length();
    int[] num = new int[N];
    int r = 0, l = 0, ir = 0, il = 0;
    for(int i = 0; i < N; i++){
      if(S.charAt(i) == 'R'){
        r++;
      }else{
        l++;
      }
      
      if(S.charAt(i) == 'R' && S.charAt(i+1) == 'L'){
        ir = i;
        il = i+1;
      }
      
      if(S.charAt(i) == 'L'){
        if(i == N-1){
          num[ir] = num[il] = (r+l)/2;
          if((r+l)%2 == 1){
            if((r > l && l%2 == 1) || (r < l && r%2 == 0)){
              num[il]++;
            }else{
              num[ir]++;
            }
          }
          l = r = 0;
        }else if(S.charAt(i+1) == 'R'){
          num[ir] = num[il] = (r+l)/2;
          if((r+l)%2 == 1){
            if((r > l && l%2 == 1) || (r < l && r%2 == 0)){
              num[il]++;
            }else{
              num[ir]++;
            }
          }
          l = r = 0;
        }
      }
    }
    
    for(int j = 0; j < N; j++){
      if(j < N-1){
        System.out.print(num[j]);
        System.out.print(" ");
      }else{
        System.out.println(num[j]);
      }
    }
  }
}

Measured memory_bytes: 46600
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography.X509Certificates;
using System.Text;

namespace AtCoder.ABC
{
	class QuestionA
	{
		public static void Main(string[] args)
		{
            var scanner = new Scanner();

            var nxt = scanner.ArrayInt(3);
            var n = nxt[0];
            var x = nxt[1];
            var t = nxt[2];

            var tt = (n + x - 1) / x;

            Console.WriteLine(tt * t);
		}

        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                string st = Console.ReadLine();
                while (st == "") st = Console.ReadLine();
                s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
                if (s.Length == 0) return next();
                i = 0;
                return s[i++];
            }

            public int nextInt()
            {
                return int.Parse(next());
            }
            public int[] ArrayInt(int N, int add = 0)
            {
                int[] Array = new int[N];
                for (int i = 0; i < N; i++) {
                    Array[i] = nextInt() + add;
                }
                return Array;
            }

            public long nextLong()
            {
                return long.Parse(next());
            }

            public long[] ArrayLong(int N, long add = 0)
            {
                long[] Array = new long[N];
                for (int i = 0; i < N; i++) {
                    Array[i] = nextLong() + add;
                }
                return Array;
            }

            public double nextDouble()
            {
                return double.Parse(next());
            }


            public double[] ArrayDouble(int N, double add = 0)
            {
                double[] Array = new double[N];
                for (int i = 0; i < N; i++) {
                    Array[i] = nextDouble() + add;
                }
                return Array;
            }
        }
    }
}

Measured memory_bytes: 27500
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>

using namespace std;

int main()
{
  int n,count = 0;
  string s;
  
  cin >> n;
  cin >> s;
  
  if(n % 2 != 0)
  {
    cout << "No";
    return 0;
  }
  
  n /= 2;
  
  for(int i = 0; i < n; i++)
  {
    if(s[i] == s[i+n])
    {
      count++;
    }
  }
  
  if(count == n)
  {
    cout << "Yes";
  }
  else
  {
    cout << "No";
  }
  
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define inf INT_MAX
#define INF LLONG_MAX
#define ll long long
#define ull unsigned long long
#define M (int)(1e9+7)
#define P pair<int,int>
#define FOR(i,m,n) for(int i=(int)m;i<(int)n;i++)
#define RFOR(i,m,n) for(int i=(int)m;i>=(int)n;i--)
#define rep(i,n) FOR(i,0,n)
#define rrep(i,n) RFOR(i,n,0)
#define all(a) a.begin(),a.end()
const int vx[4] = {0,1,0,-1};
const int vy[4] = {1,0,-1,0};
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define int ll
#define vi vector<int>
#define IP pair<int,P>
#define PI pair<P,int>
#define PP pair<P,P>
#define Yes(f){cout<<(f?"Yes":"No")<<endl;}
#define YES(f){cout<<(f?"YES":"NO")<<endl;}
int Madd(int x,int y) {return (x+y)%M;}
int Msub(int x,int y) {return (x-y+M)%M;}
int Mmul(int x,int y) {return (x*y)%M;}


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

  vi a(2);
  rep(i,2){
    cin>>a[i];
  }
  sort(all(a));
  reverse(all(a));
  if(a[0]==a[1]){
    cout<<a[0]*2<<endl;
  }else{
    cout<<a[0]*2-1<<endl;
  }


}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

const int N = 16;
int64 dp[1 << N], pre[1 << N];
int a[N][N];

int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      scanf("%d", &a[i][j]);
    }
  }
  for (int k = 1; k < (1 << n); ++k) {
    int x = -1;
    for (int i = 0; i < n; ++i) {
      if (k & (1 << i)) {
        x = i;
        break;
      }
    }
    pre[k] = pre[k ^ (1 << x)];
    for (int i = 0; i < n; ++i) {
      if (k & (1 << i)) {
        if (i == x) continue;
        pre[k] += a[x][i];
      }
    }
    // trace(k, pre[k]);
  }
  for (int k = 1; k < (1 << n); ++k) {
    int x = -1;
    for (int i = 0; i < n; ++i) {
      if (k & (1 << i)) {
        x = i;
        break;
      }
    }
    int all = k ^ (1 << x);
    for (int v = all; ; v = (v - 1) & all) {
      dp[k] = max(dp[k], dp[k ^ v ^ (1 << x)] + pre[v ^ (1 << x)]);
      if (v == 0) break;
    }
  }
  printf("%lld\n", dp[(1 << n) - 1]);
  return 0;
}


Measured memory_bytes: 1280
# coding: utf-8
# Your code here!
n=int(input())
A=list(map(int,input().split()))
ans=0
l=0;r=0
nowsum =0#ここでf(0,0)を計算
nowxsum=0
for l in range(0,n):
    while(r < n and (nowsum + A[r] == nowxsum ^ A[r])):#f(l,r+1)が条件をみたすかチェック
        nowsum  += A[r] #ここでf(l,r+1)にうつる
        nowxsum ^= A[r]
        r +=1
    #f(l,r) < Sとなる最大のrがとれた！
    ans += r-l #ここで問題に必要な値を計算
    nowsum -= A[l] #ここでf(l+1,r)を計算
    nowxsum ^= A[l] #ここでf(l+1,r)を計算
print(ans)

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

int main() {
  int N;
  cin >> N;
  vector<string> test(N);
  for(int i=0; i<N; i++){
    cin >> test.at(i);
  }
  
  int AC=0;
  int WA=0;
  int TLE=0;
  int RE=0;
  for(int i=0; i<N; i++){
    if(test.at(i)=="AC"){
      AC++;
    }
    else if(test.at(i)=="WA"){
      WA++;
    }
    else if(test.at(i)=="TLE"){
      TLE++;
    }
    else{
      RE++;
    }
  }
  
  cout << "AC" << " " << "x" << " " << AC << endl;
  cout << "WA" << " " << "x" << " " << WA << endl;
  cout << "TLE" << " " << "x" << " " << TLE << endl;
  cout << "RE" << " " << "x" << " " << RE << endl;
}


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

int main() {
  int h,n;
  cin >> h >> n;
  int attack = 0;
  rep(i,0,n) {
    int a;
    cin >> a;
    attack += a;
  }
  if (attack >= h) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 3620
#include <stdio.h>

int main(void)
{
	int x,y,a,b,c,d;
	d=0;
	scanf("%d %d %d",&a,&b,&c);
	for(x=a;x<=b;x++){
		y=c%x;
		if(y>0){
			d=d+0;
		}else{
			d=d+1;
		}
	}
	printf("%d\n",d);
	
	return 0;
}

Measured memory_bytes: 596
#include<cstdio>
#include<bitset>
using namespace std;

const int N = 400;
const int M = 1e5;
bitset<N+3> f[N+3],tmp;
int a[M+2],b[M+2];
int n,m;

int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1; i<=m; i++) scanf("%d%d",&a[i],&b[i]);
    for(int i=1; i<=n; i++)
    {
        f[i][i] = true;
        for(int j=m; j>=1; j--)
        {
            bool x = f[i][a[j]],y = f[i][b[j]];
            if(x && y) {f[i].set(0); break;}
            if((!x) && y) {f[i].set(a[j]);}
            else if(x && (!y)) {f[i].set(b[j]);}
        }
    }
    int ans = 0;
    for(int i=1; i<=n; i++)
    {
        for(int j=i+1; j<=n; j++)
        {
            if(f[i][0] || f[j][0]) continue;
            tmp = f[i]&f[j];
            if(!(tmp.any())) ans++;
		}
	}
	printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 1024
'use strict'
function Main(input) {
	input = input.split('\n');
  	let num = input[0];
  	let char = input[1];
  	
	const divide = char.length / 2;
  	let first = char.substr(0, divide);
  	let second = char.substr(divide, divide);
  
  	if (num % 2 !== 0) {console.log('No'); return;};
  	if (first === second) {
    	console.log('Yes');
    } else {
    	console.log('No');
    }
  
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7372
#include<bits/stdc++.h>
using namespace std;
#define test int t;scanf("%d", &t);while(t--)
#define sd(n) scanf("%d", &n)
#define loop(i, n) for(int i = 0;i<n;i++)
#define kloop(i, k, n) for(int i=k;i<n;i++)
#define rloop(i, n) for(int i = n;i>=0;i--)
#define rkloop(i, n, k) for(int i = n;i>=k;i--)
#define MOD 1000000007
#define PI 3.14159265
#define interactive(x) cout<<x<<"\n";fflush(stdout)
const int MAXN = 100005;
typedef long long ll;
/*int fact[5001];
int invfact[5001];
int inv(int a, int b){
    if(b==0)
        return 1;
    if(b&1)
        return (long long)a*inv(a, b-1)%MOD;
    else{
        int res = inv(a, b>>1);
        return (long long)res*res%MOD;
    }
}
void init(){
    fact[0] = 1;
    for(int i=1;i<5001;i++){
        fact[i] = (long long)fact[i-1]*i%MOD;
    }
    invfact[5000] = inv(fact[5000], MOD-2);
    for(int i=5000;i>0;i--){
        invfact[i-1] = (long long)invfact[i]*i%MOD;
    }
}
int C(int n, int r){
    if(r>n || r<0)
        return 0;
    return (long long)((long long)fact[n]*invfact[r]%MOD)*invfact[n-r]%MOD;
}
int gcd(int a, int b){
    return a>b?(gcd(b, a)):(a==0?b:gcd(b%a, a));
}*/
int n, arr[205];
void solve(){
    sd(n);
    loop(i, 2*n)    sd(arr[i]);
    sort(arr, arr+(2*n));
    int ans = 0;
    for(int i=(2*n)-2;i>=0;i-=2)    ans+=arr[i];
    printf("%d\n", ans);
}
int main(){
    solve();
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1'000'000'007;
template <class T>
bool chmax(T &a, const T &b) { return (a < b) ? (a = b, 1) : 0; }
template <class T>
bool chmin(T &a, const T &b) { return (b < a) ? (a = b, 1) : 0; }

int main() {
    int n;
    cin >> n;
    vl a(3 * n);
    for (int i = 0; i < 3 * n; ++i) {
        cin >> a[i];
    }
    sort(a.begin(), a.end(), greater<ll>());
    ll ret = 0;
    for (int i = 0; i < 2 * n; ++i) {
        if (i % 2 == 1)
            ret += a[i];
    }
    cout << ret << endl;
    return 0;
}

Measured memory_bytes: 2560
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
using namespace std;
typedef long long ll;
const ll inf=1e16;
int n;
int S,T,cnt=1;
int head[2013];
struct Edge{
	int nxt,to;
	ll w,c;
}e[20003];
ll dis[2013],flow[2013];
int pre[2013],lst[2013];
bool v[2013];
void add(int u,int v,ll w,ll c)
{
	e[++cnt]=(Edge){head[u],v,w,c};
	head[u]=cnt;
	e[++cnt]=(Edge){head[v],u,0,-c};
	head[v]=cnt;
}
bool spfa()
{
	queue<int> q;
	for(int i=1;i<=T+4;i++)
		dis[i]=inf;
	dis[S]=0,flow[S]=inf;
	q.push(S);
	while(!q.empty())
	{
		int x=q.front();
		q.pop();
		v[x]=false;
		for(int i=head[x];i;i=e[i].nxt)
		{
			int to=e[i].to;
			if(e[i].w&&dis[to]>dis[x]+e[i].c)
			{
				dis[to]=dis[x]+e[i].c;
				flow[to]=min(flow[x],e[i].w);
				pre[to]=x,lst[to]=i;
				if(!v[to]) q.push(to),v[to]=true;
			}
		}
	}
	return dis[T]!=inf;
}
ll mcmf()
{
	ll ans=0;
	while(spfa())
	{
		ans+=dis[T]*flow[T];
		for(int i=T;i!=S;i=pre[i])
			e[lst[i]].w-=flow[T],e[lst[i]^1].w+=flow[T];
	}
	return ans;
}
int main()
{
	scanf("%d",&n);
	S=n+n+1,T=S+1;
	for(int i=1;i<=n;i++)
	{
		ll x,y,z;
		scanf("%lld%lld%lld",&x,&y,&z);
		add(S,i,z,0);
		add(i,T+1,inf,x+y);
		add(i,T+2,inf,-x-y);
		add(i,T+3,inf,x-y);
		add(i,T+4,inf,y-x);
	}
	for(int i=1;i<=n;i++)
	{
		ll x,y,z;
		scanf("%lld%lld%lld",&x,&y,&z);
		add(n+i,T,z,0);
		add(T+1,n+i,inf,-x-y);
		add(T+2,n+i,inf,x+y);
		add(T+3,n+i,inf,y-x);
		add(T+4,n+i,inf,x-y);
	}
	printf("%lld",-mcmf());
	return 0;
}

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

int abs( int a, int b )
{
    return a - b > 0 ? a - b : b - a;
}

int min( int a, int b )
{
    return a < b ? a : b;
}

string plusCalc( string a, string b );
string multipleCalc( string a, int b );

int main()
{
    string r, s, res, unit[17] = { "Man", "Oku", "Cho", "Kei", "Gai", "Jo", "Jou", "Ko", "Kan", "Sei", "Sai", "Gok", "Ggs", "Asg", "Nyt", "Fks", "Mts" };
    int a, b;

    while( cin >> a >> b )
    {
        res = "";
        if( a + b == 0 )
            break;

        r = '1';
        for( int i = 0; i < b; i++ )
            r = multipleCalc( r, a );

        string fix = "";
        for( int i = 0; i < ( 4 - r.size() ) % 4; i++ )
            fix += "0";
        r = fix + r;

        int i = r.size(), k = 0;
        s = r.substr( i - 4, 4 );
        if( s != "0000" )
            res = plusCalc( s, "0" );
        i -= 4;
        while( i != 0 )
        {
            string s = r.substr( i - 4, 4 );
            if( s != "0000" )
                res = plusCalc( s, "0" ) + unit[k] + res;
            k++;
            i -= 4;
        }
        cout << res << endl;
    }
    return 0;
}

string plusCalc( string a, string b )
{
    int d = abs( a.size(), b.size() );
    string fix = "";
    for( int i = 0; i <= d; i++ )
        fix += "0";
    string s, t;
    if( a.size() > b.size() )
    {
        s = "0";
        t = fix;
    }
    else if( a.size() < b.size() )
    {
        s = fix;
        t = "0";
    }
    else
    {
        s += "0";
        t = "0";
    }
    s += a;
    t += b;
    for( int i = s.size() - 1; i >= 0; i-- )
    {
        s[i] = s[i] + t[i] - '0';
        if( s[i] - '0' >= 10 )
        {
            s[i-1]++;
            s[i] -= 10;
        }
    }

    int k = 0;
    for( int i = 0; i < s.size(); i++ )
        if( '1' <= s[i] && s[i] <= '9' )
        {
            k = i;
            break;
        }
    s = s.substr( k, s.size() );
    return s;
}

string multipleCalc( string a, int b )
{
    string c = "0";
    for( int i = 0; i < b; i++ )
    {
        c = plusCalc( a, c );
    }
    return c;
}


Measured memory_bytes: 3228
#include<bits/stdc++.h>
#define fo(i,a,b) for(int i= a ; i < b ; ++i)
#define rep(i,n) fo(i,0,n)
#define pln(n) printf("%lld\n",n)
#define sll(n) scanf("%lld",&n)
#define ss(n) scanf("%s",n)
#define vi vector < int >
#define pii pair < int , int >
#define pb push_back
#define mp make_pair
#define ll long long
#define ull unsigned long long
#define INF 0x3f3f3f3f
#define dbg(x) { cout<< #x << ": " << (x) << endl; }
#define dbg2(x,y) { cout<< #x << ": " << (x) << " , " << #y << ": " << (y) << endl; }
#define dbg3(x,y,z) { cout<< #x << ": " << (x) << " , " << #y << ": " << (y) <<" , "<< #z <<": "<<(z)<<endl; }
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define vll vector<long long>
#define vvi vector<vector<int>>
#define si set<int>
#define tr(c, it) \
for(decltype(c.begin()) it = c.begin(); it!= c.end(); it++)
#define pis pair<int,string>
#define present(c, x) (c.find(x) != c.end())
#define cpresent(c, x) (find(all(c),x) != c.end())
using namespace std;
int main(){
	int n, W;
	cin >> n >> W;
	vector<int> w(n);
	vector<int> val(n);
	for(int i = 0; i < n; i++){
		cin >> w[i] >> val[i];
	}
	long long dp[n+1][W+1];
	for(int i = 0; i <= n; i++){
		dp[i][0] = 0;
	}
	for(int j = 0; j <= W; j++){
		dp[0][j] = 0;
	}
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= W; j++){
			if(j >= w[i-1]){
				dp[i][j] = max(dp[i-1][j], dp[i-1][j - w[i-1]] + val[i-1]);
			}
			else {
				dp[i][j] = dp[i-1][j];
			}
		}
	}
	cout << dp[n][W] << endl;
	return 0;
}

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

using ll = long long;
#define REP(i,n) for(int i=0; i < (n); ++i)
#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)

#define INF 1e9

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  REP(i, N){
    cin >> A[i];
  }
  REP(i, N){
    if(A[i] % 2 == 0){
      if(A[i] % 3 == 0 || A[i] % 5== 0){

      }
      else{
        cout << "DENIED" << endl;
        return 0;
      }
    }
  }
  cout << "APPROVED" << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(void){
    
    int a,b;
    cin>>a>>b;
    int num[]={13,1,2,3,4,5,6,7,8,9,10,11,12};
    cout<<(num[a-1]>num[b-1]?"Alice":num[a-1]<num[b-1]?"Bob":"Draw")<<endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define forn(i, n) for(int i = 0; i < int(n); ++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi; typedef vector<pair<int, int>> vpi; typedef vector<vi> vvi;
typedef vector<ll> vll; typedef vector<pair<ll, ll>> vpll; typedef vector<vll> vvll;


int32_t main(){
    ios::sync_with_stdio(false); cin.tie(nullptr);
    cout.precision(10); cout << fixed;
#ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
#endif

    int a,b,c,d;
    cin>>a>>b>>c>>d;
    while(a>0&&c>0){
    	c=c-b;
    	if(c<=0){
    		cout<<"Yes"<<endl;
    		break;
    	}
    	a=a-d;
    	if(a<=0){
    		cout<<"No"<<endl;
    		break;
    	}
    }



    
    return 0;
}


Measured memory_bytes: 3688
#include<bits/stdc++.h>
using namespace std;
#define int long long
namespace Fread {
	const int MAXN=1<<20;
	char buf[MAXN],*S,*T;
	inline char getchar() {
		if (S==T) {
			T=(S=buf)+fread(buf,1,MAXN,stdin);
			if (S==T) return EOF;
		}
		return *S++;
	}
}
inline int read() {
	int x(0),neg(1);
	char ch=getchar();
	while(!isdigit(ch)) {
		if (ch=='-') neg=-1;
		ch=getchar();
	}
	while(isdigit(ch)) {
		x=(x<<1)+(x<<3)+(ch-'0');
		ch=getchar();
	}
	return x*neg;
}
#ifdef ONLINE_JUDGE
	#define getchar Fread::getchar
#endif
#define pb push_back
#define mp make_pair
const int MAXN=1e5;
int n;
int val[MAXN+5];
int num[25];
int dp[1<<20],xr[1<<20];
signed main() {
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	n=read();
	for (int i=1;i<n;++i) {
		int u(read()+1),v(read()+1),w(read());
		val[u]^=w,val[v]^=w;
	}
	sort(val+1,val+n+1);
	int pos=1,ans=0,cnt=0;
//	for (int i=1;i<=n;++i) cout<<val[i]<<" ";
//	puts("");
	while(pos<=n) {
		if (val[pos]==0) {
			pos++;
			continue;
		}
		if (val[pos]==val[pos+1]) {
			ans+=1;
			pos+=2;
		}
		else {
			num[++cnt]=val[pos];
			++pos;
		}
	}
//	cout<<ans<<'\n';
	int S=0;
	for (int i=1;i<=cnt;++i) {
		S |= (1<<(num[i]-1));
	} 
	for (int i=1;i<(1<<15);++i) dp[i]=dp[i>>1]+(i&1);
	for (int i=1;i<(1<<15);++i) --dp[i];
	for (int i=1;i<=(1<<15);++i) {
		for (int j=1;j<=15;++j) {
			if (i&(1<<(j-1))) {
				xr[i]^=j;
			}
		}
	}
	for (int i=1;i<(1<<15);++i) {
		if (xr[i]) continue;
		for (int j=i&(i-1);j;j=(j-1)&i) {
			if (!xr[j]) {
				dp[i]=min(dp[i],dp[j]+dp[i^j]);
			}
		}
	}
    printf("%lld\n",ans+dp[S]);
	return 0;
}


Measured memory_bytes: 5044
#include<stdio.h>
 
long long krag(long long x,long long y){
	if(x%y == 0){return x/y;}
	return (x/y)+1;
}
 
int main(void){
	long long a,b,x;
	scanf("%lld%lld%lld",&a,&b,&x);
	printf("%lld\n",(b/x)-krag(a,x)+1);
	return 0;
}

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


int main(){
  ll a, b, c, d;
  cin >> a >> b >> c >> d;

  ll ret = a*c;
  ret = max(ret, a*d);
  ret = max(ret, b*c);
  ret = max(ret, b*d);
  
  cout << ret << endl;
  
  return 0;
}


Measured memory_bytes: 3632
# Union Find 木
from sys import setrecursionlimit


def find(parent, i):
    t = parent[i]
    if t < 0:
        return i
    t = find(parent, t)
    parent[i] = t
    return t


def unite(parent, i, j):
    i = find(parent, i)
    j = find(parent, j)
    if i == j:
        return
    parent[j] += parent[i]
    parent[i] = j


setrecursionlimit(10 ** 5)

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

parent = [-1] * N
inconvenience = N * (N - 1) // 2
result = []
for a, b in reversed([[int(c) - 1 for c in input().split()] for _ in range(M)]):
    result.append(inconvenience)
    pa, pb = find(parent, a), find(parent, b)
    if pa != pb:
        inconvenience -= parent[pa] * parent[pb]
    unite(parent, a, b)
print(*result[::-1])


Measured memory_bytes: 39304
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[][] studentInfo = new int[n][2];
		int[][] checkPointInfo = new int[m][2];
		for(int i =0;i<n;i++) {
			studentInfo[i][0] = sc.nextInt();
			studentInfo[i][1] = sc.nextInt();
		}
		for(int i =0;i<m;i++) {
			checkPointInfo[i][0] = sc.nextInt();
			checkPointInfo[i][1] = sc.nextInt();
		}

		for(int i =0;i < n;i++) {
			int x = studentInfo[i][0];
			int y = studentInfo[i][1];
			int checkPoint = 0;
			int distance = Integer.MAX_VALUE;
			for(int j = 0; j <m;j++) {
				int distancej =(int)(Math.abs((double)(x -checkPointInfo[j][0]))
						+ Math.abs((double)(y -checkPointInfo[j][1])));
				if(distancej < distance) {
					checkPoint = j+1;
					distance = distancej;
				}
			}
			System.out.println(checkPoint);
		}
	}
}

Measured memory_bytes: 21716
#include<iostream>
#include<math.h>
using namespace std;
typedef long long ll;
ll a[50];
int main(){
	ll n,cnt=0,m,ans=1;
	cin>>m>>n;
	for(int i=2;i<=sqrt(n);){ 
		if(n%i==0){ 
			a[cnt++]=i;
			n=n/i;
		}else{
	 		i++;
		}
	}
	if(n!=1)a[cnt++]=n;
	a[cnt++]=0;
	ll pos=a[0],sum=0;
//	cout<<cnt<<"asdasdasdads";
//	for(int i=0;i<cnt;i++){
//		cout<<a[i]<<" ";
//	}cout<<endl;
	for(int i=0;i<cnt;i++){
	
		if(a[i]==pos){
			sum++;
		}else{
			if(sum>=m){
//				cout<<"asdasdasdasdasd";
				sum/=m;
				ans*=pow(pos,sum);
			}
			pos=a[i];
			sum=1; 
		}	
//		cout<<sum<<endl;
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 888
import sys

def make_all_cards():
    mark = ['S', 'H', 'C', 'D']
    cards = []
    
    for i in mark:
        for n in range(1, 14):
            cards.append(i + ' ' + str(n))

    return cards

if __name__ == '__main__':
    all_cards = make_all_cards()
    n = int(sys.stdin.readline().strip())

    for _ in range(n):
        card = sys.stdin.readline().strip()
        all_cards.remove(card)

    for i in all_cards:
        print(i)


Measured memory_bytes: 5600
#include <bits/stdc++.h>
using namespace std;
int main( ){
    string a, b;
    cin >> a;
    cin >> b;
    int n = (int)a.length() + 1;
    int m = (int)b.length() + 1;
    int dp[n] [m];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            if(i == 0 || j == 0)
                dp[i] [j] = 0;
            else if(a[i - 1] == b[j - 1])
                dp[i] [j] = dp[i - 1] [j - 1] + 1;
            else
                dp[i] [j] = max(dp[i] [j - 1], dp[i - 1] [j]); 
        }
    }
    if(dp[n - 1] [m - 1] == 0){
        puts(" ");
        return 0;
    }
    string ans;
    int i = n - 1, j = m - 1;
    while(i != 0 && j != 0){
        if(dp[i] [j] > dp[i - 1] [j] && dp[i] [j] > dp[i] [j - 1]){
            --i;
            --j;
            ans += a[i];
        }else if(dp[i] [j] == dp[i - 1] [j])
            --i;
        else if(dp[i] [j] == dp[i] [j - 1])
            --j;
    }
    reverse(ans.begin(), ans.end());
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 38800
#include <cstdio>
#include <map>
#include <string>
using namespace std;

int main(){
	char buf[8];
	map<string,int> mp;
	while(scanf("%*d,%s", buf) == 1){
		++mp[buf];
	}
	printf("%d\n%d\n%d\n%d\n", mp["A"], mp["B"], mp["AB"], mp["O"]);
}

Measured memory_bytes: 1072
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;

int main() {
  ll P, Q, R;
  cin >> P >> Q >> R;
  cout << min({P + Q, Q + R, R + P}) << endl;
  return 0;
}

Measured memory_bytes: 3584