akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define pi 2*asin(1.0)
#define MAX 10000000
#define MOD 1000000007
 
 
vector<long> fac(MAX);
vector<long> finv(MAX);
vector<long> inv(MAX);
 
//template functions
/////////////////////////
void Cominit(){
  fac.at(0)=fac.at(1)=1;
  finv.at(0)=finv.at(1)=1;
  inv.at(1)=1;
  for(long i=2;i<MAX;i++){
      fac.at(i)=(fac.at(i-1)*i)%MOD;
      inv.at(i)=MOD-inv.at(MOD%i)*(MOD/i)%MOD;
      finv.at(i)=finv.at(i-1)*inv.at(i)%MOD;
  }
}

long facComb(long N,long M){// nCm%
if(N<M) return 0;
if(N<0||M<0) return 0;
return fac.at(N)*(finv.at(M)*finv.at(N-M)%MOD)%MOD;
}

long Comb(long N,long M){// nCm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
for(long i=M;i>0;i--){
    ans=ans/i;
}
return ans;
}

long Perm(long N,long M){// nPm
long ans=1;
for(long i=N;i>N-M;i--){
    ans=ans*i;
}
return ans;
}

long GCM(long A,long B){
            long W,r;
    if(A<B){

        W=B;
        B=A;
        A=W;
    }
    while(A%B!=0){
        r=A%B;
        A=B;
        B=r;
    }
    return B;
}
long LCM(long A,long B){
    return (A*B)/GCM(A,B);
}

long upDiv(long a,long b){
  return (a+b-1)/b;
}

/////////////////////////


//Answer


int main() {

typedef pair<long,long> P;
long H,W,M,ans,flag=0;
cin>>H>>W>>M;
vector<P> h(H+1);
vector<P> w(W+1);
vector<P> m(M);


//vector<vector<long>> A(H+1,vector<long>(W+1,0));

for(long i=0;i<H+1;i++){
h.at(i).first=0;
h.at(i).second=i;
}
for(long i=0;i<W+1;i++){
w.at(i).first=0;
w.at(i).second=i;
}
 
for(long i=0;i<M;i++){
cin>>m.at(i).first>>m.at(i).second;
h.at(m.at(i).first).first++;
w.at(m.at(i).second).first++;
//A.at(m.at(i).first).at(m.at(i).second)=1;
}
sort(h.begin(),h.end());
reverse(h.begin(),h.end());
sort(w.begin(),w.end());
reverse(w.begin(),w.end());
sort(m.begin(),m.end());

 
long a=0,b=0;
while(a<H+1 && h.at(a).first==h.at(0).first){
    a++;
  if(a==H+1){
    break;
  }
}
while(b<W+1 && w.at(b).first==w.at(0).first){
    b++;
  if(b==W+1){
    break;
  }
}


if(a*b>M){
    ans=h.at(0).first+w.at(0).first;
}else{
   vector<P> hw(a*b);
    for(long i=0;i<a;i++){
        for(long j=0;j<b;j++){
            hw.at(i*b+j).first=h.at(i).second;
            hw.at(i*b+j).second=w.at(j).second;

        }
    }
    sort(hw.begin(),hw.end());
    sort(m.begin(),m.end());
    long t=0;
    for(long i=0;i<M;i++){
        if((m.at(i).first==hw.at(t).first)&&(m.at(i).second==hw.at(t).second)){
            t++;
          if(t==a*b){
            break;
          }
        }
    }
	
    if(t<a*b){
        ans=h.at(0).first+w.at(0).first;
    }else{
        ans=h.at(0).first+w.at(0).first-1;
    }
 
}
cout<<ans<<endl;
 
 
 
}




