akhauriyash/Code-Regression huggingface dataset:
class Node:
    def __init__(self, key:int):
        self.key = key
        self.p = None
        self.left = None
        self.right = None

class Tree:
    def __init__(self):
        self.root = None

    def insert(self, z:Node):
        y = None
        x = self.root
        while x != None:
            y = x
            if z.key < x.key:
                x = x.left
            else:
                x = x.right
        z.p = y
        if y == None:
            self.root = z
        elif z.key < y.key:
            y.left = z
        else:
            y.right = z

def Preorder(target:Node):
    yield target.key
    if target.left != None:
        yield from Preorder(target.left)
    if target.right != None:
        yield from Preorder(target.right)

def Inorder(target:Node):
    if target.left != None:
        yield from Inorder(target.left)
    yield target.key
    if target.right != None:
        yield from Inorder(target.right)

def find(target:Node,findkey:int):
    return node_of_key(target, findkey) != None

def node_of_key(target:Node,findkey:int):
    if target.key == findkey:
        return target
    elif target.key > findkey:
        if target.left:
            return node_of_key(target.left, findkey)
    else:
        if target.right:
            return node_of_key(target.right, findkey)
    return None

def min_value_node_of_tree(root:Node):
    if root.left == None:
        return root
    else:
        return min_value_node_of_tree(root.left)

def delete(target:Node):
    if target.left == None and target.right == None:
        if target.key < target.p.key:
            target.p.left = None
        else:
            target.p.right = None
    elif (target.left == None) ^ (target.right == None):
        child = target.left if target.left else target.right
        child.p = target.p
        if target.key < target.p.key:
            target.p.left = child
        else:
            target.p.right = child
    else:
        next_node = min_value_node_of_tree(target.right)
        target.key = next_node.key
        delete(next_node)

from sys import stdin
tree = Tree()
n = int(input())
lines = stdin.readlines()
for line in lines:
    proc,*key = line.split()
    if proc == "insert":
        tree.insert(Node(int(key[0])))
    elif proc == "find":
        print("yes" if find(tree.root, int(key[0])) else "no")
    elif proc == "delete":
        delete(node_of_key(tree.root, int(key[0])))
    else:
        print(" ",end="")
        print(*Inorder(tree.root))
        print(" ",end="")
        print(*Preorder(tree.root))


Measured memory_bytes: 128524
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
while(true) {
int n, m;
scanf("%d%d", &n, &m);
if(n == 0)
break;
vector<int> h(n + 1), w(m + 1);
for(int i = 1; i <= n; ++i) {
scanf("%d", &h[i]);
h[i] += h[i - 1];
}
for(int i = 1; i <= m; ++i) {
scanf("%d", &w[i]);
w[i] += w[i - 1];
}
vector<int> x, y;
x.reserve(n * n / 2);
y.reserve(m * m / 2);
for(int i = 0; i < n; ++i) {
for(int j = i + 1; j < n + 1; ++j)
x.push_back(h[j] - h[i]);
}
for(int i = 0; i < m; ++i) {
for(int j = i + 1; j < m + 1; ++j)
y.push_back(w[j] - w[i]);
}
sort(x.begin(), x.end());
sort(y.begin(), y.end());
int ans = 0;
for(int i = 0; i < x.size(); ++i) {
int v = x[i];
int c = upper_bound(y.begin(), y.end(), v) - lower_bound(y.begin(), y.end(), v);
ans += c;
}
printf("%d\n", ans);
}
return 0;
}

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

int main() {
    int N, K; cin >> N >> K;
    string S; cin >> S;

    // 「1 の個数」「0 の個数」を交互に記録していく
    vector<int> nums;    
    if (S[0] == '0') nums.push_back(0); // 先頭が 0 だったら
    for (int i = 0; i < S.size();) {
        int j = i;
        while (j < S.size() && S[j] == S[i]) ++j; // S[i] の数値がどこまで続くか
        nums.push_back(j - i);
        i = j;
    }
    if (S.back() == '0') nums.push_back(0);

    // 累積和
    vector<int> sums((int)nums.size() + 1, 0);
    for (int i = 0; i < nums.size(); ++i) sums[i+1] = sums[i] + nums[i];

    // 偶数番目の添字から始まる、長さ 2K+1 の区間の総和のうち、最大値を求める
    int res = 0;
    for (int left = 0; left < sums.size(); left += 2) {
        int right = min((int)sums.size()-1, left + K*2+1);
        res = max(res, sums[right] - sums[left]);
    }
    cout << res << endl;
}


Measured memory_bytes: 1272
#include<bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
using namespace std;

//ループマクロ
#define FOR(i , a , b)  for(int i = (a) ; i < (b) ; i++)
#define REP(i , n)      for(int i = 0 ; i < n ; i++)
#define REPR(i , n)     for(int i = n ; 0 <= i ; i--)
#define ROP(i, n)       for(int i = 1 ; i <= n ; i++)

//入出力
#define SCOUT(x) cout << (x) << " "
#define VECCIN(x) for(auto& ele : (x) ) cin >> ele
#define VECOUT(x) for(auto& ele : (x) ) cout << ele << " "; cout << endl;

//その他
#define ALL(obj) (obj).begin() , (obj).end() 
#define SORT(obj) sort(ALL(obj))
#define GSORT(obj) sort(ALL(obj) , greater<int>())
#define P pair<int , int>
#define V vector<int>
#define VLL vector<long long>
#define M map<int, int>
#define S set<int>
#define PQ priority_queue<int>
#define PQG priority_queue<int , V , greater<int>>

int main(void) {

	ios::sync_with_stdio(false);	cin.tie(0);
    int N, m;  cin >> N >> m;
    ll sum = 0;
    REP(i, m){  int A;  cin >> A;  sum += A;  }

    cout << ((sum <= N) ? N - sum : -1)  << endl;
	return 0;
}


