akhauriyash/Code-Regression huggingface dataset:
import sys
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7

def main():
    N, M = map(int, input().split())
    H = list(map(int, input().split()))
    good = [True]*N
    for _ in range(M):
        a, b = map(int, input().split())
        if H[a-1]==H[b-1]:
            good[a-1]=False
            good[b-1]=False
        elif H[a-1]<H[b-1]:
            good[a-1] = False
        else:
            good[b-1]=False
    print(sum(good))


if __name__ == '__main__':
    main()

Measured memory_bytes: 20132
#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
#include <tuple>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <cstdio>
#include <bitset>
#include <limits.h>
#define REP(i, n) for(LL i = 0;i < n;i++)
#define REPR(i, n) for(LL i = n;i >= 0;i--)
#define FOR(i, m, n) for(LL i = m;i < n;i++)
#define FORR(i, m, n) for(LL i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define inf (int)1e9
#define MOD 1000000007
using namespace std;
typedef long long LL;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;
typedef pair<int, P> PP;
typedef pair<LL, LP> LPP;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

//#define int long long

/*************** using variables ***************/
int n;
vector<P> red, blue;
int ans = 0;
vector<vector<int>> red_blue, blue_red;
vector<bool> blue_flag;
/**********************************************/
struct max_flow {
    struct edge { int to, cap, rev; };
    int V;
    vector<vector<edge>> G;
    vector<int> itr, level;

    max_flow(int V) : V(V) { G.assign(V,vector<edge>()); }

    void add_edge(int from, int to, int cap) {
        G[from].push_back((edge) {to, cap, (int) G[to].size()});
        G[to].push_back((edge) {from, 0, (int) G[from].size()-1});
    }

    void bfs(int s) {
        level.assign(V,-1);
        queue<int> q;
        level[s] = 0; q.push(s);
        while (!q.empty()) {
            int v = q.front(); q.pop();
            for(auto &e: G[v]){
                if (e.cap > 0 and level[e.to] < 0) {
                    level[e.to] = level[v] + 1;
                    q.push(e.to);
                }
            }
        }
    }

    int dfs(int v, int t, int f) {
        if (v == t) return f;
        for (int& i = itr[v]; i < (int) G[v].size(); ++i) {
            edge& e = G[v][i];
            if (e.cap > 0 and level[v] < level[e.to]) {
                int d = dfs(e.to, t, min(f, e.cap));
                if (d > 0) {
                    e.cap -= d;
                    G[e.to][e.rev].cap += d;
                    return d;
                }
            }
        }
        return 0;
    }

    int run(int s, int t) {
        int ret = 0, f;
        while (bfs(s), level[t] >= 0) {
            itr.assign(V,0);
            while ((f = dfs(s, t, inf)) > 0) ret += f;
        }
        return ret;
    }
};

int main() {
    cin >> n;
    REP(i, n){
        int a, b;
        cin >> a >> b;
        red.pb(P(a, b));
    }
    REP(i, n){
        int c, d;
        cin >> c >> d;
        blue.pb(P(c, d));
    }

    max_flow f(n*2 + 2);
    REP(i, n){
        f.add_edge(0, i+1, 1);
        f.add_edge(n+1+i, n*2+1, 1);
    }
    REP(i, n){
        REP(j, n){
            if(red[i].first < blue[j].first && red[i].second < blue[j].second){
                f.add_edge(i+1, j+n+1, 1);
            }
        }
    }

    cout << f.run(0, n*2+1) << endl;
}



Measured memory_bytes: 384
#include <iostream>
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#pragma GCC optimize("Ofast")
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<ll>> vvll;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = 1; i <= (n); ++i)
#define irep(it, stl) for (auto it = stl.begin(); it != stl.end(); it++)
#define drep(i, n) for (ll i = (n)-1; i >= 0; --i)
#define mes(a) cout << (a) << endl
#define dmes(a, b) cout << (a) << " " << (b) << endl
#define re0 return 0
#define mp(p, q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define Sort(a) sort(a.begin(), a.end())
#define rSort(a) sort(a.rbegin(), a.rend())
#define Rev(a) reverse(a.begin(), a.end())
#define MATHPI acos(-1)
#define itn int
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
struct io
{
    io()
    {
        ios::sync_with_stdio(false);
        cin.tie(0);
    }
};
const int INF = INT_MAX;
const ll LLINF = 1LL << 60;
const ll MOD = 1000000007;
const double EPS = 1e-19;


signed main() {
    ll x;
    cin >> x;
    
    ll t = 0;
    
    ll sum = 0; 
    
    while(true) {
        sum += t;
        if (sum >= x) {
            mes(t);
            re0;
        }
        t++;
    }
    
    
    
        
    
    
    
    
    
    
    
    
}

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

int main(){
	int n,q,c,t,x;
	cin>>n>>q;
	stack<int> stq[1005];
	for(int i=0;i<q;i++){
		cin>>c;
		switch(c){
			case 0:
				cin>>t>>x;
				stq[t].push(x);
				break;
			case 1:
				cin>>t;
				if(!stq[t].empty()) cout<<stq[t].top()<<endl;
				break;
			case 2:
				cin>>t;
				if(!stq[t].empty()) stq[t].pop();
		}
	}
	return 0;
}	


Measured memory_bytes: 4180
#include <iostream>
#include <algorithm>
#define rep(i, x) for(int i = 0; i < (x); i++)
typedef long long ll;
using namespace std;
 
const int inf = (int)1e8;
 
int N, M, R;
int r[10];
ll G[205][205];
 
