akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <deque>
using namespace std;

long long degree(long long a, long long k, long long p) {
	long long res = 1;
	long long cur = a;

	while (k) {
		if (k % 2) {
			res = (res * cur) % p;
		}
		k /= 2;
		cur = (cur * cur) % p;
	}
	return res;
}

long long get_degree(long long n, long long p) {
	int degree_num = 0;
	long long u = p;
	long long temp = n;

	while (u <= temp) {
		degree_num += temp / u;
		u *= p;
	}
	return degree_num;
}

long long combinations(long long n, long long k, long long p) {
	int num_degree = get_degree(n, p) - get_degree(n - k, p);
	int den_degree = get_degree(k, p);

	if (num_degree > den_degree) {
		return 0;
	}
	long long res = 1;
	for (long long i = n; i > n - k; --i) {
		long long ti = i;
		while (ti % p == 0) {
			ti /= p;
		}
		res = (res * ti) % p;
	}
	for (long long i = 1; i <= k; ++i) {
		long long ti = i;
		while (ti % p == 0) {
			ti /= p;
		}
		res = (res * degree(ti, p - 2, p)) % p;
	}
	return res;
}

int main(){
	long long N, a, b;
	cin >> N >> a >> b;
	while (cin){
		long long types = 2, p = 1000000007;
		types = (degree(2,N,p) - combinations(N, a, p) - combinations(N, b, p) - 1);
		while (types < 0) types += p;
		cout << types << "\n";
		cin >> N >> a >> b;
	}
	return 0;
}

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

using namespace std;

#define debug(x) cerr << "  - " << #x << ": " << x << endl;
#define debugs(x, y) cerr << "  - " << #x << ": " << x << "         " << #y << ": " << y << endl;
#define sep() cerr << "--------------------" << endl;
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)x.size()
#define pb push_back
#define fi first
#define se second
#define mp make_pair

typedef long long ll;
const ll mod = 1e9 + 7;


int main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int a, b;
	cin >> a >> b;
	int mx = max(a, b);
	if(mx > 8) cout << ":(" << endl;
	else cout << "Yay!" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h> //C++の標準ライブラリを一行で一括でインクルードする
#include <math.h> //数学関数と数学定数を利用する
#define rep(i,n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}
bool is_integer( double x ){
  return floor(x)==x;
}
int main(){
  int n,d; cin >> n >> d;
  vector<vector<int>> x(n,vector<int>(d));
  rep(i,n){
    rep(j,d){
      cin >> x[i][j];
    }
  }
  
  int cnt = 0;
  for(int i=0;i<n;i++){
    for(int j=i+1;j<n;j++){
      int sum = 0;
      for(int k = 0; k<d;k++){
        sum += (x[i][k]-x[j][k])*(x[i][k]-x[j][k]);
      }
      double tmp = sqrt(sum);
      //printf("sum=%d tmp=%.10f\n",sum,tmp);
      if(is_integer(tmp)) cnt++;
    }
  }
  
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    int n, t, c, d, z = 890328;
    cin >> n >> t;
    while (n--) cin >> c >> d, z = (d <= t ? min(z, c) : z);
    if (z == 890328) cout << "TLE";
    else cout << z;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,s,n) for (int i=(s); i<(n); i++)
using namespace std;
using ll = long long;
 
int main()
{
    ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
 
    int N;
    cin >> N;
 
    vector<int> h(N);
    rep(i,0,N) cin >> h[i];
 
    int sum = h[0];
    rep(i,1,N) sum += max(h[i] - h[i - 1], 0);

    cout << sum << endl;
 
    return 0;
}

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

#define HAS_TEST_CASE 0  // Do you forget to complete this?

namespace rG
{
typedef long long ll;

const int N=5e5;

int n,m,a[N+10];
char str[N+10];

inline bool check(int i,int j,int k)
{
	if(a[i]==a[j]||a[j]==a[k]||a[k]==a[i])return 0;
	if(a[i]+a[j]<=a[k]||a[i]+a[k]<=a[j]||a[j]+a[k]<=a[i])return 0;
	return 1;
}

inline void main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",a+i);
	int ans=0;
	for(int i=1;i<=n;i++)
		for(int j=i+1;j<=n;j++)
			for(int k=j+1;k<=n;k++)
				if(check(i,j,k))ans++;
	printf("%d\n",ans);
}
}

int main()
{
#if !defined(ONLINE_JUDGE)&&HAS_TEST_CASE
	freopen("tmp.out","w",stdout);
#endif
	int T=1;
#if HAS_TEST_CASE
	scanf("%d",&T);
#endif
	while(T--)rG::main();
	return 0;
}


Measured memory_bytes: 3828
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll MOD = 1000000007;
 
int main(){
    string S;
    cin >> S;

    set<char> target{'A', 'C', 'G', 'T'};
    int max_len = 0;
    for(int i=0;i<S.size();i++){
        for(int j=1;i+j<=S.size();j++){
            string sub = S.substr(i, j);
            set<char> s(sub.begin(), sub.end());
            bool ok = true;
            for(char e : s){
                if(target.count(e) == 0){
                    ok = false;
                    break;
                }
            }
            if(ok){
                max_len = max(max_len, j);
            }
        }
    }
    cout << max_len << endl;

    return 0;
}


Measured memory_bytes: 256
n,a,b,c = map(int,input().split())
flag = True
ans = []
s = []
for i in range(n):
    s.append(input())