Measured memory_bytes: 3636
#include <iostream>
#include <set>
#include <algorithm>


using namespace std;

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

int main(int argc, char const* argv[])
{
	string str;
	int m;
	set<string> ans;
	
	cin >> m;
	
	rep(i, m){
		cin >> str;
		ans.clear();
		rep(i, str.length()){
			string a, b;
			a = str.substr(0, i+1);
			b = str.substr(i+1, str.length() - i+1);
			ans.insert(a + b);
			ans.insert(b + a);
			reverse(b.begin(), b.end());
			ans.insert(a + b);
			ans.insert(b + a);
			reverse(a.begin(), a.end());
			ans.insert(a + b);
			ans.insert(b + a);
			reverse(b.begin(), b.end());
			ans.insert(a + b);
			ans.insert(b + a);
		}
		
		cout << ans.size() << endl;
	}
	return 0;
}

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

int main(void) {

	int n;
	cin >> n;

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

	reverse(a, a+n);
	for(int i=0;i<n;i++) {
		cout << a[i];
		if(i != n-1) {
			cout << " ";
		}
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

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;}

const ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

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

  int N_S = S.size();
  int N_T = T.size();
  vector<vector<int>> dp(N_S + 10, vector<int>(N_T + 10, 0));
  dp[0][0] = dp[0][1] = dp[1][0] = 0;
  for (int i = 0; i < N_S; ++i){
    for (int j = 0; j < N_T; ++j){
      if (S[i] == T[j]) chmax(dp[i + 1][j + 1], dp[i][j] + 1);
      else chmax(dp[i + 1][j + 1], dp[i][j]);
      chmax(dp[i + 1][j + 1], dp[i + 1][j]);
      chmax(dp[i + 1][j + 1], dp[i][j + 1]);
    }
  }
  string ans = "";
  int i = (int)S.size(), j = (int)T.size();
  while (N_S > 0 && N_T > 0){
    // (i, j + 1) -> (i + 1, j + 1)
    if (dp[N_S][N_T] == dp[N_S - 1][N_T]) --N_S;
    // (i + 1, j) -> (i + 1, j + 1)
    else if (dp[N_S][N_T] == dp[N_S][N_T - 1]) --N_T;
    // (i, j) -> (i + 1, j + 1)
    else {
      ans = S[N_S- 1] + ans;
      --N_S, --N_T;
    }
  }
  //cout << dp[N_S][N_T] << endl;
  cout << ans << endl;
}


Measured memory_bytes: 35712
#include <bits/stdc++.h>
#define itn int
#define REP(i, n) for (int i = 0; i < (n); i++)
#define IREP(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, k, n) for (int i = (k); i < (n); i++)
#define REPEACH(itr, k) for (auto &&itr : k)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;


const ll INF = 1ll << 60;
const ll MOD = 1000000007;
vector<int> v;

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


Measured memory_bytes: 256
'use strict'

const main = (input) => {
    const N = parseInt(input)
    for(let i = 1; ; i++){
        let num = Math.pow(2, i)
        if(num > N){
            console.log(Math.pow(2, i - 1))
            return
        }
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))

Measured memory_bytes: 22212
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.InputMismatchException;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskX solver = new TaskX();
		solver.solve(1, in, out);
		out.close();
	}

	static int INF = 1 << 30;
	static int modP = 1000000007;

	static class TaskX {
		public void solve(int testNumber, InputReader in, PrintWriter out) {

			String[] s = in.nextString().split("T");
			int x = in.nextInt(), y = in.nextInt();
			int len = s.length;
			List<Integer> xs = new ArrayList<>();
			List<Integer> ys = new ArrayList<>();
			for (int i = 0; i < len; i++) {
				if (i % 2 == 0) {
					xs.add(s[i].length());
				} else {
					ys.add(s[i].length());
				}
			}

			if (!xs.isEmpty()) {
				x -= xs.get(0);
				xs.remove(0);
			}
			out.println(can(xs, x) && can(ys, y) ? "Yes" : "No");


		}

		boolean can(List<Integer> xs, int x) {

			Set<Integer> set = new HashSet<>();
			set.add(0);

			for (int v : xs) {
				Set<Integer> next = new HashSet<>();
				for (int base : set) {
					next.add(base + v);
					next.add(base - v);
				}
				set = next;
			}

			return set.contains(x);
		}
	}

	static class InputReader {
		BufferedReader in;
		StringTokenizer tok;

		public String nextString() {
			while (!tok.hasMoreTokens()) {
				try {
					tok = new StringTokenizer(in.readLine(), " ");
				} catch (IOException e) {
					throw new InputMismatchException();
				}
			}
			return tok.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(nextString());
		}

		public long nextLong() {
			return Long.parseLong(nextString());
		}

		public double nextDouble() {
			return Double.parseDouble(nextString());
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt();
			}
			return res;
		}

		public long[] nextLongArray(int n) {
			long[] res = new long[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextLong();
			}
			return res;
		}

		public InputReader(InputStream inputStream) {
			in = new BufferedReader(new InputStreamReader(inputStream));
			tok = new StringTokenizer("");
		}

	}

}


Measured memory_bytes: 114548
#include <iostream>
#include <numeric>
#define N 51

using namespace std;

int path[N][N];