int main(void) {
    cin >> N >> M >> R;
    rep(i, R) cin >> r[i], r[i]--;
    sort(r, r + R);
 
    rep(i, N) rep(j, N) G[i][j] = inf;
    rep(i, M) {
        int A, B, C;
        cin >> A >> B >> C;
        A -= 1; B -= 1;
        G[A][B] = C;
        G[B][A] = C;
    }
 
    rep(k, N) rep(i, N) rep(j, N) 
        G[i][j] = min(G[i][j], G[i][k] + G[k][j]);
 
    int ans = inf;
    do {
        int tmp = 0;
        rep(i, R - 1) tmp += G[r[i]][r[i + 1]]; 
        ans = min(ans, tmp);
    } while (next_permutation(r, r + R));
 
    cout << ans << endl;
}

Measured memory_bytes: 512
mod = 10 ** 9 + 7

def sum_subarrays(A):
    N = len(A)
    S = [0]
    for a in A:
        S.append(S[-1] + a)
        S[-1] %= mod
    return sum((2 * i - N - 1) * s % mod for i, s in enumerate(S)) % mod

N, M = map(int, input().split())
X = [0] + list(map(int, input().split()))
Y = [0] + list(map(int, input().split()))
diff_X = [X[i + 1] - X[i] for i in range(N)]
diff_Y = [Y[i + 1] - Y[i] for i in range(M)]
print(sum_subarrays(diff_X) * sum_subarrays(diff_Y) % mod)


Measured memory_bytes: 22908
#include  <iostream>
#include  <stdio.h>
#include <algorithm>
#include <map>
#include <math.h>

using namespace std;
#include <vector>
#define rep(i,n) for (int i = 0; i < (n) ; i++)
#define INF 1e9
#define llINF 1e18
#define base10_4 10000      //1e4
#define base10_5 100000     //1e5
#define base10_6 1000000    //1e6
#define base10_7 10000000   //1e7
#define base10_8 100000000  //1e8
#define base10_9 1000000000 //1e9

#define MOD 1000000007
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vint vector<int>
#define vll vector<ll>

//#include <stack>
//#include <queue>

string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 

ll A;
ll B;
ll C;
ll N;
ll M;
ll K;

ll ltmp;
string stmp;
double dtmp;

int main(){

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

    rep(ni,5){
        cin >> A;
        if(A==0) cout << ni+1 << endl;

    }
    
    

}

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

const int MOD = 1e9 + 7;
const int N = 1e5 + 5;
int n;
char s[N];
int f[N][14];

int DP(int idx, int rmd) {
    if (idx == n) return (rmd == 5);
    if (f[idx][rmd] != -1) return f[idx][rmd];
    
    int ret = 0;
    int k = (s[idx + 1] == '?')? 10 : s[idx + 1] - '0';
    if (k != 10) ret = DP(idx + 1, (rmd * 10 + k) % 13) % MOD;

    else {
        for (int j = 0; j < k; j++)
            ret = (ret + DP(idx + 1, (rmd * 10 + j) % 13) % MOD) % MOD;
    }

    if (f[idx][rmd] == -1) f[idx][rmd] = ret;
    return ret;
}

int main() {
    scanf("%s", s + 1);
    n = strlen(s + 1);

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

    cout << DP(0, 0);
}

Measured memory_bytes: 13568
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;


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


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <stdlib.h>

using namespace std;

int n;
int dif[90000], sum[90000];
int S[10005], T[10005];

int gettime()
{
  string tmp;
  char c; int ret = 0;

  cin >> c, tmp += c;
  cin >> c, tmp += c;
  ret += atoi(tmp.c_str()) * 3600;
  cin >> c;

  tmp.clear();
  cin >> c, tmp += c;
  cin >> c, tmp += c;
  ret += atoi(tmp.c_str()) * 60;
  cin >> c;

  tmp.clear();
  cin >> c, tmp += c;
  cin >> c, tmp += c;
  ret += atoi(tmp.c_str());

  return ret;
}

int main(void)
{
  while(1){
    cin >> n;
    if(n == 0) break;

    for(int i = 0; i <= 86405; i++) dif[i] = 0;

    for(int i = 0; i < n; i++){
      S[i] = gettime();
      T[i] = gettime();
    }

    /*for(int i = 0; i < n; i++){
      cout << S[i] << " " << T[i] << endl;;
    }*/

    for(int i = 0; i < n; i++){
      dif[S[i]]++;
      dif[T[i]]--;
    }
    sum[0] = dif[0];
    for(int i = 1; i <= 86405; i++){
      sum[i] = sum[i-1] + dif[i];
    }

    int ans = 0;
    for(int i = 0; i <= 86405; i++){
      ans = max(ans, sum[i]);
    }
    cout << ans << endl;
  }

  return 0;
}



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

#define F first
#define S second
#define pb push_back
#define ld  double
#define ll long long
#define int long long


using namespace std;

const int MAXN = 301 * 1001  , MOD = 1e9 + 7 , sq = 333  ;


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

   int n ;
   cin >> n ;
   deque < int > dq ;

   int s = 0 , i = 1  ;
   while(s<n)
     dq.push_back(i),s+=i,i++ ;
   while(s>n)
   {
       if(dq.front()==1)
        dq.pop_front() ;
       else
        dq[0]--;
       s--;
   }
   for(auto u : dq)
    cout<<u<<'\n';



}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
int main() {
	vector<int> arr(3);
	cin >> arr[0] >> arr[1] >> arr[2];
	sort(arr.begin(), arr.end());
	if(arr[0] + arr[1] == arr[2]) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 256
import java.util.*;
import static java.lang.Math.*;

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

		// 入力
		String s = sc.next();// 

		String[] str = s.split("");

		int a = Integer.parseInt(str[0]);
		int b = Integer.parseInt(str[1]);
		int c = Integer.parseInt(str[2]);
		int d = Integer.parseInt(str[3]);

		// 計算
		String result;

		result = path("", 1, 0, a, b, c, d);
		result = result.substring(0, 9);

		// 出力
		System.out.println(result);
	}

	static String path(String p, int depth, int cal, int a, int b, int c, int d){
		if(depth == 1){
			return path(p + a, depth + 1, a, a, b, c, d);
		}
		if(depth == 2){
			return path(p + "+" + b, depth + 1, cal + b, a, b, c, d) + path(p + "-" + b, depth + 1, cal - b, a, b, c, d);
		}
		if(depth == 3){
			return path(p + "+" + c, depth + 1, cal + c, a, b, c, d) + path(p + "-" + c, depth + 1, cal - c, a, b, c, d);
		}
		if(depth == 4){
			return path(p + "+" + d, depth + 1, cal + d, a, b, c, d) + path(p + "-" + d, depth + 1, cal - d, a, b, c, d);
		}

		if(cal == 7) return p + "=7";
		return "";
	}
}




