akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

int main(){
  int x, y;
  cin >> x >> y;
  if(((x == 1 || x == 3 || x == 5 || x == 7 || x == 8 || x == 10 || x == 12) && (y == 1 || y == 3 || y == 5 || y == 7 || y == 8 || y == 10 || y == 12)) || ((x == 4 || x == 6 || x == 9 || x == 12) && (y == 4 || y == 6 || y == 9 || y == 12))){
  cout << "Yes";
  }else{
  cout << "No";
  }
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    int N; cin >> N;
    int x[1100];
    for(int i=0;i<N;i++){
        cin >> x[i];
    }
    sort(x,x+N);
    cout << (x[N-1]-x[0]+1)/2 << endl;
}


Measured memory_bytes: 3152
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
    public static void main(String[] args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try{
            int n = Integer.parseInt(reader.readLine());
            String[] str1 = reader.readLine().split(" ");
            int m = Integer.parseInt(reader.readLine());
            String[] str2 = reader.readLine().split(" ");
            int i = 0;
            int flag = 0;
            int k = 0;
            while(i < m){
                flag = 0;
                int i1 = Integer.parseInt(str2[i]);
                for(int j = k; j  < n; j++){
                    if(Integer.parseInt(str1[j]) == i1){
                        flag = 1;
                        k = j + 1;
                        break;
                    }else if(Integer.parseInt(str1[j]) > i1){
                        flag = 0;
                        break;
                    }
                }
                if(flag == 0){
                    break;
                }
                i++;
            }
            System.out.println(flag);

        }catch(IOException e){
            
        }
    }
}


Measured memory_bytes: 76716
import sys
N,K=map(int,input().split())
if K>(N-1)*(N-2)//2:
    print(-1)
    sys.exit()

k=(N-1)*(N-2)//2
G=[]
for i in range(2,N+1):
    G.append([1,i])

s,g=2,3
while k!=K:
    G.append([s,g])
    g+=1
    if g==N+1:
        s+=1
        g=s+1
    k-=1

print(len(G))
for i in G:
    print(*i)

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

#define int long long

using namespace std;

 main () {
	int a, b;
	cin >> a >> b;
	int ans = 0;
	if (abs (a) <= abs (b)) {
		if (b >= 0) {
			if (a < 0) ans = abs (b) - abs (a) + 1;
			else ans = abs (b) - abs (a);
			cout << ans;
			return 0;
		}
		else {
			if (a < 0) ans = abs (b) - abs (a) + 2;
			else ans = abs (b) - abs (a) + 1;
			cout << ans;
			return 0;	
		}
	}
	else {
		if (b > 0) {
			if (a > 0) ans = abs (a) - abs (b) + 2;
			else ans = abs (a) - abs (b) + 1;
			cout << ans;
			return 0;
		}
		else {
			if (a > 0) ans = abs (a) - abs (b) + 1;
			else ans = abs (a) - abs (b);
			cout << ans;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>

int main(void){

int a[256],b[256],c[256],i=-1,j;
do{
	i++;
	scanf("%d%d%d",&a[i],&b[i],&c[i]);
}while((a[i]!=-1)||(b[i]!=-1)||(c[i]!=-1));

for(j=0;j<i;j++){
	if ((a[j]==-1)||(b[j]==-1)){
		printf("F\n");
	}else if (a[j]+b[j]>=80){
		printf("A\n");
	}else if(a[j]+b[j]>=65){
		printf("B\n");
	}else if((a[j]+b[j]>=50)||((a[j]+b[j]>=30)&&(c[j]>=50))){
		printf("C\n");
	}else if(a[j]+b[j]>=30){
		printf("D\n");
	}else {
		printf("F\n");
	}
}
return 0;
}

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

int main() {

	int a,b,c,d;
	cin >> a >> b >>c >>d ;
	bool flag =true; 
	while(flag) {
		c = c-b;
		if(c<=0) {cout << "Yes" ; break ; }
		a = a-d ;
		if(a<=0) {cout << "No" ; break ;} 
	}
	// if(a==0) cout << "No" ;
	// else cout << "Yes" ;
}

Measured memory_bytes: 3620
// Strange Bank 配るDP
#include <iostream>
using namespace std;
int dp[100100];

int main () {
    int N; cin >> N;
    for (int i = 0; i < 100010; i++) dp[i] = N;
    dp[0] = 0;
    for (int i = 0; i < N; i++) {
        for (int pow6 = 1; i + pow6 <= N; pow6 *= 6) {
            dp[i + pow6] = min(dp[i + pow6], dp[i] + 1);
        }
        for (int pow9 = 1; i + pow9 <= N; pow9 *= 9) {
            dp[i + pow9] = min(dp[i + pow9], dp[i] + 1);
        }
    }
    cout << dp[N] << endl;
}

Measured memory_bytes: 640
"use strict";
const Main = (input) =>{
    let xs = input.trim().split('');
    let count = 0;
    let ans = [];
    for(let i=0; i<xs.length; i++){
      if(xs[i]=="A"|| xs[i]=="G"||xs[i]=="C"||xs[i]=="T"){
        if(count==0){
          ans.push(count=1);
        }else{
          ans.push(count+=1);
          }
       }else{
       ans.push(count=0);
       }
    }
    //console.log(ans);
    const compare = (a,b) =>{
       return b - a;
    }
    ans.sort(compare)
    
    if(ans[0]==0){
       console.log(0);
    }else if(ans[0]==1){
       console.log(ans[0]);
    }else{
       console.log(ans[0]);
    }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));

Measured memory_bytes: 7372
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define DEBUGP(val) cerr << #val << "=" << val << "\n"

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
const ll mod = 1e9 + 7;



int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  string s;
  cin >> n >> s;
  ll tot = 0;
  string res = s.substr(n);
  reverse(res.begin(), res.end());
  REP(bits, 0, 1 << n) {
    string tap, ris;
    REP(i, 0, n) {
      if (bits & 1 << i) tap += s[i];
      else ris += s[i];
    }
    int a = tap.size();
    int b = ris.size();
    vector<VI> dp(a + 1, VI(b + 1, 0));
    dp[0][0] = 1;
    REP(i, 0, a + 1) {
      REP(j, 0, b + 1) {
	if (i == 0 && j == 0) continue;
	if (i > 0 && res[i + j - 1] == tap[i - 1]) {
	  dp[i][j] += dp[i - 1][j];
	}
	if (j > 0 && res[i + j - 1] == ris[j - 1]) {
	  dp[i][j] += dp[i][j - 1];
	}
      }
    }
    tot += dp[a][b];
  }
  cout << tot << endl;
}


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

#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
const int inf = 1000000001;
const ll INF = 2e18 * 2;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };

#define N 100010
vii G(N, vi());
int check;
int adda = 1;
int dfs(int parent, int now) {
	if (parent != -1 && G[now].size() == 1) {
		return 0;
	}
	int res = 0;
	int cnt0 = 0;
	for (int i = 0; i < G[now].size(); i++) {
		if (G[now][i] == parent) {
			continue;
		}
		int temp = dfs(now, G[now][i]);
		res += temp;
		if (temp == 0) {
			cnt0++;
		}
	}
	if (cnt0 >= 2) {
		res += cnt0 - 1;
	}
	if (now == check && cnt0 == 0) {
		adda = 0;
	}
	return res;
}

void dfs2(int parent, int now) {
	if (G[now].size() > 2) {
		check = now;
		return;
	}
	for (int i = 0; i < G[now].size(); i++) {
		if (G[now][i] == parent) {
			continue;
		}
		dfs2(now, G[now][i]);
	}
}

int main() {
	int n, i, j;
	cin >> n;
	for (i = 0; i < n - 1; i++) {
		int a, b;
		cin >> a >> b;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	int root;
	for (i = 0; i < n ; i++) {
		if (G[i].size() == 1) {
			root = i;
			break;
		}
	}
	dfs2(-1, root);
	int ans = dfs(-1, root);
	cout << ans + adda << endl;
}

Measured memory_bytes: 11904
n=int(input())
s=list(input())
rw=[0]*(n+1)
lb=[0]*(n+1)
for i in range(n):
    if s[i]=='#':
        lb[i+1]=lb[i]+1
    else:
        lb[i+1]=lb[i]
for i in range(n):
    if s[n-i-1]=='.':
        rw[n-i-1]=rw[n-i]+1
    else:
        rw[n-i-1]=rw[n-i]
ans=100000000000
for i in range(n+1):
    ans=min(ans,lb[i]+rw[i])
print(ans)   

Measured memory_bytes: 14180
import java.util.Scanner;

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

	int n=0,l=0,s=0,count=0,hikaeIn=0;
	int[] nArray = { 0,0,0,0 };
	int[] hikae = new int[4];
	Scanner sc = new Scanner(System.in);

	while(sc.hasNext()){ // テ・ツ?・テ・ツ環崚」ツ?陛」ツつ古」ツ?ェテ」ツ?湘」ツ?ェテ」ツつ凝」ツ?セテ」ツ?ァ
	    
	    n = sc.nextInt();
	    count = 0;
	    if(n==0){ break; }
	    
	    while(true){
		
		if(n==6174){ System.out.println(count); break; }
		for(int i = 0;i<4;i++){ nArray[i] = 0;}
		l = 0; s = 0;

		hikae[0] = n%10;
		hikae[1] = (n/10)%10;
		hikae[2] = (n/100)%10;
		hikae[3] = n/1000;

		boolean check = false;
		for(int i = 0;i<4;i++){ // テ・ツ崢崚ヲツ。ツ?・ツ青古」ツ?佚」ツ?ォテ」ツ?ェテ」ツ?」テ」ツ?ヲテ」ツ??」ツ?ェテ」ツ??」ツ?凝ァツ「ツコティツェツ?
		    if(hikae[0]!=hikae[i]){ check=true; break; }
		}
		if(check==false){
		    System.out.println("NA");
		    break;
		}

		for(int i = 0;i<4;i++){ // テ・ツ、ツァテ」ツ?催」ツ??ゥツ??」ツ?ォテ、ツクツヲテ」ツ?ウテヲツ崢ソテ」ツ?暗」ツつ?
		    for(int j = 0;j<4;j++){
			if(nArray[i]<hikae[j]==true){
			    nArray[i] = hikae[j];
			    hikaeIn = j;
			}
		    }
		    hikae[hikaeIn] = 0;
		}

		// l
		l += nArray[3];
		l += nArray[2]*10;
		l += nArray[1]*100;
		l += nArray[0]*1000;

		// s
		s += nArray[0];
		s += nArray[1]*10;
		s += nArray[2]*100;
		s += nArray[3]*1000;

		n = l-s;

		count++;
		
	    }
	    
	}
    }
}

Measured memory_bytes: 33316
// E - Simple String Queries
// Segment Tree version
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)

// Segment Tree: sum
template<class T> class SegmentTree{//0_origin
private:
	inline int LEFT(int i){return 2*i+1;}
	inline int RIGHT(int i){return 2*i+2;}
	int n;//最下段データ数
	vector<T> node;//セグ木
	T init = T(0);//sum
	T calc_func(T left, T right){return left + right;}//sum
	T bottom_up(int i){return calc_func(node[LEFT(i)], node[RIGHT(i)]);}
public:
	SegmentTree(const vector<T> &v){// 配列 をセグ木にする
		int size = v.size();
		for(n=1; n<size; n<<=1);//最下段データ数
		node.resize(2*n-1, init);//セグ木領域確保
		for(int i=0; i<size; ++i) node[n-1 + i] = v[i];//最下段設定
		for(int i=n-2; i>=0; --i) node[i] = bottom_up(i);
	}
	void update(int i, T val){
		i += n-1;//最下段のindex
		if(node[i] == val) return;
		node[i] = val;//最下段更新
		while(i){i = (i-1)/2; node[i] = bottom_up(i);}
	}
	int calc(int a, int b, int k=0, int l=0, int r=-1){// calc[a,b), k:self index, segT[l,r)
		if(r<0) r = n;//first time [l,r)=[0,n)
		if(r<=a || b<=l) return init;//unmatch: !(l<b & a<r)
		if(a<=l && r<=b) return node[k];//match: calc[l,r)
		int m = (l+r)/2;
		return calc_func(calc(a, b, LEFT(k), l, m), calc(a, b, RIGHT(k), m, r));//calc_func(left,right)
	}
};

using SEGT = SegmentTree<int>;
using VSEG = vector<SEGT>;