int main()
{
    int n, m;
    cin >> n >> m;
    for(int i = 0; i <= n; i += 1)
        for(int j = 0; j <= n; j+= 1)
            path[i][j] = 0;
    
    int s, g;
    while(m--) {
        cin >> s >> g;
        path[s][g]++;
        path[g][s]++;
    }

    for (int i = 1; i <= n; i += 1) {
        cout << accumulate(&path[i][0], &path[i][n+1], 0) << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int           long long
#define pb            push_back
#define mp            make_pair
#define PI            3.14159265
#define M             1000000007
#define MM            998244353
#define fr            first
#define sc            second
#define all(v)        (v).begin(),(v).end()
#define rall(v)       (v).rbegin(),v.rend()
#define vc            vector
#define vi            vector<int>
#define pii           pair<int,int>
#define psi           pair<string,int>
#define pis           pair<int,string>
#define mii           map<int,int>
#define msi           map<string,int>

int visited[200005],v1[200005];
vector<int> v[200005];

void dfs(int vertex,int t){
    visited[vertex]=1;
    v1[vertex]+=t;
    for (int x:v[vertex])
    {
        if(!(visited[x]))
            dfs(x,t);
    }
}
int solve() {
    int n,q; cin>>n>>q;
    for (int i = 0; i < n-1; ++i)
    {
        int a,b; cin>>a>>b;
        v[a].pb(b);
    }
    for (int i = 0; i < q; ++i)
    {
        int a,b; cin>>a>>b;
        v1[a]+=b;
    }
    for (int i = 1; i <= n; ++i)
    {
        for (int j = 0; j < v[i].size(); ++j)
        {
            v1[v[i][j]]+=v1[i];
        }
    }
    for (int i = 1; i <= n; ++i)
    {
        cout<<v1[i]<<" ";
    }
}

signed main() {
    ios::sync_with_stdio(false);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int t=1;
    //cin>>t;
    while(t--) solve();
    return 0;
}

Measured memory_bytes: 14976
#include <stdio.h>
typedef long long ll;
using namespace std;

ll abs(ll a) {
  return a > 0 ? a : -a;
}

int main(void) {
  ll i, j, k, n, m, a, b, c, d, ans = 1e18;
  scanf("%lld%lld%lld%lld", &n, &a, &b, &c);
  m = 1ll << (2 * n);
  ll l[n];
  for(i = 0; i < n; ++i) scanf("%lld", &l[i]);
  for(i = 0; i < m; ++i) {
    ll na = 0, nb = 0, nc = 0, ca = 0, cb = 0, cc = 0, now = 0;
    for(j = 0; j < n; ++j) {
      if((3 & (i >> (2 * j))) == 1) na += l[j], ca++;
      if((3 & (i >> (2 * j))) == 2) nb += l[j], cb++;
      if((3 & (i >> (2 * j))) == 3) nc += l[j], cc++;
    }
    if(!ca || !cb || !cc) continue;
    ca--, cb--, cc--;
    now = 10 * (ca + cb + cc);
    now += abs(na - a) + abs(nb - b) + abs(nc - c);
    if(now < ans) ans = now;
  }
  printf("%lld", ans);
  return 0;
}

Measured memory_bytes: 128
#pragma GCC optimize(2)
#include<bits/stdc++.h>
typedef long long ll;
const int maxn=2e6+5;
using namespace std;
const ll INF=1e18;
const ll mod=1e9+7;
ll n,x,d;
ll num[200005];
set<pair<ll,ll>>s[maxn];
ll gcd(ll a,ll b)
{
    if(!b)
        return a;
    return gcd(b,a%b);
}
int main()
{
    scanf("%lld%lld%lld",&n,&x,&d);
    if(d==0)
    {
        printf("%lld\n",x?n+1:1ll);
        return 0;
    }
    ll t=gcd(x,d);
    x/=t;
    d/=t;
    //printf("%lld\n",d);
    num[1]=x;
    if(d<0)
    {
        d=-d;
        x=-x;
    }
    ll ans=0;
    for(int i=2; i<=n; i++)
        num[i]=num[i-1]+d;
    for(int i=0; i<d; i++) //枚举哪一类
    {
        set<pair<ll,ll>>s;
        for(ll k=i; k<=n; k+=d)
        {
            ll temp=k*x;
            ll mins=(0ll+k-1)*k/2ll,maxe=(n-k+n-1ll)*k/2ll;
            s.insert(make_pair(temp/d+mins,temp/d+maxe));
        }
        ll en=-INF;
        for(auto k=s.begin(); k!=s.end(); k++)
        {
            auto u=*k;
            if(en<u.first)
            {
                ans+=u.second-u.first+1;
                en=u.second;
            }
            else
            {
                if(u.second>en)
                {
                    ans+=u.second-en;
                    en=u.second;
                }
            }
        }
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 108032
N = int(input())
ab = [list(map(int, input().split())) for _ in range(N)]
cd = [list(map(int, input().split())) for _ in range(N)]

ab = sorted(ab, key=lambda x:x[1])
cd.sort()
  
count = 0
for i in range(N):
  idx = -1
  for j in range(len(ab)):
    if cd[i][0] > ab[j][0] and cd[i][1] > ab[j][1]:
      idx = j
  if idx >= 0:
    count += 1
    ab.pop(idx)
  
print(count)

Measured memory_bytes: 3064
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

var sc *bufio.Scanner
var out *bufio.Writer

func main() {
	sc = bufio.NewScanner(os.Stdin)
	//bytes, _ := ioutil.ReadFile("./stdin.txt")
	//sc = bufio.NewScanner(strings.NewReader(string(bytes)))
	out = bufio.NewWriter(os.Stdout)
	buf := make([]byte, 1<<20)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush()

	n := nextInt()
	a, b, c := nextInts(n), nextInts(n), nextInts(n)

	sort.Sort(sort.IntSlice(a))
	sort.Sort(sort.IntSlice(b))
	sort.Sort(sort.IntSlice(c))

	result := 0
	for bi := 0; bi < n; bi++ {
		ai := sort.Search(n, func(i int) bool { return a[i] >= b[bi] })
		ci := sort.Search(n, func(i int) bool { return c[i] > b[bi] })
		result += ai * (n - ci)
	}

	fmt.Fprintln(out, result)

}

func next() string {
	sc.Scan()
	return sc.Text()
}
func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}
func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func intMin(a, b int) int {
	if a > b {
		return b
	}
	return a
}
func intMax(a, b int) int {
	if a > b {
		return a
	}
	return b
}


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

int a,b,c;

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>a>>b>>c;
	if(a + b >= c){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(long long int (i)=0;(i)<(n);++(i))
#define ref(i,a,b) for (long long int (i)=(a); (i)<=(b); ++(i))
#define ll long long
double dp[3005][3005];
int n;
int main(){
	dp[0][0]=1;
	cin >> n;
	ref(i,1,n){
		double p;
		cin >> p;
		rep(j,i){
			dp[i][j + 1] += dp[i - 1][j] * p;
			dp[i][j] += dp[i - 1][j] * (1-p);
		}
	}
	double res = 0.0;
	for (int i = n / 2 + 1; i <= n; i++)res += dp[n][i];
	printf("%.15f\n", res);
}

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

int main() {
	int n, k;
	cin >> n >> k;
	int j = 0;
	int a[n];
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		if (a[i] == 1)j = i + 1;
	}

	int count = 0;

	int x = (j - 1) % (k - 1);
	if (x == 0){
	    count += (j - 1) / (k - 1);
	    int y=(n-j)%(k-1);
	    if(y==0)count+=(n-j)/(k-1);
	    else count+=(n-j)/(k-1)+1;
	}
	else {
	    count += (j - 1) / (k - 1) + 1;
	    if(n-j-(k-1-x)>=0){
		int y= (n - j - (k-1-x)) % (k - 1);
		if(y==0)count += (n - j - (k-1-x)) / (k - 1);
		else count += (n - j - (k-1-x)) / (k - 1) + 1;
	    }
	    else count+=0;
	}
	
	cout << count << endl;

	return 0;
}


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

const ll mod = 1e9 + 7;
ll dp[1001001][2][2], ans;

int n;

int main(){
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin >> n;
	dp[0][0][0] = 1;

	for(int i=1;i<=n;i++){
		for(int j=0;j<10;j++){
			for(int l=0;l<2;l++){
				for(int m=0;m<2;m++){
					(dp[i][l | (j==0)][m | (j==9)] += dp[i-1][l][m]) %= mod;
				}
			}
		}
	}

	cout << dp[n][1][1];
}

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

long long gcd(long long x, long long y){
  if (x<y) return gcd(y,x);
  else if(x%y == 0) return y;
  else return gcd(y,x%y);
}

int main(){
  int T;
  cin >> T;
  for (int i=0; i<T; i++){
    long long A, B, C, D;
    cin >> A >> B >> C >>D;
    if ((D < B) || (A < B)){
      cout <<"No" << endl;
    } else if (C >= B){
      cout << "Yes" << endl;
    } else if ((C >= B-gcd(B,D)) && (A%B <= C)){
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
}


Measured memory_bytes: 256
from math import sqrt
def circle_center(x1, y1, x2, y2):
    xd = x2 - x1; yd = y2 - y1
    d = xd**2 + yd**2
    k = sqrt((4.0 - d) / d) / 2.0
    xc = (x1 + x2) / 2.0; yc = (y1 + y2) / 2.0
    xd *= k; yd *= k
    return [[xc - yd, yc + xd], [xc + yd, yc - xd]]
while 1:
    n = int(raw_input())
    if n==0: break
    p = sorted(map(float, raw_input().split()) for i in xrange(n))
    prev = 0
    ans = 1
    for i in xrange(n):
        bx, by = p[i]
        while bx - p[prev][0] >= 2.0: prev += 1
        for j in xrange(i+1, n):
            cx, cy = p[j]
            if cx - bx >= 2.0: break
            if abs(by - cy) <= 2.0 and (bx - cx)**2 + (by - cy)**2 <= 4.0:
                for ex, ey in circle_center(bx, by, cx, cy):
                    count = 2
                    for k in xrange(prev, n):
                        if k==i or k==j: continue
                        dx, dy = p[k]
                        if ex - dx >= 1.0: continue
                        if dx - ex >= 1.0: break
                        if abs(ey - dy) <= 1.0 and (ex - dx)**2 + (ey - dy)**2 <= 1.0:
                            count += 1
                    ans = max(ans, count)
    print ans

Measured memory_bytes: 6580
n = list(input())
n = [int(i) for i in n]
if n[0] < n[1]:
    print(str(n[0]+1)*3)
elif n[0] == n[1]:
    if n[0] < n[2]:
        print(str(n[0]+1)*3)
    elif n[0] >= n[2]:
        print(str(n[0])*3)
else:
    print(str(n[0])*3)

Measured memory_bytes: 38256
import java.io.*;
class Main{
  public static void main(String[] args) throws Exception{
    String S=new BufferedReader(new InputStreamReader(System.in)).readLine();
    int l=S.length(),m=753,x[]=new int[l];
    for(int i=0;i<l;)x[i]=Character.getNumericValue(S.charAt(i++));
    for(int i=0;i<l-2;)m=Math.min(Math.abs(x[i]*100+x[i+1]*10+x[2+i++]-753),m);
    System.out.println(m);}}

Measured memory_bytes: 22740
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) throws Exception {
        // Here your code !
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String line = br.readLine();
        StringBuilder sb = new StringBuilder();
        for(int i=0;i<line.length();i++){
            if(Character.isLowerCase(line.charAt(i))){
                sb.append(String.valueOf(line.charAt(i)).toUpperCase());
            }else {
                sb.append(String.valueOf(line.charAt(i)).toLowerCase());
            }
        }
        System.out.println(sb.toString());
    }
}

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

const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];

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

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

int main() {
    COMinit();
    int n, k; cin >> n >> k;
    long long res = 0;
    for(int i=0; i<=min(n,k); ++i) {
        res = (res + COM(n, i) * COM(n - 1, i) % MOD) % MOD;
    }
    cout << res << endl;
}

Measured memory_bytes: 12160
# coding: utf-8
# hello worldと表示する
#float型を許すな
#numpyはpythonで
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)
from collections import Counter, deque
from collections import defaultdict
from itertools import combinations, permutations, accumulate, groupby, product
from bisect import bisect_left,bisect_right
from heapq import heapify, heappop, heappush
from math import floor, ceil,pi,factorial
from operator import itemgetter
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def LI2(): return [int(input()) for i in range(n)]
def MXI(): return [[LI()]for i in range(n)]
def SI(): return input().rstrip()
def printns(x): print('\n'.join(x))
def printni(x): print('\n'.join(list(map(str,x))))
inf = 10**17
mod = 10**9 + 7

prepare=[]
n=I()
tree=[[] for i in range(n)]
for i in range(n-1):
    a,b=MI()
    a-=1
    b-=1
    prepare.append([a,b])
    tree[a].append(b)
    tree[b].append(a)
lis=sorted(LI(),reverse=True)
answers=[0 for i in range(n)]
Q=deque([0])
answers[0]=lis[0]
count=1
while Q:
    q=Q.popleft()
    for x in tree[q]:
        if answers[x]==0:
            answers[x]=lis[count]
            Q.append(x)
            count+=1
#print(answers)
ans=0
for i in range(n-1):
    ans+=min(answers[prepare[i][0]],answers[prepare[i][1]])
print(ans)
print(*answers)

Measured memory_bytes: 47856
/*----- || Hare Krishna || -----*/

/*  "WHY DO WE FALL, BRUCE?"  */

//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")

#include<bits/stdc++.h>
#define ll long long
#define endl '\n'
#define elif else if
#define pb push_back
#define pf push_front
#define PI 3.1415926535897932384
#define MOD 1000000007
using namespace std;

char alpha[26] = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};