Measured memory_bytes: 23764
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] chars  = sc.nextLine().toCharArray();
		int count = Integer.parseInt(sc.nextLine());
		for(int i = 0;i < count;i++ ) {
			String[] lines = sc.nextLine().split(" ");
			int num1 = Integer.parseInt(lines[1]);
			int num2 = Integer.parseInt(lines[2]);

			if(lines[0].equals("replace")) {
				char[] rep = lines[3].toCharArray();
				int repCount = 0;
				for(int j = num1;j <= num2;j++) {
					chars[j] = rep[repCount];
					repCount++;
				}

			} else if(lines[0].equals("reverse")){
				char[] rev = new char[num2 - num1 + 1];
				int revCount = 0;
				for(int j = num2;j >= num1;j--) {
					rev[revCount] = chars[j];
					revCount++;
				}
				revCount = 0;
				for(int j = num1;j <= num2;j++) {
					chars[j] = rev[revCount];
					revCount++;

				}

			} else if(lines[0].equals("print")) {
				for(int j = num1;j <= num2; j++) {
					System.out.print(chars[j]);
				}
				System.out.println();

			}


		}
		sc.close();

	}
}

Measured memory_bytes: 31152
def resolve():
    from collections import defaultdict
    import bisect
    def factorization(n):
        dic = defaultdict(int)
        temp = n
        for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
            if temp % i == 0:
                cnt = 0
                while temp % i == 0:
                    cnt += 1
                    temp //= i
                dic[i] = cnt

        if temp != 1:
            dic[temp] = 1
        if not dic:
            dic[n] = 1

        return dic
    n = int(input())
    a = factorization(n)
    total = []
    sums = 0
    for i in range(1,100):
        sums += i
        total.append(sums)
    ans = 0
    for i in a.keys():
        test = a[i]
        ans += bisect.bisect_right(total, test)
    if n == 1:
        print(0)
    else:
        print(ans)
resolve()

Measured memory_bytes: 9736
# Inputs
n = int(input())
moves = []
for a in range(n):
    moves.append(list(map(int, input().split())))

# Apartment
apt = [[[0 for i in range(10)] for j in range(3)] for k in range(4)]

# Movement
for move in moves:
    apt[move[0]-1][move[1]-1][move[2]-1] += move[3]

# Output
for x in range(3):
    for y in range(3):
        for z in range(10):
            print(' {}'.format(apt[x][y][z]), end='')
        print()
    wall = '#' * 20
    print(wall)
for b in range(3):
    for c in range(10):
        print(' {}'.format(apt[3][b][c]), end='')
    print()


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

#define REP(i,m,n) for(int i=(m); i<(int)(n); i++)
#define RREP(i,m,n) for(int i=(int)(n-1); i>=m; i--)
#define rep(i,n) REP(i,0,n)
#define rrep(i,n) RREP(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define fi first
#define se second
#define debug(...) {cerr<<"[L"<<__LINE__<<"] "; _debug(__VA_ARGS__);}

template<typename T>
string join(const vector<T>&v, string del=", "){ stringstream s;
    for(auto x : v) s << del << x; return s.str().substr(del.size());
}
template<typename T>
ostream& operator<<(ostream& o, const vector<T>&v){
    if(v.size()) o << "[" << join(v) << "]"; return o;
}
template<typename T>
ostream& operator<<(ostream& o, const vector<vector<T> >&vv){
    int l = vv.size();
    if(l){ o<<endl; rep(i,l) o << (i==0 ? "[ " : ",\n  " ) << vv[i] << (i==l-1 ? " ]" : ""); }
    return o;
}
template<typename T1, typename T2>
ostream& operator<<(ostream& o, const pair<T1, T2>& p){
    return o << "(" << p.first << ", " << p.second << ")";
}
inline void _debug(){cerr<<endl;}
template<class First, class... Rest>
void _debug(const First& first, const Rest&... rest){cerr<<first<<" ";_debug(rest...);}

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

const double PI = (1*acos(0.0));
const double EPS = 1e-9;
const int INF = 0x3f3f3f3f;
const ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const ll mod = 1e9 + 7;

inline void finput(string filename) {
    freopen(filename.c_str(), "r", stdin);
}