for i in range(n):
    if s[i] == "AB":
        if a == 0 and b == 0:
            flag = False
        if a > b:
            a -= 1
            b += 1
            ans.append("B")
        elif b > a:
            a += 1
            b -= 1
            ans.append("A")
        else:
            if i != n-1:
                if s[i+1] == "AC":
                    a += 1
                    b -= 1
                    ans.append("A")
                else:
                    a -= 1
                    b += 1
                    ans.append("B")
            else:
                ans.append("A")
    if s[i] == "BC":
        if b == 0 and c == 0:
            flag = False
        if b > c:
            b -= 1
            c += 1
            ans.append("C")
        elif b < c:
            b += 1
            c -= 1
            ans.append("B")
        else:
            if i != n-1:
                if s[i+1] == "AB":
                    b += 1
                    c -= 1
                    ans.append("B")
                else:
                    c += 1
                    b -= 1
                    ans.append("C")
            else:
                ans.append("B")
    if s[i] == "AC":
        if a == 0 and c == 0:
            flag = False
        if a > c:
            a -= 1
            c += 1
            ans.append("C")
        elif c > a:
            a += 1
            c -= 1
            ans.append("A")
        else:
            if i != n-1:
                if s[i+1] == "AB":
                    a += 1
                    c -= 1
                    ans.append("A")
                else:
                    c += 1
                    a -= 1
                    ans.append("C")
            else:
                ans.append("A")
if flag:
    print("Yes")
    for i in ans:
        print(i)
else:
    print("No")


Measured memory_bytes: 85664
package main
import (
    "bufio"
    "fmt"
    "os"
    "sort"
    "strconv"
)

func main() {
    n, k := readInt(), readInt()
    h := readIntSlice(n)
  
    answer := 0
    if n > k {
        sort.Ints(h)
        answer = sum(h[:n-k])
    }
    fmt.Println(answer)
}

var (
    sc = bufio.NewScanner(os.Stdin)
)

func init() {
    sc.Split(bufio.ScanWords)
}

func read() string {
    sc.Scan()
    return sc.Text()
}

func readInt() int {
    n, error := strconv.Atoi(read())
    if error != nil {
        panic(error)
    }
    return n
}

func readIntSlice(len int) []int {
    nSlice := make([]int, len)
    for i := range nSlice {
        nSlice[i] = readInt()
    }
    return nSlice
}

func sum(nSlice []int) int {
    var sum int
    for i := range nSlice {
        sum += nSlice[i]
    }
    return sum
}

Measured memory_bytes: 4992
import java.util.Scanner;
class Main{
    public static void main(String arg[]){
        Scanner scn=new Scanner(System.in);
        String time =scn.next();
        int zero1 = Integer.parseInt(time.substring(0,2));
        int two3 = Integer.parseInt(time.substring(2,4));
        System.out.println(func(zero1,two3));
    }
    public static String func(int test1,int test2){
        if(0<test1&&test1<13){
            if(0<test2&&test2<13){
                return "AMBIGUOUS";
            }else{
                return "MMYY";
            }
        }else{
            if(0<test2&&test2<13){
                return "YYMM";
            }else{
                return "NA";
            }
        }
    }
}


Measured memory_bytes: 21844
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <set>
#include <stack>
#include <deque>
#include <cmath>
#include <map>
using namespace std;
using ll = long long;
#define rep(i, n) for (ll i = 0; i < n; i++)
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

