akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdio>
#include<cmath>
#include<vector>
#include<algorithm>

struct P{ double x, y; };
typedef std::pair<P, double> Cir;
typedef std::pair<P, P> Ret;

const double EPS = 1e-15;

Ret cross(Cir a, Cir b){
	Ret ret;
	ret.first.x = -100000;

	double x = a.first.x - b.first.x;
	double y = a.first.y - b.first.y;
	double l = std::sqrt(x*x + y*y);

	if (l > a.second + b.second)return ret;

	double c = std::atan2(b.first.y - a.first.y, b.first.x - a.first.x);
	double alpha = std::acos((l*l + a.second*a.second - b.second*b.second) / (2 * l*a.second));
	
	P r1, r2;
	r1.x = a.first.x + std::cos(c + alpha), r1.y = a.first.y + std::sin(c + alpha);
	r2.x = a.first.x + std::cos(c - alpha), r2.y = a.first.y + std::sin(c - alpha);

	ret.first = r1;
	ret.second = r2;

	return ret;
}

bool check(Cir cir, P p){
	double l = (cir.first.x - p.x)*(cir.first.x - p.x) + (cir.first.y - p.y)*(cir.first.y - p.y);
	l = std::sqrt(l);

	return (l <= cir.second + EPS);
}

int main(){
	int n;

	while (std::cin >> n, n){
		int res = 1;
		Cir data[1001];

		std::vector<P>search;
		for (int i = 0; i < n; i++){
			double x, y, r;
			scanf("%lf,%lf", &data[i].first.x, &data[i].first.y);
			data[i].second = 1.0;
		}

		for (int i = 0; i < n; i++){
			for (int j = i + 1; j < n; j++){
				Ret ret = cross(data[i], data[j]);
				if (ret.first.x != -100000)search.push_back(ret.first), search.push_back(ret.second);
			}
		}

		for (int i = 0; i < search.size(); i++){
			int cnt = 0;
			for (int j = 0; j < n; j++){
				cnt += check(data[j], search[i]);
			}
			res = std::max(res, cnt);
		}

		std::cout << res << std::endl;
	}

	return 0;
}

Measured memory_bytes: 1460
#include <bits/stdc++.h>
using namespace std;
const int INF = 2100100100;

int main() {
    int N;
    int X;
    cin >> N >> X;
    vector<float> donut = vector<float>(N);

    for (int i=0;i<N;i++){
        cin >> donut.at(i);
    }
    float sum = 0;
    float nin = INF;
    for (int i=0;i<N;i++){
        sum+= donut.at(i);
        nin = min (nin , donut.at(i));
    }
    cout << int((X-sum)/nin)+N << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
#define REP(i, a) for (int i = 0; i < (a); i++)
#define REPR(i, a) for (int i = (int)(a) - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define FORR(i, a, b) for (int i = (int)(b) - 1; i >= a; i--)
#define ALL(a) a.begin(), a.end()
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<long long>;
using vvl = vector<vl>;
using vs = vector<string>;
int si() { int x; scanf("%d", &x); return x; }
long long sl() { long long x; scanf("%lld", &x); return x; }
string ss() { string x; cin >> x; return x; }
void pi(int x) { printf("%d ", x); }
void pl(long long x) { printf("%lld ", x); }
void pd(double x) { printf("%.15f ", x); }
void ps(const string &a) { cout << a << ' '; }
void br() { putchar('\n'); }

int main() {
  int N = si();
  vector<pair<int, int>> ans;
  if (N % 2 == 0) {
    for (int i = 1; i <= N; i++) {
      for (int j = i + 1; j <= N; j++) {
        if (i + j != N + 1) {
          ans.push_back({i, j});
        }
      }
    }
  } else {
    for (int i = 1; i <= N; i++) {
      for (int j = i + 1; j <= N; j++) {
        if (i + j != N) {
          ans.push_back({i, j});
        }
      }
    }
  }
  pi(ans.size()); br();
  REP(i, ans.size()) { pi(ans[i].first); pi(ans[i].second); br(); }
}



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

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

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

#define INF 1e16
#define mod 1000000007

int N;
string S;
ll dp[2][3003];

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

  cin>>N>>S;
  int crt=0,nxt=1;
  dp[0][0]=1;
  rep(i,N-1){
    memset(dp[nxt],0,sizeof(dp[nxt]));
    if(S[i]=='<'){
      ll sum=0;
      rep(k,i+2){
        (dp[nxt][k]+=sum)%=mod;
        (sum+=dp[crt][k])%=mod;
      }
    }else{
      ll sum=0;
      for(ll k=i+1;k>=0;k--){
        (sum+=dp[crt][k])%=mod;
        (dp[nxt][k]+=sum)%=mod;
      }
    }
    swap(crt,nxt);
  }
  ll res=0;
  rep(i,N)(res+=dp[crt][i])%=mod;
  cout<<res<<endl;

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

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

        final long A = sc.nextLong();
        final long V = sc.nextLong();
        final long B = sc.nextLong();
        final long W = sc.nextLong();
        final long T = sc.nextLong();

        System.out.println(Math.abs(A-B)<=T*(V-W) ? "YES": "NO");
    }
}


Measured memory_bytes: 35692
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<climits>
#define MOD 1000000007
typedef long long ll;
using namespace std;