Measured memory_bytes: 256364
#include<stdio.h>
#include<iostream> 
using namespace std;
int main(){
	long long ans;
	cin>>ans;
	long long money = 100;
	int cnt = 0 ;
	while(money<ans){
		money = money*1.01;
		cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}

Measured memory_bytes: 3184
class Node:
    __slots__ = ["string", "index"]
    def __init__(self, string, index):
        self.string = string
        self.index = index

    def get_children(self):
        s = "abcdefghij"
        parent = self.string
        out = [None]*(self.index+1)
        for i, c in enumerate(s[:self.index]):
            out[i] = Node(parent+c, self.index)
        out[i+1] = Node(parent+s[self.index], self.index+1)
        return out

def main():
    n = int(input())
    root = Node("a", 1)
    children = [root]
    for _ in range(n-1):
        parents, children = children, []
        for parent in parents:
            children.extend(parent.get_children())
    for child in children:
        print(child.string)

if __name__ == "__main__":
    main()

Measured memory_bytes: 21852
#include <iostream>
#include <string>
#include <stack>
using namespace std;

int main(){
    string x;
    stack<int> opers;
    while(cin >> x){
        int a=0,b=0;
        switch(x[0]){
            case '+':
                a=opers.top();
                opers.pop();
                b=opers.top();
                opers.pop();
                opers.push(b+a);
                break;
            case '-':
                a=opers.top();
                opers.pop();
                b=opers.top();
                opers.pop();
                opers.push(b-a);
                break;
            case '*':
                a=opers.top();
                opers.pop();
                b=opers.top();
                opers.pop();
                opers.push(b*a);
                break;
            default:
                opers.push(stoi(x));
                break;
        }
//        cout << x << opers.top() << endl;
    }
    cout << opers.top() <<endl;
    return 0;
}


Measured memory_bytes: 3152
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> ii;
typedef vector<ii> vii;

main(){
    int n,k;
    cin>>n>>k;
    int p[n];
    for(int i=0;i<n;i++) cin>>p[i];
    sort(p,p+n);
    int ans=0;
    for(int i=0;i<k;i++) ans+= p[i];
    cout<<ans;
}

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

int main(){
  long long n,c,k;
  cin >> n >> c >> k;
  vector<long long> t(n);
  long long ans = 0;
  for(long long i = 0; i < n; i++){
    cin >> t[i];
  }
  sort(t.begin(),t.end());
  long long kousin = t[0]+k;
  long long kyaku = 0;  
  for(long long i = 0; i < n; i++){
    if(t[i] <= kousin && (kyaku + 1) <= c){
      kyaku++;
    }else{
      ans++;
      kousin = t[i]+k;
      kyaku = 1;
    }
  }
  if(kyaku > 0) ans++;
  cout << ans << endl;
}

Measured memory_bytes: 3980
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest 091
# B - Two Colors Card Game

from sys import stdin

def multiset(xs, vocabulary=[]):
    d = {}
    for x in xs + vocabulary: d[x] = 0
    for x in xs: d[x] += 1
    return d

def solve(s, t):
    ss = multiset(s)
    tt = multiset(t, vocabulary=s)
    value = max([ss[x] - tt[x] for x in ss])
    return max(value, 0)

def readStrList():
    n = int(stdin.readline())
    s = []
    for i in range(n):
        x = stdin.readline().strip()
        s.append(x)
    return s

s = readStrList()
t = readStrList()
print(solve(s, t))


Measured memory_bytes: 3064
#include <iostream>

using namespace std;

int main()
{
  while (true)
  {
    int m, f, r;
    cin >> m >> f >> r;
    if (m == -1 && f == -1 && r == -1)
      return 0;

    if (m == -1 || f == -1)
      cout << "F" << endl;
    else if (m + f >= 80)
      cout << "A" << endl;
    else if (m + f >= 65)
      cout << "B" << endl;
    else if (m + f >= 50 || r >= 50)
      cout << "C" << endl;
    else if (m + f >= 30)
      cout << "D" << endl;
    else
      cout << "F" << endl;
  }
}

Measured memory_bytes: 3104
import bisect
from itertools import accumulate
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline


def solve():
    N, K = map(int, input().split())
    L = [int(input()) for _ in range(N)]

    L_acc = [0]+list(accumulate(L))
    for i in range(N+1):
        L_acc[i] -= (i)*K

    L_sort = list(sorted(set(L_acc)))
    L_comp = [-1]*(N+1)
    for i in range(N+1):
        key = L_acc[i]
        ind = bisect.bisect_left(L_sort, key)
        L_comp[i] = ind
    # BIT
    bit = [0]*(N+1)

    def sum_bit(i):
        s = 0
        while i > 0:
            s += bit[i]
            i -= i & (-i)
        return s

    def add(i, x):
        while i <= N:
            bit[i] += x
            i += i & (-i)

    ans = 0
    for i, l in enumerate(L_comp):
        if l == 0:
            ans += N-i
            continue
        ans += sum_bit(l)
        add(l, 1)
    print(ans)


solve()


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template < typename T >
void vprint(T &v){
	REP(i, v.size()){
		cout << v[i] << " ";
	}
	cout << endl;
}

const int MAX_N = 1e6;

struct UnionFind{
    int N;
    int par[MAX_N];

    UnionFind(int N): N(N){
        for (int i=0;i<N;i++){
            par[i] = i;
        }
    }

    int root(int x){
        if(par[x] == x) return x;
        int rx = root(par[x]);
        par[x] = rx;
        return rx;
    }

    void unite(int x, int y){
        int rx = root(x);
        int ry = root(y);
        if(rx==ry) return;
        par[rx] = ry;
    }

    bool find(int x, int y){
        return root(x) == root(y);
    }
};

int main(){
	ll N, M;
	cin >> N >> M;
	ll tmp = N*(N-1)/2;
	vector<ll> res;
	res.push_back(tmp);
	UnionFind uf(N);
	vector<ll> X(M), Y(M);
	REP(i, M){	
		cin >> X[i] >> Y[i], X[i]--, Y[i]--;
	}
	vector<ll> sz(N, 1);
	REP(i, M){
		ll A = X[M-1-i];
		ll B = Y[M-1-i];
		if(!uf.find(A, B)){
			ll sa = sz[uf.root(A)];
			ll sb = sz[uf.root(B)];
			tmp -=  sa * sb;
			uf.unite(A, B);
			sz[uf.root(A)] = sa + sb;
		}
		res.push_back(tmp);
	}
	REP(i, M){
		cout << res[M-1-i] << endl;
	}
    return 0;
}

Measured memory_bytes: 7028
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 500100;
struct Node{int lch,rch,data;}t[maxn*30];
int N,a[maxn],cnt = 0,pre[maxn],tmp[maxn*20];
int root[maxn],M;
#define mid ((l+r)>>1)
int Build(int l,int r){
	int x = ++cnt;
	if(l!=r){
		t[x].lch = Build(l,mid);
		t[x].rch = Build(mid+1,r);
	}return x;
}
int Build(int rt,int l,int r,int v){
	int x = ++cnt;
	if(l == r)t[x].data = t[rt].data+1;
	else {
		t[x].lch = t[rt].lch;t[x].rch = t[rt].rch;
		if(v <= mid)t[x].lch = Build(t[rt].lch,l,mid,v);
		else t[x].rch = Build(t[rt].rch,mid+1,r,v);
		t[x].data = t[t[x].lch].data+t[t[x].rch].data;
	}return x;
}
int get(int ll,int rr,int l,int r,int x){
	if(x >= r)return t[rr].data - t[ll].data;
	if(x <= mid)return get(t[ll].lch,t[rr].lch,l,mid,x);
	else return t[t[rr].lch].data-t[t[ll].lch].data+get(t[ll].rch,t[rr].rch,mid+1,r,x);
}
int main(){
	scanf("%d%d",&N,&M);
	for(int i = 1;i <= N;i++)scanf("%d",&a[i]);
	for(int i = 1;i <= N;i++){
		pre[i] = tmp[a[i]]+1;
		tmp[a[i]] = i;
	}
	root[0] = Build(1,N);
	for(int i = 1;i <= N;i++)root[i] = Build(root[i-1],1,N,pre[i]);
		// for(int i = 0;i <= N;i++)printf("%d ",root[i]);
	for(int i = 1;i <= M;i++){
		int a,b;
		scanf("%d%d",&a,&b);
		printf("%d\n",get(root[a-1],root[b],1,N,a));
	}
	return 0;
}

Measured memory_bytes: 140528
#include <iostream>
#include <set>
#include <vector>
#include <map>
#include <string>
#include <math.h>
#include <queue>

using namespace std;

int solve(int Y,int M, int D){
	int res;

	res=0;

	//ひと月目
	if(Y%3==0 || M%2!=0){//20notoki
		for(int dd=D;dd<=20;dd++) res++;
	}
	else{//19notoki
		for(int dd=D;dd<=19;dd++) res++;
	}

	//二つ決め以降
	for(int mm=M+1;mm<=10;mm++){
		if(Y%3==0){
			for(int dd=1;dd<=20;dd++) res++;
		}
		else{
			if(mm%2==0){
				for(int dd=1;dd<=19;dd++) res++;
			}
			else{
				for(int dd=1;dd<=20;dd++) res++;
			}
		}
	}

	for(int yy=Y+1;yy<1000;yy++){
		for(int mm=1;mm<=10;mm++){
			if(yy%3==0){
				for(int dd=1;dd<=20;dd++){
					res++;
				}
			}
			else{
				if(mm%2==0){
					for(int dd=1;dd<=20;dd++){
						res++;
					}
				}
				else{
					for(int dd=1;dd<=19;dd++){
						res++;
					}
				}

			}
		}
	}


	return res;
}


int main(void){

	int n;
	int Y,M,D;

	while(true){
		cin >> n;
//		if(n==0) return 0;
		
		for(int i=0;i<n;i++){
			cin >> Y;
			cin >> M;
			cin >> D;

			cout << solve(Y,M,D) << endl;
		}
		return 0;
	}

	return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<string>
#include<vector>
#include<stdio.h>
#include<algorithm>
#include<math.h>
#include<numeric>
#include<iomanip>
#include<deque>
#include<tuple>
#include<queue>
#include<stack>
#include<map>
#include<cstdint>
#include<unordered_map>
#include<boost/multiprecision/cpp_int.hpp>


#define rep(i, n) for(int i = 0; i < ( int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define vi vector<int>
#define vll vector<ll>
#define all(x) (x).begin(),(x).end()
#define F first
#define S second


namespace mp = boost::multiprecision;

using cpp_int = mp::cpp_int;
using ll = long long;
using namespace std;

vector<int>devisor(int n) {
	vector<int>value;
	FOR(i, 1, pow(n, 0.5) + 1) {
		if (n % i == 0) {
			value.push_back(i);
			if (i * i != n) {
				value.push_back(n / i);
			}
		}
	}
	return value;
}
int ans(int gcd, vector<int>devisor,vector<int>&a) {
	bool flag = true;
	int i = 0;
	while (flag) {
		int count = 0;
		rep(j, a.size()) {
			if (a[j] % devisor[i] != 0) {
				count++;
			}
			if (count >= 2) {
				break;
			}
		}
		if (count <= 1) {
			gcd = max(gcd, devisor[i]);
			flag = false;
		}
		else {
			i++;
		}
	}
	return gcd;
}

int main() {
	int n;
	cin >> n;
	vector<int>a(n);
	rep(i, n) {
		cin >> a[i];
	}
	sort(all(a));

	int b = a[0];
	int c = a[1];
	vector<int>div_b,div_c;
	div_b = devisor(b);
	div_c = devisor(c);
	sort(all(div_b));
	reverse(all(div_b));
	sort(all(div_c));
	reverse(all(div_c));
	int gcd = 1;
	int answer = max(ans(gcd, div_c, a), 
		ans(gcd, div_b, a));
	cout << answer << endl;

}


Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A, B;
		A = sc.nextInt();
		B = sc.nextInt();
		if(A != 1 && ( A < B || B == 1)) System.out.print("Bob");
		else if(B != 1 && (A > B || A == 1)) System.out.print("Alice");
		else if(A == B) System.out.print("Draw");
	}
}

