akhauriyash/Code-Regression huggingface dataset:
#[allow(dead_code)]
fn is_whitespace(c: &char) -> bool {
    c.is_whitespace()
}

#[allow(dead_code)]
fn is_eol(c: &char) -> bool {
    ['\r', '\n'].contains(c)
}

#[allow(unused_macros)]
macro_rules! input {
    ($var:ident, $($r:tt)*) => {
        input_inner!{$var, $($r)*}
    };

    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        #[allow(unused_mut, unused_variables, bare_trait_objects)]
        let mut next = move |f: &Fn(&char)->bool| -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|f(&c))
                .take_while(|c|!f(&c))
                .collect()
        };
        input_inner!{next, $($r)*};
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; eol ]) => {
        $next(&is_eol).split(' ').map(|x| x.parse::<$t>().unwrap()).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, parser) => {
        $next
    };

    ($next:expr, $t:ty) => {
        $next(&is_whitespace).parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BinaryHeap, HashMap, HashSet};

#[allow(dead_code)]
struct Edge {
    from: usize,
    to: usize,
}

#[allow(dead_code)]
type Graph = Vec<Vec<usize>>;
#[allow(dead_code)]
const M: usize = 1_000_000_007;

fn main() {
    input! {
        a: usize,
        b: chars
    }
    let mut m = 0;
    m += 100 * (b[0] as usize - '0' as usize);
    m += 10 * (b[2] as usize - '0' as usize);
    m += 1 * (b[3] as usize - '0' as usize);
    println!("{}", a * m / 100);
}


Measured memory_bytes: 2116
N, M = map(int, input().split())

forw = set()
backw = set()

for i in range(M):
  a, b = map(int, input().split())
  if a == 1:
    forw.add(b)
  if b == N:
    backw.add(a)

if len(forw&backw) > 0:
  print("POSSIBLE")
else:
  print("IMPOSSIBLE")

Measured memory_bytes: 18936
import sys
from collections import defaultdict

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, K, *A = map(int, read().split())

    A = [(a - 1) % K for a in A]

    csum = [0] * (N + 1)
    for i in range(N):
        csum[i + 1] = (csum[i] + A[i]) % K

    indices = defaultdict(list)
    for i in range(N + 1):
        indices[csum[i]].append(i)

    ans = 0
    for vec in indices.values():
        right = 0
        for left in range(len(vec)):
            while right + 1 < len(vec) and vec[right + 1] - vec[left] < K:
                right += 1

            ans += right - left
            if left == right:
                right += 1

    print(ans)

    return


if __name__ == '__main__':
    main()


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

// repetition
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define NREP(i, n) FOR(i, 1, n + 1)
#define RFOR(i, a, b) for (int i = (a); i >= (b); i--)
#define RREP(i, n) RFOR(i, n, 0)
#define RNREP(i, n) RFOR(i, n, 1)

// debug
#define test(x) cout << #x << " = " << x << endl

// answer output
#define Yes(c) cout << ((c) ? "Yes" : "No") << endl;
#define YES(c) cout << ((c) ? "YES" : "NO") << endl;
#define yes(c) cout << ((c) ? "yes" : "no") << endl;
 
#define possible(c) cout << ((c) ? "possible" : "impossible") << endl;
#define POSSIBLE(c) cout << ((c) ? "POSSIBLE" : "INPOSSIBLE") << endl;

