akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
typedef long long ll;
//#include <algorithm>
using namespace std;

int main() {
  int N;
  cin >> N;

  ll mod = 1e9 + 7;

  ll dp[1009][4][4][4];

  dp[0][3][3][3] = 1;

  for(int len = 0; len < N; len++){
    for(int c1 = 0; c1 < 4; c1++){
      for(int c2 = 0; c2 < 4; c2++){
        for(int c3 = 0; c3 < 4; c3++){
          if(dp[len][c1][c2][c3] == 0)continue;

          for(int a = 0; a < 4; a++){
            if(c2 == 0 && c3 == 2 && a == 1)continue;
            if(c2 == 0 && c3 == 1 && a == 2)continue;
            if(c2 == 2 && c3 == 0 && a == 1)continue;
            if(c1 == 0 && c2 == 2 && a == 1)continue;
            if(c1 == 0 && c3 == 2 && a == 1)continue;

            dp[len + 1][c2][c3][a] += dp[len][c1][c2][c3];
            //(dp[len + 1][c2][c3][a] += dp[len][c1][c2][c3]) %= mod;
            dp[len + 1][c2][c3][a] %= mod;
          }
        }
      }
    }
  }

  ll ans = 0;
  for(int c1 = 0; c1 < 4; c1++){
    for(int c2 = 0; c2 < 4; c2++){
      for(int c3 = 0; c3 < 4; c3++){
        ans += dp[N][c1][c2][c3];
        ans %= mod;
        //(ans += dp[N][c1][c2][c3]) %= mod;
      }
    }
  }


  cout << ans << endl;
}


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

int main() {
    int N;
    cin >> N;
    vector<int> H(N);
    for (int i = 0; i < N; i++)
        cin >> H[i];

    int res = 1, max_height = H[0];
    for (int i = 1; i < N; i++) {
        if (H[i] >= max_height) {
            max_height = H[i];
            res++;
        }
    }
    cout << res << endl;
    return 0;
}

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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	ll area; cin >> area;
	
	ll X = 1e9;
	pll a, b, c;

	if (area == X*X) {
		a = {0,0}, b = {X,0}, c = {0,X};
	} else {
		ll y = area/X+1, x = area%X;
		a = {0,1}, b = {X,0}, c = {x,y};
	}

	for (pll p: {a,b,c}) cout << p.xx << " " << p.yy << endl;

}



Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
const long long mod = 1000000007;
const long long inf = 1ll << 61;
typedef pair<char, int> P;
struct edge { int to; int to2; int cost; };
int brwa[200005], wrwa[200005];
signed main() {
	int n; cin >> n;
	string s; cin >> s;
	rep(i, s.size()) {
		if (s[i] == '.')wrwa[i + 1]++;
		else brwa[i + 1]++;
	}
	rep(i, n) {
		wrwa[i + 1] += wrwa[i];
		brwa[i + 1] += brwa[i];
	}
	int ans = inf;
	rep(i, n+1) {
	//W0~i-1,Bi~n-1
		ans = min(ans, brwa[i] + wrwa[n] - wrwa[i]);
	}
	cout << ans << endl;
}


Measured memory_bytes: 3716
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstdio>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)2e18
#define jck 3.141592

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;


ll dp[1010][1010];

int main(){
	int H,W; cin >> H >> W;
	vector<vector<char>> a(H,vector<char>(W));
	rep(i,H)rep(j,W) cin >> a[i][j];
	rep(i,1010)rep(j,1010) dp[i][j] = 0;
	repr(i,1,H+1){
		if(a[i-1][0] == '#') break;
		dp[i][1] = 1;
	}
	repr(i,1,W+1){
		if(a[0][i-1] == '#') break;
		dp[1][i] = 1;
	}
	repr(i,1,H)repr(j,1,W){
		if(a[i][j] == '.'){
			dp[i+1][j+1] = dp[i][j+1] + dp[i+1][j];
			dp[i+1][j+1] %= MOD;
		}
	}
	cout << dp[H][W] << endl;
}


Measured memory_bytes: 9216
import sys
n,m=map(int,input().split())
A=[0]*n
B=[0]*m
C=[0]*n
for i in range(0,n):
	A[i]=list(map(int, input().split()))
	
for i in range(0,m):
	B[i]=int(input())
for i in range(0,n):
	for j in range(0,m):
		C[i]+=A[i][j]*B[j]	
	print(C[i])

Measured memory_bytes: 7036
#include<bits/stdc++.h>
using namespace std;
char s[2005][2005];
int n,m,a[2005],b[2005];
int main()
{
	scanf("%d%d",&n,&m);
	int ans=max(n,m);
	for(int i=0;i<n;i++)scanf("%s",s[i]);
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<m-1;j++)if(i&&!(s[i-1][j+1]^s[i][j]^s[i-1][j]^s[i][j+1]))a[j]++;else a[j]=1;
		int t=0;
		for(int j=0;j<=m-1;j++)
		{
			while(t&&a[b[t-1]]>=a[j])
			{
				int x=b[--t];
				if(t==0)ans=max(ans,(j+1)*a[x]);else ans=max(ans,(j-b[t-1])*a[x]);
			}
			b[t++]=j;
		}
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 4224
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int i = kb.nextInt();
		int j = kb.nextInt();
		if (i != j) {
			System.out.println("No");
		} else
			System.out.println("Yes");
		kb.close();
	}

}


Measured memory_bytes: 22996
#include<iostream>
#include<cmath>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cstring>
#include<queue>
#include<stack>

using namespace std;

#define INF 999999999
#define REP(i,n) for(int i=0; i<(int)(n); i++)