Measured memory_bytes: 21844
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>

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

//qsort(str, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}
int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );}
int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;}
int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);}

int main(void){
 
    int s[3], ans=0;
    
    rep(i, 3){
        scanf("%d", &s[i]);
        ans+=s[i];
    }
    
    if (ans>=22) {
        printf("bust");
    } else {
        printf("win");
    }

    return 0;
}



Measured memory_bytes: 1736
import sys
input = sys.stdin.readline

r, c, k = map(int, input().split())
v = [[0 for _ in range(c)] for _ in range(r)]

for i in range(k):
    rr, cc, vv = map(int, input().split())
    rr, cc = rr - 1, cc - 1
    v[rr][cc] = vv

dp = [[0 for _ in range(c + 1)] for _ in range(4)]
for y in range(r):
    tmp = [[0 for _ in range(c + 1)] for _ in range(4)]
    for x in range(c):
        for i in range(2, -1, -1):
            dp[i + 1][x] = max(dp[i + 1][x], dp[i][x] + v[y][x])
        for i in range(4):
            tmp[0][x] = max(tmp[0][x], dp[i][x])
            dp[i][x + 1] = max(dp[i][x + 1], dp[i][x])
    dp = tmp
print(dp[0][c - 1])


Measured memory_bytes: 198476
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
#define MOD 1000000007
using namespace std;

bool** table;
int** dp;
int N;

int recursive(int left,int right){

	if(left == right)return dp[left][right] = 0;
	if(dp[left][right] != -1)return dp[left][right];
	if((right-left+1)%2 == 1){
		return dp[left][right] = max(recursive(left,right-1),recursive(left+1,right));
	}
	if(table[left][(right-left+1)/2] == true)return dp[left][right] = right-left+1;
	if(right == left+1 && table[left][1] == false)return 0;

	int ans = 0;
	for(int i = left+1; i <= right-2; i++){
		ans = max(ans,recursive(left,i)+recursive(i+1,right));
	}
	return dp[left][right] = ans;
}

int main(){

	int data[301];
	table = new bool*[301];
	dp = new int*[301];
	for(int i = 0; i <= 300; i++){
		table[i] = new bool[151];
		dp[i] = new int[301];
	}

	bool FLG;

	while(true){
		scanf("%d",&N);
		if(N == 0)break;

		if(N <= 1){
			printf("0\n");
			continue;
		}

		for(int i = 0; i <= 300; i++){
			for(int k = 0; k <= 150; k++)table[i][k] = false;
			for(int k = 0; k <= 300; k++){
				dp[i][k] = -1;
			}
		}

		for(int i = 1; i <= N; i++)scanf("%d",&data[i]);

		for(int i = 1; i <= N-1; i++){
			if(abs(data[i+1]-data[i]) <= 1)table[i][1] = true;

		}

		for(int length = 4; length <= N; length += 2){
			for(int left = 1; left+length -1 <= N; left++){
				FLG = false;

				if(table[left+1][(length-2)/2] == true && abs(data[left] - data[left+length-1]) <= 1)FLG = true;

				if(!FLG){
					for(int i = 2; i <= length-2; i += 2){
						if(table[left][i/2] == true && table[left+i][(length-i)/2] == true){
							FLG = true;
							break;
						}
					}
				}
				if(FLG){
					table[left][length/2] = true;
				}
			}
		}

		printf("%d\n",recursive(1,N));
	}

	return 0;
}

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

using namespace std;

int main() {
  int N;
  cin >> N;
  int lcm = 1;
  for(int i = 0; i < N; i++) {
    int a;
    cin >> a;
    lcm = a / __gcd(lcm, a) * lcm;
  }
  cout << lcm << endl;
}



Measured memory_bytes: 3112
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



#define SIZE 1000005

ll N,K;
vector<int> G[100005];
ll num_child[SIZE];
ll fact[SIZE],inv_fact[SIZE];

ll mod_pow(ll x,ll count, ll mod){

	if(count == 0)return 1;
	ll ret = mod_pow((x*x)%mod,count/2,mod);
	if(count%2 == 1){

		ret = (ret*x)%mod;
	}
	return ret;
}


ll extgcd(ll a,ll b,ll &x,ll &y){
	ll d = a;
	if(b != 0){
		d = extgcd(b,a%b,y,x);
		y -= (a/b)*x;
	}else{
		x = 1;
		y = 0;
	}
	return d;
}

ll mod_inverse(ll a,ll m){
    ll x,y;
    extgcd(a,m,x,y);
    return (m+x%m)%m;
}

ll nCk(ll n,ll k){

	ll ret = fact[n]*inv_fact[k];
	ret %= MOD;
	ret *= inv_fact[n-k];

	return ret%MOD;
}