int main() {
  
  int x;
  cin >> x;
  
  int cnt500,cnt5;
  
  cnt500 = x / 500;
  x %= 500;
  cnt5 = x / 5;
  
  cout << cnt500 * 1000 + cnt5 * 5 << endl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define PI 3.14159265359
int main(){
    long long int A,B,K;
    cin>>A>>B>>K;
    set<int> st;
    for(long long int i=A;i<A+K;i++){
        if(i>B)break;
        st.insert(i);
    }
    for(long long int i=B;i>B-K;i--) {
        if(i<A)break;
        st.insert(i);
    }
    for(auto itr = st.begin(); itr != st.end(); ++itr) {
        std::cout << *itr << "\n";      // イテレータの指す先のデータを表示
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#define ll long long

using namespace std;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    //-1, 0 -> None. 1 -> Inc. 2 -> Dec.
    short current_dir = -1;
    int last = 0;
    int min_subarr = 1;
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        if (current_dir == -1) {
            current_dir = 0;
        }
        else if (current_dir == 0) {
            if (x > last) {
                current_dir = 1;
            }
            else if (x < last) {
                current_dir = 2;
            }
            else {
                current_dir = 0;
            }
        }
        else if (current_dir == 1) {
            if (x < last) {
                min_subarr++;
                current_dir = 0;
            }
        }
        else if (current_dir == 2) {
            if (x > last) {
                min_subarr++;
                current_dir = 0;
            }
        }
        last = x;
    }
    cout << min_subarr;
}

Measured memory_bytes: 3564
import java.util.Scanner;

public class Main {
    public static void main(String[] args){
        Scanner scan = new Scanner(System.in);
        int a = scan.nextInt();
        int b = scan.nextInt();
        if(-1000 <= a && b <= 1000){
            if(a < b) {
                System.out.println("a < b");
            }else if(a > b){
                System.out.println("a > b");
            }else{
                System.out.println("a == b");
            }
        }

    }
}



Measured memory_bytes: 26224
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vec;
typedef vector<vec> mat;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define revrep(i, n) for(ll i = (n)-1; i >= 0; i--)
#define pb push_back
#define f first
#define s second
/*
ll max(ll a, ll b){return (a > b) ? a : b;}
ll min(ll a, ll b){return (a < b) ? a : b;}
ll max3(ll a, ll b, ll c){return max(a, max(b, c));};
ll min3(ll a, ll b, ll c){return min(a, min(b, c));};
ll max4(ll a, ll b, ll c, ll d){return max(max(a, b), min(c, d));};
ll min4(ll a, ll b, ll c, ll d){return min(min(a, b), min(c, d));};
ll max5(ll a, ll b, ll c, ll d, ll e){return max(max(a, b), max3(c, d, e));};
ll min5(ll a, ll b, ll c, ll d, ll e){return min(min(a, b), min3(c, d, e));};
*/
const ll INFL = 1LL << 60;//10^18 = 2^60
const int INF = 1 << 30;//10^9
ll MOD = 1000000007;
//ll MOD = 998244353;

vector<ll> dy = {0, 0, 1, -1, 1, 1, -1, -1, 0};
vector<ll> dx = {1, -1, 0, 0, 1, -1, 1, -1, 0};

//デバッグ
void BinarySay(ll x, ll y = 60){rep(i, y) cout << (x>>(y-1-i) & 1); cout << endl;}

ll pow_long(ll x, ll k){
  ll res = 1;
  while(k > 0){
    if(k % 2) res *= x;
    x *= x;
    k /= 2;
  }
  return res;
}
ll pow_mod(ll x, ll k){
  ll res = 1;
  while(k > 0){
    if(k % 2){
      res *= x; res %= MOD;
    }
    x *= x; x %= MOD;
    k /= 2;
  }
  return res;
}

ll inverse(ll x){return pow_mod(x, MOD - 2);};

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

ll lcm(ll x, ll y){return x / gcd(x, y) * y;};

ll kai_mod(ll x){
  if(x == 0) return 1;
  return x * kai_mod(x-1) % MOD;
}

/*
//コンビネーション
const int MAXcomb = 200010;
ll fac[MAXcomb], finv[MAXcomb], inv[MAXcomb];
//facはn!,finvは1/n!
//invは逆元
void COMinit(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < MAXcomb; 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;
    }
}
ll comb(int n, int k){
    if(n < k) return 0;
    if(n < 0 || k < 0) return 0;
    return fac[n] * finv[k] % MOD * finv[n-k] % MOD;
}
*/

//素因数列挙
vector<ll> MakePrimeList(ll x) {
    vector<ll> res;
    for(ll k=2; k*k<=x; k++) {
        if(x % k == 0) {
            res.pb(k);
            while(x % k == 0) x /= k;
        }
    }
    if(x > 1) res.push_back(x);
    return res;
}

set<ll> a, b;

ll A, B;

int main(){
  cin >> A >> B;
  vector<ll> aa = MakePrimeList(A);
  vector<ll> bb = MakePrimeList(B);
  rep(i, aa.size()){
    a.insert(aa[i]);
  }
  rep(i, bb.size()){
    b.insert(bb[i]);
  }
  a.insert(1);
  b.insert(1);
  ll cnt = 0;
  for(auto itr = a.begin(); itr != a.end(); itr++){
    if(b.count(*itr)) cnt++;
  }
  cout << cnt << endl;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; typedef long long ll; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T, class U>bool chmax(T& a, U&& b) { return a < b ? a = b, 1 : 0; }
template<class T, class U>bool chmin(T& a, U&& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

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

    rep(x, 1e5) {
        int n = x * 1.08;
        if (n == N) {
            write(x);
            return 0;
        }
    }

    write(":(");
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
#include <functional>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define EB emplace_back
#define GREATER(T) T, VT<T> greater<T>
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

const int MAX = 2e5 + 10;
int N, Q;
int a[MAX], b[MAX];
int p[MAX], x[MAX];

VI G[MAX];
LL cnt[MAX];
LL ans[MAX];

void dfs(int cur, int par) {
    const LL prev_cnt = (par == -1 ? 0 : ans[par]);
    const LL cur_cnt = prev_cnt + cnt[cur];
    ans[cur] = cur_cnt;
    FORE(e, G[cur]) if (e != par) {
        dfs(e, cur);
    }
}

int main(void) {
    scanf("%d%d", &N, &Q);
    REP(i, N - 1) {
        scanf("%d%d", a + i, b + i);
        a[i]--; b[i]--;
        G[a[i]].EB(b[i]);
        G[b[i]].EB(a[i]);
    }
    REP(i, Q) {
        scanf("%d%d", p + i , x + i);
        p[i]--;
        cnt[p[i]] += x[i];
    }

    dfs(0, -1);

    REP(i, N) {
        printf("%lld%c", ans[i], (i + 1 == N ? '\n' : ' '));
    }
}


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

int main()
{
	double a, ans = 0;
	cin >> a;
	for (int i = 0; i < a;i++){
		double t;
		cin >> t;
		ans += 1 / t;
	}
	cout << 1 / ans << endl;
}

Measured memory_bytes: 256
N,Y = map(int, input().split())
c = [-1,-1,-1]
for i in range(N+1):
    for j in range(N+1):
        a = N - i - j
        if a >= 0 and (10000*i + 5000*j + 1000*a) == Y:
            c = [i,j,a]
            break
print(c[0],c[1],c[2])

Measured memory_bytes: 3064
#--初期の並びを圧縮表示,逆立ち、正立を目印--#
import sys,math,collections,itertools
input = sys.stdin.readline

N,K = list(map(int,input().split()))
S = input().rstrip()

stand = []
s_or_r = []

s_bf = '.'
cnt = 0
for i in range(N):
    if s_bf != S[i] and i != 0:
        stand.append(cnt)
        s_or_r.append(s_bf)
        cnt = 1
        s_bf=S[i]
    else:
        cnt += 1
        s_bf =S[i]
stand.append(cnt)
s_or_r.append(s_bf)


#--正立kまで許容して足す。maxが答え
if s_or_r.count('0')<=K:
    print(len(S))
    exit()
#--成形==#
if s_or_r[0]=='0':
    s_or_r=['1']+s_or_r
    stand = [0]+stand
if s_or_r[-1]=='0':
    s_or_r.append('1')
    stand.append(0)
#初期条件#
tmp = sum(stand[0:2*K+1])
ans = tmp
for i in range(2,len(stand)-2*K,2):
    tmp += -(stand[i-1]+stand[i-2])+stand[i+2*K-1]+stand[i+2*K]
    ans = max(ans,tmp)
print(ans)
    


Measured memory_bytes: 88152
import java.util.*;
public class Main{
	public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        long x = sc.nextLong();
        long y = sc.nextLong();
        int cnt = 0;
        for(long i=x; i<=y; i*=2){
            cnt++;
        }
        System.out.println(cnt);
    }
}

Measured memory_bytes: 22996
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <array>
#include <vector>
#include <functional>
#include <unordered_map>
#include <map>
#include <numeric>
#include <limits>
#include <utility>
#include <queue>
#include <random>
using namespace std;

int main(){
	int n;
    int x = 1;
    
    cin >> n;
    
    while(1){
        if(x * 2 > n){
            break;
        }
        x = x * 2;
    }
    
    cout << x;
    
	return 0;
}

Measured memory_bytes: 256
// Template {{{
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0; i<(int)(n); ++i)
using namespace std;
typedef long long LL;

#ifdef LOCAL
#include "contest.h"
#else
#define dump(x) 
#endif

class range {
    struct Iterator {
        int val, inc;
        int operator*() {return val;}
        bool operator!=(Iterator& rhs) {return val < rhs.val;}
        void operator++() {val += inc;}
    };
    Iterator i, n;
    public:
    range(int e) : i({0, 1}), n({e, 1}) {}
    range(int b, int e) : i({b, 1}), n({e, 1}) {}
    range(int b, int e, int inc) : i({b, inc}), n({e, inc}) {}
    Iterator& begin() {return i;}
    Iterator& end() {return n;}
};

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
inline bool valid(int x, int w) { return 0 <= x && x < w; }

void iostream_init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.setf(ios::fixed);
    cout.precision(12);
}
//}}}