string s;
int t;

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    double d,t,s;
    cin >> d >> t >> s;
    if(d<=t*s){
    	cout <<"Yes";
	}
	else{
		cout <<"No";
	}
}


Measured memory_bytes: 3736
//https://atcoder.jp/contests/abc079/tasks/abc079_d
//D - Wall
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
const ll LINF = 0x1fffffffffffffff;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
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< typename T >
void warshall_floyd(vector<vector<T>>& d) //nは頂点数
{
  const int n = d.size();
	for(int i = 0; i < n; i++) // 経由する頂点
		for(int j = 0; j < n; j++) // 開始頂点
			for(int k = 0; k < n; k++) // 終端
        if(d[j][i] != LINF && d[i][k] != LINF) //負辺がない場合は不要
				  d[j][k] = min(d[j][k], d[j][i] + d[i][k]);
}

int main() {
  ll H,W; cin>>H>>W;
  vector<vector<ll>> g(10,vector<ll>(10,LINF));
  FOR(i,0,10){
    FOR(j,0,10){
      cin>>g[i][j];
    }
  }

  warshall_floyd(g);

  ll ans=0;
  FOR(i,0,H){
    FOR(j,0,W){
      ll a; cin>>a;
      if(a==-1||a==1)continue;
      ans += g[a][1];
    }
  }
  cout<<ans<<endl;  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
const long long mod = 1000000007;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    long long sum, ans;
    sum = 0;
    ans = 0;
    for (int i = 0; i < a.size(); i++){
        cin >> a[i];
        sum += a[i];
        sum %=mod;
    }
    
    for(int i = 0; i < n; i ++){
        sum -= a[i];
        if(sum < 0){
            sum += mod;
        }
        ans += a[i] * sum;
        ans %=mod;
    }
    cout << ans << endl;

    return 0;
}

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

