akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <tuple>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl
#define show2(a, n, m) rep(i, n) { rep(j, m) {cout << a[i][j] << ' ';} cout << endl;} 
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<long long, long long> pll;
typedef long double ld;

const int INF = 1 << 30;
const long long INFL = 1LL << 60;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100010;

int main() {
//	cout << fixed << setprecision(15);
	int h, w;
	cin >> h >> w;
	vector<string> s(h);
	rep(i, h) cin >> s[i];

	vector<vi> d(h, vi(w, INF));
	if(s[0][0] == '.') d[0][0] = 0;
	else d[0][0] = 1;

	typedef tuple<int, int, int> tup;
	priority_queue<tup, vector<tup>, greater<tup>> que;
	que.push(tup(d[0][0], 0, 0));
	while(!que.empty()) {
		int _d, i, j;
		tie(_d, i, j) = que.top();
		que.pop();
		if(i+1 < h && d[i+1][j] > _d + (s[i][j] == '.' && s[i+1][j] == '#')) {
			d[i+1][j] = _d + (s[i][j] == '.' && s[i+1][j] == '#');
			que.push(tup(d[i+1][j], i+1, j));
		}
		if(j+1 < w && d[i][j+1] > _d + (s[i][j] == '.' && s[i][j+1] == '#')) {
			d[i][j+1] = _d + (s[i][j] == '.' && s[i][j+1] == '#');
			que.push(tup(d[i][j+1], i, j+1));
		}
	}
	cout << d[h-1][w-1] << endl;
}


Measured memory_bytes: 256
/*
　　　　 ∧＿∧　にっぽんちゃちゃちゃ
　／＼（　・∀・）／ヽ
（ ●　と　　　つ　● ）　にっぽんちゃちゃちゃ
　＼/⊂、 ノ　　＼ノ
　　　　　し'
*/
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define MOD 1000000007
#define INF 9223372036854775807

signed main()
{
  string xyz ="";
int x=0,y=0,z=0,w=0,i=0,j=0,n=0;
double a=0,b=0,c=0,d=0,e=0,f=0;
std::vector<int> v;
while(std::cin >>a>>b>>c>>d>>e>>f){
  printf("%0.3f %0.3f\n",(e*c-b*f)/(a*e-b*d)+0,(a*f-d*c)/(a*e-d*b)+0);

}
}



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

#define ll long long
#define ull unsigned long long
#define FOR(i,a,b) for (int i=(a);i<(b);++i)
#define REP(a,b) for(int a=0;a<(b);++a)
#define REP1(i,n) for(int i=1;i<=(n);++i)
#define debug(x) cerr<<#x<<": "<<x<<'\n'
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair
#define INF (1<<29)
using namespace std;
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};

template<class T=int>
T in(){T x;cin>>x;return (x);}
template<class T>
void print(T& x){cout<<x<<'\n';}

const int MOD =(int)1e9+7;
const int MAX =510000;
ll fac[MAX],finv[MAX],inv[MAX];
void COMint(){
    fac[0]=fac[1]=1;
    finv[0]=finv[1]=1;
    inv[1]=1;
    for(int i=2;i<MAX;i++){
        fac[i]=fac[i-1]*i%MOD;
        inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
        finv[i]=finv[i-1]*inv[i]%MOD;
    }
}
ll COM(int n,int k){
    if(n<k) return 0;
    if(n<0||k<0)return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}
ll gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    ll g;g=gcd(a,b);
    return a*b/g;
}
bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

bool compare_by_a(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
    }else{
        return a.second < b.second;
    }
}

vector<int>vec[8];
bool visited[8];
int dfs(int now,bool){

}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N=in();
    int now;now=1000000000;
    int a;
    int cnt;cnt=-1;
    int ans;ans=0;
    REP(i,N){
        cin>>a;
        if(a<=now){
            cnt++;
        }else{
            ans=max(ans,cnt);
            cnt=0;
        }
        now=a;
    }
    ans=max(ans,cnt);
    print(ans);
    return 0;
}

Measured memory_bytes: 256
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
#import numpy as np
INF = float("inf")
#d = defaultdict(int)
#d = defaultdict(list)
N = int(input())
A = list(map(int,input().split()))
A.sort()
if N == 1:
    print(1)
else:
    is_prime = [True]*(10**6+1)
    is_prime[0] = False
    old = -1
    for i in range(N):
        a = A[i]
        if old == a:
            is_prime[a] = False
            continue
        if not is_prime[a]:
            old = a
            continue
        else:
            old = a
            if a*2 <= 10**6:
                for j in range(a*2,10**6+1,a):
                    is_prime[j] = False
                
    ans = 0
    for i in range(N):
        a = A[i]
        if is_prime[a] == True:
            ans += 1
    print(ans)

Measured memory_bytes: 133820
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define dunk(a) cout << (a) << "\n"
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int inf = 1001001001;
const int mod = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	int ans = min(b, d) - max(a, c);
	dunk(max(ans, 0));
	return 0;
}


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

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

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

  int n;
  cin >> n;
  vector<int> seq(n);
  rep(i, n) { cin >> seq.at(i); }

  vector<int> sorted = seq;
  sort(seq.begin(), seq.end());

  int cnt_diff = 0;
  rep(i, n) {
    if (sorted.at(i) != seq.at(i)) {
      cnt_diff++;
    }
  }

  if (cnt_diff <= 2) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
  string s;
  while(cin >> s){
    while(s.find("@")!=-1){
      int x=s.find("@");
      string buf;
      for(int i=0;i<s[x+1]-'0';i++) buf+=s[x+2];
      s.replace(x,3,buf);
    }
    cout << s << endl;
  }
}