struct Edge{ int dst, cost; };
typedef vector<Edge> Node;
typedef vector<Node> Graph;
const int INF = 1000000000;
void add_edge(Graph& G, int a, int b) {
    G[a].push_back({b, 1});
    G[b].push_back({a, 1});
}
vector<int> SPFA(const Graph& G, int s) {
    int n = G.size();
    vector<int> dist(n, INF);
    vector<bool> inque(n);
    queue<int> que;

    dist[s] = 0;
    que.push(s);
    inque[s] = true;
    while(!que.empty()){
        int v = que.front();
        que.pop();
        inque[v] = false;
        for(Edge e : G[v]) {
            if(dist[e.dst] > dist[v] + e.cost) {
                dist[e.dst] = dist[v] + e.cost;
                if(!inque[e.dst]) {
                    que.push(e.dst);
                    inque[e.dst] = true;
                }
            }
        }
    }
    return dist;
}
int main(){
    iostream_init();
    int N, M, s, t;
    while(cin >> N >> M >> s >> t) {
        s--; t--;
        Graph G(N);
        REP(i, M) {
            int a, b;
            cin >> a >> b;
            a--; b--;
            add_edge(G, a, b);
        }

        vector<int> ds = SPFA(G, s);
        vector<int> dt = SPFA(G, t);
        unordered_map<int, int> cnt;
        for(int x : dt) cnt[x]++;
        int D = ds[t];
        long long ans = 0;
        REP(i, N) {
            // ds[i] + 1 + E == D-1
            int E = D - ds[i] - 2;
            ans += cnt[E];
        }
        cout << ans << endl;

    }

    return 0;
}

/* vim:set foldmethod=marker: */

Measured memory_bytes: 9152
//%std
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
inline int read()
{
	int out=0,fh=1;
	char jp=getchar();
	while ((jp>'9'||jp<'0')&&jp!='-')
		jp=getchar();
	if (jp=='-')
		fh=-1,jp=getchar();
	while (jp>='0'&&jp<='9')
		out=out*10+jp-'0',jp=getchar();
	return out*fh;
}
const double inf=1e18;
const int MAXN=601;
vector<int> G[MAXN];
int n,m;
double f[MAXN];
double calc(int x)
{
	f[n]=0;
	for(int i=n-1;i>=1;--i)
	{
		f[i]=0;
		int siz=G[i].size();
		double mx=0;
		for(auto j:G[i])
		{
			f[i]+=f[j];
			mx=max(mx,f[j]);
		}
		if(i==x && siz>1)
			--siz,f[i]-=mx;
		f[i]/=(double)siz;
		f[i]+=1;
	}
	return f[1];
}
int main()
{
	n=read(),m=read();
	for(int i=1;i<=m;++i)
	{
		int u=read(),v=read();
		G[u].push_back(v);
	}
	double ans=calc(n);
	for(int i=1;i<n;++i)
		ans=min(ans,calc(i));	
	printf("%.10lf\n",ans);
	return 0;
}