int main(){
    ios_base::sync_with_stdio(0);
    // finput("./input");
    int n; cin >> n;
    vector<pll> p;
    rep(i,n){
        ll x,y; cin >> x >> y;
        p.emplace_back(x, y);
    }

    map<pll,ll> mp;
    rep(i,n) rep(j,n){
        if(i == j) continue;
        pll d = pll(p[i].fi - p[j].fi, p[i].se - p[j].se);
        if(mp.count(d) > 0) mp[d]++;
        else mp[d] = 1;
    }
    ll ans = n;
    for(auto p : mp){
        ans = min(ans, n-p.se);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3816
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.Scanner;
import java.util.HashSet;
import java.util.Iterator;

class Main {

    static final int MOD = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int d = sc.nextInt();
        int h = sc.nextInt();
        int li = sc.nextInt();
        double l = (double) li / d;
        double r = 0;
        double delta = Math.PI/2;
        while (delta > 1.0e-8) {
            double hc = h * Math.cos(r);
            double ds = d * Math.sin(r);
            if (hc > ds) {
                double dq = d * Math.cos(r);
                double hq = h * Math.sin(r);
                double du = hc - ds;
                double duq = du * Math.tan(r);
                double duh = du/Math.cos(r);
                double cap = duh * d + (h-duh)*d/2;
                if (cap <= l) {
                    r-=delta;
                    //System.out.println("a:" + cap);
                }else{
                    delta/=2;
                    r+=delta;
                }
            } else {
                double dh = h / Math.tan(r);
                double cap = h * dh / 2;
                if (cap <= l) {
                    r-=delta;
                    //System.out.println("b:" + cap);
                }else{
                    delta/=2;
                    r+=delta;
                }
            }
        }
        System.out.println(r * (180 / Math.PI));
    }
}

Measured memory_bytes: 23764
n = int(input())
a_str = input().split()
a = [int(i) for i in a_str]

c = 1
for s in a:
    if c != n:
        print("{} ".format(s), end="")
    elif c == n:
        print(s)
    c += 1

i = 1
while n-1 >= i:
    v = a[i]
    j = i - 1
    while j >= 0 and a[j] > v:
        a[j+1] = a[j]
        j -= 1
    a[j+1] = v

    c = 1
    for s in a:
        if c != n:
            print("{} ".format(s), end="")
        elif c == n:
            print(s)
        c += 1

    i += 1



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

#if __has_include("print.hpp")
  #include "print.hpp"
#endif

#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

typedef long long ll;
typedef pair<int, int> p;

int n;

vector<vector<int>> tree;

vector<vector<int>> tree_init(){
  vector<vector<int>> tree(n, vector<int>());
  for (int i = 0; i < n-1; i++) {
    int tmp1, tmp2;
    cin >> tmp1 >> tmp2;
    tmp1--; tmp2--;
    tree[tmp1].push_back(tmp2);
    tree[tmp2].push_back(tmp1);
  }
  return tree;
}

vector<int> distance1;
vector<int> distance2;

void dist_init(){
  for (int i = 0; i < n; i++) {
    distance1.push_back(-1);
    distance2.push_back(-1);
  }
}

map<int, bool> visited;

void map_init(){
  for (int i = 0; i < n; i++) {
    visited[i] = false;
  }
}


void dfs1(int from, int distance){
  visited[from] = true;
  for(auto a : tree[from]){
    distance1[from] = distance;
    if(!visited[a]) dfs1(a, distance + 1);
  }
}

// muda
void dfs2(int from, int distance){
  visited[from] = true;
  for(auto a : tree[from]){
    distance2[from] = distance;
    if(!visited[a]) dfs2(a, distance + 1);
  }
}

int main(){
  cin >> n;
  tree = tree_init();
  dist_init();

  dfs1(0, 0);
  map_init();
  dfs2(n-1, 0);


  int count = 0;
  for (int i = 0; i < n; i++) {
    if (distance1[i] <= distance2[i]) count++;
    else if(distance1[i] > distance2[i]) count--;
  }


  if(count > 0) cout << "Fennec" << endl;
  else cout << "Snuke" << endl;
}



Measured memory_bytes: 20516
#ifndef ONLINE_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define reps(i,a,b) for(int i=a;i<b;++i)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<typename T> inline bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T &a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U &u,const V... v){for(auto &e:u)fill_v<T>(e,v...);}

struct weighted_unionfind {
    vector<int> d;
    vector<int> diff_weight;
    weighted_unionfind(int n=0) : d(n, -1), diff_weight(n, 0) {}
    int find(int x) {
        if (d[x] < 0) return x;
        int root = find(d[x]);
        diff_weight[x] += diff_weight[d[x]];
        return d[x] = root;
    }
    int weight(int x) {
        find(x);
        return diff_weight[x];
    }
    int diff(int x, int y) { return diff_weight[y] - diff_weight[x];}
    // weight(y) - weight(x) = w
    bool unite(int x, int y, int w) {
        w += weight(x);
        w -= weight(y);
        x = find(x); y = find(y);
        if (x == y) return false;
        if (d[x] > d[y]) {
            swap(x, y);
            w = -w;
        }
        d[x] += d[y];
        d[y] = x;
        diff_weight[y] = w;
        return true;
    }
    bool same(int x, int y) { return find(x) == find(y);}
    int size(int x) { return -d[find(x)];}
};

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

    int n, m;
    cin >> n >> m;
    weighted_unionfind wuf(n);
    bool ans = true;
    rep(i, m) {
        int l, r, d;
        cin >> l >> r >> d;
        l--; r--;
        if (wuf.same(l, r)) {
            if (wuf.diff(l, r) != d) ans = false;
        } else {
            wuf.unite(l, r, d);
        }
    }
    cout << (ans ? "Yes" : "No") << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + ll(b)) % mod
#define MUL(a, b) a = (a * ll(b)) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)
#define all(a) (a).begin(), (a).end()
#define sz(v) (int)(v).size()
#define pb push_back
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<int, pi> ppi;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> mat;
typedef complex<double> comp;
void Debug() {cout << '\n'; }
template<class FIRST, class... REST>void Debug(FIRST arg, REST... rest){
	cout<<arg<<" ";Debug(rest...);}
template<class T>ostream& operator<<(ostream& out,const vector<T>& v) {
	out<<"[";if(!v.empty()){rep(i,0,sz(v)-1)out<<v[i]<<", ";out<<v.back();}out<<"]";return out;}