Measured memory_bytes: 3108
#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <stdio.h>
#include <cmath>
#include <math.h>
#include <sstream>
#include <iomanip>
#include <time.h>
#include <fstream>
#include <map>

using namespace std;

#define pb push_back;

typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long long ll;

int main(){
	int n;
	cin>>n;
	vi a(n);
	int minim = 1e6 + 1;
	int min_idx;
	int maxim = -(1e6 + 1);
	int max_idx;

	for(int i = 0; i < n; i++){
		cin>>a[i];
		if (a[i] > maxim){
			maxim = a[i];
			max_idx = i;
		}
		if (a[i] < minim){
			minim = a[i];
			min_idx = i;
		}
	}
	if (abs(a[min_idx]) <= abs(a[max_idx])){
		cout<<2*n - 1<<endl;
		for(int i = 1 ; i <= n; i++){
			cout<<max_idx + 1<<" "<<i<<endl;
		}
		for(int i = 1; i <= n -1; i++){
			cout<<i<<" "<<i + 1<<endl;
		}
		return 0;
	}
	
	cout<<2*n - 1<<endl;
	for(int i = 1 ; i <= n; i++){
		cout<<min_idx + 1<<" "<<i<<endl;
	}
	for(int i = n ; i >= 2; i--){
		cout<<i<<" "<<i - 1<<endl;
	}
	return 0;
}


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

using ll = long long;

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

    ll k,a,b;cin>>k>>a>>b;

    ll ans=1;

    if(a>=b-1)ans=k+1;
    else for(int i=0;i<k;)
    {
        if(ans<a||i>=k-1)
        {
            ans++;
            i++;
        }
        else
        {
            ans+=b-a;
            i+=2;
        }
    }

    cout<<ans<<"\n";

    return 0;
}


Measured memory_bytes: 3616
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <ctime>
#include <complex>

using namespace std;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define RFOR(i,b,a) for (int i = (b)-1; i >= (a); i--)
#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a,value) memset(a, value, sizeof(a))

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef unsigned long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL) INF;

const double EPS = 1e-8;
const int MAX = 2 * 1000 * 100 + 10;

const int MOD = 998244353;

map<VI, int> DP;

int F(VI x)
{
    if (DP.count(x))return DP[x];
    if (SZ(x) == 0)return DP[x] = 1;
    
    int ans = 0;
    
    FOR(i, 1, SZ(x))
        FOR(j, 2, SZ(x) + 1)
        {
            int len = i * j;
            if (len > SZ(x))continue;
            VI y(i, 1);
            FOR(k, 0, len)
            {
                int idx = i - k % i - 1;
                y[idx] &= x[SZ(x) - 1 - k];
            }
            VI xx = x;
            xx.resize(SZ(x) - len);
            ans = (ans + F(xx) * 1LL * F(y)) % MOD;
        }
    
    int val = x.back();
    VI xx = x;
    xx.pop_back();
    int res = F(xx);
    if (val)res += res;
    if (res >= MOD)res -= MOD;
    ans += res;
    if (ans >= MOD)ans -= MOD;
    
    return DP[x] = ans;
}


int main()
{
    string s;
    cin >> s;
    VI x;
    FOR(i, 0, SZ(s))
        x.PB(s[i] - '0');
    cout << F(x) << endl;
    
    return 0;
}


Measured memory_bytes: 7552
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication12
{

    //ONLINE JUDGE (ITP1_8_B)


    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string str = Console.ReadLine();

                if (str == "0")
                {
                    break;
                }

                int[] Array = new int[str.Length];
                int sum = 0;

                for (int i = 0; i < str.Length; ++i)
                {
                    Array[i] = int.Parse(str[i].ToString());
                    sum += Array[i];
                }
                Console.WriteLine(sum);


            }
        }
    }
}

Measured memory_bytes: 5668
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

using namespace std;

struct Coord{
  int x1,y1,x2,y2;
  Coord(){}
  Coord(int x1,int y1,int x2,int y2):x1(x1),y1(y1),x2(x2),y2(y2){}
};

typedef pair<int,int>P;

int W,H,N;
vector<int>X,Y;
int unzipX[1024], unzipY[1024];
map<int,int>zipX,zipY;
int g[2048][2048];
int dy[]={-1,0,1,0},dx[]={0,-1,0,1};

int compressX(vector<int> &x){
  sort(x.begin(), x.end());
  x.erase(unique(x.begin(), x.end()), x.end());
  for(int i=0;i<x.size();i++){
    unzipX[i] = x[i];
    zipX[x[i]] = i;
  }
  return x.size();
}
int compressY(vector<int> &y){
  sort(y.begin(), y.end());
  y.erase(unique(y.begin(), y.end()), y.end());
  for(int i=0;i<y.size();i++){
    unzipY[i] = y[i];
    zipY[y[i]] = i;
  }
  return y.size();
}

void bfs(int y, int x){
  queue<P>q;
  q.push(P(y,x));
  g[y][x] = -1;

  while(!q.empty()){
    P p = q.front(); q.pop();
    for(int d=0;d<4;d++){
      int ny=p.first+dy[d], nx=p.second+dx[d];
      if(ny<0||ny>=H||nx<0||nx>=W||g[ny][nx]==-1) continue;
      q.push(P(ny,nx));
      g[ny][nx] = -1;
    }
  }
}