Measured memory_bytes: 1408
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <vector>
#include <algorithm>
#include <map>

long long mod = 1000000007;

// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

// a^{-1} mod を計算する
long long modinv(long long a, long long mod) {
  return modpow(a, mod - 2, mod);
}

int main (){

  int N;
  scanf("%d",&N);
  std::vector<long long  > x(N);
  for (int i=0; i<N; i++){
    scanf("%lld", &x[i]);
  }
  std::vector<long long > sum(N+1); // sum[n]は1+1/2+1/3+ .... 1/nを表す

  long long fact = 1;
  for (int i=2; i<N; i++){
    fact*=i;
    fact%=1000000007;
  }

  sum[1]=fact;
  for (int i=2; i<N; i++){
    sum[i] = (sum[i-1] + (fact*modinv((long long)i,mod))%mod)%mod;
  }

  double val;
  long long ans = 0;
  for (int i=1; i<N; i++){
    val = (x[i]-x[i-1])*sum[i];
    //ans += (long long)(val*mod)%mod;
    ans += ((x[i]-x[i-1])*sum[i])%mod;
    ans %= mod;
  }

  printf("%lld\n",ans);
  return 0;
}


Measured memory_bytes: 2424
#include <bits/stdc++.h>
using namespace std;
#define modulo 1000000007
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 100000000

int main(){
	
	string A,B;
	cin>>A>>B;
	
	if(A==B){
		cout<<"EQUAL"<<endl;
		return 0;
	}
	
	if(A.size()>B.size()){
		cout<<"GREATER"<<endl;
	}
	else if(A.size()<B.size()){
		cout<<"LESS"<<endl;
	}
	else{
		if(A>B){
			cout<<"GREATER"<<endl;
		}
		else{
			cout<<"LESS"<<endl;
		}
	}
	
    return 0;
}



Measured memory_bytes: 256
N,Ma,Mb = map(int,input().split())
a = [0]*N
b = [0]*N
c = [0]*N
for i in range(N):
    a[i],b[i],c[i] = map(int,input().split())
A = [0]*N
for i in range(N):
    A[i] = (Mb*a[i]-Ma*b[i],c[i])

A0 = [A[i][1] for i in range(N) if A[i][0] == 0]
A1 = [A[i] for i in range(N) if A[i][0] > 0]
A2 = [A[i] for i in range(N) if A[i][0] < 0]

def DP(A):
    dp = {0:0}
    for i in range(len(A)):
        update = {}
        for j in dp.keys():
            if A[i][0]+j not in dp:
                update[A[i][0]+j] = A[i][1]+dp[j]
            else:
                update[A[i][0]+j] = min(dp[A[i][0]+j],A[i][1]+dp[j])
        for j in update.keys():
            dp[j] = update[j]
    return dp

dA1 = DP(A1)
dA2 = DP(A2)
ans = float('inf')

for x in dA1:
    if x != 0 and -x in dA2:
        ans = min(dA1[x]+dA2[-x],ans)
for x in A0:
    ans = min(x,ans)

if ans == float('inf'):
    print(-1)
else:
    print(ans)

Measured memory_bytes: 3572
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def main():
    N = I()
    h = LI()
    lowerRight = [0] * N
    cnt = 0
    for i in range(N-1, 0, -1):
        lowerRight[i] = cnt
        if h[i-1] >= h[i]:
            cnt += 1
        else:
            cnt = 0
    lowerRight[0] = cnt
    print(max(lowerRight))

main()



Measured memory_bytes: 16624
#include <stdio.h>
#define N 102
#define INF 1000000000

int main(){
  int n,i,j,k,m,l;
  int a[N],b[N][N];

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

  for(i=1;i<=n;i++)b[i][i]=0;

  for(k=2;k<=n;k++){
    for(i=1;i<=n-k+1;i++){
      j=i+k-1;
      b[i][j]=INF;
      for(m=i;m<=j-1;m++){
	l=b[i][m]+b[m+1][j]+a[i-1]*a[m]*a[j];
	if(b[i][j]>l)
	  b[i][j]=l;
      }
    }
  }
  
  printf("%d\n",b[1][n]);
  return 0;

}