template<class S, class T>ostream& operator<<(ostream& out,const pair<S, T>& v){
	out<<"("<<v.first<<", "<<v.second<<")";return out;}
const int MAX_N = 200010;
const int MAX_V = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = 1 << 29;
const ll linf = 1LL << 60;
const double PI = 3.14159265358979323846;
///////////////////////////////////////////////////////////////////////////////////////////////////

ll X, Y;

void solve() {
	cin >> X >> Y;
	int cnt = 0;
	while(X <= Y) {
		cnt++;
		X *= 2;
	}
	cout << cnt << "\n";
}

int main() {
#ifndef LOCAL
	ios::sync_with_stdio(false);
    cin.tie(0);
#endif
    cout << fixed;
	cout.precision(20);
#ifdef LOCAL
    freopen("in.txt", "rt", stdin);
#endif	
	solve();
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}



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

using namespace std;

int n, m, k;

int main()
{
int i, j;

scanf("%d%d%d", &n, &m, &k);

for(i=0; i<=n; i++){
for(j=0; j<=m; j++){
if(i * (m-j) + j * (n-i) == k){
printf("Yes\n");
return 0;
}
}
}
printf("No\n");
return 0;
}

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

int main() {

	string S;
	cin >> S;

	for (int i = 0; i < (int)S.size(); i++)
	{
		if (i % 2 == 0 && S[i] == 'L') {//偶数
			cout << "No" << endl;
			return 0;
		}
		else if (i % 2 == 1 && S[i] == 'R') {//奇数
			cout << "No" << endl;
			return 0;
		}
	}

	cout << "Yes" << endl;


	return 0;
}

Measured memory_bytes: 256
#include<math.h>
#include<limits.h>
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<sstream>
#include<list>
#include<queue>
#include<algorithm>
#include<functional>
#include<initializer_list>
#include<map>
#include<set>
#include<utility>
#include<tuple>
#include<regex>
using namespace std;
#define ull unsigned long long
#define llong long long
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define all(t) t.begin(), t.end()


int main() {
	string s;
	cin >> s;
	int n = s.length();
	int a, b, c;
	a = b = c = 0;
	rep(i, n) {
		if (s[i] == 'a') a++;
		if (s[i] == 'b') b++;
		if (s[i] == 'c') c++;
	}
	int ma = max({ a,b,c });
	int mi = min({ a,b,c });
	string ans = ma - mi <= 1 ? "YES" : "NO";
	cout << ans << endl;
	return 0;
}





Measured memory_bytes: 512
n = int(input())
P = tuple(map(lambda x: int(x)-1, input().split()))
ans = 0
pre = P[0]
for i in range(n-1):
    if pre == i:
        ans += 1
    else:
        pre = P[i+1]
if pre == n-1:
    ans += 1
print(ans)


Measured memory_bytes: 20844
a,b,c = gets.split.map(&:to_i)
count = 0
if a % 2 == 1 || b % 2 == 1 || c % 2 == 1
  puts count
  exit
end
if a == b && b == c && a == c
  puts "-1"
  exit
end
while a%2 == 0 && b % 2 == 0 && c % 2 == 0
  x,y,z = a,b,c
  a = (y/2) + (z/2)
  b = (x/2) + (z/2)
  c = (x/2) + (y/2)
  count += 1
end

puts count


Measured memory_bytes: 1788
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;

namespace AtCoder.C
{
    public class Program
    {
        public static void Main() { var r = GetResult(); Debug.WriteLine(r); Console.Write(r); }

        private static object GetResult()
        {
            var x = ReadLong();
            var count = (x / 11) * 2;
            var amari = x % 11;

            if (amari == 0) return count;

            if (amari <= 6)
            {
                return count + 1;
            }

            return count + 2;
        }

        #region Console.Read

        public static string ReadText() { return Console.ReadLine(); }
        public static List<string> ReadTexts() { return Console.ReadLine().Split(' ').ToList(); }
        public static long ReadLong() { return long.Parse(Console.ReadLine()); }
        public static (long, long) Read2Longs() { var ls = ReadLongs(); return (ls[0], ls[1]); }
        public static (long, long, long) Read3Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2]); }
        public static (long, long, long, long) Read4Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3]); }
        public static (long, long, long, long, long) Read5Longs() { var ls = ReadLongs(); return (ls[0], ls[1], ls[2], ls[3], ls[4]); }
        public static List<long> ReadLongs() { return Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToList(); }

        #endregion
    }
}


Measured memory_bytes: 27468
#include<iostream>
#include<vector>
#include<math.h>
using namespace std;

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

int main(){
    int n, temp, c1, c2;
    cin>>n;
    vector<int> h;
    for(int i=0;i<n;i++){
        cin>>temp;
        h.push_back(temp);
    }
    vector<int> cost;
    cost.push_back(0);
    cost.push_back(abs(h[1]-h[0]));
    for(int i=2;i<n;i++){
        c1 = cost[i-1] + abs(h[i]-h[i-1]);
        c2 = cost[i-2] + abs(h[i]-h[i-2]);
        cost.push_back(min(c1,c2));
    }
    cout<<cost[cost.size()-1]<<endl;
}

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

typedef long long ll;
typedef complex<double> Vec;

ll N;
const ll MOD = 998244353;
vector<ll> Pow;
vector<ll> Y;
vector<pair<ll, ll>> XY;
map<ll, ll> IY;
ll R;

void prepare() {
  Pow.push_back(0);
  for (ll i = 1; i <= N; ++i) {
    Pow.push_back((Pow.back() * 2 + 1) % MOD);
  }
}