int main(){
    string N;

    //入力
    cin >> N;
    int sum;

    for(int i = 0;i<N.size();i++){
        int dig = (int) N[i]-48;
        sum += dig;
        sum = sum%9;
        }

    if(sum!=0){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }
    
}


Measured memory_bytes: 3676
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cctype>

int main(void){
    std::string word; 
    std::vector<std::string> input_sentence;
    std::vector<std::string> sentence;

    std::cin >> word;
    std::cin.ignore();
    while(1){
        std::string word_input;
        std::cin >> word_input;
        if(word_input == "END_OF_TEXT")
            break;
        input_sentence.push_back(word_input);
    }
    for (auto line : input_sentence){
        transform(line.begin(),line.end(),line.begin(),::tolower);
        sentence.push_back(line);
    }

    int count=0;
    for (auto line : sentence){
        if(line == word)
            count++;
    }
    std::cout << count << std::endl;
}


Measured memory_bytes: 3152
using System;

namespace ProgramingStydying
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var ans = 100;

            for(int i = 1; i < n; i++)
            {
                var a = i;
                var b = n - i;
                var sum = ScaleSum(a) + ScaleSum(b);
                
                if(sum < ans)
                {
                    ans = sum;
                }
            }
            Console.WriteLine(ans);
        }

        public static int ScaleSum(int x)
        {
            var sum = 0;

            while(x > 0)
            {
                sum += x % 10;
                x /= 10;
            }
            return sum;
        }
    }
}

Measured memory_bytes: 27428
#include<iostream>