Measured memory_bytes: 2108
#include <bits/stdc++.h>
using namespace std;
int main(){
  int i=0;char x='a';string S;cin>>S;
  sort(S.begin(),S.end());
  if(S.at(0)!=x)cout<<x<<endl;
  else{
    while(1){
      while(S.at(i)==x){
        if(x=='z'){cout<<"None"<<endl;break;}
        i++;
        if(i==S.size()){cout<<++x<<endl;break;}
      }
      if(x=='z'||i==S.size())break;
      x++;
      if(S.at(i)!=x){cout<<x<<endl;break;}
    }
  }
}

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

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

    vector<int> A(3);
    REP(i, 3) cin >> A[i];

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

    int ans = 0;
    REP(i, 2){
        ans += abs(A[i] - A[i + 1]);
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <queue>
using namespace std;
#define ll long long
queue<ll> bi, bj;
ll stand[50][50];
ll h, w;
char s[50][50];

void bfs (ll length) {
  ll vx[4] = {1, -1, 0, 0};
  ll vy[4] = {0, 0, 1, -1};
  stand[0][0] = 1;
  while (bi.empty() == false) {
    ll i = bi.front();
    ll j = bj.front();
    for (ll p = 0; p < 4; p++) {
      ll x = vx[p] + j;
      ll y = vy[p] + i;  
      if (x >= 0 && x < w && y >= 0 && y < h) {
        if (stand[y][x] == 0 && s[y][x] == '.') {
          stand[y][x] = stand[i][j] + 1;
          bi.push(y);
          bj.push(x);
        }  
      }
    }
    bi.pop();
    bj.pop();
  }
}

int main () {
  cin >> h >> w;
  ll black = 0;
  for (int i = 0; i < h; i++) {
    for (int j = 0; j < w; j++) {
      cin >> s[i][j];  
      stand[i][j] = 0;
      if (s[i][j] == '#') {
        black++;  
      }
    }  
  }  
  bi.push(0);
  bj.push(0);
  bfs(1);
  if (stand[h - 1][w - 1] == 0) {
    cout << - 1 << endl;
    return 0;  
  }
  cout << h * w - stand[h - 1][w - 1] - black << endl;

}

Measured memory_bytes: 888
#include<stdio.h>

int main() {
    //変数の宣言
    int hako[4][14]; //入力用
    int n; //手元にあるカード
    char mark[52]; //カードのマークの入力
    int num[52]; //カードの数字の入力
    int i, j; //処理用
    
    //全部０にする
    for(j=0; j<4; j++) {
        for(i=0; i<14 ;i++){
            hako[j][i] = 0;
        }
    }
    
    //入力
    scanf ("%d ", &n);
    for (i=0; i<n; i++) {
        scanf ("%c %d ", &mark[i], &num[i]);
        
        if (mark[i] == 'S') {
            hako[0][num[i]] = 1;
        }else if (mark[i] == 'H') {
            hako[1][num[i]] = 1;
        }else if (mark[i] == 'C') {
            hako[2][num[i]] = 1;
        }else if (mark[i] == 'D') {
            hako[3][num[i]] = 1;
        }
    }
    
    //出力
    for (j=1; j<=13; j++) {
        if (hako[0][j] != 1) {
            printf ("S %d\n", j);
        }
    }
    
    for (j=1; j<=13; j++) {
        if (hako[1][j] != 1) {
            printf ("H %d\n", j);
        }
    }
    
    for (j=1; j<=13; j++) {
        if (hako[2][j] != 1) {
            printf ("C %d\n", j);
        }
    }
    
    for (j=1; j<=13; j++) {
        if (hako[3][j] != 1) {
            printf ("D %d\n", j);
        }
    }
    
    
    
    return 0;
}



Measured memory_bytes: 2036
#include <iostream>
#include <string>
#include <string.h>
#include <vector>
using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i < n + 1; i++)


int main(){
    ll N;
    cin >> N;

    if(N % 1000 == 0){
        N = 1000;
    }else{
        N %= 1000;
    }
    cout << 1000 - N << endl;

    return 0;
}


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

using namespace std;

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

const long long INF = (long long)1e18;
const long long MOD = (long long)1e9 + 7; 

string yn(bool f){return f?"Yes":"No";}
string YN(bool f){return f?"YES":"NO";}

#define MAX

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(12);
	
	int W, H, x, y;
	
	cin>>W>>H>>x>>y;
	
	cout<<(((long  double)W*H/2))<<" ";
	if(H-y == y && W-x == x) cout<<1;
	else cout<<0;
	cout<<endl;
	
	return 0;
}

Measured memory_bytes: 256
use std::io::prelude::*;
use std::io::stdin;
use std::str::FromStr;

fn main() {
    let n: usize = read();
    let a: Vec<i64> = (0..n).map(|_| read()).collect();

    println!(
        "{}",
        if a.iter().filter(|&&x| x % 2 == 1).count() % 2 == 0 {
            "YES"
        } else {
            "NO"
        }
    );
}

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|b| b.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


Measured memory_bytes: 4352
import math
import sys

def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod


ans = 1
x,y = map(int,input().split())
if (x+y) % 3 != 0:
    print(0)
    
    sys.exit()