int main(){
  while(scanf("%d%d", &W,&H) && W||H){
    memset(g, 0, sizeof g);
    scanf("%d", &N);
    Coord crd[1024];
    zipX.clear();
    zipY.clear();
    X.clear(); X.push_back(0); X.push_back(W);
    Y.clear(); Y.push_back(0); Y.push_back(H);

    for(int i=0;i<N;i++){
      scanf("%d%d%d%d",&crd[i].x1,&crd[i].y1,&crd[i].x2,&crd[i].y2);
      X.push_back(crd[i].x1); X.push_back(crd[i].x2); 
      Y.push_back(crd[i].y1); Y.push_back(crd[i].y2);
    }

    W = compressX(X)-1;
    H = compressY(Y)-1;
    //    for(int i=0;i<W;i++) printf("%d ", X[i]); puts("");
    //    for(int i=0;i<H;i++) printf("%d ", Y[i]); puts("");    
    //    printf("%d %d\n", H, W);
    for(int k=0;k<N;k++){
      for(int i=zipY[crd[k].y1];i<zipY[crd[k].y2];i++)
	for(int j=zipX[crd[k].x1];j<zipX[crd[k].x2];j++)
	  g[i][j] = -1;
    }

    /*    for(int i=0;i<H;i++){
      for(int j=0;j<W;j++) printf("%c", g[i][j]==-1?'x':'o'); puts("");
      }*/
    int res = 0;
    for(int i=0;i<H;i++) for(int j=0;j<W;j++){
	if(g[i][j] == -1) continue;
	res++;
	bfs(i, j);
      }

    printf("%d\n", res);
  }
  return 0;
}

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

#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define ll long long
#define ldb long double 
#define db double
#define str string

#define fr first
#define se second
#define lb lower_bound 
#define ub upper_bound 
#define pb push_back
#define mpr make_pair

#define pi pair<int,int>
#define pll pair<ll,ll>
#define pdb pair<db,db>
#define pldb pair<ldb,ldb>

#define vi vector<int>
#define vll vector<ll>
#define vdb vector<db>
#define vldb vector<ldb>
#define vpi vector< pi >
#define vpll vector< pll >

#define mi map<int,int>
#define mll map<ll,ll>
#define mdb map<db,db>
#define mldb map<ldb,ldb>


#define forr(a,b) for (int i = (a); i < (b); ++i)
#define rrof(a,b) for (int i = (b)-1; i >= (a); --i)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)

const int md = 1e9+7;
const int MX = 2e5+5;
const ll INF = 1e18; 
const ldb PI = 4*atan((ldb)1);

ll power(ll a,ll n)
{
 ll res=1;
 while(n)
{
 if(n%2)
  res*=a;
  a*=a;
  n/=2;
}
return res;
}

ll abst(ll a)
{
 return ((a<0)?(-1*a):(a));
}

int main()
{
  int x,y,z;
  cin>>x>>y>>z;
  if((x==y&&x!=z)||(x==z&&x!=y)||(y==z&&y!=x))
   cout<<"Yes\n";
   else
    cout<<"No\n";
    return 0;
}

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

typedef long long ll;
typedef double ld;

#define pb push_back 
#define pop pop_back
#define mp make_pair
#define vii vector < ll > 
#define pii pair< ll, ll > 
#define len length 
#define fi first
#define se second
#define dt cout<<"HEre\n";
#define sz size
const ll inf=1e18+1e17;
const ll mod = 1e9+7;


ll modInverse(ll a,ll m){ll m0=m;ll y=0,x=1;if(m == 1)return 0;while(a> 1){ll q=a/m;ll t=m;m=a%m,a=t;t=y;y=x-q*y;x=t;}if(x<0)x+=m0;return x;}  
ll powm(ll a,ll b){a=a%mod;ll res=1;while(b){if(b&1)res=(res*a)%mod;a=(a*a)%mod;b>>=1;}return (res%mod);}
const ll N = ( 1<<18);
void solve() {
	ll n, d;
	cin>>n>>d;
	d=d*d;
	int ans=0;
	for ( int i=0;i<n;i++){
		ll x, y;
		cin>>x>>y;
		if ( x*x +y*y<=d)
			ans++;
	}
	cout<<ans<<'\n';

}


int main(){
	ios_base::sync_with_stdio(false);
	cin.tie( NULL);
	cout.tie(NULL);
	#ifndef ONLINE_JUDGE
		freopen ("INPUT.txt" , "r" , stdin);
		freopen ("OUTPUT.txt", "w" , stdout);
	#endif
	ll t=1;
//	cin>>t;
	for ( ll i=1;i<=t;i++){
	//	cout<<"Case #"<<i<<": ";
    	solve();
    }
    //	cout << clock() / double(CLOCKS_PER_SEC) << endl;
}

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

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
//template <typename T, typename S>ostream &operator<<(ostream &os, pair<T, S> &p) {os << p.first << " " << p.second;return os;}

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T, class U>bool chmin(T& a, U b) { if (a > b) { a = b; return true; }return false; }
template <class T, class U>bool chmax(T& a, U b) { if (a < b) { a = b; return true; }return false; }

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

	int t1, t2; cin >> t1 >> t2;
	int a1, a2; cin >> a1 >> a2;
	int b1, b2; cin >> b1 >> b2;

	int c1 = (a1 - b1)*t1;
	int c2 = (a2 - b2)*t2;
	if (c1 < 0) {
		c1 *= -1;
		c2 *= -1;
	}
	int d = c1 + c2;
	dump(d);
	if (d > 0) {
		cout << 0 << endl;
		return 0;
	}
	else if (d == 0) {
		cout << "infinity" << endl;
		return 0;
	}

	d *= -1;
	int ans = (c1) / d + 1;
	ans *= 2;
	ans--;
	if (c1%d == 0)ans--;
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
using namespace std;
typedef long long ll;