int main(){
    long long N;
    std::cin >> N;
    
    long long max = 10000000000;
    while(max * max > N){
        max = (max + N / max) / 2;
    }
    int i;
    for(i=max;i>=2;i--){
        if(N % i == 0){
            break;
        }
    }
    
    int j = N / i;
    int digit = 0;
    while(j != 0){
        j /= 10;
        digit++;
        
    }
    
    std::cout << digit << std::endl;
    return 0;
}



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

using namespace std;
using ll = long long;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vector<int> a(n);
  set<int> s;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    s.insert(a[i]);
  }
  if (s.size() % 2 == 1) {
    cout << s.size() << endl;
  } else {
    cout << s.size() - 1 << endl;
  }
  return 0;
}

Measured memory_bytes: 5376
#!/usr/bin/env python3
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

(n, m), *q = [list(map(int, i.split())) for i in open(0)]
c = 0
for i in range(m):
    UF = UnionFind(n)
    for j, (a, b) in enumerate(q):
        if i == j:
            continue
        UF.union(a - 1, b - 1)
    if UF.group_count() > 1:
        c += 1
print(c)

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

using pint = pair<int, int>;

int main() {
  int N, M, X;
  cin >> N >> M >> X;
  int tot_0 = 0, tot_n = 0, a;
  rep(i, 0, M) {
    cin >> a;
    if (a < X) {
      tot_0++;
    } else if (a > X) {
      tot_n++;
    }
  };

  cout << min(tot_0, tot_n) << endl;

  return 0;
}


Measured memory_bytes: 3592
#include <cstdio>
#include <cmath>
#include <cstring>
#include <iostream>
#include <sstream>

#include <memory>
#include <string>
#include <vector>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <deque>
#include <algorithm>
#include <random>
#include <iomanip>
using namespace std;



int main(int argc, char *argv[]) {
    int n, t;
    cin >> n >> t;
    vector<pair<int, int>> vp;
    for (int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        vp.push_back(make_pair(a, b));
    }
    sort(vp.begin(), vp.end());
    unordered_map<int, unordered_map<int, int>> um;
    um[-1][0] = 0;
    for (int i = 0; i < vp.size(); i++) {
        um[i] = um[i - 1];
        for (auto p : um[i - 1]) {
            int lt = p.first;
            int ld = p.second;
            if (lt >= t) {
                um[i][t] = max(um[i][t], ld);
                continue;
            }
            // eat it
            if (lt + vp[i].first >= t) {
                um[i][t] = max(um[i][t], ld + vp[i].second);
            }
            else {
                um[i][lt + vp[i].first] = max(um[i][lt + vp[i].first], ld + vp[i].second);
            }
            // not eat it
            um[i][lt] = max(um[i][lt], ld);
        }
    }
    int res = 0;
    for (auto p : um[n - 1]) {
        // cout << p.first << " " << p.second << endl;
        res = max(res, p.second);
    }
    cout << res << endl;
}