int main(){
	int N,Q; string S; cin>>N>>S>>Q;

	VSEG segT;
	rep(i,26){
		vector<int> a(N); rep(j,N) if(S[j]-'a' == i) a[j] = 1;
		segT.push_back(SEGT(a));
	}

	while(Q--){
		int t; cin>>t;
		if(t-1){//type2 out
			int l,r; cin>>l>>r;
			int ans = 0;
			rep(i,26) if(segT[i].calc(l-1, r)) ans++;//[l,r)
			printf("%d\n",ans);
		}
		else{//type1 update
			int i; cin>>i; --i;
			segT[S[i]-'a'].update(i, 0);//del
			cin>>S[i];
			segT[S[i]-'a'].update(i, 1);//add
		}
	}
}

Measured memory_bytes: 109408
#include <iostream>
#include <algorithm>
using namespace std;
 
struct Card{
  char a;
  int  b;
};
 
bool compare_as_ints(Card i,Card j){
  return (i.b<j.b);
}
 
int partition(Card A[],int p,int r){
  Card x = A[r];
  int i = p-1;
  for(int j=p;j<=r-1;j++){
    if(A[j].b <= x.b){
      i++;
      swap(A[i],A[j]);
    }
  }
  swap(A[i+1],A[r]);
  return i+1;
}
 
void quicksort(Card A[],int p,int r){
  if(p<r){
    int q = partition(A,p,r);
    quicksort(A,p,q-1);
    quicksort(A,q+1,r);
  }
}
 
int main(){
  int n;
  cin >> n;
 
  Card A[100000],B[100000];
 
  for(int i=0;i<n;i++){
    cin >> A[i].a >> A[i].b;
    B[i]=A[i];
  }
 
  quicksort(A,0,n-1);
  stable_sort(B,B+n,compare_as_ints);
 
  int miss = 0;
 
  for(int i=0;i<n;i++){
    if(A[i].a!=B[i].a){
      miss++;
    }
  }
 
  if(miss>0){
    cout << "Not stable" << endl;
  }else{
    cout << "Stable" << endl;
  }
 
  for(int i=0;i<n;i++){
    cout << A[i].a << ' ' << A[i].b << endl;
  }
 
  return 0;
}


Measured memory_bytes: 4732
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include <ext/pb_ds/detail/standard_policies.hpp>


/* 
*    coder :: ATUL_PANDEY_2608
*        >>> INDIA <<<
*/
using namespace std;
using namespace __gnu_pbds;

// #define  part ..
#define pb(a) push_back(a)
#define all(a) a.begin(),a.end() 
#define mod 1000000007
//#define maxx 200006
#define ll long long 
#define quick    ios_base::sync_with_stdio(NULL),cin.tie(0);
#define listll vector< long long > 
#define listi vector< int> 
#define pii   pair<int , int> 
#define pll pair<long long , long long > 
#define minheap priority_queue<long long , vector< long long >, greater<long long > >
#define rep(i,a,b) for(int i=a;i<b;i++)
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll power( ll a, ll n, ll m){
  ll ans = 1;
  while(n){
  if(n&1)
  {
  ans *= a;
  ans%=m;
  }
  a*=a;
  n/=2;
  }
  return ans ;
} 


template < class T > using oset = tree< T , null_type, less  < T  > , rb_tree_tag , tree_order_statistics_node_update > ;


// end of #define 

// define globals ...
const int maxx = 2e5+26;

//write function from here ...







 
 
 int Main(){

   int n;
   cin>>n;
   
    vector< ll > arr ( n);
    vector< int > aa;
    vector< int > bb;
    
    for( int i =0 ; i < n;i++){
		
		
		ll a,b;
		cin>>a>>b;
		aa.pb(a);
		bb.pb(b);
		arr[i] = a+b;
		
		
		
	}
	
	
	sort(all(arr));
	
	
	ll ans = abs(arr[0] - arr[n-1]);
	
	for( int i =0 ;i < n;i++){
		
		arr[i] = aa[i]-bb[i];
		
		
	}
	
	sort(all(arr));
	ans = max(ans  , abs(arr[0] -arr[n-1] ));
    
    cout<<ans<<endl;



return 0;

}






int main(){
 quick;
int t =1; 
//cin>>t;
while(t-- )
 Main();

 return 0;


}


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