int N;

int main(){
    cin>>N;

    int ans;
    if(N%2==0){
        ans=N;
    }else{
        ans=2*N;
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main()
{
	int k,i,c,len,a1;
	char s[101],a[101];
	scanf("%d %s",&k,s);
	len=strlen(s);
	c=0;
	for(i=0;i<len;i++){
		c++;
	}
	a1=0;
	a1=c-k;
	c=c-a1;
	if(a1>0){
		for(i=0;i<c;i++){
			a[i]=s[i];
		}
		a[c]='\0';
		printf("%s",a);
		printf("...\n");
	}
	else	printf("%s\n",s);
	return 0;
}

Measured memory_bytes: 1708
#include <bits/stdc++.h>
using namespace std;
 
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define REPS(c, s) for (char c : s)
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REV(c) reverse(ALL(c))
#define sz(v) (int)v.size()
#define endl '\n'
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
template<class T> inline void prn(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << ' ';}
template<class T> inline void printv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << (i == n - 1 ? endl : ' ');}
template<class T> inline void printvv(vector<vector<T>>& v) {for (auto u : v) printv(u);}
template<class T> inline void printlnv(vector<T>& v) {int n = sz(v); REP(i, n) cout << v[i] << endl;}
const int MOD = 1000000007;
const int INF = 1000000001;
const ll LINF = 1000000001000000001LL;
 
void solve();
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(numeric_limits<double>::max_digits10);
    solve();
    return 0;
}