ll ans = 1;

void dfs(int node_id,int pre,int D){

	num_child[node_id] = 0;

	for(int i = 0; i < G[node_id].size(); i++){

		int child = G[node_id][i];
		if(child == pre)continue;

		num_child[node_id]++;
	}

	//printf("node_id:%d D:%d num_child:%lld\n",node_id,D,num_child[node_id]);

	if(D == 0){

		ans *= K;
		if(K-1 < num_child[node_id]){
			ans = 0;
			return;
		}

		ll mult = (nCk(K-1,num_child[node_id])*fact[num_child[node_id]])%MOD;
		ans *= mult;
		ans %= MOD;

		//printf("ans:%lld\n",ans);

	}else{

		if(K-2 < num_child[node_id]){
			ans = 0;
			return;
		}

		ll mult = (nCk(K-2,num_child[node_id])*fact[num_child[node_id]])%MOD;
		ans *= mult;
		ans %= MOD;
	}

	for(int i = 0; i < G[node_id].size(); i++){

		int child = G[node_id][i];
		if(child == pre)continue;

		dfs(child,node_id,D+1);
	}
}



int main(){

	fact[0] = 1;
	for(ll i = 1; i < SIZE; i++){
		fact[i] = i*fact[i-1];
		fact[i] %= MOD;
	}
	inv_fact[SIZE-1] = mod_inverse(fact[SIZE-1],MOD);
	for(ll i = SIZE-1; i >= 1; i--){

		inv_fact[i-1] = inv_fact[i]*i;
		inv_fact[i-1] %= MOD;
	}

	scanf("%lld %lld",&N,&K);

	int from,to;

	for(ll i = 0; i < N-1; i++){

		scanf("%d %d",&from,&to);
		from--;
		to--;

		G[from].push_back(to);
		G[to].push_back(from);
	}

	dfs(0,-1,0);

	printf("%lld\n",ans);

	return 0;
}


Measured memory_bytes: 29696
while line = gets
    c1, c2, c3 = line.chomp.split.map(&:to_i)
    arr = (1..10).to_a
    arr.delete c1
    arr.delete c2
    arr.delete c3
    limit = 20 - c1 - c2
    count = arr.count{|x| x <= limit}
    puts count >= 4 ? "YES" : "NO"
end



Measured memory_bytes: 6848
#include<bits/stdc++.h>
using namespace std;
string s;
main(){
  cin>>s;
  for(int i=0;i<s.size();++i){
    if(i<1)continue;
    if(s[i]==s[i-1]){
      printf("%d %d\n",i,i+1);
      return 0;
    }
    if(i<2)continue;
    if(s[i]==s[i-2]){
      printf("%d %d\n",i-1,i+1);
      return 0;
    }
  }
  printf("-1 -1\n");
}


Measured memory_bytes: 512
N, M = map(int, input().split())
A = list(map(int, input().split()))
num = [2, 5, 5, 4, 5, 6, 3, 7, 6]
ans = {}
for i in range(N + 1):
    x = 0
    for j in A:
        k = num[j - 1]
        if i - k < 0:
            continue
        if i == k:
            x = max(x, j)
            continue
        an = ans[i - k]
        if an == 0:
            continue
        x = max(x, an * 10 + j)
    ans[i] = x
print(ans[N])

Measured memory_bytes: 52060
#include <bits/stdc++.h>
#define F first
#define S second
using namespace std;
using ll = long long;
typedef pair<int, int> P;
ll Mod = 1000000007;
int main() {
  int H,W,N;
  cin >> H >> W >> N;
  int X[N],Y[N];
  vector<int> R[H];
  map<P,bool> mp;
  for (int i = 0; i < N; i++) {
    cin >> X[i] >> Y[i];
    X[i]--; Y[i]--;
    mp[make_pair(X[i],Y[i])] = true;
    R[X[i]].push_back(Y[i]);
  }
  for (int i = 0; i < H; i++) {
    if (!R[i].empty()) {
      sort(R[i].begin(),R[i].end());
    }
  }
  int DP[H];
  DP[0] = 1;
  for (int i = 1; i < H; i++) {
    if (mp[make_pair(i,DP[i-1])]) {
      DP[i] = DP[i-1];
    } else {
      DP[i] = DP[i-1] + 1;
    }
  }
  int ans = H;
  for (int i = 0; i < H-1; i++) {
    if (!R[i+1].empty()) {
      if (R[i+1][0]+1 <= DP[i]) {
        ans = i+1;
        break;
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 37316
#include <stdio.h>
#include <string.h>

int main(void){
	char str[25] = {0}, afstr[25] = {0};
	int i, j = 0;

	scanf("%s", str);
	
	for(i = strlen(str) - 1;i >= 0;i--){
		afstr[j] = str[i];
		j++;
	}
	
	printf("%s\n", afstr);
	
	return 0;
}

Measured memory_bytes: 520
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    ll n;
    scanf("%lld", &n);

    if (n == 0) {
        cout << '0' << endl;
        return 0;
    }

    ll temp = n;
    string str = "";
    while (temp != 0) {
        if (temp % 2 == 0) {
            str = '0' + str;
        } else {
            str = '1' + str;
            temp--; //偶数にする
        }
        temp /= -2;
    }
    cout << str << endl;
    return 0;
}

Measured memory_bytes: 3696
import heapq

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

arr=[0]*N
for z in range(N):
  heapq.heapreplace(arr,int(input()))

arr2=[0]*K
for z in range(K):
  arr2[z]=heapq.heappop(arr)

r=arr2[-1]-arr2[0]

z=0
try:
  while True:
    arr2[z]=heapq.heappop(arr)
    if z==K-1:
      zz=0
    else:
      zz=z+1

    rb=arr2[z]-arr2[zz]
    if rb<r:
      r=rb

    z+=1
    if z==K:
      z=0

except Exception:
  pass

print(r)

Measured memory_bytes: 54232
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <math.h>
#include <algorithm>
#include <deque>
#include <climits>
using namespace std;
#define rep(i,l,r) for(int i=l;i<r;i++)
#define repb(i,r,l) for(int i=r;i>l;i--)
#define ll long long
#define ull unsigned long long
#define ve vector
#define umap unordered_map
#define iter iterator
const int MxN = 1e9;
void solve() {
    ll x;
    cin>>x;
    x *= 2;
    ll l=0, r=MxN;
    while (l<r-1) {
        ll m=(l+r)/2;
        if ((m+1)*m >=x) {
            r=m;
        } else {
             l=m;
        }
    }
    cout<<r<<endl;
}

int main() {
    solve();
    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
import sys
import numpy as np
MOD = 1000000007  # type: int


def solve(N: int, s: str):

    # DP[i][j]はi文字目までをみたす順列のうち、最後がjで終わるものの個数
    DP = np.zeros(N+1, dtype=np.int64)
    DP[1] = 1

    for i in range(1, N):
        acc = np.cumsum(DP)
        if s[i-1] == "<":
            DP[1:i+2] = np.mod(acc[:i+1], MOD)
        else:
            DP[1:i+2] = np.mod(acc[i+1]-acc[:i+1], MOD)

    print(np.mod(DP.sum(), MOD))
    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    s = next(tokens)  # type: str
    solve(N, s)


if __name__ == '__main__':
    main()


Measured memory_bytes: 12496
import java.util.Arrays;
import java.util.Scanner;


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

        int A = sc.nextInt();
        int B = sc.nextInt();
        int Q = sc.nextInt();
        
        int[] ans = new int[101];
        
        for(int i = 100;i > 0 ; i--) {
        	if((A%i==0) && (B%i==0)) {
        		ans[i] = i;
        	}
        }
        Arrays.sort(ans);
        System.out.println(ans[101-Q]);
    }
}

Measured memory_bytes: 22868
fun main(arg: Array<String>){
    val O: String = readLine()!!
    val E: String = readLine()!!

    for(i in 0..E.length-1){
        print("${O[i]}${E[i]}")
    }
    if(O.length != E.length){
        print(O[O.length-1])
    }
    println()
}


Measured memory_bytes: 33532
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
	ios_base::sync_with_stdio (false);
    cin.tie (NULL);
	int n,k;
	cin>>n>>k;
    int a[n];
    for(int i=0;i<n;i++)
    	cin>>a[i];
    sort(a,a+n);
    long long sum=0;
    for(int i=0;i<k;i++)
    	sum+=a[i];
    cout<<sum;
	return 0;
}

Measured memory_bytes: 3640
N = int(input())
s = [int(input()) for _ in range(N)]
s.sort()
ans = sum(s)
if ans % 10 != 0:
    print(ans)
    exit()
for i in range(N):
    if s[i] % 10 != 0:
        print(ans-s[i])
        exit()
print(0)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
  cin>>n;
  string s;
  cin>>s;
  char c=s[0];
  int count=1;
  for(int i=1;i<n;i++){
  	if(s[i]==c) continue;
  	else{
  		count++;
  		c=s[i];
  	}
  }
  cout<<count<<endl;
      
    return 0;
}