a = max(x,y)
b = min(x,y)
ab_sum = a+b
ab_diff = a-b
turn = ab_sum // 3
a_turn = ab_diff + (ab_sum//3 - ab_diff)//2
b_turn = turn - a_turn
# print(a_turn,b_turn)
# ab_fac = math.factorial(turn)
# b_fac = math.factorial(b_turn)
# print(a_fac,b_fac)
# for i in range(a_turn+1,turn+1):
#     print(i)
mod = 10**9+7 #出力の制限
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル
n = turn
r = b_turn
for i in range( 2, N + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

ans = cmb(n,r,mod)
print(ans)

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

using namespace std;

#define ll long long
#define ss stringstream
#define rep(i,n) for(int i=1;i<=(n);i++)
#define rep0(i,n) for(int i=0;i<(n);i++)

const ll INF=1e9+7;

int main()
{
	/*freopen("input.txt","r",stdin);
	freopen("outcout<<put.txt","w",stdin);*/
	string s,t;
	cin>>s>>t;
	if(s.size()!=t.size()){
		cout<<"No";
		return 0;
	} 
	bool f=1;
	rep0(i,s.size()){
		rep0(j,s.size()){
			if(s[(i+j)%s.size()]!=t[j]){
				f=0;
				break;
			}
		}
		if(f){
			cout<<"Yes";
			return 0;
		}
		f=1;
	}
	cout<<"No";
	return 0;
}

Measured memory_bytes: 256
using System;

namespace ConsoleApplication17
{
    class Program
    {
        static void Main()
        {
            int a = int.Parse(Console.ReadLine());
            bool[,] b = new bool[4,13];
            string[] e = { "S", "H", "C", "D" };
            for(int i = 0; i < a; i++)
            {
                string c = Console.ReadLine();
                string []d = c.Split(' ');
                for(int x = 0; x < 4; x++)
                {
                    if (d[0] == e[x])
                    {
                        int f = int.Parse(d[1])-1;
                        b[x,f] = true;
                        break;
                    }
                }
                
            }
            for(int i = 0; i < 4; i++)
            {
                for(int j = 0; j < 13; j++)
                {
                    if (b[i, j] == false)
                    {
                        Console.WriteLine(e[i] + " "+(j+1));
                    }
                }
            }
        }
    }
}

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

int main() {
  int n;
  cin >> n;
  long long z=0,x,y;
  while(n--) {
    char c;
    cin >> x >> c >> y;
    z+=c=='('?y:-y;
    if(z) cout << "No" << endl;
    else cout << "Yes" << endl;
  }
  return 0;
}


Measured memory_bytes: 3120
#include <stdio.h>

int main(int argc, char** argv){
	int num;
    int cnt = 0;
    scanf("%d", &num);
    
    while(num > 1){
    	num = num / 2;
        cnt++;
    }

    num = 1;
  	while(cnt > 0) {
      num = num * 2;
      cnt--;
    }  
    printf("%d\n", num);
}

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

int n;
int a[15];
int x[15][15],y[15][15];

int main()
{
    cin >> n;
    
    // 初期値のデータを入力
    for(int i=0;i<n;i++)
    {
        cin >> a[i];
        
        for(int j=0;j<a[i];j++)
        cin >> x[i][j] >> y[i][j];
    }

    // 正直者の人数の最大値
    int max=0;
    
    
    for(int i=0;i<1<<n;i++)
    {
        int tmpmax=0;
        bool judge=false;
        for(int j=0;j<n;j++)
        {
            if(i&1<<j)
            {
                tmpmax++;
                for(int k=0;k<a[j];k++)
                {
                    if(y[j][k]==1) if(i&(1<<(x[j][k]-1))) continue;
                    if(y[j][k]==0) if((i&(1<<(x[j][k]-1)))==0) continue;
                    judge=true;
                    break;
                }
            }
            if(judge) break;
        }
        if(!judge)
        {
            // printf("YES %d %d\n",i,tmpmax);
            if(max<tmpmax) max=tmpmax;
        }
    }
    cout << max << endl;
}



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

int main()
{
    int N;
    cin >> N;
    vector<int> L(N, 0);
    for(auto&& l: L){
        cin >> l;
    }

    sort(L.rbegin(), L.rend());
    int max_L = L[0];
    int sum_L = 0;
    for (int i = 1; i < N; ++i){
        sum_L += L[i];
    }
    if(max_L < sum_L){
        cout << "Yes" << endl;
    }else {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#[derive(Default)]
//NOTE
//declare variables to reduce the number of parameters for dp and dfs etc.
struct Solver {}

impl Solver {
    fn solve(&mut self) {
        let stdin = std::io::stdin();
        let mut scn = Scanner {
            stdin: stdin.lock(),
        };
        let n: usize = scn.read();
        let k: usize = scn.read();
         
        let mut result = 0.0;
        for i in 1..=n {
            if i < k {
                let mut score = i;
                let mut tmp = 1.0;
                while score < k {
                    tmp *= 0.5;
                    score *= 2;
                }
                result += tmp;
            } else {
                result += 1.0;
            }
        }
        println!("{}", result / n as f64);
    }
}

fn main() {
    std::thread::Builder::new()
        .stack_size(64 * 1024 * 1024) // 64MB
        .spawn(|| {
            let mut solver = Solver::default();
            solver.solve()
        })
        .unwrap()
        .join()
        .unwrap();
}
pub mod utils {
    const DYX: [(isize, isize); 8] = [
        (0, 1),   //right
        (1, 0),   //down
        (0, -1),  //left
        (-1, 0),  //top
        (1, 1),   //down right
        (-1, 1),  //top right
        (1, -1),  //down left
        (-1, -1), //top left
    ];

    pub fn try_adj(y: usize, x: usize, dir: usize, h: usize, w: usize) -> Option<(usize, usize)> {
        let ny = y as isize + DYX[dir].0;
        let nx = x as isize + DYX[dir].1;
        if ny >= 0 && nx >= 0 {
            let ny = ny as usize;
            let nx = nx as usize;
            if ny < h && nx < w {
                Some((ny, nx))
            } else {
                None
            }
        } else {
            None
        }
    }
}

//snippet from kenkoooo
pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_line(&mut self) -> String {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b'\n' || b == b'\r')
            .take_while(|&b| b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}


Measured memory_bytes: 2256
n = int(input())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
import itertools
i = 1
for ptn in itertools.permutations(range(1,n+1)):
    if list(ptn)==p:
      a = i
    if list(ptn)==q:
      b = i
    i += 1
print(abs(a-b))

Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Linq;

class D
{
	struct P
	{
		public int i, j;
		public P(int _i, int _j) { i = _i; j = _j; }
		public bool IsInRange => 0 <= i && i < h && 0 <= j && j < w;
		public P[] Nexts() => new[] { new P(i, j - 1), new P(i, j + 1), new P(i - 1, j), new P(i + 1, j) };
	}

	static int h, w;
	static string[] c;

	static void Main()
	{
		Func<int[]> read = () => Console.ReadLine().Split().Select(int.Parse).ToArray();
		var z = read();
		h = z[0]; w = z[1];
		c = new int[h].Select(_ => Console.ReadLine()).ToArray();

		var M = 0;
		for (int i = 0; i < h; i++)
			for (int j = 0; j < w; j++)
				if (c[i][j] == '.')
					M = Math.Max(M, CountMax(new P(i, j)));
		Console.WriteLine(M);
	}

	static int CountMax(P sp)
	{
		var u = new int[h, w];
		var q = new Queue<P>();
		u[sp.i, sp.j] = 1;
		q.Enqueue(sp);

		var M = 0;
		while (q.Any())
		{
			var p = q.Dequeue();
			foreach (var x in p.Nexts())
			{
				if (!x.IsInRange || u[x.i, x.j] > 0) continue;
				if (c[x.i][x.j] == '#') { u[x.i, x.j] = int.MaxValue; continue; }
				u[x.i, x.j] = u[p.i, p.j] + 1;
				M = Math.Max(M, u[x.i, x.j]);
				q.Enqueue(x);
			}
		}
		return M - 1;
	}
}


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

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

int main(){
    int h,w;
    cin>>h>>w;
    int ans=0;
    vector<string>s(h);
    rep(i,h)cin>>s[i];
    rep(i,h)rep(j,w)if(s[i][j]=='.')ans++;
    vector<vector<int>>dist(h,vector<int>(w,INF));
    queue<P>q;
    q.push(P(0,0));
    dist[0][0]=1;
    while(!q.empty()){
        int y=q.front().first;
        int x=q.front().second;
        q.pop();
        rep(dir,4){
            int vy=y+dy[dir];
            int vx=x+dx[dir];
            if(vy<0||vy>=h||vx<0||vx>=w)continue;
            if(s[vy][vx]=='#'||dist[vy][vx]!=INF)continue;
            dist[vy][vx]=dist[y][x]+1;
            q.push(P(vy,vx));
        }
    }
    ans-=dist[h-1][w-1];
    if(dist[h-1][w-1]!=INF)cout<<ans<<endl;
    else cout<<-1<<endl;
}

Measured memory_bytes: 3576
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;

    void solve() throws IOException {
        int a = ni(), b = ni();
        out.println((a * b) + " " + (a * 2 + b * 2));
    }

    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }

    int ni() throws IOException {
        return Integer.parseInt(ns());
    }

    long nl() throws IOException {
        return Long.parseLong(ns());
    }

    double nd() throws IOException {
        return Double.parseDouble(ns());
    }

    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }

    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }

    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }

    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}