int main() {
    string s;
    cin >> s;
    rep(i, s.size()) {
        for (int j = i+1; j < s.size(); j++) {
            if (s[i] == 'C' && s[j] == 'F') {
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N; int K; cin>>N>>K;
  vector<int> S(N);
  for(int i=0; i<N; i++){
    cin>>S.at(i);
  }
  sort(S.begin(),S.end());
  int L=0;
  for(int i=0; i<K; i++){
 L+=S.at(i);
  }
  cout<<L<<endl;
}

Measured memory_bytes: 3600
s = list(str(input()))
l1 = ["R", "U", "D"]
l2 = ["L", "U", "D"]

ans = "Yes"
for i, c in enumerate(s):
    if i % 2 == 0 and c not in l1:
        ans = "No"
    elif i % 2 == 1 and c not in l2:
        ans = "No"
print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >>N;
  vector<int> A,B;
  for(int i=0; i<N; i++){
    int v;
    cin >>v;
    if(i%2==0) A.push_back(v);
    else B.push_back(v);
  }
  sort(A.begin(), A.end());
  sort(B.begin(), B.end());
  int count=1, keep1=0, keep2=0, i1=0, i2=0;
  for(int i=0; i<N/2; i++){
    if(A[i]==A[i+1]) count++;
    else{
      if(keep1<=count){
        if(keep1!=0) keep2=keep1;
        keep1=count;
        if(i1!=0) i2=i1;
        i1=A[i];
      }
      else if(keep2<=count){
        keep2=count;
        i2=A[i];
      }
      count=1;
    }
  }
  count=1;
  int keep3=0, keep4=0, i3=0, i4=0;
  for(int i=0; i<N/2; i++){
    if(B[i]==B[i+1]) count++;
    else{
      if(keep3<=count){
        if(keep3!=0) keep4=keep3;
        keep3=count;
        if(i3!=0) i4=i3;
        i3=B[i];
      }
      else if(keep4<=count){
        keep4=count;
        i4=B[i];
      }      
      count=1;
    }
//  cout<<"keep1:"<<keep1<<" keep2:"<<keep2<<" keep3:"<<keep3<<" keep4:"<<keep4<<" i1:"<<i1<<" i2:"<<i2<<" i3:"<< i3 <<" i4:"<<i4 <<endl;
  }
  int ans=0;
  if(i1==i3){
    ans=N-max(keep1+keep4,keep2+keep3);
  }
  else ans=N-keep1-keep3;
  cout <<ans <<endl;
}


Measured memory_bytes: 892
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict, deque
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations
from operator import add, mul, sub

sys.setrecursionlimit(100000)
input = sys.stdin.readline
INF = 2**62-1

def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input().strip()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


@mt
def slv(X):
    ans = 0
    ans += (X // 500) * 1000
    X %= 500
    ans += (X // 5) * 5
    return ans


def main():
    X = read_int()
    print(slv(X))


if __name__ == '__main__':
    main()


Measured memory_bytes: 6476
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <string>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <list>
#include <tuple>
#include <bitset>
#include <ciso646>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;

inline bool cheak(ll x, ll y, ll xMax, ll yMax){ return x >= 0 && y >= 0 && xMax > x && yMax > y; }
inline ll toInt(string s) { ll v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toString(T x) { ostringstream sout; sout << x; return sout.str(); }
template<class T> inline T sqr(T x) { return x*x; }

#define For(i,a,b)	for(ll (i) = (a);i < (b);(i)++)
#define rep(i,n)	For(i,0,n)
#define rFor(i,a,b)	for(ll (i) = (a-1);i >= (b);(i)--)
#define rrep(i,n)	rFor(i,n,0)
#define clr(a)		memset((a), 0 ,sizeof(a))
#define mclr(a)		memset((a), -1 ,sizeof(a))
#define all(a)		(a).begin(),(a).end()
#define sz(a)		(sizeof(a))

const ll dx[8] = { 1, 0, -1, 0, 1, 1, -1, -1 }, dy[8] = { 0, -1, 0, 1, -1, 1, -1, 1 };
const ll mod = 1e9 + 7;
const ll INF = 1e9 + 9;

int main(){

	int a, b, c;
	cin >> a >> b >> c;

	for (int cnt = 0; cnt <= 1e7; cnt++){
		int t = cnt % (a + b);
		if (cnt % 60 == c){
			if (t <= a){
				cout << cnt << endl;
				return 0;
			}
		}
	}
	
	cout << -1 << endl;

	return 0;
}

Measured memory_bytes: 1160
import java.io.*
import java.util.*
import kotlin.collections.*

object FastReader {
    private val br = BufferedReader(InputStreamReader(System.`in`))
    private var st: StringTokenizer = StringTokenizer(br.readLine())

    fun next(): String {
        if (!st.hasMoreElements() ) {
            try {
                st = StringTokenizer(br.readLine());
            } catch (e: IOException) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    fun nextInt() = next().toInt()

    fun nextLong() = next().toLong()

    fun nextDouble() = next().toDouble()
}


fun main(args: Array<String>) = Scanner(System.`in`).use {
    FastReader.nextInt()
    val a = FastReader.nextInt()
    val b = FastReader.nextInt()
    val s = FastReader.next()!!

    var c1 = 0
    var c2 = 0
    val ans = mutableListOf<String>()
    for (c in s) {
        if ((c == 'a') && (c1 < a+b)) {
            ans.add("Yes")
            c1++
        } else if ((c == 'b') && (c1 < a+b) && (c2 < b)) {
            ans.add("Yes")
            c1++
            c2++
        } else {
            ans.add("No")
        }
    }
  
  	println(ans.joinToString("\n"))
}


Measured memory_bytes: 41292
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
#define cyes cout<<"YES"<<endl
#define cno cout<<"NO"<<endl
#define sp <<" "<<
#define cst(x) cout<<fixed<<setprecision(x)
#define pi 3.14159265359
#define mod 1000000007
using namespace std;
using ll = long long;
using ld = long double;
using Graph = vector<vector<int>>;
using que_a = priority_queue<int, vector<int>, greater<int> >;
using que_d = priority_queue<int>;
using pint = pair<int,int>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int n;
vector<ll> a;
vector<vector<ll>> dp;
vector<vector<int>> flag;
vector<ll> cum;

void rui(){

    cum.at(0) = 0;
    for(int i = 1; i <= n; i++){
        cum.at(i) = cum.at(i-1) + a.at(i-1);
    }

}

ll rec(int s,int e){

    if(flag.at(s).at(e)) return dp.at(s).at(e);
    if(s == e) return 0;

    flag.at(s).at(e) = 1;
    ll res = 1e18;
    for(int point = s; point <= e-1; point++){
        chmin(res,rec(s,point)+rec(point+1,e));
    }
    return dp.at(s).at(e) = res + cum.at(e+1) - cum.at(s);

}


int main(){

    cin >> n;
    a.resize(n);
    rep(i,n) cin >> a.at(i);
    dp.resize(n,vector<ll>(n));
    flag.resize(n,vector<int>(n,0));
    cum.resize(n+1);

    rui();

    cout << rec(0,n-1) << endl;
    return 0;   

}


Measured memory_bytes: 2176
import sys
from collections import defaultdict
from collections import deque
import numpy as np
import heapq
from heapq import heappush, heappop


sys.setrecursionlimit(10 ** 7)

H = int(input())

a = 0
h = H
while(h > 0):
    h = h // 2
    a += 1

ans = (1-2**a) * (-1)
print(ans)


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

int main() {
  char c;
  cin >> c;
  if(c == 'A') cout << 'T' << endl;
  if(c == 'T') cout << 'A' << endl;
  if(c == 'C') cout << 'G' << endl;
  if(c == 'G') cout << 'C' << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
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());

    int M = a[n - 1];
    int d[1000001] = {0};

    for(int i = 0;i < n;i++){
        for(int j = 1;j*a[i] <= M;j++){
            d[a[i]*j]++;
        }
    }

    /*
    for(int i = 1;i <= M;i++){
        cout << d[i] << " ";
    }

    cout << endl;
    */

    int ans = 0;
    for(int i = 0;i < n;i++){
        if(d[a[i]] == 1){
            ans += 1;
        }
    }

    cout << ans << endl;

    
}


Measured memory_bytes: 8008
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>

using namespace std;

int N;
int a[1200];
int b[1200];
int wa1,wa2,amax;
int nokoa;
int c[1200];
int jjjj;

int main(){
	while(1){
		cin >> N;
		if (N==0) return 0;
		wa1 = 0;	
		wa2 = 0;
		amax = 0;
		nokoa = 0;
		for(int i=0;i<N;i++){
			cin >> a[i] >> b[i];
			wa1 += a[i];
			wa2 += b[i];
			amax = max(amax,a[i]);
		}
		if(amax*2 <= wa1){
			cout << wa1+wa2 << endl;
		}
		else{
			for(int i=0;i<1100;i++){
				c[i]=0;
			}
			for(int i=0;i<N;i++){
				if(a[i]==amax) jjjj = i;
			}
			nokoa = amax - (wa1-amax);
			c[0] = 1;
			for(int j=0;j<N;j++){
				if (j==jjjj) continue;
				for(int k=nokoa;k>=0;k--){
					if(k-b[j]>=0 && c[k-b[j]]==1){
						c[k]=1;
					}
					
				}
			}
			int kk = nokoa;
			while(c[kk] == 0)kk--;
			cout << wa1+wa2+(nokoa-kk) << endl;
		}
	}
}
				
				


Measured memory_bytes: 3116
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cassert>
#include <cstring>
#include <climits>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define SORT(c) sort((c).begin(), (c).end())
#define mp make_pair
#define fi first
#define se second
#define pb push_back

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> V;
typedef map<int, int> M;

constexpr ll INF = 1e18;
constexpr ll MOD = 1e9 + 7;
constexpr double PI = 3.14159265358979323846;
constexpr int di[] = {0, 0, 1, -1};
constexpr int dj[] = {1, -1, 0, 0};

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

    int r;
    int rnk[112345];
    int n, m, a[112345], b[112345];

    V g[112345], h[112345];

    int t[112345] = {0};

    cin >> n >> m;

    memset(rnk, -1, sizeof(rnk));

    REP(i, n - 1 + m)
    {
        cin >> a[i] >> b[i];

        t[b[i]]++;

        g[a[i]].push_back(b[i]);
        h[b[i]].push_back(a[i]);
    }

    V v;
    queue<int> q;

    REP(i, n)
    if (t[i + 1] == 0)
    {
        q.push(i + 1);
        v.push_back(i + 1);
    }

    while (q.size())
    {
        int p = q.front();
        q.pop();

        for (int i : g[p])
        {
            t[i]--;
            if (t[i] == 0)
            {
                q.push(i);
                v.push_back(i);
            }
        }
    }

    REP(i, n)
    rnk[v[i]] = i;

    for (int i = 1; i <= n; i++)
    {
        int ma = -1;
        int res = 0;

        for (int j : h[i])
        {
            if (ma < rnk[j])
            {
                ma = rnk[j];
                res = j;
            }
        }

        cout << res << endl;
    }

    return 0;
}

Measured memory_bytes: 14588
#include<bits/stdc++.h>
#include<memory.h>
using namespace std;
#define IN freopen("input.txt","r",stdin)
#define OUT freopen("output.txt","w",stdout)
#define pf printf
#define sf scanf
#define pb push_back
#define MAX 1000005
#define FOR(i,n) for(i=0;i<n;i++)
#define all(x) x.begin(),x.end()
#define mod7 1000000007
typedef long long int ll;
typedef long double lld;
const double PI=2*acos(0.0);
int CASE=1,TEST=1;
struct vpair{
    int a;
    int b;
    vpair(int a,int b){this->a=a;this->b=b;}
};
bool cmp(vpair &a,vpair &b){
    if(a.a<b.a)return true;
    else if(a.a==b.a){
        if(a.b<b.b)return true;
        else return false;
    }else{
        return false;
    }
}
int n,a,b,c;
char ch[10];
int main(void){
    cin>>n;
    cout<<48-n<<endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define range(a) (a).begin(),(a).end()
#define print(A,x,n) rep(i,0,n){cout<<(i ? " ":"")<<A[i]x;}cout<<endl;
#define pprint(A,y,m,n) rep(j,0,m){print(A[j],y,n);}
const long mod=1e9+7;
const int siz=2e5;
const int inf=1e9;
int main(){
	int H,W,K; cin>>H>>W>>K;
	char c[H][W]; int cnt = 0;
	rep(i,0,H)rep(j,0,W){
		cin>>c[i][j];
		if(c[i][j] == '#') cnt++;
	}
	int ans = 0; int res;
	rep(i,0,(1<<H))rep(j,0,(1<<W)){
        res = 0;
		rep(a,0,H)rep(b,0,W){
			if(i & (1<<a) || j & (1<<b))if(c[a][b] == '#') res++;
		}
		if(cnt - res == K) ans++;
	}cout<<ans<<endl;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int n,x;
	cin>>n;
	long long int arr1[n];
	long long int arr[200006];
	for (int i=0;i<200006;i++)
		arr[i]=0;
	long long int sum=0;
	vector<pair<long long int,long long int>> v[200006];
	for (int i=0;i<n;i++)
	{
		cin>>x;
		arr1[i]=x;
		arr[x]++;
	}
	//cout<<arr[1]<<endl;
	for (int i=0;i<200006;i++)
	{
		if (arr[i]!=0)
		{
			sum+=arr[i]*(arr[i]-1)/2;
			v[i].push_back(make_pair((arr[i]*(arr[i]-1)/2),(arr[i]-1)*(arr[i]-2)/2));
		}
	}
	//cout<<v[2][0].first<<endl;
	for (int i=0;i<n;i++)
	{
		//cout<<"d"<<endl;
		cout<<sum-v[arr1[i]][0].first+v[arr1[i]][0].second<<endl;
	}
	return 0;
}

Measured memory_bytes: 13380
#include<iostream>
#include<stdio.h>
#include<string>
using namespace std;
int main()
{char S[3];
int i,a=0,b=0;
for(i=0;i<3;i++)
{cin>>S[i];
if(S[i]=='A')
a++;
if(S[i]=='B')
b++;
}
if(a==3||b==3)
printf("No");
else
printf("Yes");
}

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

using namespace std;

struct DataSet {
	int element;
	int unit;
};

int main(void) {
	int n, q;

	cin >> n >> q;

	struct DataSet *ds = new struct DataSet[n];

	for (int i = 0; i < n; i++) {
		ds[i].element = i;
		ds[i].unit = i;
	}

	cin >> ws;

	vector<int> rlt;
	for (int j = 0; j < q; j++) {
		int c, x, y;
		cin >> c >> x >> y;

		int ux = -1, uy = -1;
		for (int a = 0; a < n; a++) {
			if (ds[a].element == x) {
				ux = ds[a].unit;
				if (uy >= 0) break;
			}
			else if (ds[a].element == y) {
				uy = ds[a].unit;
				if (ux >= 0) break;
			}
		}

		if (c == 0) {
			if (ux != uy) {
				for (int b = 0; b < n; b++) {
					if (ds[b].unit == uy) {
						ds[b].unit = ux;
					}
				}
			}
		}
		else {
			if (ux != uy) {
				rlt.push_back(0);
			}
			else {
				rlt.push_back(1);
			}
		}
	}

	for (int b = 0; b < rlt.size(); b++) {
		cout << rlt[b] << endl;
	}

	delete[] ds;

	return 0;
}

Measured memory_bytes: 3276
#include <iostream>
#include <algorithm>
#include <limits.h>
using namespace std;

int main(){
	int a[10000],b[10000],n,s,m,p,M;
	while(cin>>n,n){
		m=INT_MIN;p=0;M=INT_MIN;
		for(int i=0;i<n;i++){
			cin>>a[i];
			M=max(M,a[i]);
			if(a[i]>=0)p=1;
		}
		if(p==0)m=M; else
		for(int i=1;i<=n;i++){
			for(int j=0;j<n-i+1;j++){
				if(a[j]<0||a[j+i-1]<0)continue;
				s=0;
				for(int k=0;k<i;k++){
					s+=a[j+k];
				}
				m=max(m,s);
			}
		}
		cout<<m<<endl;
	}
}

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

int main(void) {
	const char *SEP = " ";
	long long int a, b, c ,d;
	long long int ac, ad, bc, bd, max;
	char input_str[12 * 200000];
	char *num_str;

	fgets(input_str, sizeof(input_str), stdin);
	num_str = strtok(input_str, SEP);
	a = atoi(num_str);
	num_str = strtok(NULL, SEP);
	b = atoi(num_str);
	num_str = strtok(NULL, SEP);
	c = atoi(num_str);
	num_str = strtok(NULL, SEP);
	d = atoi(num_str);

	max = ac = a * c;
	ad = a * d;
	bc = b * c;
	bd = b * d;

	if (max < ad ) {
		max = ad;
	}
	if (max < bc ) {
		max = bc;
	}
	if (max < bd) {
		max = bd;
	}

	printf("%lld\n", max);
	

	return 0;
}


Measured memory_bytes: 1716
import java.util.Scanner;

public class Main {

	enum ORDER {
		print, reverse, replace;
	}

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

		String str = sc.nextLine();
		int orderCount = Integer.parseInt(sc.nextLine());
		for (int i = 0; i < orderCount; i++) {
			String[] orderStr = sc.nextLine().split("[\\s]+");
			ORDER order = ORDER.valueOf(orderStr[0]);
			switch (order) {
			case print:
				Print(str, orderStr[1], orderStr[2]);
				break;
			case reverse:
				str = Reverse(str, orderStr[1], orderStr[2]);
				break;
			case replace:
				str = Replace(str, orderStr[1], orderStr[2], orderStr[3]);
			}
		}

	}

	static void Print(String str, String a, String b) {
		System.out.println(str.substring(Integer.parseInt(a), Integer.parseInt(b) + 1));
	}

	static String Reverse(String str, String a, String b) {
		char[] carray = str.toCharArray();
		int start = Integer.parseInt(a), end = Integer.parseInt(b);
		for (int i = start; i <= (start + end) / 2; i++) {
			char work = carray[end + (start - i)];
			carray[end + (start - i)] = carray[i];
			carray[i] = work;
		}
		return String.valueOf(carray);
	}

	static String Replace(String str, String a, String b, String c) {
		String result = str.substring(0, Integer.parseInt(a));
		result += c;
		if (Integer.parseInt(b) + 1 != str.length()) {
			result += str.substring(Integer.parseInt(b) + 1);
		}
		return result;
	}

}



Measured memory_bytes: 29908
#include<stdio.h>
int main(void)
{
    char S[4],T[4];
    int i,j=0;
  
    scanf("%s",S);
    scanf("%s",T);
  
    for(i=0;i<3;i++){
      if(S[i]==T[i]) j++;
    }
      
    printf("%d\n",j);
  
    return 0;
}


Measured memory_bytes: 1704
#include <stdio.h>
int main(void){
    double height,max,min;
    
    max=0;
    min=1000000;
    while(scanf("%lf",&height)!=EOF){
        max=(max>height)?max:height;
        min=(min<height)?min:height;
    }
    
    printf("%.1f\n",max-min);
    return 0;
    
}

Measured memory_bytes: 648
#include <stdio.h>



int main(void){
	int N, i, q;
	int a[10*10*10*10*10];
	int b[10*10*10*10*10];
	
	
	
		scanf("%d", &N);
		
	
	
		
	for(i=0; i<N;i++){
		
			scanf("%d", &a[i]);
		
	}
for(i=0; i<N; i++){
	q = a[i];
	q -= 1;
	b[q]= i+1;
}

	
for(i=0;i<N; i++){
	printf("%d ", b[i]);
}
return 0;
}
		
	
		


Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
 
//#define READ_NUMBER(i) scanf("%d",i)
 
int main(){
	int A, B, K;
	cin >> A >> B >> K;
	int Ans;
	int count = 0;
	for(int i = 100;count < K;i--){
		if(A % i == 0 && B % i == 0){
			Ans = i;
			count++;
            //cout << Ans << endl;
		}
	}
	cout << Ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<math.h>
#include<queue>
#include<stack>
#include<iomanip>
#include<cstring>
#include<string>
#include<set>

#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

using namespace std;
using ll = long long int;

const ll INF = 1<<30;
const ll LINF = 1LL<<60;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(void) {
    ll a, v, b, w, t; cin >> a >> v >> b >> w >> t;
    if (a < b) {
        if (a + v * t >= b + w * t) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
    else {
        if (a - v * t <= b - w * t) cout << "YES" << endl;
        else cout << "NO" << endl;
    }
}

Measured memory_bytes: 3636
#include<iostream>
#define roop(i,p) for(int i=1;i<=p;i++)
#define LL long long

using namespace std;


int main(){

	LL int N;
	cin >> N;

        LL int A[N+1];
	roop(i,N){
		cin >> A[i];
	if(A[i] %2==0){
		if (A[i]%3 != 0 && A[i]%5 != 0){
			cout << "DENIED";
			return 0;
		}
	}

	}
	cout << "APPROVED";
	return 0;
}


	




Measured memory_bytes: 256
import math
def rec(li, p_coor, s):
  total_len = 0
  if len(li)==0:
    return s
  for i in range(len(li)):
    c_li = li[:]
    c_coor = c_li.pop(i)
    d = dist(c_coor, p_coor) if p_coor is not None else 0
    total_len += rec(c_li, c_coor, s+d)
  return total_len
  
def dist(c1, c2):
  x1, y1 = c1
  x2, y2 = c2
  return math.sqrt((x1-x2)**2+(y1-y2)**2)

n = int(input())
coor = []
for _ in range(n):
  coor.append(tuple(map(int, input().split())))
print(rec(coor,None,0)/math.factorial(n))


Measured memory_bytes: 3064
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <set>
#include <queue>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <memory.h>
#include <string>
#include <sstream>
#include <cstdlib>
#include <ctime>
#include <cassert>

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;

#define MP make_pair
#define PB push_back
#define FF first
#define SS second

#define FORN(i, n) for (int i = 0; i <  (int)(n); i++)
#define FOR1(i, n) for (int i = 1; i <= (int)(n); i++)
#define FORD(i, n) for (int i = (int)(n) - 1; i >= 0; i--)

#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define PR0(A,n) { cout << #A << " = "; FORN(_,n) cout << A[_] << ' '; cout << endl; }

// #define FL fflush(stdout)

#define MOD 1000000007
#define INF 2000000000
#define maxn 110

int GLL(LL& x) {
  return scanf("%lld", &x);
}

int GI(int& x) {
  return scanf("%d", &x);
}

int n;
vector<int> s;
int main() {
  GI(n);
  s.resize(n);
  FORN(i, n) {
    GI(s[i]);
  }

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

  int ans = 0;
  FORN(i, n) {
    ans += s[i];
  }

  int idx = 0;
  while (ans % 10 == 0 && idx < n) {
    ans -= s[idx];
    if (idx > 0) ans += s[idx-1];
    idx++;
  }

  if (ans % 10 == 0) ans = 0;
  
  printf("%d\n", ans);
    
  return 0;
}

Measured memory_bytes: 256
import bisect

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()

ans = 0
for i in b:
  ai = bisect.bisect_left(a,i)
  ci = bisect.bisect_right(c,i)
  ans += ai*(n-ci)
print(ans)

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

ll dfs(ll x, string rest){
    if(rest.size() == 0) return  x;
    ll res = 0;
    for(int i = 1; i <= (int)rest.size(); ++i){
        res += dfs(x + stoll(rest.substr(0,i)), rest.substr(i));
    }
    return res;
}

int main(){
    string s;
    cin >> s;
    cout << dfs(0,s) << endl;
}


Measured memory_bytes: 256
fun main() = Thread(null, ::abc171e, "(^o^)", 128 * 1024 * 1024).apply { start() }.join()

@OptIn(ExperimentalStdlibApi::class)
fun abc171e() {
    val n = readLine()!!.toInt()
    val aList = readLine()!!.split(' ').map { it.toInt() }

    val xorSum = aList.reduce(Int::xor)

    val answer = aList.map(xorSum::xor).joinToString(" ")

    println(answer)
}


Measured memory_bytes: 76248
#include<bits/stdc++.h>
using namespace std;
 
#define pb push_back
#define ll long long
#define maxn 1000005
#define fr(i,j,k) for(int i=j;i<k;i++)
#define f(n) fr(i,0,n)
#define f1(n) fr(i,1,n+1)
#define ms(i) memset(i,0,sizeof(i));
#define ms1(i) memset(i,-1,sizeof(i));
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pii pair<int,int>
const int mod = 1e9 + 7;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int a, b;
    cin >> a >> b;
    cout << max(0,a-2*b) << '\n';   
}

Measured memory_bytes: 256
n,m=map(int,input().split())

pic1=[]
pic2=[]

for i in range(n):
    pic1.append(input())

for j in range(m):
    pic2.append(input())

#print(pic1)
#print(pic2)

ans="No"

for i in range(n-m+1):
    for j in range(n-m+1):
        flag=True
        for k in range(m):
            for l in range(m):
                if pic1[i+k][j+l]!=pic2[k][l]:
                    flag=False

            if not flag:
                break
        if flag:
            print("Yes")
            exit()

print("No")


Measured memory_bytes: 3064
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<functional>
#define int long long
using namespace std;

int a[100000], b[100000], c[100000];
int d[100001];
int e[100001];
signed main() {
	int n; cin >> n;
	for (int i = 0; i<n; i++)cin >> a[i];
	for (int i = 0; i<n; i++)cin >> b[i];
	for (int i = 0; i<n; i++)cin >> c[i];
	sort(a, a + n, greater<int>()); sort(b, b + n, greater<int>()); sort(c, c + n, greater<int>());
	int k = 0;
	for (int i = 0; i<n; i++) {
		while (k<n&&b[i]<c[k]) { k++; }
		d[i + 1] = k;
		e[i + 1] = e[i] + d[i + 1];
	}
	int ans = 0;
	k = 0;
	for (int i = 0; i<n; i++) {
		while (k<n&&a[i]<b[k]) { k++; }
		ans += e[k];
	}
	cout << ans << endl;
}


Measured memory_bytes: 4224
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N, K = list(map(int,_in[0].split(' ')))
    l_arr = list(map(int,_in[1].split(' ')))
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    l_arr.sort(reverse=True)
    cnt = sum(l_arr[:K])
    ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(cnt)


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

using namespace std;

int main() {
    int n,m; cin >> n >> m;
    vector<int> a(m);
    vector<long long> dp(n+1, 0);
    for(int i = 0; i < m; i++){
        cin >> a[i];
    }
    int current = 0;
    dp[0] = 1;
    if(m != 0){
        if(a[0] == 1) {
            dp[1] = 0;
            current++;
        } else {
            dp[1] = 1;
        }
    } else {
        dp[1] = 1;
    }
    for(int i = 2; i <= n; i++){
        if(current < m && a[current] == i){
            current++;
        } else {
            if(dp[i-1] != 0)
                dp[i] += dp[i-1];
            if(dp[i-2] != 0)
                dp[i] += dp[i-2];
            dp[i] %= 1000000007;
        }
    }
    cout << dp[n] << endl;
}



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

int main(){
    int m, n;
    cin >> m >> n;
    char arr[m][n];
    for(int i=0; i<m; i++){
        for(int j=0; j<n; j++){
            cin >> arr[i][j];
        }
    }
    int val{0};
    for(int i=0; i<m; i++){
        for(int j=0; j<n; j++){
            val = 0;
            if(arr[i][j] == '.'){
                if(j>0){
                if(arr[i][j-1]=='#'){
                        val++;
                }
                }
                if(j<(n-1)){
                if(arr[i][j+1]=='#'){
                        val++;
                }
                }
                if(i>0){
                    if(arr[i-1][j]=='#'){
                        val++;
                    }
                    if(j>0){
                        if(arr[i-1][j-1]=='#'){
                        val++;
                        }
                        
                        
                    }
                    if(j<(n-1)){
                        if(arr[i-1][j+1]=='#'){
                        val++;
                        }
                        
                    }
                }
                if(i<(m-1)){
                    if(arr[i+1][j]=='#'){
                        val++;
                    }
                    if(j>0){
                        if(arr[i+1][j-1]=='#'){
                        val++;
                        }
                        
                    }
                    if(j<(n-1)){
                        if(arr[i+1][j+1]=='#'){
                        val++;
                        }
                    }
                }
                val+=48;
                arr[i][j] = val;
            }
        }
    }
    for(int i=0; i<m; i++){
        for(int j=0; j<n; j++){
            cout << arr[i][j];
        }
        cout << endl;
    }
}

Measured memory_bytes: 3608
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

template <typename T>
void print(T x) {
    cout << x << endl;
}

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REVFOR(i, m, n) for (int i = (n - 1); i >= (m); --i)
#define REP(i, n) FOR(i, 0, n)
#define REVREP(i, n) REVFOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

ll d[int(1e7) + 1];

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    
    int N;
    cin >> N;

    memset(d, 0, sizeof(d));

    FOR(i, 1, N+1) {
        for(int j = i; j <= N; j += i) d[j]++;
    }

    ll ans = 0;
    REP(i, N + 1) {
        ans += i * d[i];
    }

    print(ans);
    
}


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

const long long MOD = 1000000007;
const long long INF = 1LL << 60;
const int INT_INF = 1000000000;

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

const int MAX_H = 100, MAX_W = 100;
int H, W;
int sx, sy;
int gx, gy;
char maze[MAX_H][MAX_W];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> H >> W;
    for (int i = 0; i < H; i++)
    {
        for (int j = 0; j < W; j++)
        {
            cin >> maze[i][j];
        }
    }
    vector<vector<int>> dp(H, vector<int>(W));
    dp[0][0] = maze[0][0] == '#' ? 1 : 0;
    for (int i = 1; i < H; i++)
    {
        dp[i][0] = dp[i - 1][0];
        if (maze[i][0] == '#' && maze[i - 1][0] == '.')
        {
            dp[i][0]++;
        }
    }
    for (int i = 1; i < W; i++)
    {
        dp[0][i] = dp[0][i - 1];
        if (maze[0][i] == '#' && maze[0][i - 1] == '.')
        {
            dp[0][i]++;
        }
    }
    for (int i = 1; i < H; i++)
    {
        for (int j = 1; j < W; j++)
        {
            int up = dp[i - 1][j];
            int left = dp[i][j - 1];
            if (maze[i][j] == '#')
            {
                if (maze[i - 1][j] == '.')
                {
                    up++;
                }
                if (maze[i][j - 1] == '.')
                {
                    left++;
                }
            }
            dp[i][j] = min(up, left);
        }
    }
    cout << dp[H - 1][W - 1] << endl;
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main()
{
  int N, M;
  cin >> N >> M;
  vector<P> vc(N);
  REP(i, N)
  cin >> vc[i].first >> vc[i].second;
  sort(ALL(vc));
  ll ans = 0;
  REP(i, N)
  {
    ll t = min(1ll * M, vc[i].second);
    ans += vc[i].first * t;
    M -= t;
  }
  cout << ans << endl;
  return 0;
}

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

int main() {

    string s, t;
    cin >> s >>  t;
    bool ok = true;
    for (int i = 0; i < s.size(); i++) {
        if(s[i] != t[i]) {ok = false; break;}
    }
    if (ok) cout << "Yes\n";
    else cout << "No\n";

    return 0;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define f first
#define s second
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

ll N, L;
struct node {
	bool v = 0;
	node* c[2];
	node() { c[0] = c[1] = 0; }
} root;
ll solve(node* cur, ll d) {
	if (!cur->c[0] && !cur->c[1]) return !cur->v;
	ll ret = 0;
	for (int i = 0; i < 2; ++i) {
		if (cur->c[i]) ret ^= solve(cur->c[i], d + 1);
		else ret ^= (1ll << __builtin_ctzll(L - d));
	}
	return ret;
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);

	cin >> N >> L;
	for (int i = 0; i < N; ++i) {
		string s; 
		cin >> s;
		node* cur = &root;
		for (auto& c : s) {
			if (!cur->c[c == '1']) cur->c[c == '1'] = new node();
			cur = cur->c[c == '1'];
		}
		cur->v = 1;
	}
	cout << (solve(&root, 0) ? "Alice" : "Bob");
}

Measured memory_bytes: 8044
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);

const int N = 2e5+5, M = 1e6+6, OO = 0x3f3f3f3f;
int tc;
ll x, k, d;
int main()
{
    FIO
    cin>>x>>k>>d;
    ll tmpx = abs(x);
    ll y = tmpx / d;
    // cout<<y<<endl;
    if(y < k)
    {
        if((k - y) %2 == 0)
        {
            cout<<min(abs(tmpx - y*d), abs(tmpx - (y+2 <= k ? (y+2) *d : 0)))<<endl;
        }
        else
        {
            cout<<min(abs(tmpx - (y-1)*d), abs(tmpx - (y+1)*d))<<endl;
        }
    }
    else
    {
        cout<<abs(tmpx - k*d)<<endl;
    }
    return 0;
}


Measured memory_bytes: 3652
M1, D1 = (int(i) for i in input().split()) 
M2, D2 = (int(i) for i in input().split())

result = 0
 
if (M2 % 12) == ((M1 + 1) % 12):
  if (D2 == 1) & (M2 != 1):
    result = 1
    
print(result)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(ll i=0;i<ll(n);i++)
const int MOD = 1e9 + 7;
int main() {
    int n;
    cin >> n;
    map<int, vector<int>>t;
    vector<pair<int, int>>e(n - 1, pair<int, int>());
    map<ll, int> c;
    int a, b;
    //cout << '!';
    rep(i, n - 1) {
        cin >> a >> b;
        t[a - 1].push_back(b - 1);
        e[i].first = a - 1;
        e[i].second = b - 1;
    }
    //cout << '!';
    int k = 0;
    int cs = 1;
    vector<int>cr(n, -1);
    for (int s : t[0]) {
        if (cr[0] == cs) {
            cs++;
        }
        c[0*1e6 + s] = cs;
        cr[s] = cs;
        cs++;
    }
    cs--;
    k = max(k, cs);
    //cout << '!';
    rep(i, n){
        cs = 1;
        for (int s : t[i]) {
            if (cr[i] == cs) {
                cs++;
            }
            c[i*1e6 + s] = cs;
            cr[s] = cs;
            cs++;
        }
        cs--;
        k = max(k, cs);
    }
    cout << k << endl;
    rep(i, n - 1){
        cout << c[e[i].first*1e6 + e[i].second] << endl;
    }
    return 0;
}


Measured memory_bytes: 20068
#include <iostream>
#include <algorithm>

#define ll long long

using namespace std;

int n;
ll arr[100005][3], dp[100005][3];

ll build()
{
	dp[0][0] = arr[0][0];
	dp[0][1] = arr[0][1];
	dp[0][2] = arr[0][2];
	ll ans = max(dp[0][0], max(dp[0][1], dp[0][2]));
	for (int i = 1; i < n; i++)
	{
		dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]) + arr[i][0];
		dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]) + arr[i][1];
		dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + arr[i][2];
		ans = max(dp[i][0], max(dp[i][1], dp[i][2]));
	}
	return ans;
}

