akhauriyash/Code-Regression huggingface dataset:
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


# rstrip().decode('utf-8')
# INF=float("inf")
#MOD=10**9+7
# sys.setrecursionlimit(2147483647)
# import math
#import numpy as np
# import operator
#import bisect
# from heapq import heapify,heappop,heappush
#from math import gcd
# from fractions import gcd
#from collections import deque
#from collections import defaultdict
# from collections import Counter
#from itertools import accumulate
# from itertools import groupby
# from itertools import permutations
# from itertools import combinations
# from scipy.sparse import csr_matrix
# from scipy.sparse.csgraph import floyd_warshall
# from scipy.sparse.csgraph import csgraph_from_dense
# from scipy.sparse.csgraph import dijkstra
# map(int,input().split())


def main():
	t1,t2=map(int,input().split())
	a1,a2=map(int,input().split())
	b1,b2=map(int,input().split())
	
	a=a1*t1
	aa=a2*t2
	b=b1*t1
	bb=b2*t2
	
	if a+aa==b+bb:
		print("infinity")
		exit(0)
	elif a<b and a+aa<b+bb:
		print(0)
		exit(0)
	elif a > b and a+aa > b+bb:
		print(0)
		exit(0)
	
	else:
		x=abs(a-b)
		y=abs((a+aa)-(b+bb))
		print((x//y)*2+1-(x%y==0))
		
	
	
	
	
	
	
	

	
if __name__ == "__main__":
		main()


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

const int MAX_N = 1000001;
bool isP[MAX_N];
vector<int> Pri;

int main() {
  {
    fill(isP,isP+MAX_N,true);
    isP[0] = isP[1] = false;
    for(int i = 2; i < MAX_N; ++i) {
      if(!isP[i]) continue;
      Pri.push_back(i);
      for(int j = i*2; j < MAX_N; j += i) isP[j] = false;
    }
  }

  int N;
  while(cin >> N && N) {
    int num = 0;
    for(int i = 0; i < Pri.size() && Pri[i] <= N/2; ++i) {
      if(isP[N-Pri[i]]) ++num;
    }
    cout << num << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <string>
#include <cctype>
#include <map>
#include <limits>
#include <iomanip>

using namespace std;

const int mod = 1000000007;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define ll long long

int main()
{
	int X;
	cin >> X;

	int count1 = X / 500;
	int count2 = (X - (count1 * 500)) / 5;

	cout << (count1 * 1000 + count2 * 5) << endl;

	return 0;
}

Measured memory_bytes: 3120
/*
ID: seekho
PROG: friday
LANG: C++14                 
*/
/* LANG can be C++11 or C++14 for those more recent releases */

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

//find_by_order gives kth-largest element
//order_of_key gives the number of items in the set that are strictly smaller!!

// OT.find_by_order(k-1)
// 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define db4(x, y, z, w) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << "," << #w << "=" << w << endl
#define ll long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define X first
#define Y second
#define sz(x) (int)((x).size())
#define pii pair<int,int>
#define MOD (ll)(998244353)
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
typedef vector<int> vi;
#define inf (ll)(1e18)
#define double long double
#define int long long

// #define N 50005


int32_t main() {

    ios::sync_with_stdio(false);
    cin.tie(0); 
    cout.tie(0);

    int n,h,w;
    cin >> n >> h >> w;

    if((n - h) < 0 || (n - w) < 0) {
    	cout << "0\n";
    }
    else {
    	cout << (n-h + 1)*(n-w + 1) << "\n";
    }
}

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

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

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

signed main(){
    int n, x;
    cin >> n >> x;
    int s = max(x, n-x);
    int t = min(x, n-x);

    int ans = 0;
    while(t != 0){
        ans += s / t * t * 3;
        int tmp = s % t;
        s = t;
        t = tmp;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fast() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define mod 1000000007
#define inf (1ll<<60)
#define eps 1e-9
#define ff first
#define ss second
#define pb push_back
#define endl "\n"
using namespace std;

int main() {
    
    
    fast();
    int t,a,b,c,d,x,y;
    cin>>a>>b>>c>>d;
    
    x=ceil(a*1.0/d);
    y=ceil(c*1.0/b);
    
    //cout<<a/d<<" "<<c/b<<endl;
    
   // cout<<x<<" "<<y<<endl;
    
    if(x<y)
    cout<<"No";
    else
    cout<<"Yes";
    
	return 0;
}


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

h = [int(i) for i in input().split()]

dp = [0] * (N + 1)


for i in range(N - 1):
    if h[i] >= h[i + 1]:
        dp[i + 1] = dp[i] + 1
    else:
        dp[i + 1] = 0

print(max(dp))

Measured memory_bytes: 14224
N = int(input())
answer = 0

def f(x,answer):
    if x == 0:
        return answer
    else:
        i = 0
        sum = 0
        if x >= 0:
            while sum < x:
                sum = sum + 4**(i)
                i = i + 1
            return f(x - 4**(i-1) ,answer + 10**(2*i-2))
        else:
            while sum < abs(x):
                sum = sum + 2*(4**(i))
                i = i + 1
            return f(x + 2*(4**(i-1)) ,answer + 10**(2*i-1) )

ans = f(N,answer)
print(ans)

Measured memory_bytes: 3064
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.stream.IntStream;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        B solver = new B();
        solver.solve(1, in, out);
        out.close();
    }

    static class B {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int N = in.Int();
            int M = in.Int();
            int[] cnt = new int[N];
            for (int i = 0; i < M; i++) {
                int a = in.Int() - 1;
                int b = in.Int() - 1;
                cnt[a]++;
                cnt[b]++;
            }
            IntStream.of(cnt).forEach(out::println);
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            }
            return st.nextToken();
        }

        public int Int() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 27988
#include "bits/stdc++.h"
using namespace std;

#define ASC(vec) vec.begin(), vec.end()		// 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend()	// 降順ソート 例:sort(DESC(vec));
#define rep(i, n) for(int i = 0; i < n; i++)
#define Rep(i, n) for(int i = 1; i < n; i++)
#define In(vec) rep(i, n) cin>>vec[i];
#define ANS(s) cout << s << endl
#define inc(a, b) cin >> a >> b;

const int mod = 1000000007;
const int inf = (int)1e9 + 7;
const long long INF = 1LL << 60;

typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<vector<int> > vvi;
typedef vector<pair<int, int> > vii;

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

ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
int round_int(int a, int b) { return (a + (b - 1)) / b; }


// 4,8方向に探索する際に用いる配列
//int dx[4] = { 0,  0, 1, -1 };
//int dy[4] = { 1, -1, 0,  0 };
//int dx[8] = { 1, 0, -1,  0, 1, -1, -1,  1 };
//int dy[8] = { 0, 1,  0, -1, 1,  1, -1, -1 };

// ────────────────────────────────────────────────────

bool isUruu(int y) {
	bool ok = true;

	if (y % 4 == 0) {
		if (y % 100 == 0) ok = false;
		if (y % 400 == 0) ok = true;
	}
	else ok = false;

	return ok;
}

int main() {
	int a, b;
	cin >> a >> b;

	int n;
	cin >> n;

	vi s(n), f(n);
	rep(i, n) {
		cin >> s[i] >> f[i];

		if (s[i] < b && a < f[i]) {
			cout << 1 << endl;
			return 0;
		}
	}
	cout << 0 << endl;
}

/*

	string s, t, u, v;
	cin >> s;

	t.push_back(s[0]);
	t.push_back(s[1]);
	t.push_back(s[2]);
	t.push_back(s[3]);
	u.push_back(s[5]);
	u.push_back(s[6]);
	v.push_back(s[8]);
	v.push_back(s[9]);

	int y = atoi(t.c_str());
	int m = atoi(u.c_str());
	int d = atoi(v.c_str());

*/


Measured memory_bytes: 3120
package main

import "fmt"

func main(){
	var N,num,count int
	fmt.Scan(&N)
	m := make(map[int]int)
	for i := 0;i<N;i++{
		fmt.Scan(&num)
		if m[num] == 0{
			m[num] = 1
		}else{
			m[num] = 0
		}
	}
	for _,value := range m{
		count += value
	}
	fmt.Println(count)
}

Measured memory_bytes: 8064
//大文字->小文字 tolower(),逆はtoupper()
//int a = stoi(c); 文字列をintへ
//途中の出力をそのまま残すな
//数値計算 基本はdouble
#include <bits/stdc++.h>
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
using namespace std;

int dig(int N) {//桁数
	int dig = 0;
	while (N) {
		dig++;
		N /= 10;
	}
	return dig;
}

int main() {
	int A, B; cin >> A >> B;
	if (B%A == 0)cout << A + B << endl;
	else cout << B - A << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<cmath>
#include<queue>
#include<limits>
#include<map>
#define ll long long
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define int_INF 2147483647
#define ll_INF 	9223372036854775807
const static ll MOD = 1e9+7;
#define vi vector<int>
#define vii vector<vector<int>>
#define vll vector<long long>
#define pii pair<int,int>
#define vpii vector<pair<int,int>>
using namespace std;
namespace Arithmetics {
  template<typename T>
  T original_pow(T a, T b) {
  	T ans = 1;
  	rep(i, b) {
  		ans *= a;
  	}

  	return  ans;
  }
  template<typename T>
  T gcd(T a, T b) {
  	if (a > b) {
  		T c = a;
  		a = b;
  		b = c;
  	}
  	if (a == 0) {
  		return b;
  	}

  	return gcd(b % a, a);
  }
  template<typename T>
  T gcd_of_all(vector<T> v){
    T temp = v[0];
    for(T elem: v){
      temp = gcd(temp,elem);
    }

    return temp;
  }
  template<typename T>
  T lcm(T a, T b){
  	T GCD = gcd(a,b);
  	return a /GCD * b;
  }
  template<typename T>
  T lcm_of_all(vector<T> v){
    T temp = v[0];
    for(T elem: v){
      temp = lcm(temp,elem);
    }
    return temp;
  }
}
using namespace Arithmetics;
int main(){
  ll N; cin >> N;
  vector<ll> T(N);
  for(ll& t: T){
    cin >> t;
  }

  ll ans = lcm_of_all(T);
  cout << ans << endl;
}


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


int main() {
	int N;
	cin >> N;
	vector<tuple<string, int, int>> a;
	for(int i = 1; i <= N; i++){
		string s;
		int p;
		cin >> s >> p;
		p = -p;
		a.push_back(tie(s, p, i));
		sort(a.begin(), a.end());
	}

	for(int i = 0; i < N; i++){
		cout << get<2>(a.at(i)) << endl;
	}
	return 0;
}

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

 
int main() {
	string A,B;
  	cin >> A >> B;
  	if(A=="H" && B=="H" || A=="H" && B=="D"){
      cout << B << endl;
    }
  	else if(A=="D" && B=="H"){
      cout << "D" << endl;
    }
  	else{
      cout << "H" <<  endl;
    }
}


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

int wa(int a, int b){
  return a + b;
}

int sa(int a, int b){
  return a - b;
}

int main() {
  string str;
  int sei = 7;
  int tmp = 0;
  string kekka = "";
  
  cin >> str;
  
  int a = stoi(str.substr(0,1));
  int b = stoi(str.substr(1,1));
  int c = stoi(str.substr(2,1));
  int d = stoi(str.substr(3,1));

  for(int i = 0; i < 2; i++){
    for(int j = 0; j < 2; j++){
      for(int k = 0; k < 2; k++){
        tmp = 0;
        if(i == 0) tmp = wa(a,b);
        else tmp = sa(a,b);

        if(j == 0) tmp += c;
        else tmp -= c;

        if(k == 0) tmp += d;
        else tmp -= d;

        if(tmp == sei){
          if(i == 0) kekka += str.substr(0,1) + "+" + str.substr(1,1);
          else kekka += str.substr(0,1) + "-" + str.substr(1,1);
          
          if(j == 0) kekka += "+" + str.substr(2,1);
          else kekka += "-" + str.substr(2,1);
          
          if(k == 0) kekka += "+" + str.substr(3,1);
          else kekka += "-" + str.substr(3,1);
          
          kekka += "=7";
          cout << kekka;
          return 0;
        }
      }
    }
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pint = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;

int main() {
    string s;
    cin >> s;
    int n = s.size();

    int res = INF;
    // c1 = 010101..., c2 = 101010...
    int c1 = 0, c2 = 0;

    rep(i, n) {
        int c = s[i] - '0';
        if (i % 2 == c) {
            c2++;
        }
        else {
            c1++;
        }
    }

    res = min(c1, c2);

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

Measured memory_bytes: 512
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <bits/stdc++.h>
#include<queue>
#include <numeric>
#include<stdio.h>
using namespace std;
 
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
 
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}
 template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define fore(i,a) for(auto &i:a)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
 
//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

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

LL lcm(LL a, LL b){
    LL g = gcd(a,b);
    return a/g *b;
}

int main(){
    int N,K;
    cin >> N >> K;
    string S,T;
    cin >> S;
    T=S;
    transform(S.begin(),S.end(),S.begin(),::tolower);
    for(int i=0;i<N;++i){
        if(i!=K-1){
            cout << T[i];
        }
        else{
            cout << S[i];
        }
    }
    }

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
typedef long long ll;
#define int ll
const int N=200005;
int L,n,x[N],ans,tmp1,tmp2,np,p,Suf[N],Pre[N];
signed main()
{
	scanf("%lld%lld",&L,&n);
	for (int i=1;i<=n;i++) scanf("%lld",&x[i]),Pre[i]=Pre[i-1]+x[i];
	for (int i=n;i>=1;i--) Suf[i]=Suf[i+1]+L-x[i];
	for (int i=1;i<=n;i++){//枚举段数 
		int t=i;//顺时针 
		ans=max(ans,(Suf[t-(i+1)/2+1]-Suf[t+1])*2+Pre[i/2]*2-((i&1)?(L-x[t-(i+1)/2+1]):x[i/2]));
		t=n+1-i;//逆时针 
		ans=max(ans,(Pre[t+(i+1)/2-1]-Pre[t-1])*2+Suf[n+1-i/2]*2-((i&1)?x[t+(i+1)/2-1]:(L-x[n+1-i/2])));
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 4992
N=int(input())
t=[0]*N
r=set(range(N))
for _ in[0]*N:
 x,y,z=map(int,input().split())
 t[x]=[y,z]+[0]*5
 r-={y,z}
def f(i,p,s,d):
 if i<0:return-1
 k=t[i]
 l,r=k[:2]
 k[2:]=[p,s,(l!=-1)+(r!=-1),d,max(f(l,i,r,d+1),f(r,i,l,d+1))+1]
 return t[i][-1]
f(r.pop(),-1,-1,0)
for i in range(N):
 print('node {}: parent = {}, sibling = {}, degree = {}, depth = {}, height = {}, {}'.format(i,*t[i][2:],'root'if not t[i][5]else'internal node'if t[i][4]else'leaf'))


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

// �f������
bool is_prime(int n);

int main() {

	int X;
	cin >> X;

	bool jdg = false;
	int i = 0;
	int Y = 0;

	while (jdg == false) {
		Y = X + i;
		jdg = is_prime(Y);
		i++;
	}

	cout << Y << endl;

	return 0;
}

bool is_prime(int n) {
	for (int i = 2; i * i <= n; i++) {
		// �f���łȂ��Ȃ� false ���Ԃ�
		if (n % i == 0) {
			return false;
		}
	}
	// 1 �͑f���łȂ��̂ŁAfalse ���Ԃ�
	return n != 1;
}

Measured memory_bytes: 256
#define debug_interval ','
#define dump_interval ' '
#define debug_toggle 1
//{
#include<bits/stdc++.h>
using namespace std;
#define hi cerr<<"hi"<<endl;
#define int long long
#define INT_MAX LLONG_MAX
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define fi first
#define se second
#define mp make_pair
#define rev reverse
#define dans dump(ans)
#define MOD 1000000007
#define amp(v,n) (v).count(n)?v[n]++:v[n]=1
#define sysp system("pause")
#define PI acos(-1)

//{
inline int toInt(string s){int 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...A> inline void dump(){cout<<endl;}
template<class...A> inline void dump_rest() {cout<<endl;}
template<class T, class...A> inline void dump_rest(const T& first, const A&... rest){cout<<dump_interval<<first;dump_rest(rest...);}
template<class T,class...A> inline void dump(const T&first,const A&...rest){cout<<first;dump_rest(rest...);}
template<class...A> inline void debug(){cerr<<endl;}
template<class...A> inline void debug_rest() {cerr<<endl;}
template<class T, class...A> inline void debug_rest(const T& first, const A&... rest){cerr<<debug_interval<<first;debug_rest(rest...);}
template<class T,class...A> inline void debug(const T&first,const A&...rest){if(debug_toggle)cerr<<first,debug_rest(rest...);}
//}

typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}
template<int m>class mint{private:int i;public:mint() : i(0){}mint(int i): i((i%m+m)%m){}mint operator+(const mint& o){return o.i+i;}mint operator*(const mint& o){return o.i*i;}mint operator-(){return -i;}operator int() {return i;}};

//}

int n,ans;

main(){
	vint v;
	cin>>n;
	rep(i,3*n){
		int t;
		cin>>t;
		v.pb(t);
	}
	sort(rall(v));
	rep(i,n)v.pop_back();
	for(int i=1;i<2*n;i+=2){
		ans+=v[i];
	}
	dans;
}

Measured memory_bytes: 5872
n = int(input())
listA = []
listB = []
for i in range(n):
    a, b = map(int, input().split())
    listA.append(a)
    listB.append(b)
listA.sort()
listB.sort()

if n%2 == 0:
    ta = (listA[n//2]+listA[n//2-1])
    tb = (listB[n//2]+listB[n//2-1])
else:
    ta = listA[n//2]
    tb = listB[n//2]

print(tb-ta+1)

Measured memory_bytes: 25392
#include<bits/stdc++.h>
#define f(a,n) for(ll i=a;i<n;i++)
#define ll long long
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define all(v) v.begin(),v.end()
using namespace std;
const ll mod=(1e+9)+7;
const ll size = 2e5+9;
ll gcd(ll a,ll b) {if(b==0)return a;return gcd(b,a%b);}
ll power(ll a,ll b,ll m = mod) {ll res = 1;while(b>0){if(b&1)res = (res*a)%m;b = b>>1;a = (a*a)%m;}return res;}


void solve()
{
    ll a = 2,b;
    cin>>b;
    cout<<(a*b)/gcd(a,b)<<endl;

}

int main()
{
    #ifdef JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    clock_t beg = clock();
    solve();
    clock_t end = clock();
    fprintf(stderr, "%.3f sec, Copyright %c 2019 Skyscraper. \n", double(end - beg) / CLOCKS_PER_SEC , 184);
    return 0;
}

Measured memory_bytes: 256
a, b, c, d = map(int,input().split())
e = list(range(a,b+1))
d = list(range(c,d+1))
#print(e)
l = []
for i in e:
  if i in d:
    l.append(i)
if l == []:
  print(0)
else:
  print(len(l)-1)

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

int main() {
  char a,b;
  cin >> a >> b;
  if( (a=='H' && b=='H') || (a=='D' && b=='D') ) {
    cout << "H" << endl;
  }else {
    cout << "D" << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define eb emplace_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
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; }
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
int const INF = 1001001001;
ll const MOD = 1000000007;


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

int N;
cin >> N;
vi X(N),Y(N);
rep(i,N) {
    cin >> X[i];
    Y[i] = X[i];
}

sort(all(Y));
int medi_l = Y[N/2 - 1], medi_r = Y[N/2];
rep(i,N){
    if(X[i] < medi_r) cout << medi_r << endl;
    else cout << medi_l << endl;
}

return 0;
}



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

#define int long long
#define vi vector <int>
#define endl "\n"
#define vvi vector <vector<int> >
#define vii vector <pair<int,int> >
#define rep(i,a,b) for (int i=a;i<b;i++)
#define repD(i,a,b) for (int i=a;i>=b;i--)
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define init(i,k) memset(i,k,sizeof i)
#define pb push_back
#define pii pair <int,int>
#define ff first
#define ss second
#define all(a) a.begin(),a.end()
const int N=1e5+5 , MOD=1e9+7;

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


void solve()
{
    int h,n;
    cin >> h >> n;
    int s=0;
    rep(i,0,n)
    {
    	int x;
    	cin >> x;
    	s += x;
    }
    if(s>=h)
    	cout <<"Yes"<< endl;
    else
    	cout <<"No"<<endl;
}

signed main()
{
    speed;
    
 //    int t; cin >> t;
 //    rep(tt,1,t+1)
 //    {
	// cout <<"Case #"<<tt<<": ";
	solve();
 //    }
    return 0;
}

Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby, combinations_with_replacement
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
X = input()

def bitcount(x):
    '''xの立っているビット数をカウントする関数
    (xは64bit整数)'''
    # 2bitごとの組に分け、立っているビット数を2bitで表現する
    x = x - ((x >> 1) & 0x5555555555555555)
    # 4bit整数に 上位2bit + 下位2bit を計算した値を入れる
    x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x = (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f # 8bitごと
    x = x + (x >> 8) # 16bitごと
    x = x + (x >> 16) # 32bitごと
    x = x + (x >> 32) # 64bitごと = 全部の合計
    return x & 0x0000007f

def popcount(n):
    cnt = 0
    while n:
        n %= bitcount(n)
        cnt += 1
    return cnt

pl = [0]*(N+1)
for i in range(N+1):
    pl[i] = popcount(i)
bn = X.count("1")

modp = [0]*N
modm = [0]*N

for i in range(N):
    if X[i] == "1":
        modp[i] = pow(2, N-1-i, bn+1)
        if not bn == 1:
            modm[i] = pow(2, N-1-i, bn-1)

sp = sum(modp)
sm = sum(modm)
ans = [0]*N
for i in range(N):
    if X[i] == "1":
        if bn == 1:
            ans[i] = 0
            continue
        s = sm
        s -= modm[i]
        s %= bn-1
        ans[i] = pl[s]+1
    else:
        s = sp
        s += pow(2, N-1-i, bn+1)
        s %= bn+1
        ans[i] = pl[s]+1

print(*ans, sep="\n")


Measured memory_bytes: 89792
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <math.h>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define pie 3.141592653589793238462643383279
#define INF 1000000007
#define ggr getchar(); getchar();return 0;
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}

long long n, m;
pair<long long, long long> a[100010];
long long ta = 0;

signed main() {
	cin >> n >> m;
	rep(i, n)cin >> a[i].first >> a[i].second;
	sort(a, a + n);
	int i = 0;
	while (1) {
		if (m <= a[i].second) {
			ta += a[i].first*m;
			cout << ta << endl;
			ggr
		}
		else {
			ta += a[i].first*a[i].second;
			m = m - a[i].second;
		}
		i++;
	}
}

Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <math.h>
#include <string>
using namespace std;
typedef long long int ll;

int main(){
	int k,t; cin >> k >> t;
	vector<int> a(t);
	for(int i=0;i<t;i++){
		cin >> a[i];
	}
	sort(a.begin(),a.end());
	cout << max(0,a[t-1]-1-(k-a[t-1])) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<queue>
#include<cmath>
#include<set>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> T;
typedef unsigned long long ll;

int main(){
    ll W,H;
    ll p[100001];
    ll q[100001];
    cin >> W >> H;
    for(int i=0;i<W;i++){
        cin >> p[i];
    }
    for(int i=0;i<H;i++){
        cin >> q[i];
    }
    sort(p,p+W);
    sort(q,q+H);
    ll yoko=0;
    ll tate=0;
    ll ans = 0;
    ll nokori = (W+1)*(H+1)-1;
    while(nokori>0){
        if(yoko<W && tate<H){
            if(p[yoko]<=q[tate]){
                ans += (H+1-tate)*p[yoko];
                yoko+=1;
                nokori -= (H+1-tate);
            }else{
                ans += (W+1-yoko)*q[tate];
                tate+=1;
                nokori -= (W+1-yoko);
            }
        }else if(yoko==W){
            ans += (W+1-yoko)*q[tate];
            tate+=1;
            nokori -= (W+1-yoko);
        }else if(tate==H){
            ans += (H+1-tate)*p[yoko];
            yoko+=1;
            nokori -= (H+1-tate);
        }
    }
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pi;
typedef vector<ll> vi;
typedef vector<pi> vpi;
typedef long double ld;
const ll inf = 1e12 + 7;
const int mod = 1e9 + 7;
const int maxn = 1e6 + 3;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define rep(i, a, b) for(int i = a; i < b; i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define lb lower_bound
#define ub upper_bound
#define fact(n) rep(i, 1, n+1)ft.pb((ft[i-1]*i)%mod);
#define mod_in(a) exp(a, mod-2)
#define ncr(n, r) ((ft[n]*mod_in((ft[r]*ft[(n)-(r)])%mod))%mod)
#define deb(x) cout << #x << " " << x << endl;
#define flash ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
int main()
{   

    flash;
    ll x,y,z;
    cin >> x >> y >> z;
    cout << z << " " << x << " " << y;
    



}

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

using namespace std;

#define M 1000000007
#define pb push_back
#define f first
#define s second
#define rep(i, st, ed) for(int i=st; i<ed; i++)
#define repn(i, st, ed) for(int i=st; i<=ed; i++)
#define repb(i, ed, st) for(int i=ed; i>=st; i--)

typedef long long ll;
typedef unsigned long long int llt;
typedef long double ld;

const long double PI  =3.141592653589793238463;
const int N = 5e5 + 10;

vector<int> g[N];
bool viss[N];
int vis[N];

// Normal DFS
void dfs(int curr, int par)
{
  for(auto x: g[curr])
    if(x != par)
      dfs(x, curr);
}

// DFS with visiting status
void dfs1(int curr, int par)
{
  viss[curr] = 1;
  for(auto x: g[curr])
    if(!viss[x])
      dfs1(x, curr);
}

// DFS with strongly connected component
void dfs2(int curr, int par, int num)
{
  vis[curr] = num;
  for(auto x: g[curr])
    if(vis[x] == 0)
      dfs2(x, curr, num);
}

// XOR from 0 to n
ll fxor(ll n)
{
  if(n < 0) return 0;
  if(n % 4 == 3) return 0;
  else if(n % 4 == 0) return n;
  else if(n % 4 == 1) return n^(n-1);
  else if(n%4 == 2) return n^(n-1)^(n-2);
}

// Power in logn with mod 1000000007
llt ppow(llt x, llt y)
{
  llt res = 1;
  while(y > 0){
    if(y&1)
      res = (res * x)%M;
    y = y >> 1;
    x = (x * x)%M;
  }
  return res;
}

// Factorial with dp
llt factdp[N];
llt fact(llt x)
{
  if(x == 0) return 1;
  if(x == 1) return 1;
  if(factdp[x] != -1) return factdp[x];
  return factdp[x] = (x*fact(x-1))%M;
}

// String return to base b
string ansConv ="";
void convert10tob(llt N, int b)
{
     if (N == 0)
        return;
     int x = N % b;
     N /= b;
     if (x < 0)
        N += 1;
     convert10tob(N, b);
     ansConv += to_string(x);
     return;
}

// Convert string to num wiht base b
llt convertstrtob(string a, int b)
{
  llt aa = 0;
  llt mul = 1;
  for(int i=a.length()-1; i>=0; i--)
  {
    int curr = a[i] - '0';
    aa += (curr * mul);
    mul *= b;
  }
  return aa;
}

// Union Find algo with array
// Find()
int findpar(int curr, int arr[])
{
  while(arr[curr] != curr) curr = arr[curr];
  return curr;
}
// Union()
void Union(int b, int spa, int arr[])
{
  while(arr[b] != b)
  {
    int c = arr[b];
    arr[b] = spa;
    b = c;
  }
  arr[b] = spa;
}

// Main Code
int dp[50][500][500];
int ans = M;
int main()
{
    fill_n(**dp, sizeof(dp)/4, M);
    int n, ma, mb;
    cin>>n>>ma>>mb;
    dp[0][0][0] = 0;
    rep(i, 0, n)
    {
      int a, b, c;
      cin>>a>>b>>c;
      rep(j, 0, 410)
        rep(k, 0, 410)
        {
          dp[i+1][j][k] = min(dp[i+1][j][k], dp[i][j][k]);
          dp[i+1][j+a][k+b] = min(dp[i+1][j+a][k+b], (dp[i][j][k] + c));
        }
    }
    rep(i, 1, 410)
      rep(j, 1, 410)
        if(ma*j == mb*i)
        {
          ans = min(ans, dp[n][i][j]);
        }
  if(ans == M) {cout<<"-1"<<endl;return 0;}
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 63104
#include<bits/stdc++.h>
using namespace std;
int main(){
  int D,N;
  cin>>D>>N;
  int ans[100000]={0};
  int p=pow(10,2*D);
  for(int i=0;i<N;i++){
    ans[i]=p*(i+1);
  }
  if(D==0 && N==100){
    ans[99]=101;
  }
  if(D==1 && N==100){
    ans[99]=10100;
  }
  if(D==2 && N==100){
    ans[99]=1010000;
  }
  cout<<ans[N-1]<<endl;
  return 0;
}


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

#include <iostream>
#include <vector>
// #include <map>
// #include <string>
// #include <algorithm>
// #include <numeric>
// #include <limits>

using namespace std;

int main() {
	int n;
	cin >> n;
	vector<vector<vector<int>>> house(4, vector<vector<int>>(3, vector<int>(10, 0)));
	for (int i = 0; i < n; i++) {
		int b, f, r, v;
		cin >> b >> f >> r >> v;
		house[b-1][f-1][r-1] += v;
	}
	for (int i = 0; i < 4; i++) {
		for (int j = 0; j < 3; j++) {
			for (int k = 0; k < 10; k++) {
				cout << " " << house[i][j][k];
			}
			cout << endl;
		}
		if (i < 3) {
			cout << "####################" << endl;
		}
	}
	return 0;
}



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

using namespace std;

#define FOR(i,j,k) for(int i = 0; i <= k; i++)
typedef long long LL;
const int MAX = 30;
const int M = (1e9) + 7;

LL dp[MAX], cnt[MAX];
string str;

LL rec(int p)
{
    if(p == 26) return 1;

    if(dp[p] != -1) return dp[p];
    return dp[p] = (cnt[p] * rec(p + 1) + rec(p + 1)) % M;
}

int main()
{
    ios::sync_with_stdio(false);
    ///freopen("in.txt", "r", stdin);

    int n;

    cin >> n;
    cin >> str;
    FOR(i,0,n-1)
    {
        int c = str[i] - 'a'; cnt[c]++;
    }
    memset(dp, -1, sizeof(dp));
    cout << rec( 0 ) - 1 << endl;
    return 0;
}


Measured memory_bytes: 512
#include <stdio.h>

int main() {
	char s[20];
	scanf ("%[^\n]", s);
	
	for (int i = 0; i < 19; i++) {
		if (i == 5 || i == 13){
			printf (" ");
			continue;
		}
	printf ("%c", s[i]);
	}
	return 0;
}

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

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(int i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)

int main() {
  long long n;
  cin >> n;
  vector<long long> v(n);
  REP(i, n) cin >> v[i];
  sort(v.begin(), v.end());
  for(long long i=0; i < v.size()-1; i++) {
    if(v[i] == v[i+1]){ cout << "NO" << endl; return 0;}
  }
  cout << "YES" << endl;
 }


Measured memory_bytes: 1792
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner scan = new Scanner(System.in);
        int N = scan.nextInt();
        int M = scan.nextInt();
        int[] count = new int[N];
        
        for(int i = 0; i < M; i++) {
            count[scan.nextInt()-1]++;
            count[scan.nextInt()-1]++;
        }
        
        for(int i = 0; i < N; i++) {
            System.out.println(count[i]);
        }
    }
}


Measured memory_bytes: 21972
#include <iostream>
using namespace std;
int main(void){
    int a,b;
    cin>>a>>b;
    if(a==1){
        a=14;
    }
    if(b==1){
        b=14;
    }
if(a>b){
    cout<<"Alice"<<endl;
}
if(b>a){
    cout<<"Bob"<<endl;
}
else if(b==a){
    cout<<"Draw"<<endl;
}
   

    
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define INF 999999999
#define rep(i,n) for(int i=0;i<n;i++)
const int MOD = 1000000007;
ll cnt =0;

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.at(n/2)-a.at((n-1)/2) << endl;
}

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

ll n;
ll a [200000];
ll dp [200000];

ll Go (ll);

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

    memset (dp , -1 , sizeof dp);

    cin >> n;

    for (ll i=1; i<=n; ++i)
        cin >> a[i];

    cout << Go (1);

    return 0;
}

ll Go (ll indx)
{
    if (indx == n)
        return 0;
    if (dp [indx] != -1)
        return dp[indx];

    ll ans1 , ans2 = 1000000000;

    ans1 = abs (a[indx] - a[indx+1]) + Go (indx+1);

    if (indx+2 <= n)
        ans2 = abs (a[indx] - a[indx+2]) + Go (indx+2);

    return dp [indx] = min (ans1 , ans2);
}

Measured memory_bytes: 5760
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define repreverse(i, start, end) for (long long i = start; i >= end; --i)
#define all(x) (x).begin(), (x).end()
#define len(x) ((long long)(x).size())
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vllvll = vector<vll>;
using pll = pair<ll, ll>;
template<class T>void print1d(T x,ll n=-1){if(n==-1)n=x.size();rep(i,0,n){cout<<x[i]<<' ';}cout<<'\n';}
template<class T>void print2d(T x,ll r=-1,ll c=-1){if(r==-1)r=x.size();if(c==-1)c=x[0].size();rep(i,0,r)print1d(x[i],c);}
template<class T, class U>bool haskey(T mp, U key) { return mp.find(key) != mp.end(); }
template<class T, class U>bool isin(T el, U container) { return find(all(container), el) != container.end(); }
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>bool even(T n) { return ! (n & 1); }
template<class T>bool odd(T n) { return n & 1; }
template<class T>ld deg2rad(T deg) { return M_PI * deg / 180.0; }
template<class T>ld rad2deg(T rad) { return 180.0 * rad / M_PI; }
ll intpow(ll a,ll n){ll p=1;while(n){if(n&1)p*=a;a*=a;n>>=1;}return p;}
const long double pi = M_PI;
const long long big = 1LL << 50;
const long long inf = 1LL << 60;
const long long mod = 1e9 + 7;



int main()
{
        ll N;
        cin >> N;
        vllvll dp(50, vll(101010, inf));
        dp[0][0] = 0;
        vll choice = {0, 1, 6, 9};

        ll now = 36;
        while (now < 101010) {
                choice.push_back(now);
                now *= 6;
        }
        now = 81;
        while (now < 101010) {
                choice.push_back(now);
                now *= 9;
        }
        sort(all(choice));

        rep(i, 1, len(choice)) {
                rep(j, 0, 101010) {
                        if (j - choice[i] >= 0) chmin(dp[i][j], min(dp[i-1][j-choice[i]] + 1, dp[i][j-choice[i]] + 1));
                        else chmin(dp[i][j], dp[i-1][j]);
                }
        }
        //vll cands = {dp[1][N], dp[2][N], dp[3][N]};
        ll ans = inf;
        rep(i, 1, len(choice)) {
                chmin(ans, dp[i][N]);
        }
        cout << ans << endl;
}

Measured memory_bytes: 43652
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file 
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional> // for less 
#define pb push_back
#define For(i,s,e) for (ll i=(s); i<(e); i++)
#define Debug_array(a,n) for (ll i=(0); i<(n); i++) cout<<a[i]<<" "
#define Foe(i,s,e) for (ll i=(s); i<=(e); i++)
#define Fod(i,s,e) for (ll i=(s)-1; i>=(e); i--)
#define pii pair<ll,ll>
#define fi first
#define se second
#define endl "\n"
#define mp make_pair
#define big_prime 15486277
#define bigger_prime 179424697
#define biggest_prime 32416188691
//#define random_shuffle(indices.begin(), indices.end());
//std::random_device rd;
//std::mt19937 g(rd());
//std::shuffle(v.begin(), v.end(), g);
using namespace __gnu_pbds; 
using namespace std;
template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << v.first << ' ' << v.second; return os; }
// template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; }
 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <class Arg1> void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << endl; }
    template <class Arg1, class... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args) {
        const char* sep = strchr(names + 1, ',');
        cerr.write(names, sep - names) << " : " << arg1 << "  ";
        __f(sep + 1, args...);
    }
#else
#define trace(...) 0
#define _CRT_SECURE_NO_WARNINGS
#endif // ifndef ONLINE_JUDGE


typedef long long ll;
typedef tree<ll, null_type, less<ll>, rb_tree_tag,tree_order_statistics_node_update> ordered_set; 

#define Mod 1000000007
#define MAX 5002

int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	
	ll m1,d1;cin>>m1>>d1;
	ll m2,d2;cin>>m2>>d2;

	if(m1!=m2 && d1!=d2){
		cout<<"1"<<endl;
	}else{
		cout<<"0"<<endl;
	}































	
}

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

using namespace std;

#define dprint(Exp,...) if(Exp){fprintf(stderr, __VA_ARGS__);}
#define printe(...) fprintf(stderr, __VA_ARGS__);
#define PrtExp(_Exp)  cerr<< #_Exp <<" = "<< (_Exp)
#define PrtExpN(_Exp)  cerr<< #_Exp <<" = "<< (_Exp) <<"\n"

#define SINT(n) scanf("%d",&n)
#define SINT2(n,m) scanf("%d %d",&n,&m)
#define SINT3(n,m,o) scanf("%d %d %d",&n,&m,&o)
#define SINT4(n,m,o,p) scanf("%d %d %d %d",&n,&m,&o,&p)
#define SINT5(n,m,o,p,q) scanf("%d %d %d %d %d",&n,&m,&o,&p,&q)
#define SLL(n) scanf("%lld",&n)
#define SLL2(n,m) scanf("%lld %lld",&n,&m)
#define SLL3(n,m,o) scanf("%lld %lld %lld",&n,&m,&o)
#define SST(s) scanf("%s",s)
#define SCH(c) scanf("%c",&c)

#define GC() getchar()

#define PINT(n) printf("%d",(int)(n))
#define PINT2(n,m) printf("%d %d",(int)(n),(int)(m))
#define PINT3(n,m,l) printf("%d %d %d",(int)(n),(int)(m),(int)(l))
#define PLL(n) printf("%lld",(long long)(n))
#define PST(s) printf("%s",(s))
#define PCH(s) printf("%c",(s))

#define PINTN(n) printf("%d\n",(int)(n))
#define PINT2N(n,m) printf("%d %d\n",(int)(n),(int)(m))
#define PINT3N(n,m,l) printf("%d %d %d\n",(int)(n),(int)(m),(int)(l))
#define PLLN(n) printf("%lld\n",(long long)(n))
#define PSTN(s) printf("%s\n",(s))
#define PCHN(s) printf("%c\n",(s))

#define PSP() printf(" ")
#define PN() printf("\n")

#define PC(c) putchar(c)
#define CSP (' ')
#define SN ("\n")

#define rep(i,a) for(int i=0;i<a;i++)
#define reP(i,a) for(int i=0;i<=a;i++)
#define Rep(i,a) for(int i=a-1;i>=0;i--)
#define ReP(i,a) for(int i=a;i>=0;i--)

#define rEp(i,a) for(i=0;i<a;i++)
#define rEP(i,a) for(i=0;i<=a;i++)
#define REp(i,a) for(i=a-1;i>=0;i--)
#define REP(i,a) for(i=a;i>=0;i--)

#define repft(i,a,b) for(int i=a;i<b;i++)
#define repfT(i,a,b) for(int i=a;i<=b;i++)
#define Repft(i,a,b) for(int i=a-1;i>=b;i--)
#define RepfT(i,a,b) for(int i=a;i>=b;i--)

#define foreach(a,it) for(auto it = a.begin(); it != a.end(); ++it)

#define FILL(a,v) fill(begin(a),end(a), v)
#define FILL0(a) memset(a,0,sizeof(a))
#define FILL1(a) memset(a,-1,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> Pi;
typedef pair<ll, ll>   Pll;


const int INF = 0x2aaaaaaa; // 715,827,882
const ll INFLL = 0x1f1f1f1f1f1f1f1fLL;//2,242,545,357,980,376,863

template <class A, class B> inline ostream& operator<<(ostream& st, const pair<A, B>& P) { return st << "(" << P.first << "," << P.second << ")"; };
template <class A, class B> inline pair<A, B> operator+(const pair<A, B>& P, const pair<A, B>& Q) { return pair<A, B>(P.first + Q.first, P.second + Q.second); };
template <class A, class B> inline pair<A, B> operator-(const pair<A, B>& P, const pair<A, B>& Q) { return pair<A, B>(P.first - Q.first, P.second - Q.second); };


#define fs first
#define sc second


int x[100005] = {};

int main() {
	string s, t;


	int n;
	cin >> n;
	rep(i, n) {
		int a;
		cin >> a;
		++x[a - 1];
		++x[a];
		++x[a + 1];
	}

	int r = 0;
	rep(i, 100005) {
		r = max(r, x[i]);
	}
	cout << r << endl;


}

Measured memory_bytes: 640
#include <stdio.h>
#include <string.h>
void init(char *s,char *t,int *ans){
  int i;
  for(i=0;i<101;i++){
    s[i]=t[i]='\0';
    ans[i]='\0';
  }
}
int main(){
  int i,j,k,n,c,r,slen,tlen,sl,tl;
  char s[101],t[101];
  int ans[101];;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    init(s,t,ans);
    scanf("%s",s);
    scanf("%s",t);
    slen=strlen(s);
    tlen=strlen(t);
    for(j=0;j<100;j++){
      r=0;
      sl=slen-j-1;
      tl=tlen-j-1;
      if(sl<0 && tl<0 && c==0)break;
      
      if(sl>=0)r+=s[sl]-48;
      if(tl>=0)r+=t[tl]-48;
      ans[j]=((r+c)%10);
      if(r+c>=10)c=1;
      else c=0;
     
    }
    
    if(j>80)printf("overflow\n");
    else {
      for(k=j-1;k>=0;k--)printf("%d",ans[k]);
      printf("\n");
    }
  }
  return 0;
}

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

int main () {
  int a,b;
  cin >> a >> b;

  if (a>b && b!=1) cout << "Alice" << endl;
  else if (b>a && a!=1) cout << "Bob" << endl;
  else if (a==1 && a<b) cout << "Alice" << endl;
  else if (b==1 && b<a) cout << "Bob" << endl;
  else cout << "Draw" << endl;

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;

using namespace std;

int main(int argc, char* argv[])
{
    int n,K;
    scanf("%d%d", &n, &K);
    vector<int> a(n);
    vector<ll> s(n+1);
    int i,j;
    for(i=0; i<n; i++) {
        scanf("%d", &a[i]);
        s[i+1]=s[i]+a[i];
    }
    vector<ll> v;
    for(i=0; i<=n; i++) {
        for(j=i+1; j<=n; j++) {
            v.push_back(s[j]-s[i]);
        }
    }
    set<pair<ll,int> > z;
    for(i=0; i<(int)v.size(); i++) {
        z.insert(make_pair(v[i],i));
    }

    ll ans=0;
    int k;
    for(k=50; k>=0; k--) {
        set<pair<ll,int> > z0;
        int cnt=0;
        auto it=z.begin();
        for(; it!=z.end(); ++it) {
            ll tmp=it->first;
            if(tmp & ((ll)1<<k)) {
                z0.insert(*it);
                cnt++;
            }
        }
        if(cnt>=K) {
            ans=ans*2+1;
            z.swap(z0);
        }
        else {
            ans=ans*2;
        }
    }
    printf("%lld\n", ans);

    return 0;
}



Measured memory_bytes: 42480
from collections import defaultdict
n = int(input())
mex = 10**6 +5
lp = [0 for i in range(mex)]
prime = []

def init():
    lp[1] = 1
    for i in range(2,mex):
        if lp[i]==0:
            lp[i] = i
            prime.append(i)
        j = 0
        while j<len(prime) and i*prime[j]<mex:
            lp[i*prime[j]] = prime[j]
            if(i%prime[j]==0):
                break
            j+=1
init()
cnt = 0
for i in range(1,n+1):
    temp = n-i
    me = 1
    freq = defaultdict(int)
    while temp>1:
        freq[lp[temp]]+=1
        temp = temp//lp[temp]
    for x in freq:
        me*=(freq[x]+1)
    cnt+=me
print(cnt-1)

Measured memory_bytes: 142908