akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=1e9+7;
const LL LINF=1LL<<62;


int main(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    cout << min(a,b)+min(c,d) << endl;
    return 0;
}

Measured memory_bytes: 256
import collections

N, M = map(int, input().split())
A = list(map(int, input().split()))
B = [A[0] % M]
for i in range(1, N):
    B.append((B[i-1] + A[i] % M) % M)
 
c = collections.Counter(B)
ans = sum([x*(x-1)//2 for x in c.values()])
if 0 in c.keys():
    ans += c[0]
print(ans)

Measured memory_bytes: 16556
#pragma GCC optimize("Ofast")

//インクルード
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 10000007 //10^9+7
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define MAXR 100000 //10^5:最大のrange(素数列挙などで使用)

int main() {
  // 高速化
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    int N, K;
    cin >> N;
    cin >> K;

    int ans = 0;
    int sho =N;

    while(sho >= 1){
        sho = sho/K;
        ans++;
    }

    cout << ans << "\n"; 

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <functional>
#include <numeric>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <sstream>
#include <complex>

using namespace std;

#define FOR(i,a,b) for(long long i=(a);i<(b);i++)
#define REP(i,N) for(long long i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define fi first
#define se second

#define PI acos(-1.0)
#define INF 1000000007
#define EPS 1e-10

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<double, double> PD;
typedef pair<string, ll> PS;
typedef vector<ll> V;
typedef pair<P, char> PC;


struct edge {
	int to, cost;
	edge(int _to, int _cost) :to(_to), cost(_cost){};
};

vector<edge> G[100];

int n, a, b, c;
int d[100];
set<int> si;
set<int>::iterator it;

void dijkstra(int s){
	fill(d, d + 100, INF);
	d[s] = 0;
	priority_queue<P> que;
	que.push(P(0, s));

	while (!que.empty()){
		P p = que.top(); que.pop();
		int v = p.second;

		if (d[v] < p.first)continue;

		for (int i = 0; i < G[v].size(); i++){
			edge e = G[v][i];
			if (d[e.to] > d[v] + e.cost){
				d[e.to] = d[v] + e.cost;
				que.push(P(d[e.to], e.to));
			}
		}
	}
}

int main(){
	while (cin >> n&&n){
		REP(i, n){
			cin >> a >> b >> c;
			if (si.find(a) == si.end())si.insert(a);
			if (si.find(b) == si.end())si.insert(b);
			G[a].push_back(edge(b, c));
			G[b].push_back(edge(a, c));
		}
		int ans = 2147483647, index = 2147483647;
		it = si.begin();
		REP(i, si.size()){
			int sum = 0;
			dijkstra(*it + i);
			REP(i, si.size()){
				sum += d[i];
			}
			if (ans > sum){
				ans = sum;
				index = *it + i;
			}
		}
		cout << index << " " << ans << endl;
		REP(i, si.size()){
			G[*it + i].clear();
		}
		si.clear();
	}
}

Measured memory_bytes: 1204
/* Simplicity and Goodness */

#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>

// using namespace __gnu_pbds;
using namespace std;
// typedef tree<int, null_type, less<int>, rb_tree_tag,
//             tree_order_statistics_node_update> indexed_set;

void my_dbg() { cout << endl; }
template<typename Arg, typename... Args> void my_dbg(Arg A, Args... B)
{ cout << ' ' << A; my_dbg(B...); }
#define dbg(...)  cout << "(" << #__VA_ARGS__ << "):", my_dbg(__VA_ARGS__)

#define scn(n) scanf("%d", &n)
#define lscn(n) scanf("%lld", &n)
#define pri(n) printf("%d ", (int)(n))
#define prin(n) printf("%d\n", (int)(n))
#define lpri(n) printf("%lld ", n)
#define lprin(n) printf("%lld\n", n)
#define rep(i,a,b) for(int i=(int)(a); i<(int)(b); i++)
#define pb push_back
#define mp make_pair
#define F first
#define S second

using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;

const int inf = INT_MAX;
const int ninf = INT_MIN;
const int mod = 1e9+7;
const int N = 3e3+2;

/* dp[i][j] : max score first player can get when elements from 
 * i to j are available and first player starts the game
*/
ll a[N];
ll dp[N][N];

ll rec(int i, int j)
{
    if(i == j)
        return a[i];
    if(i > j)
        return 0;

    ll& ans = dp[i][j];

    if(ans != -1)
        return ans;

    ll v1 = a[i] + min(rec(i+2, j), rec(i+1, j-1)); // I want the oppenent to get less score than mine
    ll v2 = min(rec(i+1, j-1), rec(i, j-2)) + a[j]; // For the first player, the opponent is second player and vice versa

    ans = max(v1, v2);
    return ans;
}

void solve()
{
    int n;
    scn(n);

    ll total = 0;

    rep(i, 0, n)
    lscn(a[i]), total += a[i];

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

    ll here = rec(0, n-1);

    lprin(here - (total - here));
}

int main()
{
    int t = 1;
    // scn(t);
    
    while(t --) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 74320
#include <bits/stdc++.h>
#define nmax 100055
using namespace std;
bool prim[nmax+10];
int main()
{
    int i,j;
    for(i=2; i<nmax; i++)
        prim[i]=1;
    for(i=2; i*i<nmax; i++)
        if(prim[i])
            for(j=2*i; j<nmax; j+=i)
                prim[j]=0;
    cin>>i;
    while(!prim[i]) i++;
    cout <<i;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " \n"[i == n-1];}
#define INF (1e18)

int main(){   
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll A,B,K;
    cin >> A >> B >> K;
    ll cnt = 0;
    rrep(i,min(A,B),1){
        if(A % i == 0 && B % i == 0){
            cnt++;
            if(cnt == K){
                print(i);
                return 0;
            }
        }

    }

}


Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int a,b,c,d,e,x,y,n;
	scanf("%d %d %d %d %d",&a,&b,&c,&d,&e);
	if(a<=0){
		a=a*(-1);
		x=a*c+d;
	}
	else{
		b=b-a;
	}
	y=b*e;
	n=x+y;
	printf("%d\n",n);
	return 0;
}



Measured memory_bytes: 2108
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		long a = sc.nextLong();
		long b = sc.nextLong();
long x;
		if (a == 1) {
			if (b >= 2) {
				b = b - 2;
				System.out.println(b);
			} else {
				System.out.println(1);
			}
		}


		if(a==2){
			System.out.println(0);
		}


		if(a>=3){
			if(b==1){
				System.out.println(a-2);
			}
			if(b==2){
				System.out.println(0);
			}

			if(b>=3){
				x=(a-2)*(b-2);
				System.out.println(x);
			}
		}


	}
}

Measured memory_bytes: 23252
#include<iostream>
using namespace std;
constexpr int f(int a){
	return a?a%10+f(a/10):0;
}
template<int N>struct ans{
	int a[37][N+1];
	constexpr ans():a(){
		for(int i=1;i<=N;i++){
			for(int j=1;j<=36;j++)a[j][i]=a[j][i-1];
			a[f(i)][i]+=i;
		}
		for(int i=1;i<=N;i++){
			for(int j=1;j<=36;j++)a[j][i]+=a[j-1][i];
		}
	}
};
void print(int a){
	a?print(a/10),putchar(a%10+48):0;
}
constexpr auto s=ans<10000>();
int t,in[3],ini;
char buf[114514];
main(){
	fgets(buf,sizeof(buf),stdin);
	for(char*p=buf;*p;p++){
		if(*p<47)ini++;
		else in[ini]=in[ini]*10+*p-48;
	}
	t=s.a[in[2]][in[0]]-s.a[in[1]-1][in[0]];
	t?print(t),0:putchar(48);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 1120000000

int main(){
  int x,y,z;
  cin>>x>>y>>z;
  int n = x+y+z;
  vector<long> a(n), b(n), c(n);
  rep(i,n) cin>>a[i]>>b[i]>>c[i];

  vector<int> vi(n);
  rep(i,n) vi[i] = i;
  sort(all(vi),[&](int l, int r){
    return a[l]-b[l] < a[r]-b[r];
  });
  // b[l]+a[r] > a[l]+b[r]

  auto f = [&](vector<long> &v, int k){
    vector<long> vec(n);
    priority_queue<long> pq;
    long tmp = 0;
    rep(i,n){
      int id = vi[i];
      pq.push(c[id] - v[id]);
      tmp += v[id];
      if(pq.size()>k){
        tmp += pq.top();
        pq.pop();
      }
      vec[i] = tmp;
    }
    return vec;
  };

  auto vl = f(b, y);
  reverse(all(vi));
  auto vr = f(a, x);

  long ans = 0;
  for(int i=y-1; i+x<n; i++){
    ans = max(ans, vl[i] + vr[n-i-1-1]);
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 5752
import java.util.*;
	import java.lang.Math;
    public class Main
	{
		public static void main(String args[])
		{
			//int[] a = {'SUN','MON','TUE','WED','THU','FRI','SAT'};
			Scanner scan = new Scanner(System.in);
			String choice = scan.nextLine();
			switch(choice)
			{
				case "SUN" :
					System.out.println("7");break;
				case "MON" : 
					System.out.println("6");break;
				case "TUE" :
					System.out.println("5");break;
				case "WED" :
					System.out.println("4");break;
				case "THU" : 
					System.out.println("3");break;
				case "FRI" :
					System.out.println("2");break;
				case "SAT" :
					System.out.println("1");break;
				default : System.out.println("Enter valid choice");break;
			}
		}
    }

Measured memory_bytes: 19796
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;
using P = pair<ll, ll>;
ll GCD(ll a, ll b) { return b?GCD(b, a%b):a; }
ll LCM(ll a, ll b) { return a/GCD(a, b)*b; }


int main() {
    ll n; cin >> n;
    vector<ll> cntvec(n+1, 0);
    for(int i = 1; i <= n; ++i) {
        ll now = i;
        while(now <= n) {
            cntvec.at(now)++;
            now += i;
        }
    }

    ll sum = 0;
    for(int i = 0; i <= n; ++i) sum += (i*cntvec.at(i));
    cout << sum << endl;
}

Measured memory_bytes: 81344
x,n = map(int, input().split())
p = list(map(int, input().split()))
dif = 0

while 1:
    if not x-dif in p:
        print(x-dif)
        exit()
    elif not x+dif in p:
        print(x+dif)
        exit()
    dif += 1

Measured memory_bytes: 9180
from sys import exit, setrecursionlimit, stderr
from functools import reduce
from itertools import *
from collections import defaultdict, Counter
from bisect import bisect

setrecursionlimit(10**7)

def read():
  return int(input())

def reads():
  return [int(x) for x in input().split()]

N = read()
L = reads()
L.sort()
print("Yes" if sum(L[:-1]) > L[-1] else "No")

Measured memory_bytes: 3700
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
#ifdef _debug
#define dout(i) cout << #i << ' ' << i << ' '
#else 
#define dout(i) 0 and 0
#endif
#define rout(i) (cout << i << '\n', 0)
using ll = long long;
using ull = unsigned long long;
using ul = unsigned;
using db = double;
template<typename T, typename S>
inline istream& operator >> (istream &in, const pair<T, S> &a){
	return in >> a.first >> a.second;
}
template<typename T, typename S>
inline ostream& operator << (ostream &ou, const pair<T, S> &b){
	return ou << b.first << ' ' << b.second;
}
const ul maxn = 200001;
const ul maxk = 30;
ul res;
ul n;
ul a[maxn], b[maxn], c[maxn], cnt[maxk];	
signed main(){
	ios_base::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	for(ul i = 0u;i < n;++i)cin >> a[i];
	for(ul i = 0u;i < n;++i)cin >> b[i];
	for(ul i = 0u;i < n;++i)for(ul j = 0u;j < maxk;++j)cnt[j] += (b[i]>>j) & 1u;
	for(ul i = 0u, x;i < maxk;++i){
		x = 0u;
		for(ul j = 0u;j < n;++j)c[j] = b[j]&((2u<<i)-1u);
		sort(c, c+n);
		ul q, w, e;
		for(ul j = 0u;j < n;++j){
			q = c+n - lower_bound(c,c+n, (1u<<i) - (a[j]&((1u<<i)-1u))) - cnt[i];
			e = c+n - lower_bound(c,c+n, (2u<<i) - (a[j]&((1u<<i)-1u)));
			w = cnt[i]-e;
			x ^= q ^ w;
			if((a[j]>>i)&1u)x ^= n;
		}
		res ^= (x&1u) << i;
	}
	cout << res << '\n';
}

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

int main() {
    int N; cin>>N;
    vi L(N);
    for (int i = 0; i < N; i++){
        cin>>L[i];
    }
    int ans=0;
    sort(L.begin(),L.end());
    for (int i = 0; i < N; i++){
        for (int j = i+1; j < N; j++){
            int kl=upper_bound(L.begin(),L.end(),L[j]-L[i])-L.begin();
            int kr=lower_bound(L.begin(),L.end(),L[i]+L[j])-L.begin()-1;
            if(kr>j)ans+=kr-max(kl,j+1)+1;
        }
    }
    cout<<ans<<endl;
}

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

int main() {
   
        int n;
        cin>>n;
        int a[n];
        for(int i=0;i<n;i++)
        cin>>a[i];
        
        long long sum[n];
        sum[0]=a[0];
         int mod=(int)1e9+7;
        for(int i=1;i<n;i++){
            sum[i]=(a[i]+sum[i-1]+mod)%mod;
        }
       
        long long tsum=sum[n-1];
        long long totalsum=0;
        for(int i=0;i<n;i++){
            totalsum=(totalsum+(1ll*a[i]*(tsum-sum[i])+mod)%mod+mod)%mod;
        }
        cout<<(totalsum+mod)%mod<<endl;
    
	//code
	return 0;
}


Measured memory_bytes: 5896
#include <iostream>
#include <algorithm>
#include <functional>

using ll = long long;

constexpr int MAX_N = 100000;

int N, K;
ll T[MAX_N];
ll diff[MAX_N - 1];

int main(){

	std::cin >> N >> K;

	for(int i = 0; i < N; ++i){

		std::cin >> T[i];

		if(i != 0) diff[i - 1] = T[i] - (T[i - 1] + 1);
	}

	std::sort(diff, diff + N, std::greater<ll>());

	ll ans = (T[N - 1] + 1) - T[0];

	for(int i = 0; i < K - 1; ++i){
		ans -= diff[i];
	}

	std::cout << ans << std::endl;

	return 0;
}



Measured memory_bytes: 4720
using System;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        var input1 = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
        var monsterCount = input1[0];
        var hissatsuCount = input1[1];
        var monsterHpList = Console.ReadLine().Split(' ').Select(s => long.Parse(s)).ToList();
        monsterHpList = monsterHpList.ToList().OrderBy(hp => hp).ToList();

        for (var i = 0; i < hissatsuCount; i++)
        {
            if (monsterHpList.Any())
            {
                monsterHpList.RemoveAt(monsterHpList.Count - 1);
            }
        }

        var n = monsterHpList.Sum(hp => hp);
        Console.WriteLine(n);
    }
}

Measured memory_bytes: 47296
a = list(map(int, input().split()))
if a[1]-a[0]+1 <= a[2] * 2:
  for i in range(a[0], a[1]):
    print(i)
  print(a[1], end='')
  exit()

for i in range(a[0], a[0]+a[2]):
  print(i)
for i in range(a[1]-a[2]+1, a[1]):
  print(i)
print(a[1], end='')
  

Measured memory_bytes: 3064
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using static kyoupuro.Input;
using static kyoupuro.MyMath;

namespace kyoupuro {

    class MainClass {

        public static void Main() {
            var N = NextInt();
            var list = IntList();
            list.Sort((a, b) => b - a);

            Console.WriteLine(list.Where((_, n) => n % 2 == 0).Sum() - list.Where((_, n) => n % 2 == 1).Sum());

        }
    }

    class MyMath {
        static long Gcd(long a, long b) {
            return b == 0 ? a : Gcd(b, a % b);
        }
    }

    class Input {
        static IEnumerator<string> enumerator = new string[] { }.AsEnumerable().GetEnumerator();

        public static string Line() {
            return Console.ReadLine();
        }

        public static int NextInt() {
            while (!enumerator.MoveNext()) {
                enumerator = StrArr().AsEnumerable().GetEnumerator();
            }
            return int.Parse(enumerator.Current);
        }

        public static long NextLong() {
            while (!enumerator.MoveNext()) {
                enumerator = StrArr().AsEnumerable().GetEnumerator();
            }
            return long.Parse(enumerator.Current);
        }

        public static string[] StrArr() {
            return Line().Split(' ');
        }

        public static List<int> IntList() {
            return StrArr().Select(int.Parse).ToList();
        }

        public static List<long> LongList() {
            return StrArr().Select(long.Parse).ToList();
        }

        public static void Skip(int line = 1) {
            enumerator.Reset();
            for (int i = 0; i < line; i++) Console.ReadLine();
        }

        public static void Reset() {
            enumerator.Reset();
        }
    }
}

Measured memory_bytes: 13396
n = int(input())
ab = [list(map(int,input().split())) for _ in range(n)]
ab = sorted(ab,key=lambda x: x[1])
ans = 'No'
t = 0

for i in ab:
    t += i[0]
    if i[1] < t:
        break
else:
    ans = 'Yes'

print(ans)

Measured memory_bytes: 55264
import numpy as np

H,N = list(map(int, input().split()))
As = []
Bs = []
for _ in range(N):
    a, b = list(map(int, input().split()))
    As.append(a)
    Bs.append(b)
As = np.array(As)
Bs = np.array(Bs)

dp = np.full((H+1), np.inf)
dp[0] = 0

for c in range(1,H+1):
    dp[c] = np.amin(dp[np.maximum(c - As, 0)] + Bs)

print(int(dp[-1]))


Measured memory_bytes: 12500
def get_primes(n):
    is_prime = [True] * (n + 1)
    is_prime[0] = False
    is_prime[1] = False
    for i in range(2, int(n**0.5) + 1):
        if not is_prime[i]:
            continue
        for j in range(i * 2, n + 1, i):
            is_prime[j] = False
    return set([i for i in range(n + 1) if is_prime[i]])


def solve():
    # A = [int(n) for n in input().split()]

    NMAX = 100000
    primes = set(get_primes(NMAX+1))
    table = [0] * NMAX

    for n in range(1, NMAX):
        table[n] = table[n-1] + int(n in primes and (n+1)//2 in primes)

    Q = int(input())
    for _ in range(Q):
        l, r = [int(x) for x in input().split()]
        print(table[r]-table[l-1])
    
    return 0


def main():
    solve()


if __name__ == '__main__':
    main()


Measured memory_bytes: 7192
import java.util.*;

public class Main {
    final static Scanner sc = new Scanner(System.in);
    public static void main(String[] args){
        while(true){
            int n =Integer.parseInt(sc.next());
            if(n==0)break;
            String uhyo[][] = new String[n][2];
            for(int i=0;i<n;i++){
                uhyo[i][0]=sc.next();
                uhyo[i][1]=sc.next();
            }
            int m =Integer.parseInt(sc.next());
            String[] guhyo = new String[m];
            for(int i=0;i<m;i++){
                String str = sc.next();
                guhyo[i] = str;
            }
            //System.out.println(uhyo[2][1]);
            run(n,uhyo,m,guhyo);
        }
    }
    
    public static void run(int n,String[][] uhyo,int m,String[] guhyo){
        
        HashMap<String,String> henkan = new HashMap<String,String>();

        for(int i=0;i<n;i++){
            henkan.put(uhyo[i][0], uhyo[i][1]);
        }
            
        for(int i=0;i<m;i++){
            if(henkan.containsKey(guhyo[i])){
            
                System.out.print(henkan.get(guhyo[i]));
            }else{
                System.out.print(guhyo[i]);
            }
                
        }
        System.out.println();
        
        
    }
}

Measured memory_bytes: 76896
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
using namespace std;
#define GG puts("FUCK")
#define maxn 750
int map[750][750];
int n,m,a[750],b[750],tot;
int f[750][1550],vis[750];
void dfs(int x,int opt) {
	int i; vis[x]=opt;
	if(!opt) a[tot]++;
	else b[tot]++;
	for(i=1;i<=n;i++) {
		if(map[x][i]) {
			if(vis[i]==-1) {
				dfs(i,opt^1);
			}else if(vis[i]==opt) {
				puts("-1"); exit(0);
			}
		}
	}
}
int main() {
	scanf("%d%d",&n,&m);
	int i,j,x,y;
	memset(vis,-1,sizeof(vis));
	for(i=1;i<=n;i++) for(j=1;j<=n;j++) if(i!=j) map[i][j]=1;
	for(i=1;i<=m;i++) {
		scanf("%d%d",&x,&y); map[x][y]=map[y][x]=0;
	}
	for(i=1;i<=n;i++) {
		if(vis[i]==-1) {
			tot++;
			dfs(i,0);
		}
	}
	f[0][maxn]=1;
	for(i=0;i<tot;i++) {
		int del=a[i+1]-b[i+1];
		for(j=0;j<=maxn+maxn;j++) {
			if(f[i][j]) {
				if(j>=del) f[i+1][j-del]=1;
				if(j+del<=maxn+maxn) f[i+1][j+del]=1;
			}
		}
	}
	int mn=1<<30;
	for(i=maxn;i<=maxn+maxn;i++) {
		if(f[tot][i]) {
			mn=i-maxn; break;
		}
	}
	for(i=maxn;i>=0;i--) {
		if(f[tot][i]) {
			mn=min(mn,maxn-i); break;
		}
	}
	int s=(n+mn)>>1,t=n-s;
	printf("%d\n",s*(s-1)/2+t*(t-1)/2);
}

Measured memory_bytes: 6528
import bisect
from collections import deque
import sys
MAX_INT = int(10e9)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

H,W = IL()

if (H%3 == 0) or (W%3 == 0):
  print(0)
else:
  tate_m = H//2
  yoko_m = W//2

  ans = MAX_INT
  # 縦に切っていく
  for w in range(1,yoko_m+1):
    Area1 = H*w
    Area2 = tate_m*(W-w)
    Area3 = (H-tate_m)*(W-w)
    ans = min(ans, max(Area1,Area2,Area3)-min(Area1,Area2,Area3))

  # 横に切っていく
  for h in range(1,tate_m+1):
    Area1 = h*W
    Area2 = (H-h)*yoko_m
    Area3 = (H-h)*(W-yoko_m)
    ans = min(ans, max(Area1,Area2,Area3)-min(Area1,Area2,Area3))
  
  ans = min(ans, ((H//3)+1)*W - (H//3)*W)
  ans = min(ans, ((W//3)+1)*H - (W//3)*H)

  print(ans)

Measured memory_bytes: 3316
n, nTake = map(int, input().split())
a = sorted([tuple(map(int, input().split())) for _ in range(n)], key=lambda x: -x[1])

totalTaste = 0
same = []
types = set()
for i in range(nTake):
    type, taste = a[i]
    totalTaste += taste
    if type not in types:
        types.add(type)
    else:
        same.append(taste)

rem = []
typesRem = set()
for i in range(nTake, n):
    type, taste = a[i]
    if type not in types and type not in typesRem:
        typesRem.add(type)
        rem.append(taste)

same.sort()
rem.sort(key=lambda x: -x)
ret = totalTaste + len(types) ** 2
curTotal = totalTaste
for i in range(min(len(same), len(rem))):
    curTotal = curTotal - same[i] + rem[i]
    ret = max(ret, curTotal + (len(types) + i + 1) ** 2)
print(ret)

Measured memory_bytes: 22964
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
#define Mod 1000000007
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<ll>; using VVI = vector<VI>; using VVVI = vector<VVI>;

vector<ll> s(202020,0);
vector<ll> u(202020,0);
vector<ll> ww(202020,0);
vector<ll> bb(202020,0);

vector<ll> ipow(202020,0);

ll modinv(ll a) {
    ll m=Mod;
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}


int main(){
    ll i,j;
    ll b,w;
    cin>>b>>w;

    ipow[0]=1;
    ll t=modinv(2);
    for(i=1;i<202020;i++){
        ipow[i]=(ipow[i-1]*t)%Mod;
    }
    
    for(i=0;i<=w-1;i++) ww[i]=1;
    for(i=0;i<=w-1;i++) s[i]=1;
    for(i=w;i<b+w;i++){
        ww[i]=(ww[i-1]*i)%Mod;
        ww[i]=ww[i]*modinv(i-w+1);
        ww[i]%=Mod;

        s[i]=s[i-1]+(Mod-ww[i-1])*ipow[i];
        s[i]%=Mod;
    }

    for(i=0;i<=b-1;i++) bb[i]=1;
    for(i=0;i<=b-1;i++) u[i]=1;
    for(i=b;i<b+w;i++){
        bb[i]=(bb[i-1]*i)%Mod;
        bb[i]=bb[i]*modinv(i-b+1);
        bb[i]%=Mod;
        u[i]=u[i-1]+(Mod-bb[i-1])*ipow[i];
        u[i]%=Mod;
    }

    for(i=1;i<=b+w;i++){
        ll ans=(Mod+1+u[i-1]-s[i-1])%Mod;
        cout<<(ans*t)%Mod<<endl;
    }


    
    return 0;
}

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

int main(){
    int N;
    cin >> N;
    int count = 0;
    
    for(int i=0;i<N;i++){
        int l,r;
        cin >> l >> r;
        count = count + r - l + 1;
    }
    cout << count << endl;
}

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

int main(){
  int n;
  cin>>n;
  vector<int>a(n);
  int m1=0,m2=0,cnt=0;
  rep(i,n){
    cin>>a[i];
    m1=max(m1,a[i]);
  }
  rep(i,n){
    if(a[i]==m1){
      cnt++;
      continue;
    }
    m2=max(m2,a[i]);
  }
  if(m2==0){
    rep(i,n)cout<<m1<<endl;
    return 0;
  }
  rep(i,n){
    if(a[i]!=m1)cout<<m1<<endl;
    else{
      if(cnt<2)cout<<m2<<endl;
      else cout<<m1<<endl;
    }
  }
}
  


Measured memory_bytes: 2432
#include <iostream>
using namespace std;
int main() {
    long n;
    cin>>n;
    int digit[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
    int idx=0;
    while(n>0){
        digit[idx] = n%26;
        if(digit[idx]==0){
            digit[idx]=26;
            n-=26;
        }
        n/=26;
        idx++;
    }
    

    for(;digit[idx]==0;idx--);
    for(;idx>=0;idx--){
        cout<< (char)('a'+digit[idx]-1);
    }

    return 0;
}

Measured memory_bytes: 3636
#[allow(dead_code)]
fn getline() -> String {
    let mut res = String::new();
    std::io::stdin().read_line(&mut res).ok();
    res
}

#[allow(unused_macros)]
macro_rules! readl {
    ($t: ty) => {
        {
            let s = getline();
            s.trim().parse::<$t>().unwrap()
        }
    };
    ($( $t: ty),+ ) => {
        {
            let s = getline();
            let mut iter = s.trim().split(' ');
            ($(iter.next().unwrap().parse::<$t>().unwrap(),)*)
        }
    };
}

#[allow(unused_macros)]
macro_rules! readlvec {
    ($t:ty) => {{
        let s = getline();
        let iter = s.trim().split(' ');
        iter.map(|x| x.parse().unwrap()).collect::<Vec<$t>>()
    }};
}

#[allow(unused_macros)]
macro_rules! debug {
    ($x:expr) => {
        println!("{}: {:?}", stringify!($x), $x)
    };
}
// macro_rules! debug { ($x: expr) => () }

#[allow(dead_code)]
fn show<T>(iter: T) -> String
where
    T: Iterator,
    T::Item: std::fmt::Display,
{
    let mut res = iter.fold(String::new(), |sum, e| sum + &format!("{} ", e));
    res.pop();
    res
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::btree_map::Entry::{Occupied, Vacant};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};

fn main() {
    use std::io::Write;
    let out = std::io::stdout();
    let mut out = std::io::BufWriter::new(out.lock());
    macro_rules! printf { ($($arg:tt)*) => (write!(out, $($arg)*).unwrap()); }
    macro_rules! printfln { () => (writeln!(out).unwrap()); ($($arg:tt)*) => (writeln!(out, $($arg)*).unwrap()); }

    let (n, c) = readl!(usize, usize);
    let d: Vec<_> = (0..c).map(|_| readlvec!(i64)).collect();

    let cv: Vec<Vec<_>> = (0..n)
        .map(|_| readlvec!(i64).into_iter().map(|x| x - 1).collect())
        .collect();

    let mut cov = vec![vec![0; c]; 3];
    for (i, row) in cv.iter().enumerate() {
        for (j, &e) in row.iter().enumerate() {
            cov[(i + j) % 3][e as usize] += 1;
        }
    }
    let cov = cov;

    let inf = 1_000_000_000_000;
    let mut ans = inf;
    for c0 in 0..c {
        for c1 in 0..c {
            for c2 in 0..c {
                if c0 == c1 || c1 == c2 || c0 == c2 {
                    continue;
                }
                let ccv = [c0, c1, c2];
                let mut cost = 0;
                for (i, cr) in cov.iter().enumerate() {
                    for (&ce, dr) in cr.iter().zip(d.iter()) {
                        unsafe {
                            cost += ce * dr.get_unchecked(ccv[i]);
                        }
                    }
                }
                ans = min(ans, cost);
            }
        }
    }
    printfln!("{}", ans);
}


Measured memory_bytes: 6396
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<int,int> pii;
const int maxn=2e5+7;
const ll modn=1e9+7;
const int inf=2e9+7;
const ll INF=1000000000000000000ll;
const double PI = acos(-1.0);
const double eps=1e-8;
inline int lowbit(int x){return x&-x;}
inline ll lowbit(ll x) {return x&-x;}
inline int CountOneBinary(ll num){int ans=0;while(num){if(num&1) ans+=1;num>>=1;}return ans;}
inline void read(int &x){char c;x=0;for(c=getchar();c>'9'||c<'0';c=getchar());for(;c>='0'&&c<='9';c=getchar()) x=x*10+c-'0';}
inline void read(ll &x){char c;x=0;for(c=getchar();c>'9'||c<'0';c=getchar());for(;c>='0'&&c<='9';c=getchar()) x=x*10+c-'0';}
inline ll qpow(ll x,ll y){ll ans=1;while(y){if(y&1) ans=ans*x%modn;x=x*x%modn;y>>=1;}return ans;}
inline double qpow(double x,ll y){double ans=1;while(y){if(y&1) ans=ans*x;x=x*x;y>>=1;}return ans;}
ll n,k,x[maxn];
int main()
{
    while(scanf("%lld%lld",&n,&k)==2)
    {
        for(int i=1;i<=n;i++) scanf("%lld",&x[i]);
        ll ans=INF;
        for(int l=1,r=k;r<=n;l++,r++)
        {
            ans=min(ans,min(abs(x[l]),abs(x[r]))+x[r]-x[l]);
        }
        printf("%lld\n",ans);
    }
}


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

using namespace std;

#define f first
#define s second
#define pb push_back
#define np next_permutation
#define bs binary_search
#define mp make_pair
#define all(x) x.begin(), x.end()
#define bp __builtin_popcountll
#define sqr(x) ((llong)sqrt (x))
#define b_ctz __builtin_ctzll
#define b_clz __builtin_clzll

#define y1 road_to_respa_top_6
#define prev road_to_respa_top_6
#define Abdrakhman abcdefghijklmnopqrstuvwxyzRakhman
#define left kotoriy_levee_chem_right
#define right kotoriy_pravee_chem_left

#define android ios_base::sync_with_stdio(0), cin.tie (0), cout.tie (0)
#define fn ""

typedef long long llong;
typedef long double ldouble;
typedef unsigned long long ullong;

typedef vector <int> vi;
typedef vector <string> vs;
typedef vector <vector <llong> > matrix;

typedef pair <llong, llong> pll;

typedef map <int, int> mii;

typedef set <llong> sl;

const int MXN = 1e6 + 1;
const llong MNN = 1e3 + 1;
const llong MOD = 1e9 + 7;
const int INF = 1e9;
const llong LINF = 1e18;
const llong MAGIC = 1000;
const ldouble EPS = 1e-9;
const ldouble PI = 3.1415926536;
const string TIME = "rovno_ushten_push_ketti";

inline llong log2 (llong x) {return 64 - b_clz (x) - 1;};
inline llong __lcm (llong a, llong b) {return a / __gcd (a, b) * b;}

llong n, c, k;
llong t[MXN];

int main () {
    android;
    //freopen ("input.txt", "r", stdin);
    cin >> n >> c >> k;
    int ans = 0, cur = 0;
    for (int i = 1; i <= n; i ++) {
        cin >> t[i];
    }
    sort (t + 1, t + n + 1);
    for (int i = 1; i <= n; i ++) {
        //cout << i << ' ' << t[i] << ' ' << ans << ' ' << cur << ' ';
        if (i == 1) {
            if (c == 1) ans = 1;
            else cur = 1;
            //cout << '\n';
            continue;
        }
        if (t[i] <= t[i - cur] + k) {
            cur ++;
            //cout << 1 << ' ';
        }
        else {
            ans ++, cur = 1;
            //cout << 2 << ' ';
        }
        if (cur == c) {
            ans ++, cur = 0;
            //cout << 3 << ' ';
        }
        //cout << ans << ' ' << cur << '\n';
    }
    if (cur) ans ++;
    cout << ans;
    return 0;
}


Measured memory_bytes: 1024
//
//  main.cpp
//  ITP1_7-D
//
//  Created by ?????¶??? on 15/8/15.
//  Copyright (c) 2015??´ ?????¶???. All rights reserved.
//

#include <iostream>
#include <stdio.h>
using namespace std;

int main(int argc, const char * argv[]) {

    int n,m,l;
    cin >> n >> m >> l;
    
    int a[n][m];
    int b[m][l];
    
    // input a
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            
            cin >> a[i][j];
        }
    }
    
    // input b
    for (int i = 0; i < m; i++) {
        for (int j = 0; j < l; j++) {
            cin >> b[i][j];
        }
    }
    
    
    for (int i = 0; i < n; i++) {
        
        for (int j = 0; j < l; j++) {
            
            long result = 0;
            
            for (int k = 0; k < m; k++) {
                
                result += a[i][k] * b[k][j];
                
//                printf("a[%d][%d]: %d  b[%d][%d]: %d\n", i,k,a[i][k],k,j, b[k][j]);
            }
            
            if (j == l -1) {
                cout << result << endl;
            }else{
                cout << result << " ";
            }
        }
    }
    
    return 0;
}

Measured memory_bytes: 1236
#include <iostream>
#include <string>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <ctime>
#include <set>
#include <map>
#include <unordered_map>
#include <queue>
#include <algorithm>
#include <cmath>
#include <assert.h>
#include <iomanip>
#include <bitset>
using namespace std;
#define vi vector<int>
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define all(x) x.begin(),x.end()
#define SZ(x) (int)(x.size())
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,a,b) for(int i=b-1;i>=a;i--)
#define inf 1000000007
#define mod 1000000007
#define x first
#define y second
#define pi acos(-1.0)
#define DBG(x) cerr<<(#x)<<"="<<x<<"\n";

#define FOREACH(it,x) for(__typeof(x.begin()) it=x.begin();it!=x.end();it++)
#define ull unsigned long long
#define ll long long
#define N 2005

template <class T,class U>inline void Max(T &a,U b){if(a<b)a=b;}
template <class T,class U>inline void Min(T &a,U b){if(a>b)a=b;}

//FILE* outFile;

inline void add(int &a,int b){a+=b;while(a>=mod)a-=mod;}
inline int gcd(int a, int b){if(b == 0)return a; return gcd(b, a%b);}
int pow(int a,int b){
    int ans=1;
    while(b){
        if(b&1)ans=ans*(ll)a%mod;
        a=(ll)a*a%mod;b>>=1;
    }
    return ans;
}

int dp[N], sz[N], mx[N];
vi g[N];
int calc(vi &e){
    int s = 0, M = 0, m = -1;
    for(auto &x : e){
        int w = dp[x] + sz[x];
        s += w;
        if(M <= w){
            M = w;
            m = x;
        }
    }
    if(2 * M <= s)return 0;
    int t = 0;
    for(auto &x : e){
        if(x != m)t += mx[x] + sz[x];
    }
    return max(0, M - t);
}
vi e;
char s[N];
void dfs(int u, int fa = -1){
    sz[u] = s[u] == '1';
    mx[u] = 0;
    for(auto &v : g[u]){
        if(v == fa)continue;
        dfs(v, u);
        mx[u] += mx[v] + sz[v];
        sz[u] += sz[v];
    }
    e.clear();
    for(auto &v : g[u]){
        if(v != fa)e.pb(v);
    }
    dp[u] = calc(e);
}
int main(){
    int j,k,i,T,ca=0, n, m, K = 0;
    scanf("%d%s", &n, s);
    rep(i, 1, n){
        scanf("%d%d", &j, &k);
        j--, k--;
        g[j].pb(k), g[k].pb(j);
    }
    int ans = -1;
    rep(i, 0, n){
        dfs(i);
        int s = 0;
        e.clear();
        for(auto &x : g[i]){
            e.pb(x);
            s += mx[x] + sz[x];
        }
        if(s % 2 == 0 && calc(e) == 0){
            if(ans == -1 || ans > s / 2)ans = s / 2;
        }
    }
    printf("%d\n", ans);
}



Measured memory_bytes: 512
#include <iostream>

using namespace std;

int gcd( int m, int n )
{
  if ( ( 0 == m ) || ( 0 == n ) )
    return 0;
  while( m != n )
  {
    if ( m > n ) m = m - n;
    else         n = n - m;
  }
  return m;
}

int lcm( int m, int n )
{
  if ( ( 0 == m ) || ( 0 == n ) )
    return 0;
  return ((m / gcd(m, n)) * n);
}

int solve(int a, int b, int c){
  int max, destination;
  destination = c;
  max = lcm(a+b, 60);
  while(max > destination){
    if ((destination % (a+b) ) <= a){
      return destination;
    }
    destination += 60;
  }
  return -1;
}

int main(){
  int a, b, c;
  cin >> a >> b >> c;
  cout << solve(a, b, c) << endl;
}

Measured memory_bytes: 1164
// Bitter Alchemy

#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <unordered_map>
#include <ios>
#include <iomanip>
#include <string>
#include <numeric>

using namespace std;

int main() {
    int n, x;
    cin >> n >> x;
    vector<int> m(n);

    int min_gram = 9999999;
    for (int i = 0; i < n; i++) {
        cin >> m[i];
        if (m[i] < min_gram) {
            min_gram = m[i];
        }
        x -= m[i];
    }

    cout << n + (int)(x/min_gram) << endl;

    return 0;
}


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

int main() {
    char A, B, C, D;

    char op1[2] = {'+', '-'};
    char op2[2] = {'+', '-'};
    char op3[2] = {'+', '-'};

    cin >> A >> B >> C >> D;

    int a = int(A - '0');
    int b = int(B - '0');
    int c = int(C - '0');
    int d = int(D - '0');

    for (const auto& ope1 : op1) {
        for (const auto& ope2 : op2) {
            for (const auto& ope3 : op3) {
                int res = a;
                if (ope1 == '+')
                    res += b;
                else
                    res -= b;

                if (ope2 == '+')
                    res += c;
                else
                    res -= c;

                if (ope3 == '+')
                    res += d;
                else
                    res -= d;

                if (res == 7) {
                    cout << A << ope1 << B << ope2 << C << ope3 << D << "=7"
                         << endl;
                    return 0;
                }
            }
        }
    }

    return 0;
}


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

#include<array>

UL N;
array<UL,2> A[100000];

bool endCmp(const array<UL,2>& l, const array<UL,2>&r){
 return l[1]<r[1];
}

int main(){
 scanf("%u",&N);
 rep(i,N) rep(j,2) scanf("%u",&A[i][j]);
 sort(A,A+N,endCmp);
 UL p=0;
 UL ans=0;
 rep(i,N){
  if(p>=A[i][0]) continue;
  ans++; p=A[i][1];
 }
 printf("%u\n",ans);
 return 0;
}



Measured memory_bytes: 4060
#include<bits/stdc++.h>
using namespace std;
typedef int q;
typedef double w;
typedef string e;
int main(){
    e s,d;
    q k=0;
    cin>>s>>d;
  //it took some searching to find those  
  if(s.at(0)==d.at(0)){
    k++;
    }
    if(s.at(1)==d.at(1)){
    k++;
    }
    if(s.at(2)==d.at(2)){
    k++;
    }
    cout<<k;








return 0;}


Measured memory_bytes: 256
//int a = stoi(c); 文字列をintへ
//小文字から大文字
//transform(a.begin(), a.end(), a.begin(), ::toupper);
//途中の出力をそのまま残さない
//数値計算 個数以外はdouble
//map<キー,値> p は辞書。p[キー] = 値
//map 全探索
//auto begin = p.begin(), end = p.end();
//for (auto it = begin; it != end; it++) {}
//mapのキー：it->first mapのバリュー：it->second
//絶対値 abs()
//入力は空白で切れる
//大文字判定 isupper(文字) 小文字判定 islower(文字)
//do{}while(next_permutation(ALL(配列)))
//while(N)で回すとき、Nはコピーを作っておく
//小文字に対応する文字コード：S[i] - 'a'
//文字コード→小文字：(char)(数字+'a')
//グラフの距離:隣接行列で扱う
//等価なものに変換する思考
//bool型　初期値はTrue
//島渡りの問題：中間ノードに着目
//配列はvector<>を使う：意味わからないエラーがなくなる。
//背反な事象にちゃんとわける
//チェックリストはマップを使う
#include <bits/stdc++.h>
#define rep(i,N) for(int i = 0; i < N;i++)
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
using namespace std;

// K進数でのNの桁数
ll dig(ll N, ll K) {
	ll dig = 0;
	while (N) {
		dig++;
		N /= K;
	}
	return dig;
}
// a,bの最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a%b);
}

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

//nC2の計算
ll C(ll N) {
	return N * (N - 1) / 2;
}

//円周率
const double PI = 3.14159265358979323846;

int main() {
	double A, B; cin >> A >> B;
	
	if (A > B)cout << "GREATER" << endl;
	else if (A < B)cout << "LESS" << endl;
	else cout << "EQUAL" << endl;
}

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

#define ll long long int
#define str string
#define ALL(a)  (a).begin(),(a).end()
#define P pair<ll,ll>

using Graph = vector<vector<int>>;

const int dy[] = { 0, 0, 1, -1 }, dx[] = { 1, -1, 0, 0 };
ll INFL = 1ll << 60, INF = 1 << 30, mod = 1e9 + 7, Min = INFL, Max = -1;
ll a, b, c ,n, sum, A[500010], B[500000],rui[500000],  dp[5000];
str S,T;bool check = true;	vector<ll> v;



int main() {
	//Code Line
cin >>a >> b ;

if(a == b)cout << "Yes" << endl;
else cout << "No" << endl;



	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long  ll;
typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef double ld;
typedef complex<ld> Point;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
const ld eps = 1e-6;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;

bool exi[10][10];
int p[10];
void solve() {
	int n, m; cin >> n >> m;

	rep(i, m) {
		int l; cin >> l;
		rep(j, l) {
			int x; cin >> x; x--;
			exi[i][x] = true;
		}
	}
	int ans = 0;
	rep(i, m)cin >> p[i];
	rep(i, (1 << n)) {
		vector<int> v;
		rep(j, n) {
			if (i&(1 << j))v.push_back(j);
		}
		bool valid = true;
		rep(j, m) {
			int cnt = 0;
			rep(k, v.size()) {
				if (exi[j][v[k]])cnt ^= 1;
			}
			if (cnt != p[j]) {
				valid = false;
			}
		}
		if (valid)ans++;
	}
	cout << ans << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	//stop
	return 0;
}


Measured memory_bytes: 256
const main = stdin => {
  const [S, T] = stdin.trim().split('\n')
  let max = 0
  for (let i = 0; i <= S.length - T.length; i++) {
    let count = 0
    for (let j = 0; j < T.length; j++) {
      if (S[i + j] === T[j]) {
        count++
      }
    }
    max = Math.max(count, max)
  }

  console.log(T.length - max);
}

// 標準入力
main(require("fs").readFileSync("/dev/stdin", "utf8"))


Measured memory_bytes: 32492
#include <cstdio>
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
using ll = long long;
#define rep(i,n) for (ll i=0;i<n;i++)
using namespace std;

struct UnionFind {
    vector<ll> par;
    vector<ll> rank;

    UnionFind(ll N) : par(N),rank(N){
        // 初期化
        rep(i,N) {
            par[i] = i;
            rank[i] = 0;
        }
    }


    ll root(ll x){
        // unionfind木をたどって頂点を探す
        if(par[x]==x) return x;
        else return par[x] = root(par[x]);
    }

    void unite(ll x,ll y){
        // 高さを考慮し、結合する。
        ll rx = root(x);
        ll ry = root(y);
        if(rx==ry) return;
        if(rank[x]<rank[y]){
            par[rx] = y;
        }else{
            par[ry] = x;
            if(rank[x]==rank[y]) rank[x]++;
        }
    }

    bool same(ll x,ll y){
        // 親が同じなら同じグループ
        return root(x)==root(y);
    }

};

void solve(){

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

    ll n,m;
    cin >> n >> m;

    UnionFind tree(n);

    rep(i,m){
        ll a,b;
        cin >> a >> b;
        tree.unite(a,b);
    }

    ll ans = 0;
    vector<ll> cnt(n);
    rep(i,n){
        cnt[i] = tree.root(i);
    }
    sort(cnt.begin(),cnt.end());
    rep(i,n-1){
        if(cnt[i]!=cnt[i+1]){
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 5572
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
using Int2 = __int128_t;
signed main(){  
  cin.tie(0);
  ios::sync_with_stdio(0);
  Int n;
  while(cin>>n,n){
    vector<Int> b(n*(n+1)/2),e,o;
    for(Int i=0;i<(Int)b.size();i++) cin>>b[i];
    for(Int i=0;i<(Int)b.size();i++)
      if(b[i]%2==0) e.push_back(b[i]);
      else o.push_back(b[i]);
    sort(e.begin(),e.end());
    sort(o.begin(),o.end());
    Int a=sqrt((Int)((Int2)e[0]*e[1]/o[0]));
    cout<<a<<endl;
    for(Int i=0;i<n;i++){
      if(i) cout<<" ";
      cout<<e[i]/a;
    }
    cout<<endl;
  }
  return 0;
}

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

using namespace std;

int main(){
    int n;
    cin>>n;
    int ar[1000];
    for(int i=0;i<n;i++){
        cin>>ar[i];
    }
    int count=0;

    for(int i=0;i<n-2;i++){
        for(int j=i+1;j<n-1;j++){
            for(int k=j+1;k<n;k++){
                if(ar[i]+ar[j]>ar[k]&&ar[i]+ar[k]>ar[j]&&ar[j]+ar[k]>ar[i]&&ar[i]!=ar[j]&&ar[j]!=ar[k]&&ar[i]!=ar[k]){
                    // cerr<<'\n'<<i+1<<j+1<<k+1<<'\n';
                    count++;
                }
            }
        }
    }
    cout<<count;
    return 0;
}

Measured memory_bytes: 3636
N,M=parse.(split(readline()))
sc=Pair{Int,Int}[]
for _=1:M
	a,b=parse.(split(readline()))
	push!(sc,a=>b)
end
for i=0:999
	t=Int[]
	if i==0
		t=Int[0]
	elseif i<10
		t=Int[i]
	elseif i<100
		t=Int[div(i,10),i%10]
	else
		t=Int[div(i,100),div(i,10)%10,i%10]
	end
	ok=N==length(t)
	for (s,c)=sc
		ok=ok&&t[s]==c
	end
	if ok
		println(i)
		exit()
	end
end
println(-1)


Measured memory_bytes: 184024
#include <bits/stdc++.h>
using namespace std;
typedef long double LD; 
typedef long long ll; 
#define int ll 
#define ff(i,a,b) for (int i = a; i < b; i++) 
#define bf(i,a,b) for (int i = a; i >= b; i--) 
#define all(v) v.begin(),v.end() 
#define show(a) for(auto xyz:a)cout<<xyz<<" ";cout<<endl;
#define F first 
#define S second
#define pb push_back
#define mp make_pair
#define lb lower_bound   
#define ub upper_bound
#define yes cout<<"YES"<<endl
#define no cout<<"NO"<<endl
#define one cout<<"-1"<<endl;
#define pi 3.141592653589793238
#define mod 1000000007
#define intmx INT_MAX 
#define intmi INT_MIN

void solve(){
    int x,a;
    cin>>x>>a;
    if(x<a)
    cout<<"0";
    else
    cout<<"10";
    
}
signed main() {
    int t=1;
    //cin>>t;
    while(t--){
        solve();
    }
}


Measured memory_bytes: 3596
#include <cstdio>
#include <cstring>
#include <cctype>
#include <iostream>

using namespace std;

int main()
{   
    char ch;
    int counter[26] = {0,};
    while (scanf("%c", &ch) != EOF) {
        if (isalpha(ch)) {
            if (isupper(ch)) ch = tolower(ch);
            else ch = ch;
            int num = ch - 'a';
            counter[num]++;
        }
        
    }
    for (int i = 0; i < 26; i++) {
        int num2 = i + 'a';
        cout << (char)num2 << " : " << counter[i] << endl; 
    }
    
    
return 0;

    
}


Measured memory_bytes: 3152
#include<cstdio>
#include<cctype>

int main(){
    char ch;
    
    while(1){
        scanf("%c", &ch);
        if(islower(ch)) printf("%c", toupper(ch));
        else if(isupper(ch)) printf("%c", tolower(ch));
        else if(!isalpha(ch)) printf("%c", ch);
        if(ch=='\n') break;
    }
    
    return 0;
}


Measured memory_bytes: 2560
#include <iostream>
#include <vector>
#include <map>
#define llint long long

using namespace std;

llint n;
bool prime[105];
map<llint, llint> mp;
llint cnt[1005], sum[1005];
vector<int> vec;

int main(void)
{
	cin >> n;
	for(int i = 2; i < 105; i++){
		if(prime[i]) continue;
		for(int j = 2*i; j < 105; j+=i) prime[j] = true;
	}
	for(int i = 2; i < 105; i++) if(!prime[i]) vec.push_back(i);
	
	for(int i = 2; i <= n; i++){
		int t = i;
		for(int j = 0; j < vec.size(); j++){
			while(t % vec[j] == 0){
				t /= vec[j];
				mp[vec[j]]++;
			}
		}
	}
	
	for(auto it = mp.begin(); it != mp.end(); it++) cnt[it->second]++;
	for(int i = 1000; i >= 0; i--) sum[i] = sum[i+1] + cnt[i];
	
	llint ans = 0;
	ans += sum[74];
	if(sum[2] >= 1) ans += sum[24] * (sum[2]-1);
	if(sum[4] >= 1) ans += sum[14] * (sum[4]-1);
	if(sum[4] >= 2 && sum[2] >= 3) ans += sum[4] * (sum[4]-1) * (sum[2]-2) / 2;
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 888