vector<ll> BIT;
void add(ll i, ll x) {
  for (; i <= N; i += i & -i) BIT[i] += x;
}
ll sum(ll i) {
  ll res = 0;
  for (; i > 0; i -= i & -i) res += BIT[i];
  return res;
}
void solve() {
  R = N * Pow[N] % MOD;
  for (ll i = 0; i < N; ++i) {
    (R += MOD - 2 * (Pow[i] + Pow[N - 1 - i]) % MOD) %= MOD;
  }
  for (ll i = 0; i < 2; ++i) {
    BIT.clear();
    BIT.resize(N + 1);
    for (ll cnt = 0; cnt < N; ++cnt) {
      ll y = XY[i == 0 ? cnt : N - 1 - cnt].second;
      ll i = IY.at(y) + 1;
      ll left = sum(i);
      ll right = cnt - left;
      assert(left >= 0 && right >= 0);
      (R += Pow[left]) %= MOD;
      (R += Pow[right]) %= MOD;
      add(i, 1);
    }
  }
}

int main() {
  cin >> N;
  prepare();
  for (ll i = 0; i < N; ++i) {
    ll x, y;
    cin >> x >> y;
    Y.push_back(y);
    XY.push_back(make_pair(x, y));
  }
  sort(Y.begin(), Y.end());
  for (ll i = 0; i < N; ++i) {
    IY[Y[i]] = i;
  }
  sort(XY.begin(), XY.end());
  solve();
  cout << R << endl;
  return 0;
}


Measured memory_bytes: 21612
#include <iostream>
using namespace std;
int main(void){
    
    int a,b;
    int money=0;
    cin>>a>>b;
    
    if(a>=13){
        money=b;
    }else if(a>=6&&a<13){
        money=b/2;
    }else{
        money=0;
    }
    
    cout << money;
    
    return 0;
}

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

#define kane 17
const int m[kane] = {1,4,9,16,25,36,49,64,81,100,121,144,169,196,225,256,289};

int cnt =0;

int search(int num){
int maxx;
if(num == 0 || num == 1){
return 0;
}
for(maxx=0;num-m[maxx+1]>=0;maxx++);
return maxx;
}

void func(int num,int k){
//	cout<<num<<":"<<m[k]<<endl;
	if(num <= 3 || k==0){
		cnt++;
//		cout<<"☆"<<endl;
		return;
	}
	for(;k>=0;k--)
		func(num -m[k],min(k,search(num -m[k])));
}
int main(){
while(1){
int num;
cnt = 0;
cin>>num;
if(num == 0) break;
func(num,search(num));
cout << cnt << endl;
//cout<<search(num)<<endl;
}
return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<sstream>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<algorithm>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>

#define rep(i,n) for(int i=0;i<n;i++)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
#define pb push_back
#define rp(i,c) rep(i,(c).size())
#define fr(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define dbg(x) cerr<<#x<<" = "<<(x)<<endl

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf=1<<28;
const double INF=1e12,EPS=1e-9;

int main()
{
	int a,b,c,d;
	while(scanf("%d%d",&a,&b),a)
	{
		b-=a; b/=100;
		c=b%5; b/=5; d=b%2; b/=2;
		printf("%d %d %d\n",c,d,b);
	}
	
	return 0;
}

Measured memory_bytes: 0
// 2019/04/01 Tazoe

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
	int N, M, K;
	cin >> N >> M >> K;

	int A[100001] = {0};

	for(int i=1; i<=K; i++){
		int n;
		cin >> n;

		if(n==1){
			int a, b;
			cin >> a >> b;

			if(A[a]==0 && A[b]==0){
				A[a] = A[b] = -i;
			}
			else if(A[a]==0 && A[b]!=0){
				A[a] = A[b];
			}
			else if(A[a]!=0 && A[b]==0){
				A[b] = A[a];
			}
			else if(A[a]==A[b]){

			}
			else if(A[a]>0 && A[b]>0){
				cout << i << endl;
				return 0;
			}
			else{
				int aa = max(A[a], A[b]);
				int ab = min(A[a], A[b]);

				for(int j=1; j<=N; j++){
					if(A[j]==ab){
						A[j] = aa;
					}
				}
			}
		}
		else{
			int c, x;
			cin >> c >> x;

			if(A[c]>0 && A[c]!=x){
				cout << i << endl;
				return 0;
			}

			if(A[c]==0){
				A[c] = x;
			}
			else if(A[c]<0){
				int ac = A[c];
				for(int j=1; j<=N; j++){
					if(A[j]==ac){
						A[j] = x;
					}
				}
			}
		}
/*
		for(int j=1; j<=N; j++){
			cout << A[j] << ' ';
		}
		cout << endl;
*/
	}

	cout << 0 << endl;

	return 0;
}



Measured memory_bytes: 3496
import java.io.{BufferedReader, InputStream, InputStreamReader}
import java.util.StringTokenizer

import scala.collection.mutable
import scala.util.Sorting
import math.{abs, max, min}
import scala.collection.mutable.{ArrayBuffer, ListBuffer}

object Main {
  val MOD = 1000000007
  def solve(): Unit = {
    val sc = new InputReader(System.in)
    val X, Y = sc.nextLong()
    val ans = if (math.abs(X - Y) <= 1) "Brown" else "Alice"
    println(ans)
  }


  def main(args: Array[String]): Unit = {
    solve()
  }


  class InputReader(val stream: InputStream) {
    private val reader = new BufferedReader(new InputStreamReader(stream), 32768)
    private var tokenizer: StringTokenizer = null

    def next: String = {
      while (tokenizer == null || !tokenizer.hasMoreTokens)
        tokenizer = new StringTokenizer(reader.readLine)
      tokenizer.nextToken
    }

    def nextInt(): Int = next.toInt
    def nextLong(): Long = next.toLong
    def nextChar(): Char = next.charAt(0)
  }

}