int main()
{
	cin >> n;
	for (int i = 0; i < n; i++)
		for (int j = 0; j < 3; j++)
			cin >> arr[i][j];
	cout << build() << '\n';
	return 0;
}

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

int main(){
    int a;
    int b;
    cin >> a >> b;
    if (a<b){
        cout << "a < b" << endl;
    }else if (a>b){
        cout << "a > b" << endl;
    }else{
        cout << "a == b" << endl;
    }
    return 0;
}


Measured memory_bytes: 3096
k = int(input())
 
table = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in table:
  if len(table) > k:
    break
  x = i % 10
  for j in range(max(0, x - 1), min(x + 2, 10)):
    table.append(i * 10 + j)


print(table[k - 1])

Measured memory_bytes: 7316
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <limits.h>    
#define inf 100000000
#define INF 9223372036854775807
#define EPS 1e-10
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r);
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r);
#define TYPE int
#define MEMSET(a) memset(a,0,sizeof(a))
long long mod=(long long)1e09+7;

int in(void){
    int i;scanf("%d",&i);
    return i;
}
long long llin(void){
    long long i;scanf("%lld",&i);
    return i;
}
double din(void){
    double i;scanf("%lf",&i);
    return i;
}
void chin(char s[]){
    scanf("%s",s);
}
void print(int a){
    printf("%d\n",a);
}
void llprint(long long a){
    printf("%lld\n",a);
}
void dprint(double a){
    printf("%.10f\n",a);
}
void print2(int a,int b){
    printf("%d %d\n",a,b);
}
long long max(long long a,long long b){
    return a>b?a:b;
}
long long min(long long a,long long b){
    return a<b?a:b;
}
int cmp(const void *a,const void *b){
    return *(TYPE *)a-*(TYPE *)b;
}
int cmp_r(const void *a,const void *b){
    return *(TYPE *)b-*(TYPE *)a;
}
int char_cmp(const void *a,const void *b){
    return strcmp((char *)a,(char *)b);
}
int char_cmp_r(const void *a,const void *b){
    return strcmp((char *)b,(char *)a);
}
void swap(int *a,int *b){
    int t=*a;
    *a=*b;
    *b=t;
}
long long gcd(long long x,long long y){
    return x%y?gcd(y,x%y):y;
}
long long lcm(long long x,long long y){
    return x/gcd(x,y)*y;
}

// write codes below this
// when you use 'sort',
// make sure TYPE macro is correct

int main(void){
    int x,y,s,i,j,ans;
    while(1){
        x=in();
        y=in();
        s=in();
        if(!x)break;
        ans=0;
        for(i=1;i<s;i++){
            for(j=1;j<s;j++){
                if(i*(100+x)/100+j*(100+x)/100==s){
                    ans=max(ans,i*(100+y)/100+j*(100+y)/100);
                }
            }
        }
        print(ans);
    }
    return 0;
}



Measured memory_bytes: 2108