void solve() {
    int n;
    cin >> n;
    vl a(n);
    vl b(n);
    REP(i, n) cin >> a[i] >> b[i];
    ll ans = 0;
    REPR(i, n) ans += (b[i] - ((a[i] + ans) % b[i])) % b[i];
    cout << ans << endl;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define double long double
#define int long long
#define mi map<int,int>
#define pii pair<int,int>
#define low lower_bound
#define upp upper_bound
#define mod 1000000007 //10^9+7
#define inf (int)50000000000000000 //5･10^16
#define rep(i,n) for(int i=0;i<n;i++)
#define all(vec) vec.begin(),vec.end()
#define vsort(vec) sort(all(vec))
#define vrever(vec) reverse(all(vec));
#define vunsort(vec) vsort(vec); vrever(vec);
#define bisea binary_search
#define cend cout<<endl;
#define F first
#define S second
using namespace std;
int n,cnt=0;
int a[114514],b[114514],c[114514];
signed main() {
  cin>>n;
  rep(i,n) cin>>a[i];
  rep(i,n) cin>>b[i];
  rep(i,n) cin>>c[i];
  sort(a,a+n);
  sort(b,b+n);
  sort(c,c+n);
  rep(i,n) {
    cnt+=(low(a,a+n,b[i])-a)*(n-(upp(c,c+n,b[i])-c));
  }
  cout<<cnt<<endl;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define lli long long
#define mp make_pair
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define allr(v) (v).rbegin(), (v).rend()
#define ok return 0;
#define MOAE                 \
    ios::sync_with_stdio(0); \
    cin.tie(0);              \
    cout.tie(0);

int main()
{
    MOAE;
    string s, t;
    cin >> s >> t;
    for (int i = 0; i < s.size(); i++)
    {
        if (s[i] != t[i])
        {
            cout << "No\n";
            ok;
        }
    }
    cout << "Yes" << endl;
}

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

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
float d,t,s; cin >>d>>t>>s;
	if (float(d / t) <= float(s)) {		
		cout << "Yes";
	}
	else {
		cout << "No";
	}	
	return 0;
}

Measured memory_bytes: 3748
import math
import itertools

N,M,Q = map(int,input().split())
a =[0] * Q
b =[0] * Q
c =[0] * Q
d =[0] * Q
for i in range(Q):
    a[i] , b[i] , c[i] , d[i] = map(int,input().split())




Al =[0] * M
for i in range(M):
    Al[i] = i+1


#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
#Nの値が小さそうなので全検索でもいけるかもしれへん。
All = list(itertools.combinations_with_replacement(Al, N))


#M個のうちからN個取り出す順列
ans = 0
#for A in itertools.combinations(All, N):
for A in All:
    #点数計算
    #print(A)
    wa = 0
    for i in range(Q):
        #print(wa) 
        kari = A[b[i]-1] - A[a[i]-1]
        if kari == c[i]:
            wa = wa + d[i] 
    if ans < wa:
        ans = wa
    #print(ans) 
    #print(wa) 


print(ans)



























Measured memory_bytes: 21604
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

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

	@SuppressWarnings("unchecked")
	void solver() {
		Scanner sc = new Scanner(System.in);
		int V = sc.nextInt();
		int E = sc.nextInt();
		ArrayList<Edge>[] g = new ArrayList[V];
		for (int i = 0; i < V; i++)
			g[i] = new ArrayList<>();
		for (int i = 0; i < E; i++) {
			int v = sc.nextInt();
			int u = sc.nextInt();
			int c = sc.nextInt();
			g[v].add(new Edge(v, u, c));
		}
		Edmonds_Kerp_MaxFlow mf = new Edmonds_Kerp_MaxFlow(0, V - 1, g);
		System.out.println(mf.MaxFlow());
	}

	class Edmonds_Kerp_MaxFlow {
		int n;
		int s;
		int t;
		ArrayList<Edge>[] g;
		int[][] flow;
		int[][] capacity;

		@SuppressWarnings("unchecked")
		public Edmonds_Kerp_MaxFlow(int s, int t, ArrayList<Edge>[] g) {
			this.g = g;
			this.s = s;
			this.t = t;
			n = g.length;
			flow = new int[n][n];
			capacity = new int[n][n];

			for (int i = 0; i < n; i++) {
				for (Edge e : g[i]) {
					if (e.weight > 0) {
						g[e.dst].add(new Edge(e.dst, e.src, 0));
						capacity[e.src][e.dst] += e.weight;
					} else if (e.weight == 0) {
						continue;
					}
				}
			}
		}

		@SuppressWarnings("unchecked")
		int MaxFlow() {
			int total = 0;
			while (true) {
				int[] prev = bfs();
				if (prev[t] == -1)
					return total;
				int inc = 1 << 30;
				for (int i = t; prev[i] != -1; i = prev[i]) {
					inc = Math.min(inc, residue(prev[i], i));
				}
				for (int i = t; prev[i] != -1; i = prev[i]) {
					push(prev[i], i, inc);
				}
				total += inc;
			}
		}

		int residue(int s, int t) {
			return capacity[s][t] - flow[s][t];
		}

		int[] bfs() {
			int[] prev = new int[n];
			Arrays.fill(prev, -1);
			ArrayDeque<Integer> que = new ArrayDeque<>();
			que.add(s);
			out: while (!que.isEmpty()) {
				int v = que.poll();
				for (Edge e : g[v]) {
					if (prev[e.dst] == -1 && e.dst != s && residue(v, e.dst) > 0) {
						prev[e.dst] = v;
						que.add(e.dst);
						if (e.dst == t)
							break out;
					}
				}
			}
			return prev;
		}

		void push(int s, int t, int inc) {
			flow[s][t] += inc;
			flow[t][s] -= inc;
		}
	}

	class Edge {
		int src;
		int dst;
		int weight;

		Edge(int src, int dst, int weight) {
			this.src = src;
			this.dst = dst;
			this.weight = weight;
		}
	}

	void tr(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
}

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

using namespace std;

int main() {
	int N, Y;
	scanf("%d%d", &N, &Y);
	for(int i = 0; i <= N; i++) {
		for(int j = 0; j <= N; j++) {
			int k = N - i - j;
			if(k < 0) continue;
			if(i * 10000 + j * 5000 + k * 1000 == Y) {
				printf("%d %d %d\n", i, j, k);
				return 0;
			}
		}
	}
	printf("-1 -1 -1\n");
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#define all(x) (x).begin() (x).end()
#define rall(x) (x).rbegin() (x).rend()
typedef long long ll;

int main(){
	char a; 
	cin>>a;
		if(isupper(a))cout<<"A"<<endl;
		else cout<<"a"<<endl;
	
}


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

int n, m;
vector<int> check;
vector<vector<int>> g;
int solve(int k, int cnt){
  int res = cnt;
  if(check.at(k)) return 0;
  check.at(k) = 1;
  
  for(auto next : g.at(k)) res = max(res, solve(next, res+1));
  
  return res;
}

int main() {
  cin >> n >> m;
  check.resize(n, 0);
  g.resize(n);
  for(int i = 0; i < n; i++) g.at(i) = {};
  for(int i = 0; i < m; i++){
    int a, b;
    cin >> a >> b;
    a--, b--;
    g.at(a).push_back(b);
    g.at(b).push_back(a);
  }
  
  int ans = 0;
  for(int i = 0; i < n; i++){
    ans = max(ans, solve(i, 1));
  }
  
  cout << ans << endl;
}


Measured memory_bytes: 21176
#include <iostream>
#include <map>
#include <string>
#define rep(i, n) for(int i=0;i<(n);i++)
using namespace std;

int main() {
  int H, W, K;
  cin >> H >> W >> K;
  char C[10][10];
  rep(i, H) {
    rep(j, W) {
      cin >> C[i][j];
    }
  }
  
  int ans = 0;
  for (int i = 0; i < 1 << H; i++) {
    for (int j = 0; j < 1 << W; j++) {
      int cnt = 0; // 黒いマスの数
      rep(k, H) {
        rep(l, W) {
          // (k, l)を判定
          if (i >> k & 1 && j >> l & 1 && C[k][l] == '#') {
            cnt++;
          } 
        }
      }
      if (cnt == K) ans++;
    }
  }
  
  cout << ans;
}



Measured memory_bytes: 3616
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

using namespace std;

typedef long long ll;

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

vector<ll> ps;
vector<ll> qs;
vector<ll> rs;

vector<ll> all;

int main(void) {
    ll X, Y, A, B, C;
    cin >> X >> Y >> A >> B >> C;

    ps.resize(A);
    for (int i = 0; i < A; i++) {
        cin >> ps[i];
    }

    qs.resize(B);
    for (int i = 0; i < B; i++) {
        cin >> qs[i];
    }

    rs.resize(C);
    for (int i = 0; i < C; i++) {
        cin >> rs[i];
    }

    sort(ps.begin(), ps.end());
    reverse(ps.begin(), ps.end());
    sort(qs.begin(), qs.end());
    reverse(qs.begin(), qs.end());

    for (int i = 0; i < min(A, X); i++) {
        all.push_back(ps[i]);
    }

    for (int i = 0; i < min(B, Y); i++) {
        all.push_back(qs[i]);
    }
    for (int i = 0; i < C; i++) {
        all.push_back(rs[i]);
    }

    sort(all.begin(), all.end());
    reverse(all.begin(), all.end());

    ll ans = 0;
    for (int i = 0; i < X + Y; i++) {
        ans += all[i];
    }

    cout << ans << endl;

    return 0;
}


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

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()

#define SI(n) scanf("%d",&n)
#define PI(n) printf("%d\n",n)
#define SL(n) scanf("%lld",&n)
#define PL(n) printf("%lld\n",n)
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)

#define TRACE
#ifdef TRACE
#define TR(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define TR(...)
#endif
//FILE *fin = freopen("in","r",stdin);
//FILE *fout = freopen("out","w",stdout);
typedef long long int 	LL;
typedef long double 	LD;
typedef pair<int,int>   II;
typedef vector<int>     VI;
const int MOD = 1e9 + 7;
const int N = 100011;
const int M = 31;
int ROOT, sz, n, k;                      
int A[N], B[N];

int main() {
    SI(n), SI(k);
    for(int i = 0; i < n; ++i) {
        int u, v;
        SI(u), SI(v);
        A[i] = u, B[i] = v;
    }
    LL ans = 0;
    LL temp = 0;
    for(int j = 0; j < n; ++j) {
        if((A[j] | k) == k) temp += B[j];
    }
    ans = max(ans, temp);
    
    for(int i = 30; i >= 0; --i) {
        if((k>>i) & 1) {
            int tk = k;
            tk >>= (i + 1);
            tk <<= (i + 1);
            int t = tk | ((1<<(i))-1);
            temp = 0;
            for(int j = 0; j < n; ++j) {
                if((A[j] | t) == t) temp += B[j];
            }
            ans = max(ans, temp);
        }
    }
    PL(ans);
    return 0;
}

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

using namespace std;

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

using _loop_int = int;
#define REP(i,n) for(_loop_int i=0; i<(_loop_int)(n); i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a); i<(_loop_int)(b); i++)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1; i>=(_loop_int)(a); i--)

#define CHMIN(a,b) (a)=min((a),(b))
#define CHMAX(a,b) (a)=max((a),(b))
#define ALL(v) (v).begin(),(v).end()

#define DEBUG(x) cerr<<#x<<": "<<(x)<<endl
#define DEBUG_VEC(v) cerr<<#v<<": ";REP(__i,(v).size())cerr<<((v)[__i])<<", ";cerr<<endl

const ll MOD = 1000000007ll;

int n;
int a[1252][1252];
int enemy[1252];
int head[1252];

int main(){
    scanf("%d",&n);
    REP(i,n)REP(j,n-1)scanf("%d",&a[i][j]),a[i][j]--;
    int ans = 0;
    while(true){
        ans++;
        REP(i,n)if(head[i]!=n-1){
            enemy[i] = a[i][head[i]];
        }
        bool upd = false;
        REP(i,n)if(head[i]!=n-1 && enemy[enemy[i]]==i){
            head[i]++;
            upd = true;
        }
        if(!upd){
            puts("-1");
            return 0;
        }
        if(count(head,head+n,n-1)==n){
            break;
        }
    }
    printf("%d\n",ans);
    return 0;
}


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

using namespace std;

int hoge(int hoge)
{

    int ans = 0;

    while ( hoge > 0 ) {
        ans += hoge % 10;
        hoge /= 10;
    }

    return ans;
}

int main()
{

    long long N, A, B, pans;
    cin >> N;

    pans = 1LL<<60;

    for ( long long i = 1; i < N; i++ ) {

        int j = N - i;
        long long ans = hoge(i) + hoge(j);

        pans = min(pans, ans);
    }

    cout << pans << endl;

    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<string>

using namespace std;

int main()
{
	int a, b;
	int sol;

	scanf("%d %d", &a, &b);

	if (a >= 13)
	{
		sol = b;
	}

	else if (a >= 6)
	{
		sol = b / 2;
	}

	else
	{
		sol = 0;
	}

	printf("%d\n", sol);

	return 0;
}

Measured memory_bytes: 128
def e_handshake():
    import numpy as np
    N, M = [int(i) for i in input().split()]
    A = np.array(input().split(), np.int64)
    A.sort()

    def shake_cnt(x):
        # 幸福度が x 以上となるような握手を全て行うときの握手の回数
        # 全体から行わない握手回数を引く
        return N**2 - np.searchsorted(A, x - A).sum()

    # 幸福度の上昇が right 以上となるような握手はすべて行い、
    # left となるような握手はいくつか行って握手回数が M 回になるようにする
    left = 0
    right = 10 ** 6
    while right - left > 1:
        mid = (left + right) // 2
        if shake_cnt(mid) >= M:
            left = mid
        else:
            right = mid

    # 幸福度が right 以上上がるような握手をすべて行ったとして、回数と総和を計算
    X = np.searchsorted(A, right - A)  # 行わない人数
    Acum = np.zeros(N + 1, np.int64)  # 累積和で管理する
    Acum[1:] = np.cumsum(A)
    happiness = (Acum[-1] - Acum[X]).sum() + (A * (N - X)).sum()

    # 幸福度が right 未満の上昇となる握手を、握手回数が M になるまで追加で行う
    shake = N * N - X.sum()
    happiness += (M - shake) * left
    return happiness

print(e_handshake())

Measured memory_bytes: 24200
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(10)

using namespace std;

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

    int L;
    cin >> L;

    vector<int> two;
    int t = 1;
    REP(i, 30) {
        two.push_back(t);
        t *= 2;
    }

    int n = 0;
    int bnum = 0;
    int tmp = L;
    while (tmp > 0) {
        if ((tmp & 1) == 1) bnum++;
        tmp /= 2;
        n++;
    }

    int m = (n - 1) * 2 + bnum-1;

    cout << n << " " << m << endl;

    FOR(i, 1, n - 1) {
        cout << i << " " << i + 1 << " " << 0 << endl;
    }

    FOR(i, 1, n - 1) {
        cout << i << " " << i + 1 << " " << two[n - 2 - (i - 1)] << endl;
    }

    tmp = L;
    int mask = 0;
    int cnt = 0;
    while (tmp > 0 && cnt < n-1)
    {
        if ((tmp & 1) == 1) {
            mask = mask | (1 << cnt);
            int c = L - mask;
            cout << 1 << " " << n - cnt << " " << c << endl;
        }
        tmp /= 2;
        cnt++;
    }

    return 0;
}


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

int main(){
  int n;
  cin >> n;
  vector<int>a(n);
  rep(i,n) cin >> a[i];
  int mn =1001001;
  int count = 0;
  rep(i,n){
    if( mn > a[i] ){
      count++;
      mn = min(mn, a[i]);
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 1024
import bisect
n = int(input())
a = [int(input()) for _ in range(n)]
l = [0]*n

li = 0
l[0] = a[0]
for i in range(1, n):
    if a[i] > l[li]:
        li += 1
        l[li] = a[i]
    else:
        j = bisect.bisect_left(l[:li], a[i])
        l[j] = a[i]
print(li+1)



Measured memory_bytes: 10992
import java.util.*;
import java.lang.*;

class Main{
  public static void main(String args[]){
    Scanner sc = new Scanner(System.in);
    int x = sc.nextInt();
    int MAX_ROOT = (int)Math.sqrt(x);
    double e = 1;
    double max = e;
    for(int i = 2;i <= MAX_ROOT;i++){
      for(int j = 1;j <= 9;j++){
        e = Math.pow(i,j);
        if(e > x) break;
        if(max < e){
          max = e;
        }
      }
    }
    int emax = (int)max;
    System.out.println(emax);
  }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(long long i = 0;i < n;i++)
#define repr(i, n) for(int i = n;i >= 0;i--)
#define For(i, s, e) for(int i = s;i <= e;i++)
#define Sort(v, n) sort(v, v+n);
#define VSort(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define cY cout<<"Yes";
#define cN cout<<"No";
#define cA(a) cout<<a;
const ll MOD = 1000000007;


int main() {
    int n;
    cin >> n;
    int a[n+1];
    rep(i,n+1) {
        a[i] = 0;
    }
    rep(i,n-1) {
        int tmp;
        cin>>tmp;
        a[tmp]++;
    }
    For(i,1,n) {
        cout << a[i] << endl;
    }

}

Measured memory_bytes: 4376
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Kishan Sairam Adapa
 */

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#define ll long long int
#define MOD ((int)(1e9) + 7)

using namespace std;

class BComparison {
public:
    void solve(istream& cin, ostream& cout) {
        string a, b;
        cin >> a >> b;
        if(a.length() == b.length()) {
            int res = a.compare(b);
            if (res == 0) cout << "EQUAL\n";
            else if (res < 0) cout << "LESS\n";
            else cout << "GREATER\n";
        } else if(a.length() < b.length()) cout << "LESS\n";
        else cout << "GREATER\n";
    }
};


int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    BComparison solver;
    std::istream& in(std::cin);
    std::ostream& out(std::cout);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 256
let rec gcd n m =
  if m = 0 then n
  else gcd m (n mod m)

let () = Scanf.scanf "%d" @@ fun k ->
  Printf.printf "%d\n" @@
  Array.fold_left (Array.fold_left (Array.fold_left ( + ))) 0 @@
  Array.init k @@ fun a ->
    Array.init k @@ fun b ->
      Array.init k @@ fun c ->
        gcd (a + 1) (gcd (b + 1) (c + 1))

Measured memory_bytes: 68480
#include<iostream>
#include<algorithm>
#include <vector>

using namespace std;
int main()
{
  vector <int>a,b;
  int x;
  for(int i=0;i<10;i++)
    {
    cin>>x;
    a.push_back(x);
    }
  for(int i=0;i<10;i++)
    {
    cin>>x;
    b.push_back(x);
    }
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  cout<<a[9]+a[8]+a[7]<<" "<<b[9]+b[8]+b[7]<<endl;
}

Measured memory_bytes: 1220
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <tuple>
#include <cassert>
#include <functional>
#include <set>
#include <deque>
using namespace std;
typedef long long ll;
int dx[4] = {0,0,1,-1};
int dy[4] = {1,-1,0,0};
const int INF = 1<<29;
#define LNF __LONG_LONG_MAX__
const ll MOD = 1000000007;
const int MAX = 200000;

long long fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
// 法mでのaの逆元を計算
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
//最大公約数
int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }
//最小公倍数
int lcm(int x, int y) { return x / gcd(x, y) * y; }
// nが大きく,kが10^7程度の時の二項係数
long long com[200005];
void combination(long long n,long long k){
    com[0] = 1;
    for(int i=1;i<=k;i++){
        com[i] = (com[i-1]*(n-i+1)%MOD)*modinv(i,MOD)%MOD;
    }
}

int main(){
    ll A,B,N; cin >> A >> B >> N;
    ll out=0;
    if(N<B){
        cout << (ll)(1.0*A*N/B) - (ll)(N/B) << endl;
    }else{
        cout << (ll)(1.0*A*(B-1)/B) - (ll)((B-1)/B) << endl;
    }
    return 0;
}


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

#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define INF  (1<<30)
#define INFL (1LL<<60)
#define MOD 1000000007
#define EPS ((ld)(1e-9))

#define sz(x) ((int)(x).size())
#define setz(x) memset(x, 0, sizeof(x))
#define rep(i, x)  for (int i = 0, _##i = (x); i < _##i; i++)
#define repp(i, x) for (int i = 1, _##i = (x); i <= _##i; i++)
#define repr(i, s, e) for (int i = (s), _##i = (e); i < _##i; i++)
#define repi(i, x) for (auto &i : (x))

#ifndef __SOULTCH
#define endl '\n'
#define debug(...) 
#else
#define __debug_a(v) cout << " [+] " << #v << " = " << (v) << endl
#define __debug_b(v) cout << "     " << #v << " = " << (v) << endl
#define debug1(v1) __debug_a(v1);
#define debug2(v1, v2) __debug_a(v1), __debug_b(v2);
#define debug3(v1, v2, v3) __debug_a(v1), __debug_b(v2), __debug_b(v3);
#define GET_MACRO(_1,_2,_3,NAME,...) NAME
#define debug(...) GET_MACRO(__VA_ARGS__, debug3, debug2, debug1)(__VA_ARGS__)
#endif

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ld, ld> pdd;
typedef pair<ll, ll> pll;

template<typename T, typename V>
ostream &operator<<(ostream &os, const pair<T, V> pai) { 
    return os << pai.first << ' ' << pai.second;
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> v) {
    rep(i, sz(v)) cout << v[i] << ' ';
    return os;
}

template<typename T>
ostream &operator<<(ostream &os, const set<T> s) {
    for (T p : s) cout << p << ' ';
    return os;
}

template<typename T, typename V>
ostream &operator<<(ostream &os, const map<T, V> s) {
    for (auto p : s) cout << '(' << p << ") ";
    return os;
}

template<typename T, typename V>
istream &operator>>(istream &is, pair<T, V> &pai) {
	is >> pai.first >> pai.second;
	return is;
}

template<typename T> void umax(T &a, T b) {a = max(a, b);}
template<typename T> void umin(T &a, T b) {a = min(a, b);}


int main(void) {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    int R, G, B, N; cin >> R >> G >> B >> N;

    int res = 0;
    rep(i, N/R+1) rep(j, (N-i*R)/G+1) {
        if ((N-i*R-j*G) >= 0 and (N-i*R-j*G)%B == 0) res++;
    }
    cout << res;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
const double EPS = 1e-9;
#define INF (1LL<<60)
#define D double
#define fs first
#define sc second
#define int long long
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define RFOR(i,a,b) for(int i = (int)(b-1);i>=(int)(a);--i)
#define REP(i,n)  FOR(i,0,(n))
#define RREP(i,n) RFOR(i,0,(n))
#define ITR(itr,mp) for(auto itr = (mp).begin(); itr != (mp).end(); ++itr)
#define RITR(itr,mp) for(auto itr = (mp).rbegin(); itr != (mp).rend(); ++itr)
#define range(i,a,b) ((a)<=(i) && (i)<(b))
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SP << " " <<
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

signed main(){
  ios::sync_with_stdio(false);
  cout.tie(0);
  cout.precision(20);

  int n;
  cin >> n;

  int ans = 0;
  int t = 1;
  int i = 1;
  while(t <= n){
    t++;
    ans++;
    if(t % (int)pow(10, 2 * i - 1) == 0) {
      t *= 10;
      i++;
    }
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
    int a,b,t;
    int ans=0;
    cin>>a>>b>>t;
    for(int i=a;i<=t;i+=a){
        ans+=b;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll zero = 0;
const ll INF = 10000000000000000; //10^16
const ll MOD = 1000000007; //10^9+7
const ll MOD2 = 998244353;

int main(){
    ll a,b,c,k;
    cin >> a>>b>>c>>k;
    if(k <= a){
        printf("%lld\n", k);
    }
    else if(k <= a+b){
        printf("%lld\n", a);
    }
    else{
        printf("%lld\n", a- (k-a-b));
    }
}


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

int main()
{
    int n;
    cin >> n;
    string ans = "";
    while(n > 0){
        ans = ((n % 10 == 9) ? '1' : '9') + ans;
        n /= 10;
    }
    cout << ans;
    return 0;
}

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

using namespace std;
using ll = long long;
using ld = long double;
using Vec = vector<int>;

int main() {
 
 ll  n,d,ct=0;
 cin>>n>>d;
 for(int i=0;i<n;i++){
     ll a,b;
     cin>>a>>b;
     ll x=a*a+b*b;
     if(x<=d*d){
         ct++;
     }
 }
 cout<<ct<<endl;
}

Measured memory_bytes: 3616
//#include<bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define rep(i,n) for(int i = 0; i < n; i++)
int n, A, B, C;
vector<int> l(8);
int dfs(int depth, int a, int b, int c) {
	if (depth == n) {
		if (min(a, min(b, c)) > 0) {
			return abs(a - A) + abs(b - B) + abs(c - C) - 30;
		}
		else {
			return 1e9;
		}
	}
	int ret0 = dfs(depth + 1, a, b, c);
	int ret1 = dfs(depth + 1, a + l[depth], b, c) + 10;
	int ret2 = dfs(depth + 1, a, b + l[depth], c) + 10;
	int ret3 = dfs(depth + 1, a, b, c + l[depth]) + 10;
	return min({ ret0,ret1,ret2,ret3 });
}
int arr[100007];
int main() {
	int n, k; cin >> n >> k;
	for (int i = 0; i < n; i++) {
		cin >> arr[i];
	}
	int cnt = 0;
	sort(arr, arr + n);
	for (int i = 0; i < n; i++) {
		if (arr[i] >= k)
			cnt++;
	}
	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 640