Measured memory_bytes: 27208
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, n) for(ll i=0; i<(ll)n; i++)
#define REPR(i, n) for(ll i=(ll)n-1; i>=0; i--)
#define FOR(i, m, n) for(ll i=(ll)m; i<(ll)n; i++)
#define FORR(i, m, n) for(ll i=(ll)m-1; i>=(ll)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define PRINTD(x, d) cout << fixed << setprecision(d) << x << "\n";
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
vector<string> split(string s, char p){vector<string>v;stringstream m(s);string b;while(getline(m,b,p))v.push_back(b);return v;}
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 (a>b) { a = b; return 1; } return 0; }
struct nya{ nya(){ cin.tie(0); ios::sync_with_stdio(false); } }nyan;

int main(){
    string S; cin >> S;
    string ans = "";
    if (S == "zyxwvutsrqponmlkjihgfedcba") cout << "-1\n";
    else {
    S += 'a'-1;
  for(int i=S.size()-1;i>=0;i--)
    while(S[i]<'z'){
      S[i]++;
      bool f=true;
      for(int j=0;j<i;j++)
        if(S[i]==S[j]){
          f=false;
          break;
        }
      if(f){
        for(int j=0;j<=i;j++)
          cout<<S[j];
        return 0;
      }
    }
    }
}


Measured memory_bytes: 256
let  () =
    let main () =
        let n = int_of_string (read_line ()) in
        let s = read_line () in
        let f = n mod 2 == 0 && (
            let m = n / 2 in
            let rec loop i =
                if i < 0 then true else
                    if s.[i] <> s.[i+ m] then false else
                        loop (i - 1)
            in
            loop (m - 1)
        )
        in
        print_endline (if f then "Yes" else "No")
    in
    main ()

Measured memory_bytes: 384
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>
using namespace std;
long long n, c;
int main() {
  cin >> n >> c;
  vector<pair<long long, long long>> xv(n);
  for (int i = 0; i < n; i++) {
    cin >> xv[i].first >> xv[i].second;
  }
  long long ans = 0;
  long long rsum = 0, lsum = 0;
  long long rmax[100001] = {0}, lmax[100001] = {0};
  rmax[0] = max(0ll, xv[0].second - xv[0].first);
  rsum += xv[0].second;
  for (int i = 1; i < n; i++) {
    rsum += xv[i].second;
    rmax[i] = max(rmax[i - 1], rsum - xv[i].first);
  }
  lmax[n - 1] = max(0ll, xv[n - 1].second - (c - xv[n - 1].first));
  lsum += xv[n - 1].second;
  for (int i = 1; i < n; i++) {
    lsum += xv[n - 1 - i].second;
    lmax[n - 1 - i] = max(lmax[n - i], lsum - (c - xv[n - 1 - i].first));
  }
  for (int i = 0; i < n; i++)
    ans = max(ans, max(rmax[i], lmax[i]));

  rsum = 0;
  lsum = 0;
  for (int i = 0; i < n; i++)
    rsum += xv[i].second;
  // right * 2 + left
  long long lmaxmax = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (i < n - 1)
      lmaxmax = max(lmaxmax, lmax[i + 1]);
    ans = max(ans, lmaxmax + rsum - xv[i].first * 2);
    rsum -= xv[i].second;
  }
  lsum = 0;
  rsum = 0;
  for (int i = 0; i < n; i++)
    lsum += xv[i].second;
  // left * 2 + right
  long long rmaxmax = 0;
  for (int i = 0; i < n; i++) {
    if (i > 0)
      rmaxmax = max(rmaxmax, rmax[i - 1]);
    ans = max(ans, rmaxmax + lsum - (c - xv[i].first) * 2);
    lsum -= xv[i].second;
  }
  cout << ans << endl;
  return 0;
}


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

using namespace std;

#define INF 1e9
#define MAXN 100005
#define MAXM 100005
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define pii pair<int, int>


void solve(){
	ll s;
	cin >> s;
	
	const int v=1000000000;
	
	int x=(v-s%v)%v;
	int y=(s+x)/v;
	
	cout<<"0 0 1000000000 1 " << x << " " << y <<endl;
}

int main(){

    solve();
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdio>
#include <set>
using namespace std;

int n;

int main(){
	ios::sync_with_stdio(false);
	string s;
	string late;
	set<string> save;
	cin >> n;
	for(int i = 1;i <= n;++i){
		cin >> s;
		if(save.find(s) != save.end() || ((i != 1) && late[late.length()-1]!=s[0])){
			cout << "No";
			return 0;
		}else{
			save.insert(s);
			late = s;
		}
	}
	cout << "Yes";
	return 0;
}

Measured memory_bytes: 256
import java.io.IOException;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {

		Scanner sc = new Scanner(System.in);

		int x = sc.nextInt();
		int a = sc.nextInt();
		int b = sc.nextInt();

		if (Math.abs(x-a) < Math.abs(x-b)){
			System.out.println("A");
		} else {
			System.out.println("B");
		}
	}


}



Measured memory_bytes: 22604
n, m = map(int, input().split())
s = []
c = []

for _ in range(m):
    S, C = map(int, input().split())
    s.append(S)
    c.append(C)

for i in range(m):
    if s[i] == 1 and c[i] == 0 and n != 1:
        print(-1)
        exit()

for i in range(m):
    for j in range(m-1):
        if s[i] == s[-j-1] and c[i] != c[-j-1]:
            print(-1)
            exit()

if n == 3:
    one_hundred = False
    ten = False
    one = False
    for i in range(m):
        if s[i] == 1:
            one_hundred = c[i]
        elif s[i] == 2:
            ten = c[i]
        else:
            one = c[i]
    if one_hundred == False:
        one_hundred = 1
    if ten == False:
        ten = 0
    if one == False:
        one = 0
    print(one_hundred*100 + ten*10 + one)
    exit()