Measured memory_bytes: 24228
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mod 1000000007
#define inf 1000000000000000
#define autoit(x,it) for(auto it = x.begin(); it != x.end(); it++)
#define rep(n) for(ll i = 0; i < n; i++)
#define repi(i,n) for(ll i = 0; i < n; i++)

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 

using namespace std;


int main()
{
   FAST/**/
   
   ll n;
   cin>>n;
   
   string arr[n];
   map<string,ll> ma;
   rep(n)
        cin>>arr[i], ma[arr[i]]++;
   
   ll maxi = 0;
   autoit(ma,it)
        maxi = max(maxi, it->ss);
   autoit(ma,it)
        if(it->ss == maxi)
            cout<<it->ff<<"\n";
   return 0;        
}  
   

Measured memory_bytes: 25472
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		new Main().solve();
	}
	
	void solve(){
		Scanner sc=new Scanner(System.in);
		int x=sc.nextInt();
		int y=sc.nextInt();
		int ans=Integer.MAX_VALUE;
		int[]a=new int[4];
	
		a[0]=1+(-y+x)+1;
		a[1]=1+(y+x);
		a[2]=(-y-x)+1;
		a[3]=y-x;
		
		for(int i=0;i<4;i++){
			if(a[i]>0)
			ans=Math.min(ans, a[i]);
		}
		System.out.println(ans);
	}
}


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

int main () {

  int a , i ;

  cin >> a ;

  int T[a];

  for(i = 0 ; i < a; i++){

  cin >> T[i];

}

  for(int i = a - 1 ; i >= 0; i--) {

    cout << T[i];

    if(i == 0) {

      cout << endl;

    } else {

      cout << " " ;

    }
  
  }

  return 0;

}

Measured memory_bytes: 1160
#include <iostream>

 

using namespace std;

 

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


Measured memory_bytes: 3112
//Ruthless Coding 
#include <bits/stdc++.h>

#define uni(x)      (x).resize(unique(ALL(x)) - (x).begin())
#define fprint(v)   for(auto x : v) cout << x << ' '
#define ALL(x)      (x).begin(), (x).end()
#define MP(x, y)    make_pair(x, y)
#define SZ(x)       int((x).size())
#define PB(x)       push_back(x)
#define ll          long long
#define S           second 
#define F           first
#define nl          '\n'

using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
mt19937_64 rnd;