Measured memory_bytes: 512
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
using namespace std;
using ll = long long;
constexpr ll INF = 1010000000000000017LL;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()

class ARegistration {
public:
	void solve(std::istream& in, std::ostream& out) {
        string s;
        string t;
        in>>s>>t;
        if(s==t.substr(0,s.size())) out<<"Yes"<<endl;
        else out<<"No"<<endl;
	}
};


int main() {
	ARegistration solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3136
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <ctime>
#include <complex>
#include <cassert>
#include <iomanip>
#include <tuple>
using namespace std;
typedef long long LL;
typedef pair<int,int> P;
typedef tuple<int,int,int,int> T;

unsigned dist[2][52][52][1<<10];
char M[52][52];
char MS[10][52][52];
int main() {
	int W,H;
	memset(dist,-1,sizeof(dist));
	cin >> W >> H;
	int x=0,y=0;
	for(int i=1;i<=H;i++){
		for(int j=1;j<=W;j++){
			cin >> M[i][j];
			if(M[i][j]=='%'){
				x=i;
				y=j;
			}
		}
	}
	int S=0;
	cin >> S;
	for(int k=0;k<S;k++){
		for(int i=1;i<=H;i++){
			for(int j=1;j<=W;j++){
				cin >> MS[k][i][j];
			}
		}
	}
	queue<T> Q;
	Q.push(T(0,x,y,0));
	dist[0][x][y][0]=0;
	while(Q.size()){
		T t=Q.front();
		int f=get<0>(t);
		x=get<1>(t);
		y=get<2>(t);
		int st=get<3>(t);
		unsigned d=dist[f][x][y][st];
		int dx=1,dy=0;
		Q.pop();
		//cout << f << ", " << x << ", " << y << ", " << st << ": " << dist[f][x][y][st] << endl;
		for(int k=0;k<4;k++,swap(dx,dy),dx*=-1){
			int p=x+dx;
			int q=y+dy;
			if(('a'<=M[p][q]&&M[p][q]<='j')||
			   M[p][q]=='_'||
			   M[p][q]=='%'||
			   M[p][q]=='&'||
			   M[p][q]=='^'||
			   ('A'<=M[p][q]&&M[p][q]<='J')){
				int nex=(M[p][q]=='^'||('A'<=M[p][q]&&M[p][q]<='J'))?1:0;
				for(int i=0;i<S;i++){
					if((st&(1<<i))&&MS[i][p][q]=='*'){
						nex++;
					}
				}
				if(nex%2!=f){
					continue;
				}
			}
			else if (M[p][q]=='|'){

			}
			else{
				continue;
			}
			if(M[p][q]=='&'){
				cout << d+1 << endl;
				return 0;
			}
			if(d+1<dist[f][p][q][st]){
				dist[f][p][q][st]=d+1;
				Q.push(T(f,p,q,st));
			}
		}
		if(('a'<=M[x][y]&&M[x][y]<='j')||
		   ('A'<=M[x][y]&&M[x][y]<='J')){
			int i=('a'<=M[x][y]&&M[x][y]<='j')?M[x][y]-'a':M[x][y]-'A';
			int nex=MS[i][x][y]=='*'?f^1:f;
			if(d+1<dist[nex][x][y][st^(1<<i)]){
				dist[nex][x][y][st^(1<<i)]=d+1;
				Q.push(T(nex,x,y,st^(1<<i)));
			}
		}
		if(M[x][y]=='|'){
			if(d+1<dist[f^1][x][y][st]){
				dist[f^1][x][y][st]=d+1;
				Q.push(T(f^1,x,y,st));
			}
		}
	}
	cout << "-1" << endl;
	return 0;
}

Measured memory_bytes: 23488
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <vector>

using namespace std;

vector<int> F;
int memo(int n)
{
    int size = F.size();

    if (n < size)
    {
        return F[n];
    }

    for (int i = size; i <= n; i++)
    {
        switch (i)
        {
        case 0:
            F.push_back(1);
            break;
        case 1:
            F.push_back(F[i - 1]);
            break;
        case 2:
            F.push_back(F[i - 1] + F[i - 2]);
            break;
        default:
            F.push_back(F[i - 1] + F[i - 2] + F[i - 3]);
            break;
        }
    }

    return F[n];
}

int main()
{
    int n;
    while (cin >> n && n)
    {
        double ans = memo(n) / (10.0 * 365.0);
        cout << (int)(ceil(ans)) << endl;
    }
    return 0;
}


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

int main(void) {
    int n;
    cin >> n;
    vector<int> numbers(n);
    for (int i = 0; i < n; i++) {
        cin >> numbers.at(i);
    }

    int can_divided = 0;
    bool flag = true;
    for (;;) {
        for (int i = 0; i < n; i++) {
            if (numbers.at(i) % 2 == 0) {
                numbers.at(i) /= 2;
            } else {
                flag = false;
                break;
            }
        }
        if (flag == true) {
            can_divided++;
        } else {
            break;
        }
    }

    cout << can_divided << endl;
}

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

int main() {
    int n;
    string s;
    cin >> n >> s;

    char rgb_list[] = {'R', 'G', 'B'};

    map<char, int> rgb_num;
    for(char c : rgb_list) rgb_num[c] = 0;
    for(int i = 0; i < n; i++) rgb_num[s[i]]++;

    int64_t ans = 0;
    map<char, int> rgb_num_init;
    for(char c : rgb_list) rgb_num_init[c] = rgb_num[c];
    map<char, int> through_rgb_num;
    for(char c : rgb_list) through_rgb_num[c] = 0;

    for(int i = 0; i < n - 2; i++) {
        char si = s[i];
        rgb_num[si]--;
        for(char c : rgb_list) through_rgb_num[c] = rgb_num_init[c] - rgb_num[c];
        for(int j = i + 1; j < n - 1; j++) {
            char sj = s[j];
            through_rgb_num[sj]++;

            if(sj == si) continue;

            char sk;
            if((si == 'R' && sj == 'G') || (si == 'G' && sj == 'R'))       sk = 'B';
            else if ((si == 'G' && sj == 'B') || (si == 'B' && sj == 'G')) sk = 'R';
            else                                                           sk = 'G';

            ans += rgb_num_init[sk] - through_rgb_num[sk];
            if(2 * j - i < n && s[2 * j - i] == sk) ans--;
        }
    }

    cout << ans << endl;

    return 0;
}

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

#define int long long
#define ll long long
#define f1(i,a,b) for(i=a;i<b;i++)
#define f2(i,a,b) for(i=a;i>=b;i--)
#define endl '\n'
#define pb push_back
#define gp " "
#define ff first
#define ss second
#define mp make_pair

const int mod=1000000007;
int i,j;
ll temp;

bool cmp(pair<int,int> a, pair<int,int> b)
{
    if(a.ff>b.ff)
        return true;
    if(b.ff>a.ff)
        return false;
    return a.ss>b.ss;
}

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // #ifndef ONLINE_JUDGE
    //     freopen("in.txt","r",stdin);
    //     freopen("out.txt","w",stdout);
    // #endif
    int n,m;
    cin>>n>>m;
    multiset<int> a;
    f1(i,0,n)
    {
        cin>>temp;
        a.insert(temp);
    }
    // for(auto itr=a.begin();itr!=a.end();itr++)
    // {
    //     cout<<*itr<<gp;
    // }
    vector<pair<int,int>> ans;
    f1(i,0,m)
    {
        int x,y;
        cin>>x>>y;
        ans.pb(mp(y,x));
    }
    sort(ans.begin(),ans.end(),cmp);
    // f1(i,0,m)
    // cout<<ans[i].ff<<gp<<ans[i].ss<<endl;
    f1(i,0,m)
    {
        // cout<<*a.begin();
        if(ans[i].ff<=*a.begin())
        {
            break;
        }
        // for(auto itr=a.begin();itr!=a.end();itr++)
        // {
        //     cout<<*itr<<gp;
        // }
        while(ans[i].ss--)
        {
            if(*a.begin()<ans[i].ff)
            {
                a.erase(a.begin());
                a.insert(ans[i].ff);
        //         for(auto itr=a.begin();itr!=a.end();itr++)
        // {
        //     cout<<*itr<<gp;
        // }
            }
            else
                break;
        }
        // for(auto itr=a.begin();itr!=a.end();itr++)
        // {
        //     cout<<*itr<<gp;
        // }
        // cout<<endl;
    }
    int sum=0;
    for(auto itr=a.begin();itr!=a.end();itr++)
    {
        sum+=*itr;
    }
    cout<<sum;
    return 0;
}