Measured memory_bytes: 356864
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <map>
#include <set>
#include <queue>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
ll gcd(ll a,ll b){
    return b?gcd(b,a%b):a;
}
bool cmp(int x,int y)
{
    return x>y;
}
const int N=10005;
const int mod=1e9+7;
int a[10];
int prim(int n)
{
    int b,flag=1;
    while(n){
        b=n%10;
        if(a[b]){
            flag=0;
            break;
        }
        n/=10;
    }
    if(flag) return 1;
    return 0;
}
int main()
{
    std::ios::sync_with_stdio(false);
    int n,k,s,t;
    cin>>n>>k;
    mem(a);
    for(int i=0;i<k;i++){
        cin>>t;
        a[t]=1;
    }
    for(int i=n; ;i++){
        if(prim(i)){
            cout<<i<<endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <set> 
#include <vector>
#include <algorithm>
#include <bitset>
#define ll long long
using namespace std;
ll N;
ll midsum(ll mid);
vector <int> B(0);
int main(){
    cin>>N;
    
    for(int i=1;i<=N;i++){
        ll b;
        cin>>b;
        B.push_back(b-i);
    } 
    ll mid=0;
    sort(B.begin(),B.end());
    if(B.size()%2==1){
        mid=B[B.size()/2];
        cout<<midsum(mid)<<endl;
        return 0;
    } else{
        ll kouho1 = (B[B.size()/2]+B[B.size()/2 -1])/2;
        ll kouho2 = kouho1+1;
       ll qq = (midsum(kouho1)<midsum(kouho2)) ? midsum(kouho1):midsum(kouho2);
       ll kouho3=kouho1+1;
       qq = min(midsum(kouho3),qq);
        cout<< qq <<endl;
        return 0;
    }


  
}

ll midsum(ll mid){
    ll ans =0;
    for(int i=0;i<N;i++){
        ans+=abs(B[i]-mid);

    }

return ans;

}

Measured memory_bytes: 1400
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <bitset>
#include <tuple>
using namespace std;
typedef long long ll;

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

    int ans = 0;
    for (int i = 1; i <= n; i++) {
        int cnt = 0, ic = i;
        while (ic != 0) {
            ic /= 10;
            cnt++;
        }
        if (cnt % 2 == 1) ans++;
    }
    cout << ans << endl;
}


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

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

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF INT_MAX/3

ll n;
set<ll> st;

int main(){
	cin.sync_with_stdio(false);
  cin>>n;
  rep(i,n){
    ll a;
    cin>>a;
    if(st.count(a)){
      st.erase(a);
    }else{
      st.insert(a);
    }
  }
  cout<<st.size()<<endl;
	return 0;
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int LINF=1e18;
template<typename T>
void chmin(T &a,T b){
  if(a>b)a=b;
}
/*
どこまでを-にするかを考えてあげて前からやるだけ
[0,l)が負、[l,N)が正だとして、考えるのは
l+2*(f(l)+g(l))
ただしf(l)は[0,l)を4倍だけで降順にするのにかかるコスト、g(l)は[l,N)を4倍だけで昇順にするのにかかるコスト
これが出せればansはlを0~Nで走らせるだけ

*/
int dpf[223456][20],dpg[223456][20];
//dpf[i][j]:i番目にj回4をかけてる時の[i,N)を昇順に並べる時の4をかける総合回数

signed main(){
  int n;cin>>n;
  vector<int> v(n);
  for(int i=0;i<n;i++)cin>>v[i];
  vector<int> w(n,0);//w[i]:v[i]とv[i+1]がギリギリ昇順になるためにv[i]に何回4をかけるか
  for(int i=0;i<n-1;i++){
    if(v[i]<v[i+1]){
      int tmp=v[i];
      while(tmp<=v[i+1])tmp*=4,w[i]++;
      w[i]--;
    }
    else{
      int tmp=v[i+1];
      while(v[i]>tmp)tmp*=4,w[i]--;
    }
  }
  for(int j=0;j<20;j++)dpf[n-1][j]=j;
  for(int i=n-2;i>=0;i--){
    for(int j=0;j<20;j++){
      int a=j-w[i];
      if(a<0)a=0;
      int r=a-19;if(r<0)r=0;
      dpf[i][j]=j+dpf[i+1][min(a,19LL)]+r*(n-i-1);
    }
  }
  reverse(v.begin(),v.end());
  vector<int> w2(n,0);//w[i]:v[i]とv[i+1]がギリギリ昇順になるためにv[i]に何回4をかけるか
  for(int i=0;i<n-1;i++){
    if(v[i]<v[i+1]){
      int tmp=v[i];
      while(tmp<=v[i+1])tmp*=4,w2[i]++;
      w2[i]--;
    }
    else{
      int tmp=v[i+1];
      while(v[i]>tmp)tmp*=4,w2[i]--;
    }
  }
  for(int j=0;j<20;j++)dpg[n-1][j]=j;
  for(int i=n-2;i>=0;i--){
    for(int j=0;j<20;j++){
      int a=j-w2[i];
      if(a<0)a=0;
      int r=a-19;if(r<0)r=0;
      dpg[i][j]=j+dpg[i+1][min(a,19LL)]+r*(n-i-1);
    }
  }
  int ans=LINF;
  for(int i=0;i<=n;i++){
    int a=dpf[i][0]*2;
    int b=dpg[n-i][0]*2;b+=i;
    //cout<<a<<" "<<b<<endl;
    chmin(ans,a+b);
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 70400
import java.util.Scanner;

public class Main {

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

        int[] pushes = new int[N];

        for(int i=0;i<N;i++) {
            pushes[i] = sc.nextInt();
        }
        int sum = 0;
        int till = 0;
        for(int i=0;i<N;i++){

            if(till>pushes[i]){
                sum += (pushes[i]- pushes[i-1]);
            }
            else{
                sum += T;
            }

            till = pushes[i]+T;

        }

        //last one
       // sum += T;

        System.out.println(sum);

        sc.close();

    }

}


Measured memory_bytes: 64240
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader input =new BufferedReader(new InputStreamReader(System.in));
        String[] inputs = input.readLine().split(",");
        System.out.println(inputs[0] + " " + inputs[1] + " " +  inputs[2]);
    }
}


Measured memory_bytes: 21076
#include <iostream>
#include <stdio.h>
#include <string>
#include <set>

using namespace std;

int main(){
  int N = 0;
  set<string> st;
  cin >> N;
  string s;
  for(int i=0; i<N; i++){
    cin >> s;
    st.insert(s);
  }

  if(int(st.size())==3){
    printf("Three\n");
  }else if(int(st.size())==4){
    printf("Four\n");
  }
  return 0;
}


Measured memory_bytes: 256
import numpy as np
n, t = map(int, input().split())
cs = list()
ts = list()
for i in range(n):
   cc,tt = map(int, input().split())
   cs.append(cc)
   ts.append(tt)

np_cs = np.array(cs)
np_ts = np.array(ts)

avairable_ind = np.where(np_ts <= t)

if avairable_ind[0].size == 0:
    print("TLE")
else:
    print(np_cs[avairable_ind].min())


Measured memory_bytes: 12504
import math
a = 0
b = 0
c = 0
d = 0
e = 0
ls = [a,b,c,d,e]
for i in range(len(ls)):
    ls[i] = int(input())
for i in ls:
    if i > 9:
        i = i//10
ans = 0
for i in ls:
    ans += math.ceil(i)

lsls = [0]
for i in range(len(ls)):
    ls_one = str(ls[i])
    if int(ls_one[-1]) > 0:
    	lsls.append(10-int(ls_one[-1]))
    
lsls.remove(max(lsls))
print(ans+sum(lsls))

Measured memory_bytes: 38384
def examB():
    A, B, C, D = LI()
    ans = max(0,min(B,D) - max(A,C))
    print(ans)

import sys
import copy
import bisect
import heapq
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examB()


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


  
int main(){
  

  int n;
  cin>>n;
  
  vector<string> data(n);
  
  for (int i=0;i<n;i++){
    cin>>data.at(i);
  }
  
  string answer="";
  
  if (n%2==0){
    for (int i=n-1;i>=0;i-=2){
      answer+=data.at(i);
      answer+=" ";
    }
    
    for (int i=0;i<n;i+=2){
      answer+=data.at(i);
      answer+=" ";
    }
  }
  
  else {
    for (int i=n-1;i>=0;i-=2){
      answer+=data.at(i);
      answer+=" ";
    }
    
    for (int i=1; i<n;i+=2){
      answer+=data.at(i);
      answer+=" ";
    }
    
    
  }
  
  cout<<answer<<endl;
  
}

















Measured memory_bytes: 18052
#include <stdio.h>

int main()
{
  int num1;
  int num2;

  scanf("%d %d",&num1,&num2);
  
  if(num1 > num2)
  {
    printf("a > b\n",num1,num2);
  }
  else if(num1 < num2)
  {
    printf("a < b\n",num1,num2);
  }
  else if(num1 == num2)
  {
    printf("a == b\n",num1,num2);
  }


  return 0;
}


Measured memory_bytes: 2688
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define all(c) (c).begin(),(c).end()

int main() {

	int k,x;
	cin >> k >> x;

	if(500*k >= x)
		cout<<"Yes";
	else cout<<"No";

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <string>
#include <sstream>
#include <numeric>
#include <ios> // std::left, std::right

typedef long long int ll;
typedef unsigned long long int ull;

using namespace std;

bool cmp(const vector<ll> &x, vector<ll> &y)
{
  return x[1] == y[1] ? x[2] < y[2] : x[1] < y[1];
}

int main()
{
  ll n, m, p, y;
  cin >> n >> m;
  vector<vector<ll>> l(m);

  for (ll i = 0; i < m; i++)
  {
    cin >> p >> y;
    l[i] = {i, p, y};
  }

  sort(l.begin(), l.end(), cmp);

  vector<stringstream> ids(m);

  ll c = 0, np = 0;

  for (ll i = 0; i < m; i++)
  {
    c++;
    if (np != l[i][1])
    {
      np = l[i][1];
      c = 1;
    }
    ids[l[i][0]] << setw(6) << setfill('0') << l[i][1] << setw(6) << setfill('0') << c;
  }

  for (int i = 0; i < m; i++)
  {
    cout << ids[i].str() << endl;
  }

  return 0;
}

Measured memory_bytes: 97664
#include <iostream>
#include <algorithm>
#include <vector>
#define lli long long int
#define endl "\n"
#define whats(x) cout<<#x<<" is: "<<x<<endl;
using namespace std;
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, w;
    cin>>n>>w;
    lli weights[n+1];
    lli values[n+1];
    lli dp[n+1][w+1];
    for(int i=1; i<=n; ++i){
        cin>>weights[i];
        cin>>values[i];
    }
    for(int i=0; i<=w; ++i)
        dp[0][i]=0; //have no item to take
    for(int i=0; i<=n; ++i)
        dp[i][0]=0; // max available weight 0, can't include anything
    
    for(int i=1; i<=n; ++i){
        for(int j=1; j<=w; ++j){
            //max(include,not include)
            if(j>=weights[i]){
                dp[i][j]=max(values[i]+dp[i-1][j-weights[i]], dp[i-1][j]);
            }
            else{
                dp[i][j]=dp[i-1][j];
            }
        }
    }
    cout<<dp[n][w]<<endl;
    return 0;
}


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

main()
{
    int n; cin>>n;
    vector<int> a(n);
    for(int &x:a) cin>>x;

    long long ans=*max_element(begin(a), end(a));
    a.erase(max_element(begin(a), end(a)));
    nth_element(begin(a),begin(a)+(n-2)/2,end(a),greater<int>());
    nth_element(begin(a)+(n-2)/2,begin(a)+n/2,end(a),greater<int>());
    for(int i=0,m=n-2; i<n and m>0; i++)
    {
        if(m>1)
        {
            ans+=a[i]*2;
            m-=2;
        }
        else
        {
            ans+=a[i];
            m=0;
        }
    }
    cout << ans << "\n";
}


Measured memory_bytes: 4044
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
   
#define SENTINEL (1000000001)
#define putChar(c) ; *p = (char)(c); ++p;
   
int c = 0;
int S[500000];
int L[250001];
int R[250001];
char str[5500010];
char *p = str;
   
int getNum(void) {
    int n = 0;
    while ((*p >= '0') && (*p <= '9')) {
        n = n * 10 + (int)(*p - '0');
        ++p;
    }
    ++p;
    return n;
}
   
void putNum(int n) {
    int d;
    if (n < 10) {
        putChar( '0' + n );
        return;
    }
    d = n / 10;
    if (d) putNum(d);
    putChar( '0' + (n % 10) );
}
   
void Merge(int A[], int left, int mid, int right) {
    int i = 0, j = 0, k = left;
    int n1 = mid - left;
    int n2 = right - mid;
    memcpy(L, A + left, n1 * sizeof(int));
    memcpy(R, A + mid, n2 * sizeof(int));
    L[n1] = R[n2] = SENTINEL;
    for (; k < right; ++k) {
        if (L[i] <= R[j]) {
            A[k] = L[i];
            ++i;
        } else {
            A[k] = R[j];
            ++j;
        }
    }
}
   
void MergeSort(int A[], int left, int right) {
    int mid;
    if (left + 1 < right) {
        mid = (left + right) >> 1;
        MergeSort(A, left, mid);
        MergeSort(A, mid, right);
        Merge(A, left, mid, right);
        c += right - left;
    }
}
   
int main(void) {
    register int i;
    int n;
       
    fread(str, 1, 5500000, stdin);
    n = getNum();
    for (i = 0; i < n; ++i) {
        S[i] = getNum();
    }
       
    MergeSort(S, 0, n);
       
    --n;
    p = str;
    for (i = 0; i < n; ++i) {
        putNum(S[i]);
        putChar( ' ' );
    }
    putNum(S[i]);
    putChar( '\n' );
       
    putNum(c);
    putChar( '\0' );
       
    puts(str);
   
    return 0;
}

Measured memory_bytes: 10256