int main(){
    string S;
    string T;
    cin >> S >> T;
    if(S.size() + 1 == T.size()){
        T.pop_back();
        if(S == T){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }else{
        cout << "No" << endl;
    }
    return 0;
}

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


int main()
{
    std::ios_base::sync_with_stdio(0);	
    cin.tie(0);
    cout.tie(0);
    
	
	ll H,A;
	cin>>H>>A;
	
	cout<<ceil(H/(A+0.0L));
	
}


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

int main(){
  	int n;
  	cin >> n;
    string s;
    cin >> s;
	
  	int cnt=0;
    for(int i=0; i<n-2; i++){
      	if(s.substr(i, 3) == "ABC") cnt++;
    }
  	cout << cnt;

    return 0;
}

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

using namespace std;
using ll = long long;

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

int main() {
  int n;
  cin >> n;
  int a[n + 1], p[n];
  a[0] = 1001001001;
  rep(i, n) {
    cin >> p[i];
    a[i + 1] = min(a[i], p[i]);
  }

  int ans = 0;
  rep(i, n) {
    if (p[i] <= a[i]) ++ans;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 5164
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_map>
#include<fstream>
#include<list>
#include<typeinfo>
#include<functional>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<double,ll> pdl;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;





    
int main(){
    ll n,t;
    cin>>n>>t;
    vector<ll> a(n);
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    sort(a.begin(),a.end());
    ll ans=1;
    for(int i=1;i<n;i++){
        ll l=lower_bound(a.begin(),a.end(),a[i]-t)-a.begin();
        l=i+1-l;
        ans*=l;
        ans%=MOD;
    }
    cout<<ans<<endl;
    
    
    return 0;
}



Measured memory_bytes: 3612
#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;

const int N=4e2+5;
const int mod=998244353;
int n,Sa,Sb,tmp,ans,a[N],b[N],fac[N],inv[N],dp[N][N][N];

inline int mul(int x,int y) {return 1ll*x*y%mod;}
inline int add(int x,int y) {x+=y;if(x>=mod) x-=mod;return x;}
inline int modpow(int x,int y,int res=1) {
	for(;y;y>>=1,x=mul(x,x)) if(y&1) res=mul(res,x);
	return res;
}
inline void inc(int&x,int y) {x=add(x,y);}
template <typename _Tp> inline void IN(_Tp&x) {
	char ch;bool flag=0;x=0;
	while(ch=getchar(),!isdigit(ch)) if(ch=='-') flag=1;
	while(isdigit(ch)) x=x*10+ch-'0',ch=getchar();
	if(flag) x=-x;
}

int main() {
	IN(n),fac[0]=inv[0]=1;
	for(int i=1;i<=n;++i) IN(a[i]),Sa+=a[i],IN(b[i]),Sb+=b[i];
	for(int i=1;i<N;++i) fac[i]=mul(fac[i-1],i),inv[i]=modpow(fac[i],mod-2);
	dp[0][0][0]=mod-1;
	for(int i=1;i<=n;++i) for(int j=0;j<=Sa;++j) for(int k=0;k<=Sb;++k) {
		if(!dp[i-1][j][k]) continue;
		inc(dp[i][j][k],dp[i-1][j][k]),tmp=1;
		for(int c=0;c<b[i];++c,tmp=mul(tmp,a[i]))
			inc(dp[i][j+a[i]][k+c],mod-mul(tmp,mul(inv[c],dp[i-1][j][k])));
	}
	for(int i=1;i<=Sa;++i) {
		int res=modpow(i,mod-2);tmp=mul(Sa,res);
		for(int j=0;j<=Sb;++j,tmp=mul(tmp,res)) inc(ans,mul(dp[n][i][j],mul(tmp,fac[j])));
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 243968
#include<iostream>
    #include<cstdlib>
    #include<math.h>
    #include<set>
    #include<string>
    #include<stdlib.h>
    using namespace std ;

    int gcd(int a, int b){
      if(a%b==0)return b;
      else return gcd(b,a%b);
    }
    int main(){
      int a,b,l=0;
      cin>>a>>b;
      cout<<(((b-a)*(b-a+1))/2)-b<<endl;
      return 0;
    }

Measured memory_bytes: 256
//package code;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

/**
 *
 * @author Milo
 */
public class Main {
    
    static FastReader in = new FastReader();
    public static void main(String[] args) {
        int t = 1; //in.nextInt();
        while (t-- > 0)
            solve();
    }
 
    public static void solve() {
        int n = in.nextInt() % 10;
        switch(n){
            case 2:
            case 4:
            case 5:
            case 7:
            case 9: System.out.println("hon"); break;
            case 0:
            case 1:
            case 6:
            case 8: System.out.println("pon"); break;
            case 3: System.out.println("bon"); break;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;
 
        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }
 
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
 
        int nextInt() {
            return Integer.parseInt(next());
        }
 
        long nextLong() {
            return Long.parseLong(next());
        }
 
        double nextDouble() {
            return Double.parseDouble(next());
        }
 
        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
 
    public static int max(int a, int b) {
        return a > b ? a : b;
    }
 
    public static int min(int a, int b) {
        return a < b ? a : b;
    }
 
    public static int gcd(int a, int b) {
        return b == 0 ? a : gcd(b, (a % b));
    }
}


Measured memory_bytes: 32600
def decomposition_prime(n):
    i = 2
    li = []
    while i*i <= n:
        while n%i == 0:
            li.append(i)
            n /= i
        i += 1
    if n > 1:
        li.append(int(n))
    return li

a, b = map(int, input().split())
ap = decomposition_prime(a)
bp = decomposition_prime(b)

print(len(set(ap) & set(bp))+1)

Measured memory_bytes: 3064
#include <stdio.h>
#include <ctype.h>

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

    return 0;
}


Measured memory_bytes: 2068
from numpy import array
N, K = map(int, input().split())
A = [int(i) for i in input().split()]
k = '{0:040b}'.format(K)
a = array([[int(i) for i in '{0:040b}'.format(a)] for a in A])
ans = list(k)

f = False
for i in range(40):
    if k[i] == '0' and not f:
        continue
    ik = a[:, [i]].sum()
    zk = N - ik
    if ik > zk:
        ans[i] = '0'
        f = True
    else:
        ans[i] = '1'

ans = ''.join(ans)
k = int(ans, 2)
print(sum([x ^ k for x in A]))

Measured memory_bytes: 91820
import queue
import copy
import math
from collections import deque
import bisect

# そのまま入力文字列の入力
n = int(input())

# 空白区切りの数値をリスト化
an = input().split()

s_an = set(an)

if len(an) == len(s_an):
    print("YES")
else:
    print("NO")





Measured memory_bytes: 31300
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll MOD = 1000000007;

int main(){
    ll a;
    cin >> a;

    set<ll> visited;
    while(true){
        visited.insert(a);
        if(a % 2 == 0){
            a = a / 2;
        }else{
            a = 3 * a + 1;
        }
        if(visited.count(a) > 0){
            cout << visited.size() + 1 << endl;
            break;
        }
    }
    
    return 0;
}

Measured memory_bytes: 256
n, m = map(int, input().split())
h = list(map(int, input().split()))
good=[True for _ in range(n)]
for _ in range(m):
    a, b = tuple(map(int, input().split()))
    a -= 1
    b -= 1
    if h[a] > h[b]:
        good[b] = False
    elif h[a] < h[b]:
        good[a] = False
    else:
        good[a] = False
        good[b] = False
count = 0
for i in range(n):
    if good[i]:
        count += 1
print(count)


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

using namespace std;
using ll = long long;

string s;

class Seg{
public:
    vector<int> vals[500000*4], zero_vec;
    Seg(){
        for(auto& k: vals){
            k.resize(30);
        }
        zero_vec.resize(30);
    }
    vector<int> query(int x, int y, int l=0, int r=500000-1, int idx = 1){
        if(y<l || x>r) return zero_vec;
        if(x<=l && r<=y) return vals[idx];
        int mid = (l+r)/2;
        auto left = query(x,y,l,mid,idx*2);
        auto right = query(x,y,mid+1,r,idx*2+1);
        vector<int> res = zero_vec;
        for(int i=0;i<30;i++){
            res[i] += left[i];
            res[i] += right[i];
        }
        return res;
    }
    void update(int targ, char val, int acc, int l = 0, int r = 500000-1, int idx = 1){
        if(targ>r || targ <l) return;
        vals[idx][val-'a']+=acc;
        if(l==r) return;
        int mid = (l+r)/2;
        update(targ, val, acc, l, mid, idx*2);
        update(targ,val, acc, mid+1, r, idx*2+1);
    }
} seg;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin>>n;
    cin>>s;
    for(int i=0;i<s.length();i++){
        seg.update(i, s[i], 1);
    }
    int q;
    cin>>q;
    for(int i=0;i<q;i++){
        int a, b;
        cin>>a>>b;
        if(a==1){
            b--;
            char c;
            cin>>c;

            seg.update(b, s[b], -1);
            s[b] = c;
            seg.update(b, s[b], 1);
        }else{
            int c;
            cin>>c;
            b--;c--;
            auto ans = seg.query(b,c);
            int cnt = 0;
            for(int j=0;j<30;j++){
                if(ans[j]>0) cnt++;
            }
            cout<<cnt<<'\n';
        }
    }
    return 0;
}

Measured memory_bytes: 298004
def main():
    a = int(input())
    b = int(input())
    c = int(input())
    x = int(input())
    x2 = x // 50
    count = 0
    # 10a + 2b + c = x2

    for i in range(a+1):
        for j in range(b+1):
            for k in range(c+1):
                if 10 * i + 2 * j + k == x2:
                    count += 1

    print(count)


if __name__ == "__main__":
    main()


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

int main()
{
	#ifndef ONLINE_JUDGE
     freopen("input1.txt","r",stdin);
     freopen("output1.txt","w",stdout);
   #endif
	int n,count=0,a[100];
	cin>>n;
	for (int i = 1; i <= n; ++i)
	{
		cin>>a[i];
	}
	for (int i = 1; i <= n; ++i)
	{
		if(i%2 && a[i]%2==1)
			count++;
	}
	cout<<count;
}

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

	using namespace std;
	
	typedef long long tint;
	
	int findPow(int a){
		int exp = floor(log2(a))+1;
		return 1 << exp;
	}

	int main() {
		int n; cin >> n;
		vector<int> a (n);
		map<int, int> us;
		for(int i=0;i<n;i++){
			cin >> a[i];
			us[a[i]]++;
		}
		int cont1 = 0;
		sort(a.begin(), a.end());
		for(int i=n;i>=0;i--){
			if(us[a[i]] > 0 && us[findPow(a[i])-a[i]] > 0){
				if(a[i] == findPow(a[i])-a[i] && us[a[i]] < 2){
					continue;
				}
				cont1++;
				us[a[i]]--; us[findPow(a[i])-a[i]]--;
			}
		}
		cout << cont1 << endl;
	}


Measured memory_bytes: 19712
H, W, D = map(int, input().split())
A = [list(map(int, input().split())) for i in range(H)]


Position = {}
for h in range(H):
    for w in range(W):
        Position[A[h][w]] = (h, w)


Cost = [0] * (H * W + 1)
for d in range(D + 1, H * W + 1):
    h, w = Position[d]
    prev_h, prev_w = Position[d - D]
    Cost[d] = abs(h - prev_h) + abs(w - prev_w) + Cost[d - D]


Q = int(input())
for q in range(Q):
    l, r = map(int, input().split())
    print(Cost[r] - Cost[l])


Measured memory_bytes: 23392
import sys
import numpy as np
import random
from decimal import Decimal
import itertools
import re
import bisect
from collections import deque, Counter
from functools import lru_cache

sys.setrecursionlimit(10**9)
INF = 10**13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
def SERIES(n): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ')
def GRID(h,w): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ').reshape(h,-1)[:,:w]
def GRIDfromString(h,w): return np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(h,-1)[:,:w]
MOD = 1000000007

def main():
	n, m, k = LI()
	a_list = LI()
	b_list = LI()

	count = 0
	books = n
	time = sum(a_list)

	i, j = n-1, 0
	while True:
		if time <= k:
			count = max(count, books)
			if j == m:
				break
			time += b_list[j]
			books += 1
			j += 1
		else:
			if i == -1:
				break
			time -= a_list[i]
			books -= 1
			i -= 1
	print(count)



if __name__ == '__main__':
    main()

Measured memory_bytes: 55500
// J.cpp
#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 330;
int n, ai[MAX_N], sushi[4];
double dp[MAX_N][MAX_N][MAX_N];
double dfs(int a, int b, int c)
{
    if (a == 0 && b == 0 && c == 0)
        return 0;
    if (dp[a][b][c] >= 0)
        return dp[a][b][c];
    double d = a + b + c, ans = n / d;
    if (a)
        ans += dfs(a - 1, b, c) * a / d;
    if (b)
        ans += dfs(a + 1, b - 1, c) * b / d;
    if (c)
        ans += dfs(a, b + 1, c - 1) * c / d;
    return dp[a][b][c] = ans;
}
int main()
{
    memset(dp, -1, sizeof(dp));
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
        scanf("%d", &ai[i]), sushi[ai[i]]++;
    printf("%.10lf", dfs(sushi[1], sushi[2], sushi[3]));
    return 0;
}

Measured memory_bytes: 281088
//INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
//DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>
#define dcml(n) fixed<<setprecision(n)
//CONST
//------------------------------------------
const ll INF=1010000000000000017LL;
const ll MOD=1000000007LL;
const ld EPS=1e-12;
const ld PI=3.14159265358979323846;
//REPEAT
//------------------------------------------
#define   FOR(i,m,n) for(ll (i)=(m);   (i)<(n);  (i)++)
#define  FORS(i,m,n) for(ll (i)=(m);   (i)<=(n); (i)++)
#define  RFOR(i,m,n) for(ll (i)=(n)-1; (i)>=(n); (i)--)
#define RFORS(i,m,n) for(ll (i)=(n);   (i)>(n);  (i)--)
#define   REP(i,n)   for(ll (i)=0;     (i)<(n);  (i)++)
#define  REPS(i,x)   for(ll (i)=1;     (i)<=(x); (i)++)
#define  RREP(i,x)   for(ll (i)=(x)-1; (i)>=0;   (i)--)
#define RREPS(i,x)   for(ll (i)=(x);   (i)> 0;   (i)--)
#define  WREP(i,in,j,jn) REP(i,in)REP(j,jn)
#define WREPS(i,in,j,jn) REPS(i,in)REPS(j,jn)
//-----------------------------------------
//namespace
using namespace std;
//ライブラリはここに
//↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓
ll dp[110000];
ll h[110000];
//-----------------------------------------
int main(void){
    REP(i,110000)dp[i]=INF;dp[0]=0;
    ll N;cin>>N;
    REP(i,N)cin>>h[i];
    REP(i,N){
        dp[i+1]=min(dp[i+1],dp[i]+abs(h[i+1]-h[i]));
        dp[i+2]=min(dp[i+2],dp[i]+abs(h[i+2]-h[i]));
    }
    cout<<dp[N-1]<<"\n";
}

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

int main() {
	int h, w, a, b;
	cin>>h>>w>>a>>b;
	
	for(int i = 1; i <= b; i++){
		for(int j = 1; j <= a; j++){
			cout<<1;
		}
		for(int j = a+1; j <= w; j++){
			cout<<0;
		}
		cout<<'\n';

	}
	
	for(int i = b+1; i <= h; i++){
		for(int j = 1; j <= a; j++){
			cout<<0;
		}
		for(int j = a+1; j <= w; j++){
			cout<<1;
		}
		cout<<'\n';

	}
}

Measured memory_bytes: 1280
#include<stdio.h>

int main(){
	int n,m;
	int i,j;
	int t;
	int change;
	int list[100];
	int bucket[100];
	scanf("%d %d",&n,&m);
	while(n&&m){
		for(i=0;i<100;i++){
			list[i] = i+1;
			bucket[i] = 0;
		}
		for(i=0;i<n;i++){
			for(j=0;j<m;j++){
				scanf("%d",&t);
				bucket[j] += t;
			}
		}
		for(i=0;i<m-1;i++){
			for(j=i;j>=0;j--){
				if(bucket[j] < bucket[j+1]){
					change = list[j];
					list[j] = list[j+1];
					list[j+1] = change;
					change = bucket[j];
					bucket[j] = bucket[j+1];
					bucket[j+1] = change;
				}
				else{
					break;
				}
			}
		}
		printf("%d",list[0]);
		for(i=1;i<m;i++){
			printf(" %d",list[i]);
		}
		printf("\n");
		scanf("%d %d",&n,&m);
	}
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define rep(i,n) for(lli i=0;i<n;i++)
#define repb(i,n) for(lli i=n-1;i>=0;i--)
#define pb push_back
#define mp make_pair
#define bg() begin()
#define en() end()
#define ft first
#define sc second
#define vect_lli_it vector<lli>::iterator
#define set_lli_it set<lli>::iterator
#define inf 1e18
#define all(X) X.begin(),X.end()
#define iterate(X) for(it=X.begin();it!=X.end();it++)
lli combi(lli n,lli k)
{
    lli ans=1;
    k=k>n-k?n-k:k;
    lli j=1;
    for(;j<=k;j++,n--)
    {
        if(n%j==0)
        {
            ans*=n/j;
        }else
        if(ans%j==0)
        {
            ans=ans/j*n;
        }else
        {
            ans=(ans*n)/j;
        }
    }
    return ans;
}
lli gcd(lli a, lli b)
{
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
lli findlcm(vector <lli> arr, lli n)
{
    lli ans = arr[0];
    for (lli i = 1; i < n; i++)
        ans = (((arr[i] * ans)) /
                (gcd(arr[i], ans)));

    return ans;
}
lli power(lli x, lli y, lli p)
{
    lli res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    lli n,m,x;
    cin>>n>>m>>x;
    lli mat[n][m];
    lli cost[n];
    rep(i,n){
    	cin>>cost[i];
    	rep(j,m){
    		cin>>mat[i][j];
		}
	}
	lli ans=inf;
	lli tot=(1<<n);
	for(lli i=1;i<tot;i++){
		lli k=0;
		set <lli> st;
		while(k<n){
			if((i&(1<<k))==(1<<k)){
				st.insert(k);
			}
			k++;
		}
		set_lli_it it;
		lli cur_cost=0;
		lli num=0;
		lli level[m];
		rep(j,m){
			level[j]=0;
		}
		iterate(st){
			cur_cost+=cost[*it];
			rep(j,m){
				level[j]+=mat[*it][j];
			}
		}
		rep(j,m){
			if(level[j]>=x)
			num++;
		}
		if(num==m){
			ans=min(ans,cur_cost);
		}
	}
	if(ans==inf)
	cout<<"-1";
	else
	cout<<ans;
    return 0;
}


Measured memory_bytes: 3664
#include<stdio.h>
#include<stdbool.h>
 
#define N 8
#define WHITE -1
#define BLACK 1
#define MAX 100000
 
int r[N], cl[N], dpos[2*N-1] , dneg[2*N-1];
bool X[N][N];

void Ansplot() {
  int i,j;
  for(i = 0;i<N;i++) {
    for(j = 0;j<N;j++) {
      if(X[i][j]) {
        if(r[i] != j) return;
      }
    }
  }
  
  for(i = 0;i<N;i++) {
    for(j = 0;j<N;j++) printf("%s", (r[i] == j) ? "Q":"." );
    printf("\n");
  }
}
 
void recursive(int i) {
  if(i == N) {
    Ansplot
();
    return;
}
 
int j;
for(j=0;j<N;j++) {
  if(BLACK == cl[j] ||
     BLACK == dpos[i+j] ||
     BLACK  == dneg[i-j+N-1]) continue;
 
     r[i] = j; cl[j] = dpos[i+j] = dneg[i-j+N-1] = BLACK;
 
     recursive(i+1);
     r[i] = cl[j]=dpos[i+j] = dneg[i-j+N-1] = WHITE;
 
}
}

void aaaaa(int a){
  int i, count=0;
  for(i=0; i<a; i++)count++;
}
 
int main() {

  int i,j,k, a=10;
  for(i = 0;i<N;i++) r[i] = WHITE, cl[i] = WHITE;
  for(i=0;i<2*N-1;i++) dpos[i] = WHITE; dneg[i] = WHITE;
  
  for(i = 0;i<N;i++){
    for(j=0;j<N;j++) X[i][j] = false;
  }
  
  scanf("%d\n", &k);

  for(i = 0;i<N;i++) {
    int r,c; scanf("%d%d\n", &r,&c );
    X[r][c] = true;
  }
 
  recursive(0);
  aaaaa(a);
  return 0;
}



Measured memory_bytes: 2148
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define N 100000
char s[N+5];
int a[N+5];
int main()
{
	scanf("%s",s+1);
	int lens=strlen(s+1);
	for(int i=1;i<=lens;i++)
	{
		if(s[i]=='g') a[i]=1;
		else a[i]=-1;
	}
	int sum=0;
	for(int i=1;i<=lens;i++)
	sum+=a[i];
	printf("%d",sum/2);
}

Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#define lli long long int
#define uli unsigned long long int
#define inf 999999999999999999
#define rep(i,m,n) for(lli i = m;i < n;i++)
#define per(i,m,n) for(lli i=m-1;i>=n;i--)
#define st(n) sort(n.begin(), n.end())
#define rev(n) reverse(n.begin(),n.end())
#define ou(S) cout << S << endl
using namespace std;
int main(){
  int n;
  cin>>n;
  cout<<n*800-(n/15)*200<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,s,n) for(ll i = (s); i < (n); i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()



int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(18);
  
  string s;
  ll a, b, c, d, k;
  cin >> a >> b >> c >> d >> k;
  
  //vector<ll> a(n);  rep(i, 0, n) cin >> a[i];
  
  cout << (c*60+d)-(a*60+b)-k << "\n";
  
  //cout << (  ?"Yes" :"No") << "\n";

}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define M 1000000007
#define opt ios_base::sync_with_stdio(false); cin.tie(NULL);

void freak__()
{
    int a,b,c,f5=0,f7=0;
    cin >> a >> b >> c;
    if(a==5) f5++;
    else if(a==7) f7++;
    if(b==5) f5++;
    else if(b==7) f7++;
    if(c==5) f5++;
    else if(c==7) f7++;
    if(f5==2&&f7==1) cout << "YES";
    else cout << "NO";
    cout << "\n";
}

int main()
{
    opt;
    freak__();
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            new Program().Solve(new MyInputStream(Console.In, ' '));
            Console.Out.Flush();
        }

        public void Solve(MyInputStream cin)
        {
            var N = cin.ReadInt();
            var x = (int)Math.Sqrt(N);
            WriteLine(x * x);
        }
    }

    public class MyInputStream
    {
        private readonly System.IO.TextReader _stream;
        private char separator = ' ';
        private Queue<string> inputStream;
        public MyInputStream(System.IO.TextReader s, char separator = ' ')
        {
            this.separator = separator;
            this._stream = s;
            inputStream = new Queue<string>();
        }
        public string Read()
        {
            if (inputStream.Count != 0) return inputStream.Dequeue();
            string[] tmp = _stream.ReadLine().Split(separator);
            for (int i = 0; i < tmp.Length; ++i)
                inputStream.Enqueue(tmp[i]);
            return inputStream.Dequeue();
        }
        public string ReadLine() { return _stream.ReadLine(); }
        public int ReadInt() { return int.Parse(Read()); }
        public long ReadLong() { return long.Parse(Read()); }
        public double ReadDouble() { return double.Parse(Read()); }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read(); return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt(); return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong(); return ret;}
    }
}

Measured memory_bytes: 11220
package main

import (
	"fmt"
	"math"
)

type sw struct {
	status bool
}

type denkyu struct {
	condition int
	relation  []int
}

func main() {
	var n, m int
	fmt.Scan(&n)
	fmt.Scan(&m)

	sws := make([]*sw, 0, n)
	for index := 0; index < n; index++ {
		sws = append(sws, &sw{status: true})
	}
	ds := make([]denkyu, 0, m)

	for index := 0; index < m; index++ {
		var n int
		fmt.Scan(&n)

		d := denkyu{}
		for j := 0; j < n; j++ {
			var sw int
			fmt.Scan(&sw)
			d.relation = append(d.relation, sw-1)
		}
		ds = append(ds, d)
	}

	for index := 0; index < m; index++ {
		var n int
		fmt.Scan(&n)

		ds[index].condition = n
	}

	var re int
	pattern := int(math.Pow(2, float64(n)))
	for index := 0; index < pattern; index++ {
		pa := map[int]int{}
		for j := 0; j < n; j++ {
			pa[j] = 0
			if uint16(index)>>uint16(j)&1 == 1 {
				pa[j] = 1
			}
		}
		ok := true
		for _, item := range ds {
			var c int
			for _, r := range item.relation {
				if pa[r] == 1 {
					c++
				}
			}
			if c%2 != item.condition {
				ok = false
			}
		}
		if ok {
			re++
		}
	}

	fmt.Println(re)
}


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

int main() {
  int A,B;
  int ans=0;
  cin >> A >> B;
  for(int i=0;i<2;i++){
 	 ans=ans+max(A,B);
  }
  if(A==B){
  cout << ans << endl;
  }
  else if(A != B){
    cout << ans-1 << endl;
  }
}


Measured memory_bytes: 256
#include <stdio.h>

void bubbleSort(int A[], const int N)
{
    int i;
    int flag = 1, cnt = 0;

    while( flag ){
        flag = 0;

        for( i = N-1; 0 < i; --i )
            if( A[i] < A[i-1] ){
                int tmp = A[i];
                A[i] = A[i-1];
                A[i-1] = tmp;

                flag = 1;
                ++cnt;
            }
    }

    for( i = 0; i < N; ++i ){
        if( 0 < i ) printf(" ");
        printf("%d", A[i]);
    }
    printf("\n%d\n", cnt);
}

int main()
{
    int i;

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

    bubbleSort(A, N);

    return 0;
}

Measured memory_bytes: 604
h, w = map(int, input().split())
s = [list('#' * (w + 2))]
queue = [[1, 1, 1]]
dot = 0
for i in range(h):
    s.append(['#'] + list(input()) + ['#'])
    dot += s[-1].count('.')
s.append(list('#' * (w + 2)))

def move(yxc):
    y, x, cost = yxc[0], yxc[1], yxc[2]
    global queue
    for dy, dx in ([1, 0], [-1, 0], [0, 1], [0, -1]):
        ny, nx = y + dy, x + dx
        if s[ny][nx] == '.':
            s[ny][nx] = cost + 1
            queue.append([ny, nx, cost + 1])

while len(queue) > 0:
    move(queue.pop(0))

s[1][1] = 1
move([1, 1, 1])
if s[h][w] == '.':
    print(-1)
else:
    print(dot - s[h][w])


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0;i<n;i++)
#define all(cont) cont.begin(), cont.end()
#define unique(a)  sort(all(a)) , (a).erase(unique((a).begin(), (a).end()),(a).end())
#define rall(cont) cont.rbegin(), cont.rend()
#define sz(x) (int)(x).size()
#define fastio          ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define PB push_back
#define endl "\n"
#define f first
#define s second
#define mset(m,v) memset(m,v,sizeof(m))
#define mod 1000000007
const int N = 2e5 + 5;
#define PI acos(-1.0)
long double EPS = 1e-9;
typedef long long ll;
#define int long long
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair<int, int>> vpii;
#define pqll_max priority_queue<ll> // max heap. push(),pop(),top(),size(),empty()
#define pqll_min priority_queue<ll,vector<ll>,greater<ll> >
#define lb(v,val)   lower_bound(v.begin(),v.end(),val) //first equal to or lower than [------------
#define ub(v,val)   upper_bound(v.begin(),v.end(),val) //first greater than ------------)
#define bs(v,x) binary_search(v.begin(),v.end(),x)
inline ll add(ll x, ll y) { x += y; if (x >= mod) x -= mod; return x; }
inline ll sub(int x, int y) { x -= y; if (x < 0) x += mod; return x; }
inline ll mul(ll x, ll y) { return (x%mod * 1ll * y%mod) % mod; }
inline ll pwr(ll a, ll b) { ll x = 1 % mod; while (b) { if (b & 1) x = mul(x, a); a = mul(a, a); b >>= 1; }return x % mod; }
inline ll inv(ll a) { return pwr(a, mod - 2) % mod; }
ll gcd(ll a, ll b) { if (!a)return b % mod; return gcd(b%a, a) % mod; }
#define debug(x) cout << #x << " = " << x << endl;
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
	cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
	const char* comma = strchr(names + 1, ','); cout.write(names, comma - names) << " : " << arg1 << " | "; __f(comma + 1, args...);
}
#define in(container) for (auto &it : container) cin>>it;
#define out(container) for (auto it : container) cout << it << " "; cout << endl;
void solve() {
	int x;
	cin >> x;
	ld curr = 100;
	int cnt = 0;
	while (1) {
		if (curr >= x) {
			break;
		}
		curr =curr+ 0.01*curr;
		curr = (int)curr;
		cnt++;
	}
	cout << cnt << endl;
}

signed main()
{
	fastio;
	//cout<<fixed<<setprecision(15);
	//clock_t begin = clock();
	int tc;
	tc = 1;
	//cin >> tc;
	while (tc--) {
		solve();
	}
	//clock_t end = clock();double elapsed_secs = double(end - begin) / CLOCKS_PER_SEC;cerr << elapsed_secs;
}


//Error?
// clear lists for every test case
// print new line for each tc
// check for int or ll
// check if problem can be solved without any heavy DS like priority_queue or map



Measured memory_bytes: 3652
#include <fstream>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <cmath>
#include <climits>

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())