Measured memory_bytes: 7160
#include <stdio.h>
#include <math.h>
/*
int sqrt(int a) {
	int i;
	float res = 1;
	for (i = 0; i < 3; i++) {
		res = (res + a / res) / 2;
	}

	return res;
}
*/


int isPrime(int a) {

	int j;

	if (a == 2) {
		return 1;
	}

	if (a < 2 || a % 2 == 0) {
		return 0;
	}


	for (j = 3; j <= sqrt(a); j += 2) {
		if (a % j == 0) {
			return 0;
		}
	}

	return 1;
}

int main() {

	int num;
	int p_count = 0;
	int n, i;

	scanf("%d", &num);
	
	for (i = 0; i < num; i++) {

		scanf("%d", &n);

		if (isPrime(n)) {
			p_count++;
		}

	}


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

	return 0;
}

Measured memory_bytes: 596
#include<cstdio>
#include<cstdlib>
#include<iostream>
#include<string>
#include<map>
#include<vector>
#include<algorithm>
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

using namespace std;
int ans = 0;

void bfs(char **tile, int w, int h){
  ans++;
  tile[w][h] = '#';

  if(tile[w][h-1] == '.')
  bfs(tile, w, h-1);

  if(tile[w][h+1] == '.')
  bfs(tile, w, h+1);

  if(tile[w-1][h] == '.')
  bfs(tile, w-1, h);

  if(tile[w+1][h] == '.')
  bfs(tile, w+1, h);

  return;
}