const int N = 2e5 + 5;

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);
    ll n, m;
    cin >> n >> m;
    if(n == 1 && m == 1){
        cout << 1;
        return 0;
    }
    if(n >= 2 && m >= 2){
        cout << (n - 2) * (m - 2);
    }else if(n == 1){
        cout << m - 2;
    }else{
        cout << n - 2;
    }
    return 0;
}
/*
    *** Most Impo.. -> check base case always
    1. Overflow Check (*, +)
    2. Index check (0 - based or 1 - based)
    3. Check for n = 1, 2, 3, 4....
    4. Corner Cases
*/

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

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

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
int main(){
    while(1){
    int n,m;
    char change[2][1000];
    char bass;
        scanf("%d",&n);
        if(n==0)
            break;
        for(int i=0;i<n;i++)
            scanf(" %c %c",&change[0][i],&change[1][i]);
        scanf("%d",&m);
        for(int i=0;i<m;i++){
            scanf(" %c",&bass);
            for(int j=0;j<n;j++){
                if(bass==change[0][j]){
                    bass=change[1][j];
                    break;
                }
            }
            printf("%c",bass);
        }
        puts("");
    }
    return 0;
}

Measured memory_bytes: 1172
# AGC011A - Airport Bus
import sys
input = sys.stdin.readline

def main():
    N, C, K = tuple(map(int, input().rstrip().split()))
    T = sorted(map(int, [input() for _ in range(N)]))
    ans, cur, cnt = 0, T[0] + K, 0
    for i in T:
        if i > cur:
            cur = i + K
            cnt = 1
            ans += 1
        else:
            if cnt != C:
                cnt += 1
            else:
                cur = i + K
                ans += 1
                cnt = 1
    print(ans + 1)


if __name__ == "__main__":
    main()

Measured memory_bytes: 14236
#include<iostream>
#include<vector>
#include<stdlib.h>
#include<time.h>
#include<math.h>
#include<string.h>
#include<algorithm>
#include<queue>
using namespace std;

int main(void){
 int N,K;
 char s[60];

 cin>>N>>K;
 cin>>s;

 s[K-1]-='A'-'a'; 
 cout<<s<<endl;

 return 0;
}

Measured memory_bytes: 256
import bisect
import sys

def main(args):
    
    n = int(input())
    A = list(map(int,input().split()))
    
    A.sort()
    
    ans = [max(A), 0]
    ind = bisect.bisect_left(A ,ans[0]//2)
    if A[ind] == ans[0]//2:
        ans[1] = ans[0]//2
    else:
        r1 = min(A[ind],ans[0]-A[ind])
        r2 = min(A[ind-1],ans[0]-A[ind-1])
        if r1 > r2:
            ans[1] = A[ind]
        else:
            ans[1] = A[ind-1]
    
    print(*ans)
    
if __name__ == '__main__':
    main(sys.argv[1:])

Measured memory_bytes: 85176
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
int main()
{
    ll i,j,n,tw;
    cin>>n>>tw;
    ll w[n],v[n];
    for(i=0;i<n;i++){
    cin>>w[i]>>v[i];
    }
    ll k[n+1][tw+1];
    for(i=0;i<=n;i++)
    {
        for(j=0;j<=tw;j++)
        {
            if(i==0|| j==0)
            k[i][j]=0;
            else if(w[i-1]<=j)
            k[i][j]=max(k[i-1][j],(v[i-1]+k[i-1][j-w[i-1]]));
            else k[i][j]=k[i-1][j];
        }
    }
    cout<<k[n][tw]<<"\n";
    return 0;
}

Measured memory_bytes: 79104
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int MAX_N = 200005;
ll A[MAX_N];

int main()
{
	ll N,K;
	cin >> N >> K;
	rep(i,N)
	{
		cin >> A[i];
	}
	ll l = 0, r = 1e9+5;
	while(l+1 < r)
	{
		ll m = (l+r)/2;
		ll temp = 0;
		rep(i,N)
		{
			temp += (A[i]+m-1) / m - 1;
		}
		if (temp <= K)
		{
			r = m;
		}
		else
		{
			l = m;
		}
	}
	cout << r << endl;
	return 0;
}

Measured memory_bytes: 5084
#include<bits/stdc++.h>
using namespace std;
#define REP(i,st,ed) for(int i=(int)(st),i##end=(int)(ed);i<=i##end;++i)
#define DREP(i,st,ed) for(int i=(int)(st),i##end=(int)(ed);i>=i##end;--i)
template<typename T>bool chkmin(T &x,const T &y){return x>y?x=y,1:0;}
template<typename T>bool chkmax(T &x,const T &y){return x<y?x=y,1:0;}
#ifdef __linux__
#define getchar getchar_unlocked
#define putchar putchar_unlocked
#endif
template<typename T>T read(){
	T x=0,f=1;
	char c=getchar();
	while((c<'0')||(c>'9')){if(c=='-')f=-1;c=getchar();}
	while((c>='0')&&(c<='9'))x=(x<<1)+(x<<3)+(c^48),c=getchar();
	return x*f;
}
#define read() read<int>()
template<typename T>void write(T x,char c){
	static char t[25];
	static int tlen;
	t[tlen=1]=c;
	if(x<0)putchar('-'),x=-x;
	do t[++tlen]=(x%10)^48;
	while(x/=10);
	while(tlen)putchar(t[tlen--]);
}
#define pb push_back
typedef long long ll;
typedef double lf;
const int maxn=2005;
bitset<maxn*maxn>dp;
int n,a[maxn],sum,ans=maxn*maxn;
int main(){
	n=read();
	REP(i,1,n)a[i]=read(),sum+=a[i];
	dp[0]=1;
	REP(i,1,n)dp|=(dp<<a[i]);
	REP(i,0,sum)if(dp[i])chkmin(ans,max(i,sum-i));
	write(ans,'\n');
	return 0;
}

Measured memory_bytes: 1664