using namespace std;
typedef long long ll;

int main() {
#ifdef RUN_LOCAL
  ifstream in("../input.txt");
  cin.rdbuf(in.rdbuf());
#endif

  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<int> a = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  int k;
  cin >> k;
  cout << a[k - 1] << endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <utility>
using namespace std;
int GCD(int a,int b){
    if(b == 0)return a;
    return GCD(b,a%b);
}
int main(void){
    int H,W;
    cin >> H >> W;
    int a[H][W];
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            cin >> a[i][j];
        }
    }
    int count = 0;
    vector<pair<int,int>> P;
    queue<int> que;
    for(int i=0;i<H;i++){
        if(i % 2 == 0){
            for(int j=0;j<W;j++){
                P.push_back(make_pair(i,j));
            }
        }
        else{
            for(int j=W-1;j>=0;j--){
                P.push_back(make_pair(i,j));
            }
        }
    }
    for(int i=0;i+1<P.size();i++){
        if(a[P[i].first][P[i].second] % 2 == 1){
            count ++;
            a[P[i+1].first][P[i+1].second]++;
            que.push(P[i].first);
            que.push(P[i].second);
            que.push(P[i+1].first);
            que.push(P[i+1].second);
        }
    }
    cout << count << endl;
    for(int i=0;i<count;i++){
        for(int j=0;j<4;j++){
            cout << que.front() + 1;
            que.pop();
            if(j != 3){
                cout << " " ;
            }
        }
        cout << endl;
    }
}