int main(){
  int W,H,index_w,index_h;

  while(true){
    cin >> W >> H;
    if(W == 0 && H == 0) break;

    char **tile;
    tile = new char* [H+2];
    REP(i,H+2) tile[i] = new char[W+2];

    REP(i,H+2){
      REP(j,W+2){
        if(i == 0 || i == H+1 || j == 0 || j == W+1) tile[i][j] = '#'; //sentry
        else scanf(" %c",&tile[i][j]);

        if(tile[i][j] == '@') {
          index_h = j;
          index_w = i;
        }

      }
    }
    ans = 0;
    bfs(tile,index_w,index_h);
    
    REP(i,H) delete[] tile[i];
    delete[] tile;
    
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 1268
#include<iostream>
int main(void) {
	std::ios::sync_with_stdio(false);
	int n, COUNT = 0;
	std::cin >> n;
	int x;
	for (int i = 0; i < n; ++i) {
		std::cin >> x;
		if (x == 2) { ++COUNT; }
		else if (x % 2 != 0)
		{
			bool FLUG = false;
			for (int i = 3; i *i <= x; i += 2) {
				if (x%i == 0) {
					FLUG = true;
					break;
				}
			}
			if (FLUG == false) { ++COUNT; }
		}
	}
	std::cout << COUNT << std::endl;
	//system("pause");
	return 0;
}

Measured memory_bytes: 3124
#include<stdio.h>
#include <iostream>

#define N 100005
#define MOD 1000000007

using ll = long long;
ll x, y;

ll p[N];
int pn;

inline ll solve(ll, ll);

int main()
{
	
	std::cin >> x >> y;
	ll d = solve(x, y);

	int ans = 1;
	if (d % 2 == 0) ans++;
	while (d % 2 == 0)	d /= 2;

	for (ll i = 3; i * i <= d; i += 2) {
		if (d % i == 0)
		{
			ans++;
			while (d % i == 0)	d /= i;
		}
	}
	if (d != 1) ans++;

	std::cout << ans << "\n";
	return 0;
}

inline ll solve(ll a, ll b)
{
	if (b == 0) return a;
	else return solve(b, a % b);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A;
  char ope;
  int B;
  
  cin >> A >> ope >> B;
  
  if (ope == '+')
    cout << A + B << endl;
  
  if (ope == '-')
    cout << A - B << endl;
}

Measured memory_bytes: 256
import sys
from collections import deque
h, w = map(int, input().split())
graph = []
for i in range(h):
    a = list(map(int, sys.stdin.readline().split()))
    graph.append(a)
for i in range(h):
    b = list(map(int, sys.stdin.readline().split()))
    for j in range(w):
        graph[i][j] = abs(graph[i][j] - b[j])
result = [[0]*w for _ in range(h)]
result[0][0] = 1 << graph[0][0]
def ts(a, b):
    result = 0
    for i in range(b+1):
        if (a >> i) & 1 > 0:
            result |= (1 << b) >> i
    return result

for i in range(1, h+w-1):
    for j in range(max(0, i-(w-1)), min(i+1, h)):
        ps = 0
        nt = graph[j][i-j]
        if j > 0:
            k= result[j-1][i-j]
            result[j][i-j] |= k << nt | k >> nt | ts(k, nt)
        if i-j > 0:
            k= result[j][i-j-1]
            result[j][i-j] |= k << nt | k >> nt | ts(k, nt)
ans = result[h-1][w-1]
ans = (-ans&ans).bit_length() - 1
print(ans)


Measured memory_bytes: 51548
from functools import reduce
from math import gcd

N=int(input())
A=list(map(int, input().split()))
c=max(A)+1
C=[0]*c
f=1
for i in A:
    C[i]+=1

for i in range(2,c):
    cnt=0
    for j in range(i,c,i):
        cnt+=C[j]
    if cnt>1:
        f=0


if f==1:
    print('pairwise coprime')

elif reduce(gcd, A) == 1:
    print('setwise coprime')

else:
    print('not coprime')

Measured memory_bytes: 204096
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<ctime>
#include<cmath>
#include<stack>
#include<queue>
#include<cstring>

using namespace std;



int main()
{
	int x,t;
cin>>x>>t;
if(x>t)cout<<x-t;
else cout<<0;


return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) (a).begin(), (a).end()
#define pw(x) (1ll<<(x))
#define lb(x) ((x) & -(x))
#define endl "\n"
#define FI(x) freopen(#x".in","r",stdin)
#define FO(x) freopen(#x".out","w",stdout)
typedef double db;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
//typedef uniform_int_distribution<ll> RR;
const int P = 1e9 + 7;
//ll rnd(ll l, ll r) { mt19937 gen(rand()); RR dis(l, r); return dis(gen); }
int add(int a, int b) {if((a += b) >= P) a -= P; return a < 0 ? a + P : a;}
int mul(int a, int b) {return 1ll * a * b % P;}
int kpow(int a, int b) {int r=1;for(;b;b>>=1,a=mul(a,a)) {if(b&1)r=mul(r,a);}return r;}
//----

int a, b, ok;

int main() {
	//FI(a);
	ios::sync_with_stdio(0);
	cin.tie(0);
	//cout << setiosflags(ios::fixed);
	//cout << setprecision(2);
	cin >> a >> b;
	if (a <= 0 && b >= 0) cout << "Zero";
	else {
		ok = 0;
		b = min(b, -1);
		if (a < 0) ok = (b - a + 1) & 1;
		if (ok) cout << "Negative";else cout << "Positive";
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;//list用
using System.Text;//StringBuilder用
using System.Collections;
using System.Linq;
class Program
{
      static List<int> s = new List<int>();
       static List<string> t = new List<string>();
    static decimal result;
static StringBuilder sb = new StringBuilder();
static int N,M,K;
static long[,] table;
    static void Main()
    {
Read1();
      Read5();
      var pr=new PriorityQueue<decimal,int>();
      decimal[] check=new decimal[N];
for(int i=0;i<N;i++){
for(int j=0;j<10;j++){
  if(j>=t[i].Length){  check[i]+=27*(decimal)Math.Pow(28,9-j);}
  else{
  check[i]+=(26-t[i][j]+'a')*(decimal)Math.Pow(28,9-j);
  }
}
  check[i]+=s[i];
}
for(int i=0;i<N;i++){pr.Add(-check[i],i+1);}
for(int i=0;i<N;i++){result=pr.Dequeue().Value;
                    Console.WriteLine(result.ToString());
}
    }


    static void Read1()//1項
    {
        string tmp = Console.ReadLine();
        N = int.Parse(tmp);
    }
 
    static void Read2()//複数項（項目数Ｎ）
    {
        string[] tmp = Console.ReadLine().Split(' ');
        for (int i = 0; i < N; i++) { s.Add(int.Parse(tmp[i])); }
    }
    static void Read3()//1行複数項
   {
       string[] tmp = Console.ReadLine().Split(' ');
       for (int i = 0; i < tmp.Length; i++) { s.Add(int.Parse(tmp[i])); }
    }
    static void Read4()//NK１行
    {
        string[] tmp = Console.ReadLine().Split(' ');
       N = int.Parse(tmp[0]);
       K = int.Parse(tmp[1]);
    }
    static void Read5()//N行K項
    {
      for(int i=0;i<N;i++){
        string[] tmp = Console.ReadLine().Split(' ');
              t.Add(tmp[0]);
       s.Add(int.Parse(tmp[1]));
      }
    }

}
class PriorityQueue<TKey, TValue>
{
    SortedDictionary<TKey, Queue<TValue>> dict = new SortedDictionary<TKey, Queue<TValue>>();
    int count = 0;

    public int Count
   {
        get
       {
            return count;
       }
   }

   public void Add(TKey key, TValue value)
   {
       if (!dict.ContainsKey(key))
       {
           dict[key] = new Queue<TValue>();
       }
 
       dict[key].Enqueue(value);
       count++;
   }

    public KeyValuePair<TKey, TValue> Dequeue()
    {
        var queue = dict.First();
       if (queue.Value.Count <= 1)
        {
           dict.Remove(queue.Key);
        }
        count--;
        return new KeyValuePair<TKey, TValue>(queue.Key, queue.Value.Dequeue());
    }
}

Measured memory_bytes: 13780
#include<bits/stdc++.h>
using namespace std;
int b,c,d,cb,cc;
char a[5000][5000];
int main(){
    cin>>b>>c;
    cb=b;
    cc=c;
    for(int i=0;i<b;i++){
        for(int u=0;u<c;u++){
            cin>>a[i][u];
        }
    }
    for(int rp=0;rp<12000;rp++){
            int ad=0;
        for(int i=0;i<b;i++){
            int ccc=0;
            for(int u=0;u<c;u++){
                if(a[i][u]=='#')ccc++;
            }
            if(ccc==0){
                for(int u=0;u<c;u++){
                    a[i][u]=a[i+1][u];
                    a[i+1][u]='.';
                }
            }
        }


        for(int i=0;i<c;i++){
            int ccc=0;
            for(int u=0;u<b;u++){
                if(a[u][i]=='#')ccc++;
            }
            if(ccc==0){
                for(int u=0;u<b;u++){
                    a[u][i]=a[u][i+1];
                    a[u][i+1]='.';
                }

            }
        }


    }
    int maxx=0,maxy=0;
    for(int i=0;i<b;i++){
        for(int u=0;u<c;u++){
            if(a[i][u]=='#'){
                maxx=max(maxx,i);
                maxy=max(maxy,u);
            }
        }
    }


    for(int i=0;i<maxx+1;i++){
        for(int u=0;u<maxy+1;u++){
            cout<<a[i][u];
        }cout<<endl;
    }





}


Measured memory_bytes: 640
#include<iostream>
#include<string>

using namespace std;

int main(){
string S,T; cin >> S >> T;
  int s = S.size(); int t = T.size();
  if( s < t){cout << "LESS" <<endl; return 0;}
  else if( s > t){cout << "GREATER" << endl; return 0;}
  else{ 
    for(int i = 0; i < S.size(); i++){
      int s = S[i] - '0'; int t = T[i] - '0';
      if(s < t){cout << "LESS" << endl; return 0;}
      else if(s > t){cout << "GREATER" << endl; return 0;}}
      cout << "EQUAL" << endl;return 0;}
  
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
  int c1,c5,c10,c50,c100,c500;
  cin >> c1 >> c5 >> c10 >> c50 >> c100 >> c500;
  cout << ((c500 * 500) + (c100 * 100) + (c50 * 50) + (c10 * 10) + (c5 * 5) + c1 >= 1000) << endl;
  return 0;
}


Measured memory_bytes: 3128
import itertools
import math

N = int(input())
xy = []
for _ in range(N):
    xi, yi = map(int, input().split())
    xy.append([xi, yi])

# print(xy)

sum_dist = 0

# 第二引数を指定しなければ全ての要素の順列を返す
for perm in itertools.permutations(range(N)):
    dist = 0
    for i in range(1, N):
        dist += math.sqrt((xy[perm[i]][0] - xy[perm[i - 1]][0]) **
                          2 + (xy[perm[i]][1] - xy[perm[i - 1]][1])**2)
    # print(sum_dist)
    sum_dist += dist

ans = sum_dist / math.factorial(N)
print(ans)


Measured memory_bytes: 9224
# -*- coding: utf-8 -*-
"""
  problem:
    https://agc021.contest.atcoder.jp/tasks/agc021_a
"""

from __future__ import print_function
import sys

def solve(_input):
    """
    main function.

    Arguments:
    _input -- string of the format "n p", where n and p are positive integer, separated by space " ".
    """

    # input validation
    _li = list(_input.strip())
    try:
        _digits = map(int,_li)
    except (ValueError, IndexError) as ex:
        print ('[ERROR] Please input a whole number', ex)
        return -1

    # preprocessing
    _ans = sum(_digits)

    for _i in range(0,len(_digits)-1):

        if ( _digits[_i] == 0 ):
            continue

        _r = 0
        
        for _j in range(0,_i - 1):
            _r += _digits[_j]
        
        _r += _digits[_i] - 1

        _r += (len(_digits) - _i - 1) * 9

        _ans = max(_ans, _r)

    return _ans

# call
print (solve(sys.stdin.readline()))


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

int dp[4001][4001];

int main(){
  string a,b;

  while(cin >> a >> b){
    for(int i=0;i<=(int)a.size();i++)
      for(int j=0;j<=(int)b.size();j++)dp[i][j] = 0;

    int ans = 0;
    for(int i=1;i<=(int)a.size();i++){
      for(int j=1;j<=(int)b.size();j++){
	if(a[i-1]==b[j-1]){
	  dp[i][j] = dp[i-1][j-1] + 1;
	  ans = max(ans,dp[i][j]);
	}
	//else dp[i][j] = max(dp[i][j-1],dp[i-1][j]);
      }
    }
    cout << ans << endl;
  }
}

Measured memory_bytes: 0
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include<iostream>
#include<algorithm>//next_permutation
#include<complex>
#include<math.h>
#include<sstream>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i < (int)(n); i++)
#define rep2(i, j, n) for (int i = j; i < (int)(n); i++)

int main() {
	string s, t;
	cin >> s >> t;
	cout << t << s << endl;
}


Measured memory_bytes: 256
import numpy as np
import math

def get_nearest_val(l, n):
    i = np.abs(np.asarray(l) - n).argmin()
    return l[i]

n = int(input())
A = list(map(int, input().split(' ')))

max_n = max(A)
A = sorted(A)
max_n = A[-1]
# A = A.pop
A.pop(-1)
key_r = (max_n + 1) / 2
# key_r = int((max_n + 1) / 2)
# print(key_r)

# left_r = get_nearest_val(A, key_r, side='left')
# # print(left_r)
# right_r = get_nearest_val(A, key_r, side='right')
# # print(right_r)

# left_comb = comb(max_n, left_r)
# # print(left_comb)
# right_comb = comb(max_n, right_r)
# # print(right_comb)

# if left_comb >= right_comb:
#     print(str(max_n) + ' ' + str(left_r))
# else:
#     print(str(max_n) + ' ' + str(right_r))

r = get_nearest_val(A, key_r)
# r = get_nearest_val(A[:len(A)-1], key_r)
print(str(max_n) + ' ' + str(r))

Measured memory_bytes: 23116
import heapq
n,m=map(int,input().split())
ab=[[] for i in range(m)]
for i in range(n):
  a,b=map(int,input().split())
  if a<=m:
    ab[a-1].append(-b)
l=[]
ans=0
for i in range(m):
  for j in ab[i]:
    heapq.heappush(l,j)
  if l:
    ans+=-heapq.heappop(l)
print(ans)


Measured memory_bytes: 17604
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string A, op, B;
  cin >> A >> op >> B;
  
  int a = stoi(A);
  int b = stoi(B);
  int ans = 0;
  
  if(op == "+"){
    ans = a + b;
  }
  if (op == "-"){
    ans = a - b;
  }
  
  cout << ans << endl;

}
     

Measured memory_bytes: 3588