bool mew(string s){
	//cout << "0:" << s <<endl;
	int m, e, w;
	if(s == "mew") return true;
	for(int i=1;i<s.size();i+=3){
		if(s[i]=='e'){
			if(i!=1){
				m=0; e=0; w=0;
				for(int j=1;j<i;j++){
					if(s[j]=='m') m++;
					else if(s[j]=='e') e++;
					else if(s[j]=='w') w++;
				}
				if(m!=e||e!=w||w!=m) continue;
			}
			if(i!=s.size()-2){
				m=0; e=0; w=0;
				for(int j=i+1;j<s.size()-1;j++){
					if(s[j]=='m') m++;
					else if(s[j]=='e') e++;
					else if(s[j]=='w') w++;
				}
				if(m!=e||e!=w||w!=m) continue;
			}
			if(i==1)return mew(s.substr(i+1,s.size()-3));
			else if(i==s.size()-2)return mew(s.substr(1,s.size()-3));
			else return mew(s.substr(1,i-1))&&mew(s.substr(i+1,s.size()-2-i));
		}
	}
	return false;
}

int main(){
	int i, j;
	string s;
	cin >> s;
	if(mew(s)) cout << "Cat" << endl;
	else  cout << "Rabbit" << endl;
	return 0;
}

Measured memory_bytes: 1260
#include<iostream>
#include<cstdio>
#include<cstring>
#include<vector>
#include<string>
using namespace std;
const int S=62;
inline int read(){
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9'){
		if(c=='-')f=-1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=(x<<1)+(x<<3)+c-'0';
		c=getchar();
	}
	return x*f;
}
int len,t[66];
string ch;
string dfs(int l,int r){
	if(l==r){
		string myh(t[l],ch[l]);
		return myh;
	}
	int mid=(l+r)>>1;
	string L=dfs(l,mid),R=dfs(mid+1,r),myh="";
	int j=0;
	for(int i=0;i<(int)L.length();++i){
		while(j<(int)R.size()){
			string s=myh+R[j]+L.substr(i,L.length()-i);
			cout<<"? "<<s<<endl;
			int qwq=read();
			int o=L.length()+j+1;
			if(len-qwq!=o)break;
			myh+=R[j++];
		}
		myh+=L[i];
	}
	myh+=R.substr(j,R.length()-j);
	return myh;
}
int main(){
	ch="?";
	for(char i='a';i<='z';++i)ch+=i;
	for(char i='A';i<='Z';++i)ch+=i;
	for(char i='0';i<='9';++i)ch+=i;
	for(int i=1;i<=S;++i){
		string s(128,ch[i]);
		cout<<"? "<<s<<endl;
		t[i]=128-read();
		len+=t[i];
	}
	string ans=dfs(1,S);
	cout<<"! "<<ans<<endl;
	return 0;
}



Measured memory_bytes: 3760
def main():

    n=int(input())
    s=input()

    i,j=0,1
    ans=0
    while j<n:
        if s[i:j] in s[j:]:
            if j-i>ans: ans=j-i
            j+=1
        else:
            i+=1
            j+=1

    print(ans)

            

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
def resolve():
    '''
    code here
    '''
    import sys

    N = int(input())
    adjacency_list = [[int(item) for item in input().split()] for _ in range(N)]

    adjacency_mat = [[0 for _ in range(N)] for _ in range(N)]

    for i, adjacency in enumerate(adjacency_list):
        if adjacency[1] != 0:
            for j in adjacency[2:]:
                adjacency_mat[i][j-1] = 1

    for item in adjacency_mat:
        print(*item)

if __name__ == "__main__":
    resolve()



Measured memory_bytes: 6396
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define ins insert
#define pqueue(x) priority_queue<x,vector<x>,greater<x>>
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define vtpl(x,y,z) vector<tuple<x,y,z>>
#define at(x,i) get<i>(x);
#define rev(x) reverse(x);
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
using vpl=vector<pl>;
using vvpl=vector<vpl>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9+10;
const ll INF=4e18;
const ll dy[8]={1,0,-1,0,1,1,-1,-1};
const ll dx[8]={0,-1,0,1,1,-1,1,-1};
ll modfac(ll a){
    ll ans=1;
    while(a>1){
        ans*=a;
        ans%=1000000007;
        a--;
    }
    return ans;
}
ll modinv(ll a,ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
}
struct UnionFind {
    vector<int> par;
    
    UnionFind(int n) : par(n, -1) {}