elif n == 2:
    ten = False
    one = False
    for i in range(m):
        if s[i] == 1:
            ten = c[i]
        else:
            one = c[i] 
    if ten == False:
        ten = 1
    if one == False:
        one = 0
    print(ten*10 + one)
    exit()
else:
    one = False
    for i in range(m):
        if s[i] == 1:
            one = c[i]
    if one == False:
        one = 0
    print(one)
    exit()

print(-1)

Measured memory_bytes: 9300
#include <bits/stdc++.h> 
using namespace std;
#define rep(i, N) for(int i=0; i<N; i++)
typedef long long ll;
#define dump(x) cerr<<#x<<"="<<x<<endl
using P = pair<int, int>;

int main() {
    int a, b, c, d; cin >> a >> b >> c >> d;
    cout << (ll)max(a*b, c*d) << endl;
    return 0;
}


Measured memory_bytes: 256
N = int(input())
data = [list(map(int,input().split())) for _ in range(N - 1)]
for i in range(N):
    time = 0
    s = 0
    for j in range(i, N - 1):
        if time <= data[j][1]:
            s = data[j][1]
        else:
            s = -(-(time - data[j][1]) // data[j][2]) * data[j][2] + data[j][1]
        time = data[j][0] + s
    print(time)

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

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

    string s;
    cin >> s;

    int a1 = 0, a2 = 0;
    for (int i=0; i<(int)s.size(); ++i) {
        if (i % 2 == 0 && s[i] == '1') a1 ++;
        if (i % 2 == 1 && s[i] == '0') a1 ++;
        if (i % 2 == 0 && s[i] == '0') a2 ++;
        if (i % 2 == 1 && s[i] == '1') a2 ++;
    }

    cout << min(a1, a2) << endl;

    return 0;
}

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

#define rep(i,n) for(ll i=0;i<n;++i)
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define ALL(a) (a).begin(),(a).end()

using namespace std;
using ll  = long long;
using pll = pair<ll, ll>;

const ll MOD  = 1e9+7;
const ll LINF = 1LL << 60;
const int INF = 1e9 + 7;

int main(){
    ll n, limit;
    cin >> n >> limit;

    ll w[n], v[n];
    rep(i, n)cin >> w[i] >> v[i];

    ll dp[n+1][100010];
    rep(i, n+1)rep(j, 100010)dp[i][j] = LINF;

    dp[0][0] = 0;

    rep(i, n)rep(j, 100010){
        dp[i+1][j] = dp[i][j];
        if(j >=v[i])dp[i+1][j] = min(dp[i+1][j], dp[i][j-v[i]] + w[i]);
    }

    ll ans = 0;
    rep(i, 100010)if(dp[n][i] <= limit)ans=i;

    cout << ans << endl;
}

Measured memory_bytes: 79104
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<algorithm>
#include<utility>
#include<tuple>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<numeric>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>

using namespace std;

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define BIL ((ll)1e9)
#define MOD ((ll)1e9+7)
#define INF (1LL<<60)           //1LL<<63でオーバーフロー
#define inf (1<<29)             //1<<29でオーバーフロー

int main(int argc,char* argv[]){
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(20);

    int h,w;
    cin >> h >> w;
    vector<string> plane(h);
    for(auto &x:plane)cin >> x;

    queue<pii> nxt;
    vector<vector<bool>> check(h,vector<bool>(w,false));
    nxt.push(make_pair(0,0));
    check[0][0]=true;
    bool ans=true;
    while(!nxt.empty()){
        int x=nxt.front().first,y=nxt.front().second;
        nxt.pop();
        if(x+1<w && !check[y][x+1]){
            nxt.push(make_pair(x+1,y));
            check[y][x+1]=true;
        }
        if(y+1<h && !check[y+1][x]){
            nxt.push(make_pair(x,y+1));
            check[y+1][x]=true;
        }
        if(plane[y][x]=='.')continue;
        else{
            if(x+1<w && plane[y][x+1]=='#')continue;;
            if(x-1>=0 && plane[y][x-1]=='#')continue;
            if(y+1<h && plane[y+1][x]=='#')continue;
            if(y-1>=0 && plane[y-1][x]=='#')continue;
            ans=false;
            break;
        }
    }

    if(ans)cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
using namespace std;
int main(void){
    int ans = 0,cnt0 = 0,cnt1 = 0,mn;
    string s;
    cin >> s;
    
    for(int i = 0;i < s.length();i++){
        if(s[i] == '0') cnt0++;
        if(s[i] == '1') cnt1++;
    }
    mn = min(cnt0,cnt1);
    cout << 2*mn << endl;
    return 0;
}


Measured memory_bytes: 512
import java.util.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {

        int n = sc.nextInt();
        int m = sc.nextInt();
        int[] arr = new int[n];
        for (int i=0; i<n; i++) arr[i] = sc.nextInt();
        int[] diff = new int[n];
        for (int i=0; i<n; i++) {
            diff[i] = Math.abs(arr[i] - m);
        }

        int res = diff[0];

        for (int i=1; i<n; i++) {
            res = gcd(res, diff[i]);
        }

        System.out.println(res);

    }

    int gcd(int m, int n) {
        if (n == 0) return m;
        return gcd(n, m%n);
    }


}



Measured memory_bytes: 47416
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))


const int MAX_N = 10010, MAX_W = 10010, MAX_V = 10010;

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

Measured memory_bytes: 256
#include<iostream>
int main(){
  long long a=0,b=0,x=0,count = 0;
  
  std::cin >> a >> b >> x;
  if(a!=0){
    count = (b/x) - ((a-1)/x);
  }else{
    count = b/x + 1;//0のぶん1足す
  }
  std::cout << count << "\n";
}
      


Measured memory_bytes: 256