Measured memory_bytes: 7732
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
	char a, b;
	cin >> a >> b;
	if(a == b) cout << "=" << endl;
	else if(a > b) cout << ">" << endl;
	else if(a < b) cout << "<" << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
 
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

vector<int> adj[1511111];
const int C = 11;

int getid(int u, int t)
{
	return (u*C+t);
}
bool visited[1511111];
int col[151111];
int ans[151111];

bool cmp(const ii &a, const ii &b)
{
	return (a.se>b.se);
}

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n,m; cin>>n>>m;
	for(int i=0;i<m;i++)
	{
		int u, v; 
		cin>>u>>v;
		u--; v--;
		for(int j=0;j<C-1;j++)
		{
			//cerr<<getid(u,j)<<' '<<getid(v,j+1)<<'\n';
			adj[getid(u,j)].pb(getid(v,j+1));
			adj[getid(v,j)].pb(getid(u,j+1));
		}
	}
	vector<ii> queries[11];
	int q; cin>>q;
	memset(ans,-1,sizeof(ans));
	for(int i=0;i<q;i++)
	{
		int u,d,c;
		cin>>u>>d>>c;
		u--;
		col[i]=c;
		queries[d].pb(mp(u,i));
	}
	for(int i=0;i<C;i++) sort(queries[i].begin(),queries[i].end(),cmp);
	for(int i = C - 1; i >= 0; i--)
	{
		queue<int> Q;
		memset(visited,0,sizeof(visited));
		for(int j = 0; j < queries[i].size(); j++)
		{
			int s = getid(queries[i][j].fi,0); 
			int lab = queries[i][j].se;
			if(visited[s]) continue;
			Q.push(s);
			visited[s]=1;
			while(!Q.empty())
			{
				int u = Q.front(); Q.pop();
				//cerr<<u/C<<' '<<u%C<<'\n';
				ans[u/C] = max(ans[u/C],lab);
				for(int k=0;k<adj[u].size();k++)
				{
					int v=adj[u][k];
					//cerr<<"NEIGHBOUR : "<<v/C<<' '<<v%C<<'\n';
					if(v%C<u%C) continue;
					if(!visited[v]&&v%C<=i)
					{
						visited[v]=1;
						Q.push(v);
					}
				}
			}
		}
	}
	for(int i = 0; i < n; i++)
	{
		int res=ans[i];
		if(res==-1) res=0;
		else res=col[res];
		cout<<res<<'\n';
	}
}	


Measured memory_bytes: 75196