    int root(int x) {
        if (par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
    
    bool same(int x, int y) {
        return root(x) == root(y);
    }
    
    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y);
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    
    int size(int x) {
        return -par[root(x)];
    }
};
ll modpow(ll a, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
    ll n,m;cin >> n >>m;
    vl l(m),r(m);
    rep(i,m){
        cin >> l[i] >>r[i];
        l[i]--;r[i]--;
    }
    rev(all(l));
    rev(all(r));
    vl ans(m);
    ans[0]=n*(n-1)/2;
    UnionFind uf(n);
    rep(i,m-1){
        ll a=l[i],b=r[i];
        ll s=uf.size(a)*uf.size(b);
        if(!uf.same(a,b))ans[i+1]=ans[i]-s;
        else ans[i+1]=ans[i];
        uf.merge(a,b);
    }
    rev(all(ans));
    rep(i,m){
        cout <<ans[i] <<endl;
    }
}

Measured memory_bytes: 4096
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
q=i1()
import math
y=[]
for i in range(q):
 y.append(i2())

for a,b in y:
 x=a*b
 c=int(math.sqrt(x))
 if c**2==x:
    c-=1
 z=2*c
 if c>0 and (x//c)==c:
   z-=1
 if c>0 and x%c==0 and (x//c-1)==c:
   z-=1
 if a<=c:
   z-=1
 if b<=c:
   z-=1
 print(z)

Measured memory_bytes: 38384
import std.stdio;
import std.string;
import std.conv;
import std.algorithm;
import std.typecons;

void main() {
	auto S = readln;
	int[char] count;
	foreach (c; S) {
		if (c != '\n')
		count[c]++;
	}
	int[] data;
	int oddCount = 0;
	foreach(int co; count) {
		if (co % 2 == 1) oddCount++;
		else data ~= co / 2;
	}
	if (oddCount > 1) {
		writeln("0");
		return;
	}
	ulong evenCount = S.length - oddCount;
	if (evenCount == 0) {
		writeln("1");
		return;
	}
	//evenCount / 2???????????????????????????????????????)
	auto a = evenCount / 2;
	//data??????????????????????????§?????§?¨???????????????????
	auto combi(ulong a, ulong b) {
		auto u = 1, d = 1;
		foreach (i; 0..b) {
			u *= a;
			a--;
		}
		foreach (j; 0..b) {
			d *= b - j;
		}
		return u / d;
	}
	ulong result = 1;
	foreach (int co; data) {
		result *= combi(a, co);
		a -= co;
	}
	writeln(result);
}

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

int main(void) {
	int N;
	scanf("%d", &N);
	int a[100];
	for (int i = 0; i < N; i++) {
		scanf("%d", &a[i]);
	}
	sort(a, a + N);

	printf("%d\n", a[N - 1] - a[0]);
}


Measured memory_bytes: 3792
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input, "index" : 0, "max" : input.length,
  "hasNext" : function(){return (this.index < this.max);},
  "next" : function(){
    if(!this.hasNext()){return "";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  }
}
Main();
function next(){return obj.next();}
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var one = nextIntArray();
  var output = (1 / one[0]) + (1 / one[1]);
  myout(1 / output);
}


Measured memory_bytes: 7500
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
#include <array>
#include <numeric>
#include <regex>
#include <bitset>
#include <deque>
#include <assert.h>


using namespace std;
typedef long long ll;
typedef pair<int, int> p_ii;

const int INF = 1e9;
const double PI = acos(-1.0);
const ll MOD = 1e9 + 7;

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define debug(x) cout << #x << ": " << x << endl;



int main() {
	ll x, y;
	cin >> x >> y;

	ll res = (ll)1e15;
	vector<ll> a = {y-x, y+x+1, -y-x+1, -y+x+2,};
	for (int i = 0; i < 4; i++)
	{
		if (a[i] < 0)continue;
		res = min(res, a[i]);
	}
	cout << res << endl;

	return 0;
}

Measured memory_bytes: 256
N = int(input())
lst = list(map(int, input().split()))
dp = [0 for i in range(N)]
dp[1] = abs(lst[1] - lst[0])
for i in range(2,N):
    dp[i] = min(dp[i-2]+abs(lst[i]-lst[i-2]), dp[i-1]+abs(lst[i]-lst[i-1]))
print(dp[-1])

Measured memory_bytes: 13928
#include <stdio.h>
int main() {
	int r,c;
	scanf("%d",&r);
	scanf("%d",&c);
	int N;
	scanf("%d",&N);
	
	if (r < c)
	{
		r = c;
	}
	
	if ( N%r == 0 )
	{
		printf("%d\n",N/r);
	} 
	else if ( N%r != 0)
	{
		printf("%d\n",(N/r)+1);
	}

    return 0;
}

Measured memory_bytes: 1732
[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.map f

[<EntryPoint>]
let main argv =
    let [|a;b|] = reads int
    if a >= 13 then
        b
    elif 6 <= a && a <= 12 then
        b / 2
    else
        0
    |> printfn "%i"
    0

Measured memory_bytes: 14044
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
#include<map>
#include<cstdlib>



using namespace std;

long long int a,b,k;

int main(){
    cin >> a >> b >> k;
    if(k <= a) a -= k;
    else{
        b -= k - a;
        a = 0;
        if(b < 0) b = 0;
    }
    cout << a << " " << b << endl;
    return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define dbl double
#define forn(i,n,k) for(int i=0;i<n;i=i+k)
#define forpn(p,n,k) for(int i=p;i<n;i+=k)
#define for0(i,n) for(int i=0;i<n;i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define all(v) v.begin(),v.end()
using namespace std;
int no_of_bits(long long n)
{
    int count=0;
    while(n>0)
    {
        n=n>>1;
        count++;
    }
    return count;
}
long long gcd(int a,int b)
{
    if(b==0) return a;
    else return gcd(b,a%b);
}
bool isPrime(int n) {
    
    if (n == 1) {
        return false;
    }

    int i = 2;
  
    while (i*i <= n) {
        
        if (n % i == 0) {
            
            return false;
        }
        i += 1;
    }
    
    return true;
}
int main()
{   ios::sync_with_stdio(0);
    int t;
    // cin>>t;
    t=1;
    cin.tie(0);
    cout.tie(0);
    while(t--)
    {
        int n;
        cin>>n;
        int a[n][3];
        for0(i,n){
            for0(j,3) cin>>a[i][j];
        }
        int dp[n+1][3];
        memset(dp,0,sizeof(dp));
        for(int i=0;i<n;i++){
            for0(j,3){
                for0(k,3){
                    if(j==k) continue;
                    else{
                        dp[i+1][k]=max(dp[i+1][k],dp[i][j]+a[i][k]);
                    }
                }
            }
        }
        cout<<max(dp[n][0],max(dp[n][1],dp[n][2]))<<endl;
    }
    return 0;
}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
#define vi vector<int>
#define vvi vector<vector<int> >
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
using ll = long long;
using ld =long double;
#define int ll
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<int,pii> piii;
#define mp make_pair
signed main(){
    int n; cin>>n;
    vi a(n);
    vi b(n);
    rep(i,n)cin>>a[i];
    rep(i,n)cin>>b[i];
    int dif=0;
    int cnt=0;
    rep(i,n){
        if(a[i]>b[i])dif+=a[i]-b[i];
        else if(b[i]>a[i])cnt+=(b[i]-a[i])/2;
    }
    if(cnt>=dif)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    //cout<<cnt<<" "<<dif<<endl;
}



Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll, ll> P;
using VP = vector<P>;
using VVP = vector<VP>;
using VI = vector<ll>;
using VVI = vector<VI>;
using VVVI = vector<VVI>;
const int inf = 1e9 + 7;
const ll INF = 1LL << 61;
const ll mod = 1e9 + 7;

template <class T> inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

template <class T> inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int i, j;
    int n;
    cin >> n;
    switch (n % 10) {
        case 2:
        case 4:
        case 5:
        case 7:
        case 9: cout << "hon"; break;
        case 0:
        case 1:
        case 6:
        case 8: cout << "pon"; break;
        case 3: cout << "bon"; break;
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 3652
#include <stdio.h>
int main(void){
int a,b,c,z;

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

if(a>c){
z=a;
a=c;
c=z;
}
if(a>b){
z=a;
a=b;
b=z;
}
if(b>c){
z=b;
b=c;
c=z;
}
printf("%d %d %d\n",a,b,c);

return 0;
}



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

int d, n;

int ans;

int main(void){
  // Here your code !
  scanf("%d %d", &d, &n);

  n = (n == 100) ? 101 : n;

  ans = pow(100, d) * n;

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

  return 0;
}


Measured memory_bytes: 256
// #include {{{
#include <iostream>
#include <cassert>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <string>
#include <bitset>
#include <vector>
#include <complex>
#include <algorithm>
using namespace std;
// }}}
// #define {{{
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#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 all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
// }}}

const int N = 5 + 7 + 5 , P = 1e9 + 7 , M = 100;
inline void pp(int &x,int d) {if((x+=d)>=P)x-=P;}
int n , x , y , z , m;
int f[1 << N] , g[1 << N] , nxt[11][1 << N] , pw10[M];

int main(){
  rep(i,0,M) pw10[i]=i?10ll*pw10[i-1]%P:1;
  cin >> n >> x >> y >> z;
  m = x + y + z;
  rep(i,1,11) {
    rep(j,0,x) nxt[i][1<<j]=j+i<=x?(1<<(j+i)):0;
    rep(j,x,x+y) nxt[i][1<<j]=j+i<=x+y?(1<<(j+i)):0;
    rep(j,x+y,x+y+z) nxt[i][1<<j]=j+i<=x+y+z?(1<<(j+i)):0;
    rep(j,0,m) rep(k,0,1<<j) nxt[i][k|(1<<j)]|=nxt[i][k]|nxt[i][1<<j];
  }
  f[1] = 1;
  int ans = 0;
  rep(i,0,n) {
    rep(j,0,1<<m) g[j]=0;
    rep(j,0,1<<m) if(f[j]) rep(k,1,11){
      int t=nxt[k][j] | 1;
      if(t>>m&1) pp(ans,ll(f[j])*pw10[n-1-i]%P);
      else pp(g[t],f[j]);
    }
    rep(j,0,1<<m) f[j]=g[j];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 6400
# ANSHUL GAUTAM
# IIIT-D

A,B,C = map(int, input().split())
m = max(A,B,C)
s = sum((m-A,m-B,m-C))
if(s%2 == 0):
	print(s//2)
else:
	print(s//2 + 2)






Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <stack>
#include <algorithm>
#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <stdio.h>
#include <math.h>
#include <bitset>


using namespace std;

typedef long long ll;

typedef vector<vector<int>> vvi;
typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<ll> vll;

typedef pair<int, int> P;

typedef queue<int> qi;
typedef queue<string> qs;


#define rep(i, n) for(int i=0; i<(n); ++i)
#define repp(i, a, b) for(int i = (a); i <= (b); i++)
#define Rep(i, n) for(int i=n; i >= 0; i--)

#define all(v) v.begin(), v.end()
//sort( all(v) )　などと使える

int n, k;
vll A;


int main(){
    cin >> n >> k;
    rep(i, n){
        ll a;
        cin >> a;
        A.push_back(a);
    }

    ll ans = pow(10, 16);

    rep(bit, (1 << n)){
        //
        if(__builtin_popcount(bit) < k) continue;
        //
        ll cost = 0;
        ll max_h = A[0];

        for(int i = 1; i < n; i++){
            if(bit & (1 << i)){
                cost += max(max_h - A[i] + 1, (ll)0);
                max_h = max(max_h + 1, A[i]);
            }

            else max_h = max(max_h, A[i]);

            

        }

        ans = min(ans, cost);
    }







    cout << ans << endl;
}

Measured memory_bytes: 256
def main():
    N = int(input())
    lst_d = list(map(int, input().split()))

    ans = 0
    for i in range(N - 1):
        for j in range(i + 1, N):
            x = lst_d[i]
            y = lst_d[j]
            ans += x * y
    print(ans)


if __name__ == "__main__":
    main()

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

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            long[] In = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
            long n = In[0];
            long p = In[1];
            long ans = 1;
            long max = (long)Math.Pow(p, 1.0 / n);//1じゃなくて1.0
            for(long i =max+1; i>=1; i--)//+1は誤差考慮
            {
                long t = (long)Math.Pow(i,n);
                if (p % t == 0)
                {
                    ans = i;
                    break;
                }
            }
            Console.WriteLine(ans);
        }
    }
}

//TLE
//namespace C
//{
//    class Program
//    {
//        static void Main(string[] args)
//        {
//            long[] In = Console.ReadLine().Split(' ').Select(x=>long.Parse(x)).ToArray();
//            long n = In[0];
//            long p = In[1];
//            long ans=0;
//            long now = 1;
//            for(long i = 1; i <= p; i++)
//            {
//                long x = (long)Math.Pow(now, n);
//                if (x > p) break;
//                if (p % x == 0) ans = i;
//                now++;
//            }
//            Console.WriteLine(ans);
//        }
//    }
//}


Measured memory_bytes: 28552
package main

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

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

func scanString() string   { sc.Scan(); return sc.Text() }
func scanRunes() []rune    { return []rune(scanString()) }
func scanInt() int         { a, _ := strconv.Atoi(scanString()); return a }
func scanInt64() int64     { a, _ := strconv.ParseInt(scanString(), 10, 64); return a }
func scanFloat64() float64 { a, _ := strconv.ParseFloat(scanString(), 64); return a }

func scanInts(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = scanInt()
	}
	return a
}

func debug(a ...interface{}) {
	if os.Getenv("ONLINE_JUDGE") == "false" {
		fmt.Fprintln(os.Stderr, a...)
	}
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}
func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

//•*¨*•.¸¸♪main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)
func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	s := scanInt()
	factorialInit(s)

	ans := 0
	for i := 1; i*3 <= s; i++ {
		ans += comb(i+s-i*3-1, s-i*3)
		ans %= mod
	}
	fmt.Fprintln(wr, ans)
}

const mod = 1000000007

var fac, ifac, inv []int

func factorialInit(n int) {
	fac = make([]int, n+1)
	ifac = make([]int, n+1)
	inv = make([]int, n+1)

	fac[0], fac[1] = 1, 1
	ifac[0], ifac[1] = 1, 1
	inv[1] = 1

	for i := 1; i < n; i++ {
		fac[i+1] = fac[i] * (i + 1) % mod
		inv[i+1] = mod - inv[mod%(i+1)]*(mod/(i+1))%mod
		ifac[i+1] = ifac[i] * inv[i+1] % mod
	}
}

func comb(a, b int) int { return (fac[a] * ifac[b] % mod) * ifac[a-b] % mod }
func perm(a, b int) int { return fac[a] * ifac[a-b] % mod }


Measured memory_bytes: 1820
#include <algorithm>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
constexpr int kMod = 1000000007;
typedef long long LL;

LL gcd(LL a, LL b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}

LL lcm(LL a, LL b) {
  if ((a == 0) || (b == 0)) return 0;
  return ((a / gcd(a, b)) * b);
}

int main() {
  int A, B; std::cin >> A >> B;
  std::cout << lcm(A, B) << std::endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <functional>
#include <ctime>
#include <cmath>
#include <limits>
#include <numeric>
#include <type_traits>
unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}
using namespace std;

int main() {
    int a;
    cin >> a;
    vector<int> g(a);
    vector<int> d(a);
    for (int i = 0; i < a; i++) {
        cin >> g.at(i);
    }    
    for (int i = a; i > 0; i--) {
        int u = g.at(i-1);
        for (int j = 2; j <= a / i; j++) {
            if (d.at(j * i-1) == 1) {
                u++;
            }
        }
        d.at(i-1) = u % 2;
    }
    int y = 0;
    for (int i = 0; i < a; i++) {
        y += d.at(i);
    }
    int s = 0;
    cout << y << endl;
    for (int i = 0; i < a; i++) {
        if (d.at(i) == 1) {
            cout << i + 1;
            s++;
            if (s != y) {
                cout << " ";
            }
        }
    }
        cout << endl;
}

Measured memory_bytes: 2432
#include<stdio.h>
#include<string>
#include<iostream>
using namespace std;
int main()
{
    string s;
    cin>>s;
    long long k,cnt = 0,tmp;
    scanf("%lld",&k);
    bool flag = true;
    if(s[0] != '1') printf("%c\n",s[0]);
    else
    {
        for(int i = 1; i < s.length(); i++)
            if(s[i] == '1' && flag)
            {
                flag = true;
                tmp = i;
            }
            else
            {
                flag = false;
                break;
            }
        if(tmp + 1 >= k) printf("1\n");
        else printf("%c\n",s[tmp+1]);
    }
    return 0;
}


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

#define ll long long
#define ull unsigned long long
#define dbg(args...)    do { cerr << #args << ' ' ; print(args); } while(0); cerr << endl;
#define Max 100005
#define pii pair<int, int>
#define pll pair<ll, ll>
#define fastIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define PI acos(-1)
#define all(a)           a.begin(),a.end()
long long limit = 4294967296;
int MOD = 1000000007;
template <typename T>
void print(const T& x)
{
    cerr<<x<<' ';
}

template <typename T1, typename... T2>
void print(const T1& first, const T2&... anst)
{
    print(first);
    print(anst ...) ;
}

/*direction array*/

/***4 moves***/
/*
int dx[]={1,-1,0,0};
int dy[]={0,0,1,-1};
*/
/***8 moves***/
/*
int dx[] = { 0,  0, -1, -1, -1, +1, +1, +1 } ;
int dy[] = {-1, +1, -1,  0, +1, -1,  0, +1 } ;
*/

/*direction array ends*/

ll gcd(ll a, ll b)
{
    return (b == 0 ? a : gcd(b, a % b));
}

ll lcm(ll a, ll b)
{
    return (a * (b / gcd(a, b)));
}
int main()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);

    fastIO;

    int x; cin>>x;
    if(x == 0) cout<<1<<endl;
    else cout<<0<<endl;
}


Measured memory_bytes: 3648
#include <iostream>
#include <algorithm>

using namespace std;

int main(){
    int result = 0;
    string s;
    cin >> s;
    for(int i = 0; i < s.size(); i++){
        if(s[i] == '+'){
            result++;
        }
        else{
            result--;
        }
    }
    cout << result << endl;
}

Measured memory_bytes: 256
import collections 
d=collections.defaultdict(int) 
n=int(input())
for i in range(n):
	d[input()]+=1 

print("AC x "+str(d["AC"]))
print("WA x "+str(d["WA"]))
print("TLE x "+str(d["TLE"]))
print("RE x "+str(d["RE"]))


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

int main(){
    int a,b,c;	cin >> a >> b >> c;
    if(c >= a && c <= b){
	cout << "Yes" << endl;
    }else{
	cout << "No" << endl;
    }
}


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


using namespace std;


int main() {
    ios_base::sync_with_stdio(false);

    int x;
    cin >> x;

    for (int y = 1; ; y++) {
        if ((x * y) % 360 == 0) {
            cout << y;
            return 0;
        }
    }

    return 0;
}


Measured memory_bytes: 3656
#include<iostream>
#include<vector>
using namespace std;
vector<int>factor(100+1);
vector<int>prime_factor(int n){
    for(int i=2;i*i<=n;i++)while(n%i==0){factor[i]++;n/=i;}
    if(n!=1)factor[n]+=1;
    return factor;
}
int num(int n){
    int ret=0;
    for(auto x:factor)if(x>=n-1)ret++;
    return ret;
}
int main(){
    int n;cin>>n;
    for(int i=1;i<=n;i++)prime_factor(i);
    cout<<num(75)+num(25)*(num(3)-1)+num(15)*(num(5)-1)+num(5)*(num(5)-1)*(num(3)-2)/2<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include <algorithm>
#include <string>
#include <utility>
#include <set>
#include <map>
#include<cmath>
#include <queue>
#include <numeric>

using lli = long long int;
int inf = 1000000007;
using namespace std;

lli N, A, B, C, D;

int main()
{
	cin >> N >> A >> B >> C >> D;
	lli s = abs(A - B);
	//何回Cを足して何回Dを足したか
	for (lli i = 0; i < N; i++) {
		lli a = D * i - C * (N - 1 - i);
		lli b = C * i - D * (N - 1 - i);
		if (b <= s && s <= a) { cout << "YES" << endl; return 0; }
	}
	cout << "NO" << endl;
	return 0;
}

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

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    int ans = 0;
    while(true){
        if(a&1 || b&1 || c&1)   break;
        int aa = (b+c)/2;
        int bb = (a+c)/2;
        int cc = (a+b)/2;
        a = aa;
        b = bb;
        c = cc;
        ans++;
        if(ans > 30){
            ans = -1;
            break;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<vector>
#include<functional>
#include<algorithm>
#include<stdlib.h>
#include<string>
#include<string.h>
#define _USE_MATH_DEFINES
#include<math.h>
#include<deque>
#include<set>
#include<map>
#include<queue>
#include<list>
#include<iostream>
using namespace std;
typedef long long ll;
#define rep(i,a,b) for(auto i=a;i<b;i++)
#define all(_x) _x.begin(), _x.end()
#define r_sort(_x) sort(_x.begin(), _x.end(), std::greater<int>())
#define vec_cnt(_a, _n) (upper_bound(all(_a), _n) - lower_bound(all(_a), _n))
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
//ll lcm(ll a, ll b) { return (a / gcd(a, b)) * b; }
#define INF 1 << 30
int c[100000];
int main() {
	int n, m, a, b;
	cin >> n >> m;
	rep(i, 0, m)cin >> a >> b, c[a - 1]++, c[b - 1]++;
	rep(i, 0, n) {
		if (c[i] % 2) {
			puts("NO");
			return 0;
		}
	}
	puts("YES");
	return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
#include <iostream>
using namespace std;
int main()
{   int t,sum=0;
   cin>>t;
   int temp=t;
 while(temp!=0)
 {
        sum+=(temp%10);
        temp/=10;
 
 }
 if(t%sum==0)cout<<"Yes";
 else
 {
 cout<<"No";}
 return 0;
   }
 
 

Measured memory_bytes: 3552
N = int(input())
at = input().split(" ")
a = []
for i in at:
    a.append(int(i))
avg = sum(a) / N
mdif, flag = abs(a[0]-avg), 0
for i in range(len(a)):
    if abs(a[i]-avg) < mdif:
        mdif = abs(a[i]-avg)
        flag = i
print(flag)


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

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<double> vd;
typedef vector<vd> vdd;

#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)
#define RFOR(i,x,y) for(ll i=(ll)x; i>=(ll)y; --i)
#define RREP(i,x) RFOR(i, x, 0)
#define ALL(a) a.begin(), a.end()
#define pb push_back
#define debug_print(x...) cerr << "line " << __LINE__ << " : "; debug_print_in(x);

template <typename First>
void debug_print_in(First first){
  cerr << first << endl;
  return;
}

template <typename First, typename... Rest>
void debug_print_in(First first, Rest... rest){
  cerr << first << " ";
  debug_print_in(rest...);
  return;
}

void IN(void){
  return;
}

template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
  cin >> first;
  IN(rest...);
  return;
}

template <typename First>
void OUT(First first){
  cout << first << endl;
  return;
}

template <typename First, typename... Rest>
void OUT(First first, Rest... rest){
  cout << first << " ";
  OUT(rest...);
  return;
}

template<class t, class u> void chmax(t&a,u b){if(a<b)a=b;};
template<class t, class u> void chmin(t&a,u b){if(a>b)a=b;};
int popcount(int t){return __builtin_popcount(t);} //GCC
int popcount(ll t){return __builtin_popcountll(t);} //GCC

template <typename T>
void vec_print(vector<T> VEC){
  REP(i, VEC.size()){
    cerr << VEC[i] << " ";
  }
  cerr << endl;
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  REP(i,MAT.size()){
    REP(j,MAT[i].size()){
      cerr << MAT[i][j] << " ";
    }
    cerr << endl;
  }
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  ll N, K;
  IN(N,K);

  if(K>(N-1)*(N-2)/2){
    OUT(-1);
    return 0;
  }

  vll u, v;
  REP(i,N-1){
    u.pb(1);
    v.pb(i+2);
  }
  ll count = (N-1)*(N-2)/2;
  ll start=2;
  ll end=3;
  while(count>K){
    u.pb(start);
    v.pb(end);
    end++;
    if(end>N){
      start++;
      end=start+1;
    }
    count--;
  }

  printf("%lld\n", u.size());
  REP(i,u.size()){
    printf("%lld %lld\n", u[i], v[i]);
  }

  return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define boost  ios_base::sync_with_stdio(0);
#define N 1000
#define ll long long int
#define pb push_back
#define f first
#define s second
#define fo(i,a,b) for(i = a; i < b; i++)
#define foe(i, a,b) for(i = a; i <= b; i++)
#define tc long long int t; cin >> t; while(t--)
#define vect vector <ll>
#define pll pair<ll,ll>
#define vpll vector<pair<ll,ll>>
#define be begin
#define en end

void max_self(ll& a, ll b) {
    a = max(a, b);
}

int main(){
    boost;
    ll i;
    ll n, w;
    cin >> n >> w;
    vector<ll> dp(w + 1);
    for(i = 0; i < n; i++){
        ll wt, val;
        cin >> wt >> val;
        for(ll weightal = w - wt; weightal >= 0; weightal--){
            max_self(dp[weightal+wt], dp[weightal] + val);
        }
    }
    ll answer = 0;
    for(i = 0; i <= w; ++i) {
        max_self(answer, dp[i]);
    }
    cout << answer <<endl;
    
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <set>
#include <utility>
#include <cstdio>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n, m) for (int i = n; i >= m; i--)

template <class T>
bool contain(const std::string &s, const T &v)
{
    return s.find(v) != std::string::npos;
}

int s;

int func(int n){
    if(n%2==0){
        return n/2;
    }else{
        return 3*n+1;
    }
}

int main()
{
    int t,x;
    cin>>t>>x;
    printf("%.10lf\n",(double)t/x);
}

Measured memory_bytes: 256
import java.util.*;

class Main {
  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int num1 = sc.nextInt();
    int num2 = sc.nextInt();

    if((num1*num2) % 2 == 0) {
      System.out.println("Even");
    } else {
      System.out.println("Odd");
    }
    
  }

}

Measured memory_bytes: 20820
// In The Name Of Allah

#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define pp pop_back
#define pb push_back
#define mp make_pair
#define int long long
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x << " : " << x

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;

const int maxx = 1e6 + 19;
const int inf = 1e18 + 19;
const int mod = 1000000007LL;

int n, ans = 0;
vector<int> v;

int32_t main() {
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    int a, b;
	cin >> a >> b;
	if (a > 0)
		cout << "Positive";
	else if(a <= 0 && b >= 0)
		cout << "Zero";
	else {
		if ((b - a + 1) % 2)
			cout << "Negative";
		else
			cout << "Positive";
	}
    return 0;
}


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

int main() {

	string s; cin >> s;
	int k; cin >> k;
	map<string, int> mp;
	for (int num = 1; num <= k; num++) {
		for (int i = 0; i < s.size() - num + 1; i++) {
			mp[s.substr(i, num)] = 1;
		}
	}
	int i = 1;
	string ans;
	for (auto u : mp) {
		if (i == k) {
			ans = u.first;
			break;
		}
		i++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 4808
N, X = map(int,input().split())
L = list(map(int,input().split()))

cnt = 0
total = 0

for i in range(N):
    if total <= X:
        cnt += 1
        total += L[i]
    else:
        break
else:
    if total <= X:
        cnt += 1


print(cnt)

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

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i,n) for (ll i = 0; i < n; ++i)
#define REPR(i,n) for (ll i = n-1; i >= 0; --i)
#define FOR(i,m,n) for (ll i = m; i < n; ++i)
#define FORR(i,m,n) for (ll i = n-1; i >= m; --i)
#define FORE(x,xs) for (const auto& x : xs)
#define FORI(i,v) for (auto i = v.begin(); i != v.end(); i++)
#define ALL(v) v.begin(), v.end()
#define CHMIN(x,y) x = min(x, y)
#define CHMAX(x,y) x = max(x, y)
#define YES(b) cout << ((b) ? "YES" : "NO") << endl
#define Yes(b) cout << ((b) ? "Yes" : "No") << endl
#define DOUBLE(d) cout << fixed << setprecision(15) << (d) << endl

const int MAX = 1e5+10;

int N, M;
int H[MAX];
vi hs[MAX];

int main() {
    cin >> N >> M;
    REP (i, N) cin >> H[i];
    REP (i, M) {
        int a, b;
        cin >> a >> b; a--; b--;
        hs[a].push_back(H[b]);
        hs[b].push_back(H[a]);
    }

    ll ans = 0;
    REP (i, N) {
        int sz = hs[i].size();
        if (sz == 0) {
            ans++;
            continue;
        }
        sort(ALL(hs[i]));
        if (hs[i][sz-1] < H[i]) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 9828
class priorityQueue {
  constructor() {
    this.keys = [];
    Number.prototype.parentIdx = function() { return Math.ceil(this/2 - 1); };
    Number.prototype.leftIdx = function() { return this * 2 + 1; };
    Number.prototype.rightIdx = function() { return this * 2 + 2; };
  }

  insert(key) { this.heapIncrease(this.keys.push(key) - 1); }

  heapIncrease(idx) {
    const keys = this.keys;
    for (let i=idx, p=idx.parentIdx(); i > 0 && keys[i] > keys[p]; i=p, p=i.parentIdx()) {
      keys[p] = [keys[i], keys[i] = keys[p]][0];
    }
  }

  extract() {
    const res = this.keys[0];
    this.keys[0] = this.keys.pop();
    this.maxHeapify(0);
    return res;
  }

  maxHeapify(idx) {
    const keys = this.keys, n = keys.length;
    const innerMaxHeapify = (i) => {
      let left, right, largest = i;
      left = i.leftIdx();
      right = i.rightIdx();
      if (left < n && Number(keys[left]) > Number(keys[largest])) largest = left;
      if (right < n && Number(keys[right]) > Number(keys[largest])) largest = right;
      if (largest != i) {
        keys[largest] = [keys[i], keys[i] = keys[largest]][0];
        innerMaxHeapify(largest);
      }
    };
    innerMaxHeapify(idx);
  }
}

(function main() {
  const lines = require('fs').readFileSync('/dev/stdin', 'utf8').trim().split('\n').slice(0, -1);
  const queue = new priorityQueue();
  let str = '';
  lines.forEach(function(cmd) {
    switch(cmd.charAt(0)) {
      case 'i': queue.insert(Number(cmd.split(' ')[1])); break;
      case 'e': str += `${queue.extract()}\n`; break;
    }
  });
  process.stdout.write(str);
})();




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

int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int N; cin >> N;
	vector<int> V(N);
	for (int& v : V) cin >> v;
	vector<int> C(N);
	for (int& c : C) cin >> c;
	int ans = 0;
	for (int i = 0; i < N; i++) {
		ans += max(0, V[i] - C[i]);
	}
	cout << ans << '\n';

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <set>
#include <string>
#include <vector>

using namespace std;

int main() {

    int n;
    cin >> n;

    vector<char> v(n);

    for (int i = 0; i < n; i++){
        cin >> v[i];
    }

    set<char> s(v.begin(), v.end());


    if (s.size() == 3){
        cout << "Three" << endl;
    } else {
        cout << "Four" << endl;
    }
    return 0;
}

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

using namespace std;

typedef long long LL;

const int N = 1010;

char s[N], t[N];

int main()
{
    cin >> s >> t;

    int lens = strlen(s), lent = strlen(t);
    sort(s, s + lens);
    sort(t, t + lent);
    reverse(t, t + lent);

    if(strcmp(t, s) > 0) puts("Yes");
    else puts("No");
    return 0;
}


Measured memory_bytes: 256
def main():
    n,k=map(int, input().split())
    point = 0

    ans = 0
    kita = [(int(i)+1) for i in range(n)]
    for i in kita:
        tmp  = 0
        tmp2 = i
        while tmp2 < k:
            tmp2 *= 2
            tmp+=1
        ans = ans + ((0.5)**tmp)*(1/n)
    print(ans)






if __name__ == '__main__':
    main()


Measured memory_bytes: 7064
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> ii;
typedef vector<int>   vi;
typedef vector<long long> vll;
typedef vector<pair<int,int> > vii;
#define ll long long
#define pb push_back
#define mp  make_pair
#define ff first
#define ss second
#define pq priority_queue
#define sf1(x) scanf("%d",&x)
#define sf2(x,y) scanf("%d %d",&x,&y)
#define sf3(x,y,z) scanf("%d %d %d",&x,&y,&z)
int inf = (1e9) + 7;


int main(){


	int n;
	cin >> n;
	if(n >= 90 or n % 10 == 9)
		printf("Yes\n");
	else
		printf("No\n");


}	

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
*/

const ll mod = 1e9+7;

// void chmod(ll &M){
//     if(M >= mod) M %= mod;
//     else if(M < 0){
//         M += (abs(M)/mod + 1)*mod;
//         M %= mod;
//     }
// }

int main(){
    int N; cin >> N;
    vector<ll> a(N+1), b(N);
    for(int i=0; i<N+1; ++i) cin >> a[i];
    for(int i=0; i<N; ++i) cin >> b[i];

    ll ans = 0;
    for(int i=0; i<N; ++i){
        if(a[i] >= b[i]){
            ans += b[i];
        }
        else{
            ans += a[i];
            b[i] -= a[i];
            ans += min(a[i+1], b[i]);
            a[i+1] -= min(a[i+1], b[i]);
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 1792
import java.util.*




    fun main(args: Array<String>) {
        val scanner = Scanner(System.`in`)
        val a = scanner.nextInt()
        if (a % 2 == 0) {
            println(0.5)
        } else {
            val aa = a/2
            val aaa = (aa+1).toDouble()/a
            println(aaa)
        }

        
}

Measured memory_bytes: 31136
def f(memo,past,cnt,pipe,n)
  return past.size if cnt==10
  memo[[past.size,past[-n..-1],cnt]] ||= (0..n-1).map{|i|
    newpast=past+[false]*i
    unless newpast[-n]
      newpast[-n..-1] = newpast[-n..-1].zip(pipe).map{|a,b|a||b}
      f(memo,newpast,cnt+1,pipe,n)
    end
  }.compact.min||1e9
end

while (n=gets.to_i)>0
  pipe=(0..4).map{gets.chars.map{|c|c=="X"}}
  a=[true]+(1..n-1).map{|i|pipe.any?{|j|j[i..-1].zip(j).any?{|k,l|k&&l}}}
  p f({},a,1,a,n)
end

Measured memory_bytes: 11532