int main(){
  int n,k; cin >> n >> k;
  int h[200005];
  for(int i=0;i<n;i++){
    cin >> h[i];
  }
  sort(h,h+n);
  ll ans = 0;
  for(int i=1;i<=n-k;i++) ans += h[i-1];
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1024
from sys import stdin

s = stdin.readline().strip()

points = 0

rocks, papers = 0, 0

for move in s:
    if move == 'g':
        if papers < rocks:
            points += 1
            papers += 1
        else:
            rocks += 1
    else:
        if papers < rocks:
            papers += 1
        else:
            rocks += 1
            points -= 1

print(points)


Measured memory_bytes: 3316
fn read1<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

pub fn readn<T: std::str::FromStr>(delimiter: &str) -> Vec<T> {
    let s = read1::<String>();
    s.split(delimiter).map(|e| e.parse().ok().unwrap()).collect::<Vec<T>>()
}

fn main() {
    let hw = readn::<usize>(" ");
    let h = hw[0];
    let _w = hw[1];

    let mut ans = "".to_string();
    for _ in 0..h {
        let c = read1::<String>();
        ans = ans + &c + "\n" + &c +"\n";
    }
    print!("{}", ans);
}

Measured memory_bytes: 4352
import sys
sys.setrecursionlimit(10**7) #再帰関数の上限,10**5以上の場合python
import math
from copy import copy, deepcopy
from copy import deepcopy as dcp
from operator import itemgetter
from bisect import bisect_left, bisect, bisect_right#2分探索
#bisect_left(l,x), bisect(l,x)#aはソート済みである必要あり。aの中からx未満の要素数を返す。rightだと以下
from collections import deque, defaultdict
#deque(l), pop(), append(x), popleft(), appendleft(x)
#q.rotate(n)で → にn回ローテート
from collections import Counter#文字列を個数カウント辞書に、
#S=Counter(l),S.most_common(x),S.keys(),S.values(),S.items()
from itertools import accumulate,combinations,permutations,product#累積和
#list(accumulate(l))
from heapq import heapify,heappop,heappush
#heapify(q),heappush(q,a),heappop(q) #q=heapify(q)としないこと、返り値はNone
from functools import reduce,lru_cache#pypyでもうごく
#@lru_cache(maxsize = None)#maxsizeは保存するデータ数の最大値、2**nが最も高効率
from decimal import Decimal

def input(): 
    x=sys.stdin.readline()
    return x[:-1] if x[-1]=="\n" else x
def printe(*x):print("## ",*x,file=sys.stderr)
def printl(li): _=print(*li, sep="\n") if li else None
def argsort(s, return_sorted=False): 
    inds=sorted(range(len(s)), key=lambda k: s[k])
    if return_sorted: return inds, [s[i] for i in inds]
    return inds
def alp2num(c,cap=False): return ord(c)-97 if not cap else ord(c)-65
def num2alp(i,cap=False): return chr(i+97) if not cap else chr(i+65)
def matmat(A,B):
    K,N,M=len(B),len(A),len(B[0])
    return [[sum([(A[i][k]*B[k][j]) for k in range(K)]) for j in range(M)] for i in range(N)]
def matvec(M,v):
    N,size=len(v),len(M)
    return [sum([M[i][j]*v[j] for j in range(N)]) for i in range(size)]
def T(M):
    n,m=len(M),len(M[0])
    return [[M[j][i] for j in range(n)] for i in range(m)]
def binr(x): return bin(x)[2:]
def bitcount(x): #xは64bit整数
    x= x - ((x >> 1) & 0x5555555555555555)
    x= (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333)
    x= (x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f 
    x+= (x >> 8); x+= (x >> 16); x+= (x >> 32) 
    return x & 0x7f

def main():
    mod = 1000000007
    #w.sort(key=itemgetter(1),reverse=True)  #二個目の要素で降順並び替え

    #N = int(input())
    N, D = map(int, input().split())
    #A = tuple(map(int, input().split())) #1行ベクトル
    #L = tuple(int(input()) for i in range(N)) #改行ベクトル
    S = tuple(tuple(map(int, input().split())) for i in range(N)) #改行行列

    d2=D**2
    cnt=0
    for x,y in S:
        if x**2+y**2<=d2:
            cnt+=1
    print(cnt)


if __name__ == "__main__":
    main()


Measured memory_bytes: 103808
#include <stdio.h>
#include <string.h>
int main(void)
{
    int  a,b[200000],i,j,n=0,m,x,y,z=0;
    char c[10100],s[10100];

    scanf("%d%d",&x,&y);
    for (size_t i = 0; i < x; i++)
    {
     scanf("%d",&b[i]);
     if(b[i]>=y) z++;
    }
    
    printf("%d",z);
    printf("\n");
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (long long int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(long long int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

int main(){

    int n;
    cin>>n;
    cout<<"ABC"<<n<<endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=1LL<<61;

int main() {
  ll n,k;
  cin >> n >> k;
  vec h(n);
  for(ll i=0;i<n;i++) cin >> h[i];
  sort(h.begin(),h.end());
  ll ans=inf;
  for(ll i=0;i<n-k+1;i++) {
    ans=min(ans,h[i+k-1]-h[i]);
  }
  cout << ans << endl;
}

Measured memory_bytes: 1024
// copied by Nurstan Duisengaliev
// skatal
#include <bits/stdc++.h>
 
#define ll long long
#define all(x) x.begin(), x.end()
#define in insert
#define mp make_pair
#define F first
#define S second
#define ppf pop_front
#define pb push_back
#define ppb pop_back
#define pf push_front
#define pii pair <int, int>
#define boost() ios_base::sync_with_stdio(0), cin.tie(0)
#define sz(x) x.size()
 
using namespace std;
 
const int N = (int)2e5 + 123;
const int mod = (int)1e9 + 7;
const ll INF = (ll)1e18 + 7;
bool dp[85][85][13002];
int n, m;
int a[85][85], b[85][85];
void solve () {
	cin >> n >> m;
	for (int i = 1; i <= n; i ++) {
		for (int j = 1; j <= m; j ++) {
			cin >> a[i][j];
		}
	}
	for (int i = 1; i <= n; i ++) {
		for (int j = 1; j <= m; j ++) {
			cin >> b[i][j];
		}
	}
	dp[1][1][abs (a[1][1] - b[1][1])] = 1;
	for (int i = 1; i <= n; i ++) {
		for (int j = 1; j <= m; j ++) {
			for (int k = 0; k <= 13000; k ++) {
				if (dp[i][j][k] == 1) {
					if (i + 1 <= n) {
						dp[i + 1][j][k + abs (a[i + 1][j] - b[i + 1][j])] = 1;
						dp[i + 1][j][abs(k - abs (a[i + 1][j] - b[i + 1][j]))] = 1;
					}
					if (j + 1 <= m) {
						dp[i][j + 1][k + abs (a[i][j + 1] - b[i][j + 1])] = 1;
						dp[i][j + 1][abs(k - abs (a[i][j + 1] - b[i][j + 1]))] = 1;	
					}
				}
			}	
		}
	}
	for (int k = 0; k <= 13000; k ++) {
		if (dp[n][m][k]) {
			cout << k;
			exit (0);
		}
	}
}
 
main () {
//	freopen (".in", "r", stdin);
//	freopen (".out", "w", stdout);
	boost ();
	int TT = 1;
//  cin >> TT;
	while (TT --) {
		solve ();
	}
	return 0;	
}

Measured memory_bytes: 86784
n = int(input()) 
price = [int(input()) for i in range(n)]
maxp = price[1] - price[0]
minp = price[0]
for j in range(1, n):
    maxp = max([maxp, price[j] - minp])
    minp = min([minp, price[j]])
print(maxp)


Measured memory_bytes: 13592
#include<iostream>
#include<string>
#include<vector>

using namespace std;

long long result=0;
bool hasAdd[10];

long long tranStringtoLong(string s){
	long long l=0;
	for(int i=0;i<s.length();i++){
		l=l*10 + (s[i]-'0');
	}
	return l;
}

/**
*根据 hasAdd 和 input计算当前选择下的各位相加的和 
*/ 
long long cal(string input){
	int start = 0; //从input的第一位开始 
	long long value=0;
	for(int i=1;i<input.length();i++){
		bool current =hasAdd[i];
		if(current){
			//当碰到 当前为由加号，那么就把前一个开始的位置到当前的位置的string
			//转化为数字 
			string tmp = input.substr(start,i-start);
			long long tmpValue = tranStringtoLong(tmp);
			value+=tmpValue;
			start = i;
			//cout<<tmpValue<<"+";
		}
	}
	//最后还要做一遍，因为加号只会到最后一个数字之前 
	string tmp = input.substr(start,input.length()-start);
	long long tmpValue = tranStringtoLong(tmp);
	value+=tmpValue;
	//cout<<tmpValue<<"="<<value<<endl;
	return value; 
}

void fillAdd(string input,int position){
	if(position==input.length()){
		long long currentValue = cal(input);
		result += currentValue;
		return;
	}
	hasAdd[position]=1;
	fillAdd(input,position+1);
	hasAdd[position]=0;
	fillAdd(input,position+1);
}

int main(){
	string  input;
	cin>>input;
	fillAdd(input,1);
	cout<<result;
}

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

int check( int x )
{
	int ret = 0;
	int cnt = 0;
	int ans = 0;
	int last = -1;

	while( x > 0 ) {
		int d = x % 10;
		if( d == last ) {
			cnt++;
		}
		else {
			ans = max( ans, cnt );
			last = d;
			cnt = 1;
		}
		x /= 10;
	}
	ans = max( ans, cnt );
	if( ans >= 3 ) {
		ret = 1;
	}

	return ret;
}

int main()
{
	int ans;
	int n;

	cin >> n;

	ans = check( n );

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

	return 0;
}


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

int n;
int p[5];
string str;

int main(){

	for(int i=0;i<5;i++)p[i]=0;

	cin>>n;
	for(int i=0;i<n;i++){
		cin>>str;
		if(str == "AC")p[0]++;
		else if(str =="WA")p[1]++;
		else if(str=="TLE")p[2]++;
		else if(str=="RE")p[3]++;
	}

	cout<<"AC x "<<p[0]<<endl;
	cout<<"WA x "<<p[1]<<endl;
	cout<<"TLE x "<<p[2]<<endl;
	cout<<"RE x "<<p[3]<<endl;

	return (0);
}

Measured memory_bytes: 3632
#include<stdio.h>
#define WHITE 0
#define GRAY 1
#define BLACK 2

int h;
int PM[100][100];
int color[100],d[100],f[100],time;

void DFS();
void DFSvisit(int);

int main(){
  int i,j,k,l,m;
  scanf("%d",&h);

  for(i=0;i<h;i++){
    for(j=0;j<h;j++){
      PM[i][j]=0;
    }
  }
  for(i=0;i<h;i++){
    scanf("%d%d",&k,&l);
    k--;
    for(j=0;j<l;j++){
      scanf("%d",&m);
      m--;
      PM[k][m]=1;
    }
  }

  DFS();
  
  return 0;
}
void DFS(){
  int i;
   for(i=0;i<h;i++){
     color[i]=WHITE;
   }

   time=0;
  for(i=0;i<h;i++){
    if( color[i]== WHITE)DFSvisit(i);
  }
  
    for(i=0;i<h;i++){
      printf("%d %d %d\n",i+1,d[i],f[i]);
    }
}

void DFSvisit(int x){
  int i;

  color[x]=GRAY;
  d[x]=++time;
  for(i=0;i<h;i++){
    if(PM[x][i]==0)continue;
    if(color[i]==WHITE){
      DFSvisit(i);
    }
  }
  color[x]=BLACK;
  f[x]=++time;
}




Measured memory_bytes: 2112
#include <bits/stdc++.h>
#define ll long long
#define INF 0x3f3f3f3f
using namespace std;
const int maxn = 1e5+5;
int n, k, q, a;
int r[maxn];

void read()
{
    cin >> n >> k >> q;
    for(int i = 0; i < q; ++i)
    {
        cin >> a;
        r[a]++;
    }
}

void solve()
{
    for(int i = 1; i <= n; ++i)
        if(r[i] + k - q <= 0)
            cout << "No" << endl;
        else
            cout << "Yes" << endl;
}

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

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

// {U}{INT,LONG,LLONG}_{MAX,MIN}
#define ALPHABET    (26)
#define INF         INT_MAX
#define MOD         (1000000007LL)

using LL  = long long;
// }}}

int main() {
    std::ios::sync_with_stdio(false);
    string s;cin >> s;
    for(int i=0;i<int(s.size());i++){
        if(i%2 == 0) cout << s[i];
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 592
// lはlcmでよさそう（勘
// あとは順に埋めていって矛盾があれば終了 余ったところは適当に"a"入れればいいけど長さを答える問題なので必要ないね
// 意味不明だがTLEになる
// は？辞書かよ... 後出しだけど10^5どうしのLCMそのまんま使ってX作ろうとしてたのが駄目

package main

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

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()
	N, M := nextInt(), nextInt()
	SS, TT := chars(next()), chars(next())
	L := lcm(N, M)
	// X := make([]string, L)
	X := make(map[int]string)
	for i := 0; i < N; i++ {
		idx := i * L / N
		X[idx] = SS[i]
	}
	flag := true
	for i := 0; i < M; i++ {
		idx := i * L / M
		if _, ok := X[idx]; ok {
			if X[idx] == TT[i] {
				continue
			} else {
				flag = false
				break
			}
		}
	}
	if flag {
		fmt.Fprintln(out, L)
	} else {
		fmt.Fprintln(out, -1)
	}
}

func lcm(a, b int) int {
	return (a * b) / gcd(a, b)
}

func gcd(a, b int) int {
	if a > b {
		a, b = b, a
	}
	for a > 0 {
		a, b = b%a, a
	}
	return b
}

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

func chars(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}


Measured memory_bytes: 12032
#include <bits/stdc++.h>
        //#include <ttmath.h>
        #define endl '\n'
        #define modulo 1000000007
        #define int long long
        #pragma GCC optimize("-Ofast")
        #define float double
        #define PI 3.141592653589793238462643
        #define sinDegrees(x) sin((x) * PI / 180.0)
        #define tanDegrees(x) tan((x) * PI / 180.0)
        #define atanDegrees(x) atan(x)* 180.0 / PI
        using namespace std;
        int power(int x, unsigned int y)
        {
            if (y == 0)
                return 1;
            else if (y % 2 == 0)
                return (power(x, y / 2) * power(x, y / 2));
            else
                return (x * power(x, y / 2) * power(x, y / 2));
        }
        /*#include "testlib.h"
        int main(int argc, char* argv[])
        {
        iostream::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        registerGen(argc, argv, 1);
        int n,k;
        n=rnd.next(1,50);
        k=rnd.next(1,n);
        cout<<n<<' '<<k;
        }*/
        bool comp(int a,int b)
        {
            return a>b;
        }
        int32_t main()
        {
            //freopen("output.txt","w", stdout);
            //freopen("input4.txt","r", stdin);
            iostream::sync_with_stdio(0);
            cin.tie(0);
            cout.tie(0);
            int n,k,counter=0;
            cin>>n>>k;
            while(n){
            n=n/k;
            counter++;
            }
            cout<<counter;
            return 0;
        }


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

int N, W;
int w[100], v[100];
int dp[101][100001];

signed main() {
  cin >> N >> W;
  for(int i=0; i<N; i++) cin >> w[i] >> v[i];

  for(int i=0; i<N; i++) {
    for(int c=0; c<w[i]; c++)  dp[i+1][c] = dp[i][c];
    for(int c=w[i]; c<=W; c++) dp[i+1][c] = max(dp[i][c-w[i]] + v[i], dp[i][c]);
  }

  int ans = 0;
  for(int c=0; c<=W; c++) ans = max(ans, dp[N][c]);
  printf("%lld\n", ans);
}


Measured memory_bytes: 78336
#include <iostream>

using namespace std;

int main(){

    string s;
    int n;
    cin>>n>>s;

    int i, count = 0;

    int k = 0;
    for(i=k; i<n; i++){
        if(s[i]== 'A' && s[i+1]== 'B' && s[i+2]== 'C'){
            count++;
        }

        if(count > 0)
            k = i+2;
    }

    cout<<count<<endl;





}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define MOD 1000000007 //10^9+7
using namespace std;
using ll = long long;
using PII = pair<int, int>;
const int INF = numeric_limits<int>::max();

// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

//greatest common divisor
long long gcd(ll a, ll b) 
{
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}

//least common multiple
long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

int main()
{
    ll n; cin >> n;
    set<ll> s;
    rep(i,n) {
        ll a; cin >> a;
        auto it = s.find(a);
        if (it == s.end()) {
            s.insert(a);
        } else {
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;

    return 0;
}


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

using namespace std;

#define LL long long 
#define ULL unsigned LL
#define LD long double 

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n, k;
	cin>>n>>k;
	int t[n];
	for(int i=0; i<n; i++)
		cin>>t[i];
	sort(t, t+n);
	int w = 0;
	for(int i=0; i<k; i++)
		w+=t[i];
	cout<<w;
}


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

using ll = long long;
using P = pair<ll, ll>;

constexpr ll MOD = 1e9+7;
constexpr ll INF = 1ll<<60;

#define FOR(i,a,b) for (ll i=(a);i<(ll)(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

ll N, K;
ll V[100];

int main(int argc, char **argv)
{
	cin >> N >> K;
	REP(i, N) cin >> V[i];

	ll MAX = min(N, K);

	ll res{-INF};
	for (ll l = 0; l <= MAX; ++l)
	{
		for (ll r = 0; r <= MAX; ++r)
		{
			if (l + r > MAX) continue;

			ll th = K - (l+r);
			vector<ll> tmp;
			for (ll i = 0; i < l; ++i)
				tmp.push_back(V[i]);
			for (ll i = 0; i < r; ++i)
				tmp.push_back(V[N-1-i]);
			sort(ALL(tmp));

			for (ll i = 0; i < th; ++i)
			{
				if (i >= tmp.size()) break;
				tmp[i] = max(tmp[i], 0ll);
			}

			res = max(res, accumulate(ALL(tmp), 0ll));
		}
	}

	std::cout << res << std::endl;
}


Measured memory_bytes: 256
#include <cstdio>
using namespace std;
const int MAXN=5e5+7;
int s[MAXN],t[MAXN];
int cnt=0;
void merge (int l,int r,int mid) {
	int t1=l,t2=mid,pos=l;
	while (pos<r) {
		if (t2==r||(t1<mid&&s[t1]<s[t2])) t[pos++]=s[t1++];
		else t[pos++]=s[t2++];
		cnt++;
	}
	for (int i=l;i<r;i++) {
		s[i]=t[i];
	}
}
void mergeSort (int l,int r) {
	if (r-l<2) return;
	int mid=(l+r)>>1;
	mergeSort (l,mid);
	mergeSort (mid,r);
	merge (l,r,mid);
}
int main () {
	int n;
	scanf ("%d",&n);
	for (int i=0;i<n;i++) {
		scanf ("%d",&s[i]);
	}
	mergeSort (0,n);
	printf ("%d",s[0]);
	for (int i=1;i<n;i++) {
		printf (" %d",s[i]);
	}
	printf ("\n%d\n",cnt);
    return 0;
}


Measured memory_bytes: 6584
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
//#define in freopen("in.txt","r",stdin)
//#define out freopen("out.txt","w",stdout) 
ll n,m,k,t,l,r;
ll a,b,c,d,x;
char A,B,C,X,Y,Z;
ll ans,MAX,MIN,sum;
ll ax[100000];
char str[100000];
ll dx[200][200];
ll bx[2000];


int main()
{
    ll i,j;
    t=1;
    //scanf("lld",&t);
    while(t--)
    {
      n=6310;
      sum=0;
      cin>>x;
      for(i=0;i<=n;i++)
      {
        ax[i]=i*i*i*i*i;
      }
      for(i=0;i<=n;i++)
      {
        for(j=0;j<=n;j++)
        {
          if(ax[j]-ax[i]==x)
          {
            printf("%lld %lld",j,i);
            return 0;
          }
          if(ax[j]+ax[i]==x)
          {
            printf("%lld %lld",j,-i);
            return 0;
          }
        }
      }
    }
	return 0;
}

Measured memory_bytes: 3820
#include <iostream>
#include <vector>
using namespace std;
int main(){
	int w[10] = {1,2,4,8,16,32,64,128,256,512};
	int n;
	while(cin>>n){
		vector<int> num;
		int b=n;
		for(int i=0;i<10;i++){
			if(b==0) break;
			if(b>=w[9-i]){
				num.push_back(w[9-i]);
				b -= w[9-i];
			}else if(b==w[9-i]) break;			
		}
		for(int j=1;j<=num.size();j++){
			if(j!=1) cout<<" ";
			cout<<num[num.size()-j];
		}
		cout<<endl;
	}
	return 0;
}

Measured memory_bytes: 1216
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <stdio.h>
#include <string>
#include <queue>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll mod = 998244353;
ll a[310], dp[90010], sum, ext, ans, dp2[90010];
int n, k;
string s;


ll pow(ll x, ll y)
{
	if (y == 0) return 1;
	if (y % 2)
	{
		return pow(x, y - 1) * x % mod;
	}
	else
	{
		ll yyy = pow(x, y / 2);
		return yyy * yyy % mod;
	}
}

ll div(ll x)
{
	return pow(x, mod - 2);
}



int main(void)
{
	cin >> n >> s >> k;
	for (int i = 0; i < s.length(); i++)
	{
		if (s[i] == s[k - 1])
		{
			cout << s[i];
		}
		else
		{
			cout << '*';
		}
	}
	cout << endl;
	cin >> n;
}


Measured memory_bytes: 256
a,b,c,d,e,f=map(int,input().split())
ans=[-1]*9999
ans[a*100]=0
ans[b*100]=0
fin=[a*100,0]
p=0
for i in range(1,f+1):
    if ans[i]==-1:
        continue
    if (ans[i]+c)/(i-ans[i])<=e*0.01:
        ans[i+c]=max(ans[i]+c,ans[i+c])
    if (ans[i]+d)/(i-ans[i])<=e*0.01:
        ans[i+d]=max(ans[i]+d,ans[i+d])
    ans[i+a*100]=max(ans[i+a*100],ans[i])
    ans[i+b*100]=max(ans[i+b*100],ans[i])
    if ans[i]/i>p:
        p=ans[i]/i
        fin=[i,ans[i]]
print(*fin)

Measured memory_bytes: 9228
#include <string>
#include <math.h>
#include <iostream>
 
using namespace std;
 
int main()
{
  string s;
  cin >> s;
  int n = s.size();
  int x = 0;
  for (int i = 0; i < n; i++) {
    if (s[i] == 'A' && s[i+1] == 'C')
      x = 1;
  }
  if (x == 1)
    cout << "Yes";
  else
    cout << "No";
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define intpow(a, n) (int)pow((long double) a, (long double) n)
#define int long long

signed main(){
    int n; cin >> n;
    int sum = 0;
    reps(i,1,n){
        if(i % 3 != 0 && i % 5 != 0){
            sum += i;
        }
    }
    cout << sum << endl;
}

Measured memory_bytes: 3632
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	long N,sum=0,ans,ant;
	cin>>N;				
	int a[N],b[N],c[N];
	for(int i=0;i<N;i++)
	cin>>a[i];
	for(int i=0;i<N;i++)
	cin>>b[i];
	for(int i=0;i<N;i++)
	cin>>c[i];
	sort(a,a+N);
	sort(b,b+N);
	sort(c,c+N);
	for(int i=0;i<N;i++)
	{
		ans=lower_bound(a,a+N,b[i])-a;
		ant=upper_bound(c,c+N,b[i])-c;
		sum+=ans*(N-ant);
	}
	printf("%lld",sum);
}
 

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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { std::cout << #a << " = " << a << "\n"; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T, class V> istream& operator>> (istream& ist, pair<T, V>& p) { return ist >> p.first >> p.second; }
template<class T> ostream& operator<< (ostream& ost, pair<T, T>& p) { return ost << p.first << ", " << p.second; }
template<class T> istream& operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) ist >> e; return ist; }

typedef long long ll;
int const inf = INT_MAX / 2;

int main() {
  string S; cin >> S;
  deque<char> deq;
  rep(i, S.size()) deq.push_back(S[i]);
  int Q; cin >> Q;
  int swt = 0;
  rep(_, Q) {
    int T; cin >> T;
    if (T == 1) {
      swt = !swt;
    } else {
      int F; cin >> F; F--;
      char C; cin >> C;
      if (F ^ swt) {
        deq.push_back(C);
      } else {
        deq.push_front(C);
      }
    }
  }
  if (swt) {
    rep(i, deq.size()) cout << deq[deq.size() - 1 - i];
  } else {
    rep(i, deq.size()) cout << deq[i];
  }
  cout << "\n";
}


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

#define ll long long
#define rep(i,N) for(ll i=0; i<N; i++)
const int mx = 2e5;

int main(void){
  
  ll A,B,C,K;
  cin >> A >> B >> C;
  cin >> K;
  
  while(K>0 && B<=A){
    B *= 2;
    K--;
  }
  if(B<=A){
    cout << "No";
    return 0;
  }
  while(K>0 && C<=B){
    C*=2;
    K--;
  }
  if(C<=B){
    cout << "No";
    return 0;
  }
  
  if(B<=A || C<=B){
    cout << "No";
  }else{
    cout << "Yes";
  }

  return 0;
}

Measured memory_bytes: 3628
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#include<cstring>
#include<limits>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
using ll=long long;
static const ll mod = 1e9 + 7;
static const ll INF = 1LL << 50;
using namespace std;

int main() {
	int n;
	cin >> n;
	vector<string>v(n);
	rep(i, n)cin >> v[i];
	bool judge = true;
	rep(i, n)for (int j = 0; j < i; ++j)if (v[i] == v[j])judge = false;
	rep(i, n) {
		if (i) {
			if (v[i - 1][v[i - 1].size() - 1] != v[i][0])judge = false;
		}
	}
	if (judge)cout << "Yes" << endl;
	else cout << "No" << endl;
}

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

int main() {
  int n, x;
  cin >> n >> x;
  vector<int> m(n);
  int sum = 0;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    cin >> m[i];
    sum += m[i];
    cnt++;
  }
  sort(m.begin(), m.end());
  x -= sum;

  while (x >= m[0]) {
    x -= m[0];
    cnt++;
  }
  cout << cnt << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const int maxn = 100010;

ll a[maxn];

int main()
{
//	freopen("input.txt","r",stdin);
//	ios::sync_with_stdio(false); cin.tie(0);
	ll n;
	scanf("%lld",&n);
	for(int i=0;i<n;i++){
		scanf("%lld",&a[i]);
	}
	sort(a,a+n);
	ll x=0,y=0;
	for(int i=n-1;i>0;i--){
		if(x==0&&a[i]==a[i-1]){
			x=a[i];i--;
		}
		else if(x!=0&&a[i]==a[i-1]){
			y=a[i];break;
		}
	}
	printf("%lld\n",x*y);
	return 0;
}


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

signed main() {

    string S;
    cin >> S;

    int N = S.size();

    vector<int> nxt(N, -1);

    int piv = 0;

    // L
    REP(i, N) {
        if (S[i] == 'R') piv = i;
        else nxt[i] = piv;
    }

    // R
    RREP(i, N - 1) {
        if (S[i] == 'L') piv = i;
        else nxt[i] = piv;
    }

    vector<int> res(N, 0);

    REP(i, N) {
        if (S[i] == 'R') {
            res[nxt[i] - abs(nxt[i] - i) % 2]++;
        } else {
            res[nxt[i] + abs(nxt[i] - i) % 2]++;
        }
    }

    for (auto& e: res) {
        cout << e << ' ';
    }
    cout << endl;

}

Measured memory_bytes: 1408
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <set>
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
typedef long long ll;

#define REP(j,n) for (int (j)=0; j<(int)(n); ++j)
#define FOR(j,k,n) for (int (j)=(k); j<(int)(n); ++j)
#define FOREQ(j,k,n) for (int (j)=(k); j<=(int)(n); ++j)

#define MEMSET(z,val) memset(z,val,sizeof(z))

int main() {
    int n;
    while (scanf("%d", &n), n) {
        int ans = 0;
        for (int i = 1; i < n; i++) {
            int sum = 0;
            for (int j = i; sum < n; j++) {
                sum += j;
            }
            if (sum == n) {
                ans++;
            }
        }
        printf("%d\n", ans);
    }
}

Measured memory_bytes: 0
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;
import std.ascii;


void main()
{
  auto n = readln.chomp.map!(a=>a-'0').array;
  auto res = n.sum;
  int lsum;
  foreach (i; 0..n.length) {
    if (i == 0) {
      if (n[i] != 1) {
        lsum += n[i] - 1;
      }
    } else {
      lsum += 9;
    }
  }
  max(res, lsum).writeln;
}


Measured memory_bytes: 256
#include <stdio.h>

int max(int a,int b){
  if(a > b){
    return a;
  }
  return b;
}

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

int main(void){
  int a,k;
  int maximam = -1,minimam = 200;

  for(int i = 0;i < 5;i++){
    scanf("%d",&a);
    maximam = max(maximam,a);
    minimam = min(minimam,a);
  }

  scanf("%d",&k);

  if(maximam-minimam <= k)
    printf("Yay!\n");
  else
    printf(":(\n");

  return 0;
}

Measured memory_bytes: 128
/*input
2000000000 0 0 2000000000
*/

#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 a, b, c, k;
  cin >> a >> b >> c >> k;
  int ans = 0;
  if (k <= a) ans = k;
  else if (k <= a+b) ans = a;
  else ans = a-(k-a-b);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3636
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int MOD = 1000000007;
const char nl = '\n';
const int MX = 100001; //check the limits, dummy
 
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);    
	
    ll N; cin >> N;
    int ans = 0;
    FOR(i, 2, 1000010) {
        int cur = 0;
        while (N % i == 0) {
            cur++;
            N /= i;
        }
        FOR(j, 1, 10000) {
            if (cur < j) break;
            ans++; cur -= j;
        }
    }
    if (N > 1) ans++;
    cout << ans << nl;
	
	return 0;
}
 
// read the question correctly (ll vs int)
// template by bqi343
 

Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
#define MAX 7777777
int main(){
  int n,m,t=0;
  bool a[MAX];
  while(cin>>n>>m,n){
    t=0;
    memset(a,false,sizeof(a));
    for(int j=n;j<MAX;j++){
      if(!a[j]){
    for(int k=j;k<MAX;k+=j){
      a[k]=true;
    }
    t++;
      }
      if(m==1)break;
      if(m!=1&&t==m)break;
    }
    for(int i=n;i<MAX;i++){
      if(!a[i]){
    cout<<i<<endl;
    break;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 10580
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    map<int,int> m;
    int x,n,ar[2000];
    cin>>x>>n;
    for(int i=1; i<=n; i++)
    {
        cin>>ar[i];
        m[ar[i]]++;
    }
    int left=-1,right=-1;
    for(int i=x-1; i>=0; i--)
    {
        if(m[i]==0)
        {
            left=i;
            break;
        }
    }
    for(int i=x; i<=101; i++)
    {
        if(m[i]==0)
        {
            right=i;
            break;
        }
    }
    if(left==-1)
        cout<<right<<endl;
    else if(right==-1)
        cout<<left<<endl;
    else
    {
        int le=x-left;
        int ri=right-x;
        if(le<=ri)
            cout<<left<<endl;
        else
            cout<<right<<endl;
    }
    return 0;
}



Measured memory_bytes: 3640
import math
A, B, H, M = map(int, input().split())
#A = list(map(int, input().split()))
#K = int(input())
#S = str(input())

x = H * 60 + M
cos_x = x / 2
cos_y = 6 * M
max_xy = min(abs(cos_x - cos_y) , 360 - abs(cos_x - cos_y))

ans = (A ** 2 + B ** 2 - 2*A*B*math.cos(math.radians(max_xy)) ) ** (1/2)

print(ans)

Measured memory_bytes: 9512
#include <iostream>
#include <algorithm>
#include <string>
#include <functional>
#include <math.h>
using namespace std;

long long power(long long a,long long n){
    long long ans=1;
    while(0<n){
        if(n%2==0){
            a*=a;
            n>>=1;
        }else{
            ans*=a;
            n--;
        }
    }
    return ans;
}

int main(){
    long long N, P, PP, max = 1, count = 0;
    cin >> N >> P;
    PP = P;
    long long A_p = 0;
    if(N == 1){
        cout << P << endl;
    }else{
        for(int i = 2; PP >= power(i,N); i++){
            while(PP%i == 0){
                PP /= i;
                count ++;
            }
            while(count >= N){
                count -= N;
                max *= i;
            }
            count = 0;
        }
        cout << max << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<stdio.h>
#include<stack>
#include<stdlib.h>
#include<list>
#define LEN 100005
using namespace std;
//list実装

int main(){
    list<int> l;
    int n;
    scanf("%d",&n);
    for(int i=0;i<n;i++){
        string c;
        cin>>c;
        if(c[0]=='i'){
            int a;
            scanf("%d",&a);
            l.push_front(a);
        }else{
            if(c[6]=='F'){
                l.pop_front();
            }else if(c[6]=='L'){
                l.pop_back();
            }else{
                int a;
                scanf("%d",&a);
                for(list<int>::iterator itr=l.begin();itr!=l.end();itr++){
                    if(*itr==a){
                        l.erase(itr);
                        break;
                    }
                }
                
            }
        }
    }
    int i=0;
    for(list<int>::iterator itr=l.begin();itr!=l.end();itr++){
            if(i++)cout<<" ";
        printf("%d",*itr);
            
        }
    cout<<endl;
        
return 0;
}


Measured memory_bytes: 34552
#include <bits/stdc++.h>
using namespace std;
int main()
{
	string a,b,c;
	cin>>a>>b;
	if(a.size()>b.size())
	{
		cout<<"GREATER";
	}
	else if(a.size()<b.size())
	{
		cout<<"LESS";
	}
	else
	{
		for(int i = 0; i < a.length(); ++i)
		{
    		if ((a[i] - '0') < (b[i] - '0'))
    		{	 
        	cout << "LESS" ;
        	return 0;
    		}
    		else if ((a[i] - '0') > (b[i] - '0'))
    		{	 
        	cout << "GREATER";
			return 0; 
    		}
    		
    	}
    	cout<<"EQUAL";
	}
	
	
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
int main()
{
  long long int n,c=0,max=0;
  cin>>n;
  long long int a[n];
  cin>>a[0];
  for(long long int i=1;i<n;i++)
  {
    cin>>a[i];
    if(a[i]<=a[i-1])
    {
      ++c;
    }
    else
    {
      c=0;
    }
    if(max<c)
    {
      max=c;
    }
  }
  cout<<max;
  return 0;
}

Measured memory_bytes: 1024
n = int(input())

s = str(input())

cc = ""

m = len(s)

for i in range(m):
    if ord(s[i]) + n <= 65 + 25:
        cc += (chr(ord(s[i]) + n))
    else:
        cc += (chr(ord(s[i]) + n - (65 + 25) + 64))

print(cc)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,arr[250],k,sum=0,i;
    cin>>n;
    for(i=0;i<n;i++)
        {cin>>arr[i];sum+=arr[i];}
    if(sum%n==0)
    {
        k=sum/n;
        int ans=0;
        for(i=0;i<n;i++)
            ans+=(k-arr[i])*(k-arr[i]);
        cout<<ans<<endl;

    }
    else
    {
        k=sum/n;
         int ans=0,ans2=0;
        for(i=0;i<n;i++)
            ans+=(k-arr[i])*(k-arr[i]);
        k++;
        for(i=0;i<n;i++)
            ans2+=(k-arr[i])*(k-arr[i]);
            cout<<min(ans,ans2)<<endl;

    }

}


Measured memory_bytes: 3544
def main():
    N, K = (int(i) for i in input().split())
    ans = 10**12
    H = [int(input()) for i in range(N)]
    H.sort()
    for i in range(N-K+1):
        ans = min(ans, H[i+K-1] - H[i])
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 50264
using System;
using System.Collections.Generic;
using static System.Console;

class Program {
	static void Main() {
		var a = NextString();
		var b = NextString();
		var x = int.Parse(a + b);

		var sqrt = (int)Math.Pow(x, 0.5);
		WriteLine(Math.Pow(sqrt, 2) == x ? "Yes" : "No");
	}

	static string NextString() {
		var result = new List<char>();
		while (true) {
			int next = Read();
			if (next < 0)
				break;
			var nextChar = (char)next;
			if (!char.IsWhiteSpace(nextChar))
				result.Add(nextChar);
			else if (nextChar != '\r')
				break;
		}
		return string.Join("", result);
	}
}

Measured memory_bytes: 13268
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define sz(x) (int)(x.size())
#define fi first
#define se second
#define pii pair<int, int>

signed main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n;
    cin >> n;
    int a[n];
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    int op1 = 0, op2 = 0;
    int s = 0;
    for (int i = 0; i < n; i++) {
        s += a[i];
        if (s <= 0 && i % 2 == 0) {
            op1 += (1 - s);
            s = 1;
        } else if (s >= 0 && i % 2 == 1) {
            op1 += (s + 1);
            s = -1;
        }
    }
    s = 0; op2 = op1; op1 = 0;
    for (int i = 0; i < n; i++) {
        s += a[i];
        if (s <= 0 && i % 2 == 1) {
            op1 += (1 - s);
            s = 1;
        } else if (s >= 0 && i % 2 == 0) {
            op1 += (s + 1);
            s = -1;
        }
    }
    cout << min(op1, op2)<< "\n";
}

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

bool vis[101];

int main(){
	int x,n,l,r,i,a;
	scanf("%d%d",&x,&n);
	for(i=1;i<=n;i++){
		scanf("%d",&a);
		vis[a]=true;
	}	
	
	if(!vis[x]){
		printf("%d\n",x);
		return 0;
	} 
	
	l=r=x;
	while(1){
		l--,r++;
		if(!vis[l]){
		 	printf("%d\n",l);
			return 0;
		}
		if(!vis[r]){
			printf("%d\n",r);
			return 0;
		} 
 	}
}

Measured memory_bytes: 3824
//#define _GLIBCXX_DEBUG//TLEの原因になるので注意！！！！！！！！！！！
#include<cmath>
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair
#define sz(x) int(x.xise())
#define mod 1000000007
#define reps(i,s,n) for(int i = s; i < n; i++)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
deque<int> deq;
#define fi first
#define se second
//#define int long long

//cerrはコメントアウトしなくても通る//ただしTLEを引き起こすことがある

int n;
vector<int> to[100005];
int dis[100005];

int ans[100005];
int ch[100005];

int main(){
    int m;
    cin >> n>>m;
    /*
    set<int> S;
    rep(i,n){
        S.insert(i);
    }
    */
    
    //最長路問題
    //int a[n+m-1],b[n+m-1];
    rep(i,n+m-1){
        int a,b;
        cin >> a>> b;
        a--;b--;
        to[a].push_back(b);
        //S.erase(b[i]);
        ch[b]++;
    }
    //int s=*S.begin();
    int s=-1;
    rep(i,n){
        if(ch[i]==0)s=i;
    }
    pq.push(s);
    while(!pq.empty()){
        int p=pq.top();
        pq.pop();
        for(int u:to[p]){
            if(--ch[u]==0){
                dis[u]=dis[p]+1;
                ans[u]=p+1;
                pq.push(u);
            }
        }
    }
    //cerr<<endl;
    rep(i,n){
        cout<<ans[i]<<endl;
    }
    return 0;
}



Measured memory_bytes: 7424
from sys import stdin
from collections import deque
input = stdin.readline

n, m = map(int, input().split())
a = [[] for _ in range(n + 1)]
chk = [0] * (n + 1)
chkchk = [1] * (n + 1)
chkchk[0] = 0

for _ in range(m):
    x, y = map(int, input().split())
    a[x].append(y)
    a[y].append(x)

q = deque()

for x in a[1]:
    q.append(x)
    chk[x] = 1
    chkchk[x] = 0

while True:
    if len(q) == 0:
        break

    now = q.popleft()

    for x in a[now]:
        if chkchk[x] == 0:
            continue

        q.append(x)
        chk[x] = now
        chkchk[x] = 0

if sum(chkchk) == 0:
    print("Yes")
    for x in chk[2:]:
        print(x)
else:
    print("No")

Measured memory_bytes: 35596
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int x = sc.nextInt();
		String result = "NO";

		switch(x){
		case 3:
		case 5:
		case 7:
			result = " YES";

		}

		System.out.println(result);

	}

}


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

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

    cout << ans << endl;
}

Measured memory_bytes: 3660
def search_min_cost(nums, prev_num, min_cost, cost, c):
    _last_min_cost = min_cost
    if len(nums) != 0:
        _min_cost = cost + c[prev_num][1]
        if min_cost < _min_cost:
            _min_cost = min_cost
        for i in nums:
            _nums = nums[:]
            _nums.remove(i)
            next_cost = cost + c[prev_num][i]
            if _min_cost <= next_cost:
                if _min_cost < _last_min_cost:
                    _last_min_cost = _min_cost
            else:
                '''
                if prev_num == 8:
                    print(_nums, i, _min_cost, next_cost)
                if prev_num == 4 and i == 9:
                    print(_nums, i, _min_cost, next_cost)
                '''
                m = search_min_cost(
                    _nums, i, _min_cost, next_cost, c)
                if m < _last_min_cost:
                    _last_min_cost = m
    else:
        m = cost + c[prev_num][1]
        if m < _last_min_cost:
            _last_min_cost = m
    return _last_min_cost


H, W = map(int, input().split())
# c[y][x]: y行目、x文字目
c = [list(map(int, input().split())) for _ in range(10)]
# A[y][x]: y行目、x文字目
A = [list(map(int, input().split())) for _ in range(H)]
min_cost_map = {}
min_cost_map[1] = 0

nums = [0, 2, 3, 4, 5, 6, 7, 8, 9]
for i in nums:
    _nums = nums[:]
    _nums.remove(i)
    min_cost_map[i] = search_min_cost(_nums, i, 1001, 0, c)
# print(min_cost_map)
cost = 0
for i in range(H):
    for j in range(W):
        n = A[i][j]
        if n != -1:
            cost += min_cost_map[n]
print(cost)


Measured memory_bytes: 3444
#include<bits/stdc++.h>
using namespace std;
#define bye return 0
#define Yes cout << "Yes" << "\n"
#define No  cout << "No" << "\n"
#define YES cout << "YES" << "\n"
#define NO cout << "NO" << "\n"
// #define console.log printf
//#define endl cout << "\n"
typedef long long ll;
int main(){ 
     int a, b, c, d, e;
     cin >> a >> b >> c >> d >> e;
     if(a==0) cout << "1" << endl;
     if(b==0) cout << "2" << endl;
     if(c==0) cout << "3" << endl;
     if(d==0) cout << "4" << endl;
     if(e==0) cout << "5" << endl;
    bye;
}




Measured memory_bytes: 3580