akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <tuple>
#include <utility>
#include <vector>
#define ll long long
#define itn int
#define endl '\n'
#define co(ans) cout<<ans<<endl
#define COYE cout<<"YES"<<endl
#define COYe cout<<"Yes"<<endl
#define COye cout<<"yes"<<endl
#define CONO cout<<"NO"<<endl
#define CONo cout<<"No"<<endl
#define COno cout<<"no"<<endl
#define FORE(i,a) for(auto &i:a)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,1,n)
#define PB push_back
#define MP make_pair
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define EACH(V,i) for(typeof((V).begin()) i=(V).begin();i!=(V).end();++i)
#define equals(a,b) (fabs((a)-(b))<EPS)
#define INF ((1LL<<62)-(1LL<<31))
#define EPS 1e-10
#define PI 3.141592653589793238
#define MOD 1000000007
#define MAX 5100000
using namespace std;
using Edge=pair<ll,ll>;
using Graph=vector<vector<int>>;
inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T>inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return 1;}return 0;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

////////// 二項係数(N<=10^7) //////////

ll fac[MAX],finv[MAX],inv[MAX];
// fac[i] i!
// finv[i] i!の逆元
// inv[i] iの逆元

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

// 二項係数計算
ll COM(ll n,ll k){
  if(n<k) return 0;
  if(n<0 || k<0) return 0;
  return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}

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

int main(){
  COMinit();
  ll N,K,ans=0;
  cin>>N>>K;
  vector<ll> A;
  REP(i,N){
    ll a;
    cin>>a;
    A.PB(a);
  }
  SORT(A);
  
  REP(i,N){
    ans-=A[i]*COM(N-i-1,K-1);
    ans+=A[i]*COM(i,K-1);
    ans%=MOD;
    if(ans<0) ans+=MOD;
  }
  
  co(ans);
  return 0;
}

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

using ll = long long int;

const int MAX_N = (int)(1e3 + 5);
const int MAX_M = (int)(4e1 + 5);

int n;

ll x[MAX_N];
ll y[MAX_N];

ll length[MAX_M];
ll acc_length[MAX_M];

stack<char> ans;

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

  for (int i = 0; i < n; ++i) {
    scanf("%lld %lld", &(x[i]), &(y[i]));
  }

  int parity = (abs(x[0]) + abs(y[0])) % 2;
  for (int i = 1; i < n; ++i) {
    if ((abs(x[i]) + abs(y[i])) % 2 != parity) {
      printf("%d\n", -1);
      return 0;
    }
  }

  if (parity == 0) {
    for (int i = 0; i < n; ++i) x[i] += 1;
  }

  int m = 32;
  for (int i = 0; i < m; ++i) {
    length[i + 1] = pow(2, i);
  }

  acc_length[0] = 0;
  acc_length[1] = length[1];
  for (int i = 2; i <= m; ++i) {
    acc_length[i] = acc_length[i - 1] + length[i];
  }

  printf("%d\n", (parity == 0) ? m + 1 : m);

  if (parity == 0) printf("%lld ", 1);
  for (int i = 1; i <= m; ++i) {
    printf("%lld ", length[i]);
  }

  printf("\n");

  for (int j = 0; j < n; ++j) {
    ll cur_x = x[j];
    ll cur_y = y[j];

    for (int i = m; i >= 1; --i) {
      ll left_mv = abs(cur_x - length[i]) + abs(cur_y);
      ll right_mv = abs(cur_x + length[i]) + abs(cur_y);
      ll down_mv = abs(cur_x) + abs(cur_y - length[i]);
      ll up_mv = abs(cur_x) + abs(cur_y + length[i]);

      if (left_mv <= acc_length[i - 1]) {
        cur_x -= length[i];
        ans.push('R');
      }
      else if (right_mv <= acc_length[i - 1]) {
        cur_x += length[i];
        ans.push('L');
      }
      else if (down_mv <= acc_length[i - 1]) {
        cur_y -= length[i];
        ans.push('U');
      }
      else if (up_mv <= acc_length[i - 1]) {
        cur_y += length[i];
        ans.push('D');
      }
    }

    if (parity == 0) ans.push('L');

    while (!ans.empty()) {
      printf("%c", ans.top());
      ans.pop();
    }

    printf("\n");
  }

  return 0;
}


Measured memory_bytes: 256
import math
import collections


def main():
    n = int(input())
    s = set()
    for _ in range(n):
        s.add(input())
    print(len(s))


def input_list():
    return list(map(int, input().split()))


def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


if __name__ == '__main__':
    main()


Measured memory_bytes: 94188
#include <bits/stdc++.h>
#define MOD 1000000007
#define ll long long
#define mp(a,b) make_pair(a,b)
#define FF first
#define SS second
#define pb(x) push_back(x)
#define ub upper_bound
#define lb lower_bound
#define clr(x) memset(x,0,sizeof(x))
#define sws ios::sync_with_stdio(false); cin.tie(0)
#define pi acos(-1)
#define rep(I, N) for (ll I = 0; I < (N); ++I)
#define repp(I, A, B) for (ll I = (A); I <= (B); ++I)
using namespace std;
const ll N = 2e5+5 ;
int main()
{
    sws;
    //clock_t clk;
    //clk = clock();
    //freopen("A.in", "r", stdin); 
    //freopen("A.out", "w", stdout);

    int n;
    cin >> n;
    ll a[n + 1];
    repp(i,1,n) cin >> a[i];
    int two = 0, one = 0, zero = 0;
    repp(i,1,n)
    {
        ll num = a[i];
        if(a[i] % 4 == 0) two++;
        else if(num % 2 == 0) one++;
        else zero++;
    }
    if(one)
    {
        if(zero)
        {
            if(two < zero)
            {
                cout << "No";
            }
            else
            {
                cout << "Yes";
            }
        }
        else
        {
            cout << "Yes";
        }
    }
    else
    {
        if(two < zero - 1)
        {
            cout << "No";
        }
        else
        {
            cout << "Yes";
        }
    }

    //clk = clock() - clk;
    //cout << fixed << setprecision(6) << "Time: " << ((double)clk)/CLOCKS_PER_SEC << "\n";
    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (b); i++)
#define rrep(i, a, b) for (int i = a; i >= (b); i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
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;
}
void hr() {
   cerr << "--------------" << endl;
}
const int INF = 1001001001;
const int MOD = 1000000007;

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

   int a, b, c, k;
   cin >> a >> b >> c >> k;

   int cnt = 0;
   while (b <= a || c <= b) {
      if (b <= a) {
         b *= 2;
         //printf("b:%d\n", b);
      } else if (c <= b) {
         c *= 2;
         //printf("c:%d\n", c);
      }
      cnt++;
   }

   if (cnt <= k)
      cout << "Yes" << endl;
   else
      cout << "No" << endl;
   return 0;
}

Measured memory_bytes: 3648
#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <set>
#include <vector>
#include <queue>
#include <numeric>
using namespace std;

int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	cout << max(0,min(b,d) - max(a, c)) << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<climits>
#include<set>
#include<map>
#define ll long long
using namespace std;

int main() {
	ll a, b;
	cin >> a >> b;
	if (a + b < 10) {
		cout << a + b << endl;
	}
	else {
		cout << "error" << endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define int long long
using namespace std;
typedef pair<int,int>P;
typedef pair<int,P>P2;
#define fi first
#define se second

signed main(){
    int n,a,b,c;
    string s;
    cin>>a>>b>>c;
    cout<<c/a*b<<endl;
}

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

using namespace std;



int main() {
	int A, B, C, D;
	cin >> A >> B >> C >> D;

	int n, m;
	if (C % B == 0) {
		n = C / B;
	}
	else {
		n = C / B + 1;
	}
	if (A % D == 0) {
		m = A/ D;
	}
	else {
		m = A / D + 1;
	}
	if (n <= m) {
		cout << "Yes"<< endl;
	}
	else{
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 3592
import { readFileSync } from 'fs'
import { reverse } from 'dns'
import { start } from 'repl'
 
let lines: string[] = [];
const reader = require('readline').createInterface({
    input: process.stdin,
    output: process.stdout
});
 
reader.on('line', function (line: string) {
    lines.push(line);
});
reader.on('close', function () {
    /* let [n, d] = lines[0].split(' ').map( _ => parseInt(_)) */
    let n = parseInt(lines[0])

    console.log((1000 - (n % 1000)) % 1000)
});

Measured memory_bytes: 30056
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
Mod = 1000000007



def main(): #startline-------------------------------------------
    A,B,C = map(int,input().split())
    print(max(C-A+B,0))
if __name__ == "__main__":
    main() #endline===============================================




def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n < 2 is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))):
        if prime[i] == 1:
            for j in range(2*i,n):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n):
        if prime[i] == 1:
            res.append(i)
    return res

class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py

    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

Measured memory_bytes: 5040
package main

import (
	"bufio"
	"container/list"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	iv, _ := strconv.Atoi(scanString())
	return iv
}
func scanString() string {
	sc.Scan()
	return sc.Text()
}

func init() {
	sc.Split(bufio.ScanWords)
	buf := make([]byte, 10000)
	sc.Buffer(buf, 10000000)
}

func main() {
	s := scanString()
	ls := list.New()
	for _, r := range s {
		ls.PushBack(string(r))
	}
	rv := false
	q := scanInt()
	for i := 0; i < q; i++ {
		t := scanInt()
		switch t {
		case 1:
			rv = !rv
		case 2:
			f, c := scanInt(), scanString()
			if rv {
				f = 3 - f
			}
			if f == 1 {
				ls.PushFront(c)
			} else {
				ls.PushBack(c)
			}
		}
	}

	var wr = bufio.NewWriterSize(os.Stdout, len(s)+q)
	if rv {
		for e := ls.Back(); e != nil; e = e.Prev() {
			wr.WriteString(e.Value.(string))
		}
	} else {

		for e := ls.Front(); e != nil; e = e.Next() {
			wr.WriteString(e.Value.(string))
		}
	}
	wr.WriteString("\n")
	wr.Flush()
}


Measured memory_bytes: 22400
#include <bits/stdc++.h>
using  namespace std;
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(),(a).end()
#define INF 1e18

int main(){
	long long n,k;
	cin>>n>>k;
	long long ans=1;
	ans*=k;
	REP(i,n-1)ans*=(k-1);
	cout<<ans<<endl;
}
	
	

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

int main() {
  int n;
  cin >> n;
  
  vector<int64_t> vec(n);
  for(int i = 0; i < n; i++){
    cin >> vec.at(i);
  }
  int64_t tmp;
  
  int cnt = 0;
  bool isContinue = true;
  while(isContinue){
    for(int i = 0; i < n; i++){
      tmp = vec.at(i);
      if(tmp % 2 == 0){
        vec.at(i) = tmp / 2;
        continue;
      }
      isContinue = false;
      break;
    }
    cnt++;
  }
  cnt--;
  cout << cnt << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int fun(int n)
{
	int i,s=0;
	for(i=1;i<=n;i++)
		if(n%i==0)
			s++;
	return s; 
}
int main()
{
	int i,n,s=0;
	scanf("%d",&n);
	for(i=1;i<=n;i+=2)
		if(fun(i)==8)
			s++;
	printf("%d",s);
	return 0;
}

Measured memory_bytes: 256
/**
 * Created by hiramekun at 19:42 on 2020-05-23.
 */
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using P = pair<ll, ll>;
template<typename T> using pq = priority_queue<T>;
template<typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template<typename T, typename K> using ump = unordered_map<T, K>;
const ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll e5 = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = ll(n - 1); i >= 0; i--)
#define each(i, mp) for(auto& i:mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()

template<class T>
ostream &operator<<(ostream &out, const vector<T> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << ' ';
    return out;
}

template<class T>
istream &operator>>(istream &in, vector<T> &list) {
    ll n = list.size();
    rep(i, n) in >> list[i];
    return in;
}

template<class T>
ostream &operator<<(ostream &out, const vector<vector<T>> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << '\n';
    return out;
}

/* ------------- ANSWER ------------- */
/* ---------------------------------- */

void solve() {
    ll n, a, b;
    cin >> n >> a >> b;
    if ((b - a) % 2 == 0) {
        cout << (b - a) / 2 << '\n';
    } else {
        cout << min(a - 1, n - b) + 1 + (b - a - 1) / 2 << '\n';
    }
}

int main() {
#ifdef MY_DEBUG
    while (true) {
#endif
        solve();
#ifdef MY_DEBUG
    }
#endif
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
    char c;cin>>c;
    if(c=='a'||c=='i'||c=='u'||c=='o'||c=='e')cout<<"vowel"<<endl;
    else cout<<"consonant"<<endl;
    return 0;
}


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

int main()
{
 
    int n,x;

    while(1){
        cin>>n>>x;

        int cnt=0;
        if(n==0&&x==0)
            break;

        for(int i=1;i<=n;i++){
            for(int j=1;j<=n;j++){
                int k=x-(i+j);
                if( k>=1 && k<=n && i!=j && j!=k && i!=k)
                    cnt++;
            }
        }


        cout<<cnt/6<<endl;
    }

    return 0;
}


Measured memory_bytes: 3092
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<queue>
#include<stack>

#define reps(i,j,k) for(int i=(j);i<=(k);++i)
#define rep(i,j) reps(i,0,(j)-1)
#define fs first
#define sc second
#define pb push_back

using namespace std;

typedef pair<int,int> pii;
typedef vector<int> vi;

string eval(const string str){
	stack<char> s;
	string ret="";
	int len = str.length();
	rep(i,len){
		if('A' <= str[i] && str[i] <= 'Z'){
			char c = str[i] - 'A';
			while(!s.empty()){
				char op = s.top();
				if(op=='+') c = (c+1)%26;
				else if(op=='-') c = (c+25)%26;
				else break;
				s.pop();
			}
			s.push(c + 'A');
		}else if(str[i]==']'){
			string tmp="";
			while(!s.empty()){
				char c = s.top();
				if(c=='['){
					s.pop();
					break;
				}
				else tmp += c;
				s.pop();
			}
			rep(j,tmp.length()){
				s.push(tmp[j]);
			}
		}else{
			s.push(str[i]);
		}
	}
	while(!s.empty()){
		ret += s.top();
		s.pop();
	}
	reverse(ret.begin(), ret.end());
	return ret;
}

vector<string> hoge(string str, int p){
	vector<string> ret;
	bool flag = false;
	reps(i,p,str.length()-1){
		if(str[i]=='?'){
			reps(j,'A','Z'){
				str[i] = j;
				vector<string> tmp = hoge(str, i+1);
				rep(k,tmp.size()) ret.pb(tmp[k]);
			}
			flag = true;
			break;
		}
	}
	if(!flag) ret.pb(str);
	return ret;
}

int main(){
	string s;
	while(cin >> s){
		if(s[0]=='.') break;

		vector<string> v = hoge(s, 0);
		vector<string> ans;
		rep(i,v.size()){
			ans.pb(eval(v[i]));
//			cout << v[i] << endl;
		}
		sort(ans.begin(), ans.end());

		cout << ans[0] << endl;

	}
	return 0;
}

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

using namespace std;

int main() {

  int n;
  cin >> n;

  vector<int> a(n);
  vector<int> b(n);
  vector<int> c(n,0);

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

  for(int i =0; i <n; i++)cin >> b[i];
  for(int i =0; i <n-1; i++)cin >> c[i];

  int  ans = 0;
  for(int i =0; i < n; i++){
    int m = a[i];
    ans += b[m];
    if( (a[i] == (a[i-1] + 1 )) && i != 0) {
      int d = a[i-1];
      ans += c[d];
    }
  }

  cout << ans << endl;
    return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0; i < (n); ++i)
#define repA(i, a, n) for(ll i = a; i < (n); ++i)
#define repD(i, a, n) for(ll i = a; i > (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (long long) (x).size()
#define fill(a) memset(a, 0, sizeof(a))
#define fst first
#define snd second
// #define mp make_pair
#define pb push_back
// #define endl "\n"
#define MAXN 5000000
const long double PI = 3.141592653589793238462643383;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long int> vll;
typedef vector<double> vd;
typedef vector<pii> vii;
int Ceil(int a, int b){
    if(a%b==0) return a/b;
    else return (a/b)+1;
}
ll p=1000000007;
float E = 0.00000000000001;
ll power(ll x, ll y){
    if(y==0){
        return 1;
    }
    if(y%2==0){
        ll q=power(x,y/2);
        q=q%p;
        return (q*q)%p;
    }
    ll q=power(x,y/2);
    q=q%p;
    return ((x%p)*((q*q)%p))%p; 
}
bool sortbysec(const pair<int,int> &a, 
              const pair<int,int> &b) 
{ 
    return (a.second < b.second); 
}

bool isPowerOfTwo (int x)  
{  
    /* First x in the below expression is for the case when x is 0 */
    return x && (!(x&(x-1)));  
}  

long long int gcd(long long int a, long long int b){ 
    if (a == 0) 
        return b;  
    return gcd(b % a, a); 
}
long long int mod(long long int a, long long int b) {
    long long int ret = a%b; return ret>=0? ret: ret+b; 
}

int powerCount(int num, int x){
    int count = 0;
    while(!(num%x)){
        count++;
        num/=x;
    }
    return count;
}

vector <int> SieveOfEratosthenes(int n) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
    vector<int> vec;
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    for (int p=2; p<=n; p++) 
       if (prime[p]) {
        vec.push_back(p);
          // cout << p << " ";
        } 
    return vec;
} 

int main(){

    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);   
    freopen("output.txt", "w", stdout);
    #endif
    int t;
    // cin>>t;
    t = 1;
    while(t--){
        int n;
        cin>>n;
        if(n%10 == 2 || n%10 == 4 || n%10 == 5 || n%10 == 7 || n%10 == 9)
            cout<<"hon";
        else if(n%10 == 0 || n%10 == 1 || n%10 == 6 || n%10 == 8)
            cout<<"pon";
        else
            cout<<"bon";
    }
    return 0;
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
#define FORD(i,a,b) for(int i = (a); i >= (b); --i)
#define RI(i,n) FOR(i,1,(n))
#define REP(i,n) FOR(i,0,(n)-1)
#define mini(a,b) a=min(a,b)
#define maxi(a,b) a=max(a,b)
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define sz(w) (int) w.size()
typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
const int inf = 1e9 + 5;
const int nax = 1e6 + 5;

char sl[nax];

int main() {
	int n, a, b;
	scanf("%d%d%d", &n, &a, &b);
	scanf("%s", sl);
	int already = 0, over = 0;
	for(int i = 0; i < n; ++i) {
		if(sl[i] == 'a') {
			if(already < a + b) {
				++already;
				puts("Yes");
			}
			else puts("No");
		}
		else if(sl[i] == 'b') {
			++over;
			if(already < a + b && over <= b) {
				++already;
				puts("Yes");
			}
			else puts("No");
		}
		else puts("No");
	}
	return 0;
}


Measured memory_bytes: 768
#define TEST_MODE true
 
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
 
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep2(i, a, b) for (int i = (a); i < (int)(b); ++i)
#define rrep(i, n) for (int i = (n)-1; i >= 0; --i)
#define rrep2(i, a, b) for (int i = (a)-1; i >= (int)b; --i)
#define range(i, a, b, c) for (int i = a;		\
                               c > 0 ? i < b : i > b;	\
                               i += c)
#define chmax(a, b) (a = (a) < (b) ? (b) : (a))
#define chmin(a, b) (a = (a) > (b) ? (b) : (a))
using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define all(a) begin(a), end(a)
#define ifnot(a) if (not(a))
#define int long long
 
#if TEST_MODE == true
const bool test = true;
#define dump(x) cerr << #x << " = " << (x) << " "
#define dumpl(x) cerr << #x << " = " << (x) << " " << endl;
#else
const bool test = false;
#define dump(x) 
#define dumpl(x) 
#endif
 
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
const int INF = (int)1 << 60;
const ll INFL = (ll)1 << 60;
ll mod_n = (int)1e9 + 7;
const double eps = 1e-10;
typedef long double Real;
// return -1, 0, 1
int sgn(const Real &r) { return (r > eps) - (r < -eps); }
int sgn(const Real &a, const Real &b) { return sgn(a - b); }
 
//.....................
const int MAX = (int)2e5 + 5;
 
vector<string> split(const string &str, char sep)
{
  vector<string> v;
  stringstream ss(str);
  string buffer;
  while (getline(ss, buffer, sep))
    {
      v.push_back(buffer);
    }
  return v;
}
 
template <class InputIterator>
int sum(InputIterator begin, InputIterator end)
{
  return accumulate(begin, end, 0ll);
}
 
template<typename T>
T gcd(T a, T b)
{
  T c;
  while (a != 0) {
    c = a; a = b%a;  b = c;
  }
  return b;
}
 
void solve();
 
class Solver {
public:
  int N;
  vector<int> d;

  void solve() {
    cin >> N;
    d.resize(N);
    rep(i, N) cin >> d[i];
    sort(all(d));
    int cnt = 1;
    rep(i, N-1) {
      if (d[i] < d[i+1]) cnt += 1;
    }
    cout << cnt << endl;
  }
};
 
signed main()
{
  srand(time(NULL));
  cout << fixed << setprecision(20);
  auto ptr = new Solver();
  ptr->solve();
  delete ptr;
  // while (true) {    
  //     auto ptr = new Solver();
  //     ptr->solve();
  //     delete ptr;
  // }
  return 0;
}
 
// class Mycin {
// 	bool flag = true;
// public:
// 	Mycin& operator >> (int& a) {flag = scanf("%lld", &a) != EOF; return *this;}
// 	Mycin& operator >> (char& a) {flag = scanf("%c", &a) != EOF; return *this;}
// 	Mycin& operator >> (string& s) {flag = (bool)(cin >> s); return *this;}
// 	operator bool() {return flag;}
// } mycin;
 
// class Mycout {
// public:
// 	Mycout& operator << (const int& a) {printf("%lld", a); return *this;}
// 	Mycout& operator << (const char c) {printf("%c", c); return *this;}
// 	Mycout& operator << (const string& s) {printf("%s", s.c_str()); return *this;}
// } mycout;
 
// #define cin mycin
// #define cout mycout
// #define endl '\n'


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define For(i,x,y) for (register int i=(x);i<=(y);i++)
#define FOR(i,x,y) for (register int i=(x);i<(y);i++)
#define Dow(i,x,y) for (register int i=(x);i>=(y);i--)
#define Debug(v) for (auto i:v) printf("%lld ",i);puts("")
#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define ep emplace_back
#define siz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define fil(a,b) memset((a),(b),sizeof(a))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pa;
typedef pair<ll,ll> PA;
typedef vector<int> poly;
inline ll read(){
    ll x=0,f=1;char c=getchar();
    while ((c<'0'||c>'9')&&(c!='-')) c=getchar();
    if (c=='-') f=-1,c=getchar();
    while (c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
    return x*f;
}

inline int exgcd(int a,int b,int &x,int &y){
	if (!b) return x=1,y=0,a;
	int g=exgcd(b,a%b,y,x);
	return y-=a/b*x,g;
}
inline int inv(int A,int mod){
	int x,y;
	exgcd(A,mod,x,y);
	return x<0?x+mod:x;
}

int A,B,C,D,X,Y;

inline void init(){
	int g=__gcd(__gcd(A,B),C);
	A/=g,B/=g,C/=g;
	g=__gcd(A,C),Y/=g,C/=g,A/=g;
	g=__gcd(B,C),X/=g,C/=g,B/=g;
}
vector<int>x,cnt;
inline void Get(){
	D=1ll*A*inv(B,C)%C,x.clear(),cnt.clear();
	int W=C,H=D,now=0,invD=inv(D,C);
	while (W){
		int tmp=W/H;
		cnt.pb(tmp),x.pb(1ll*now*invD%C),now+=tmp*H;
		W%=H;
		if (!W) break;
		H%=W;
		if (H==0) H=W;
	}
	x.pb(C),cnt.pb(0);
}
inline ll Div(ll x,ll y){
	return x/y-(x%y&&(x^y)<0);
}
inline int Get(int x){
	return x==0?C:(C-1ll*x*D%C)%C;
}
inline void solve(){
	A=read(),X=read(),B=read(),Y=read(),C=read();
	init();
	if (C==1) return printf("%d\n",X+Y),void(0);
	Get();
	ll ans=0;
	FOR(i,0,siz(x)-1){
		int lx=x[i],ly=Get(lx),rx=x[i+1],ry=Get(rx),dx=(rx-lx)/cnt[i],dy=(ly-ry)/cnt[i];
		ll l=0,r=X+Y,ret=0;
		while (l<=r){
			ll mid=l+r>>1;
			if (X-mid*lx>=0&&Y-mid*ry>=0){
				ll a=(X-mid*lx)/dx,b=(Y-mid*ry)/dy;
				if (a>=0&&b>=0&&a+b>=mid*cnt[i]) l=mid+1,ret=mid;
					else r=mid-1;
			} else r=mid-1;
		}
		ans=max(ans,ret);
	}
	printf("%lld\n",ans);
}

int main(){
	int T=read();
	while (T--) solve();
}


Measured memory_bytes: 3724
import bisect

N,M = map(int,input().split())
pref = [[] for i in range(N)]
id = [[]] * M

for i in range(M):
  p,y = map(int,input().split())
  id[i] = [p,y]
  pref[p - 1].append(y)
  #pref[p - 1] = sorted(pref[p - 1])

for i in range(N):
  pref[i] = sorted(pref[i])

orders = [0] * N

for i in range(M):
  p = id[i][0] - 1
  y = id[i][1]
  order = str(bisect.bisect_left(pref[p],y) + 1)
  city = str(p + 1)
  ID = ""
  ID += "0" * (6 - len(city)) + city + "0" * (6 - len(order)) + order
  print(ID)


Measured memory_bytes: 33560
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        q_1();
    }

    private static void q_1() {
        try (Scanner scan = new Scanner(System.in)) {
            int a = scan.nextInt();
            int b = scan.nextInt();
            int c = scan.nextInt();

            System.out.println(b / a < c ? b / a : c);
        }
    }

}

Measured memory_bytes: 21844
# 入力
n, k = map(int, input().split())
a = list(map(int, input().split()))

# ライブラリ
def get_bits_pattern(n):
    bits_pattern = []
    for i in range(2**n):
        bits = [False]*n

        for j in range(n):
            if i >> j & 1:
                bits[j] = True
        bits_pattern.append(bits)
    return bits_pattern

# 処理
bits_pattern = get_bits_pattern(n)
new_bits_pattern = []
for bits in bits_pattern:
    counter = 0
    for bit in bits:
        if bit:
            counter += 1
    if counter == k:
        new_bits_pattern.append(bits)

yens = []
for bits in new_bits_pattern:
    max_height = 0
    yen = 0
    for i, bit in enumerate(bits):
        if bit:
            if max_height >= a[i]:
                yen += max_height - a[i] + 1
                max_height = max(max_height, a[i]) + 1
            else:
                max_height = max(max_height, a[i])
        else:
            max_height = max(max_height, a[i])
            
    yens.append(yen)

import numpy as np
print(np.min(yens))

Measured memory_bytes: 33256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
	string S;
	cin >> S;

	int x = 700;

	for (int i = 0; i < S.size(); i++) {
		if (S[i] == 'o') {
			x += 100;
		}
	}
	cout << x << endl;
}

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

int main() {
  ll x, ans = 0;
  cin >> x;
  cout << 10 - x / 200 << endl;
  return 0;
}


Measured memory_bytes: 3616
W,B = map(int, input().strip().split(' '))

ans = []
width = 100

# 上半分
if B == 1:
  ans.append('.'*width)
b = 1
while b < B:
  line = ['.']*width
  for i in range(0,width,2):
    if b >= B: break
    b += 1
    line[i] = '#'
  ans.append(line)
  ans.append('.'*width)

#下半分
if W == 1:
  ans.append('#'*width)
w = 1
while w < W:
  line = ['#']*width
  for i in range(0,width,2):
    if w >= W: break
    w += 1
    line[i] = '.'
  ans.append('#'*width)
  ans.append(line)

print(len(ans), width)
for b in ans:
  print(*b, sep='')



Measured memory_bytes: 41584
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)

int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    string X,Y;
    cin >> X >> Y;
    if(X < Y){
        cout << '<';
    }else if(X > Y){
        cout << '>';
    }else{
        cout << '=';
    }

    return 0;
}

Measured memory_bytes: 256
import heapq
import sys
input = sys.stdin.readline

def main():
    N,M = map(int,input().split())
    paylist = [[] for _ in range(M)]
    for _ in range(N):
        a,b = map(int,input().split())
        if M >= a:
            heapq.heappush(paylist[a-1],-b)
    work = []
    payment = 0
    for i in range(M):
        for j in paylist[i]:
            heapq.heappush(work,j)
        if work:
            payment += heapq.heappop(work)

    print(-payment)

if __name__ == "__main__":
    main()

Measured memory_bytes: 17604
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct Node{
    int key;
    struct Node *right, *left, *parent;
};

struct Node *root, *NIL;

void insert(int k){
    struct Node *y = NIL, *x = root, *z;
    
    z = (struct Node *)malloc(sizeof(struct Node));
    z->key = k;
    z->left = NIL;
    z->right = NIL;
    
    while(x != NIL){
        y = x;
        if(z->key < x->key){
            x = x->left;
        }else{
            x = x->right;
        }
    }
    z->parent = y;
    if(y == NIL){
        root = z;
    }else{
        if(z->key < y->key){
            y->left = z;
        }else{
            y->right = z;
        }
    }
}

void inorder(struct Node *u){
    if(u == NIL) return;
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
}

void preorder(struct Node *u){
    if(u == NIL) return;
    printf(" %d",u->key);
    preorder(u->left);
    preorder(u->right);
}

struct Node * find(struct Node *u, int k){
    while(u != NIL && k != u->key){
        if(k < u->key) u = u->left;
        else u = u->right;
    }
    return u;
}

int main(void){
    int n,i,x;
    char str[10];
    
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%s",str);
        // 探索関数
        if(strcmp(str,"find") == 0){
            scanf("%d",&x);
            struct Node *t = find(root,x);
            if(t != NIL) printf("yes\n");
            else printf("no\n");
        }
        //　挿入関数
        else if(strcmp(str,"insert") == 0){
            scanf("%d",&x);
            insert(x);
        }
        //　出力関数
        else if(strcmp(str,"print") == 0){
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        }
    }
    return 0;
}



Measured memory_bytes: 20460
#include<stdio.h>
#define MAX 100000

int oya (int i) {return i / 2;}
int hidari(int i) {return 2 * i;}
int migi (int i) {return 2 * i +1;}

int main(void){
  int n, i, J[MAX+1];

  scanf("%d", &n);
  for(i = 1; i <= n; i++) scanf("%d", &J[i]);

  for(i=1;i<=n;i++){
    printf("node %d: key = %d, ", i, J[i]);
    if(oya(i)>=1) printf("parent key = %d, ", J[oya(i)]);
    if(hidari(i)<=n) printf("left key = %d, ", J[hidari(i)]);
    if(migi(i)<=n) printf("right key = %d, ", J[migi(i)]);
    printf("\n");
  }
  return 0;
}





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

vector<int> a;
vector<int> b;
vector<int> c;

void CountingSort(int n, int k){
  b.resize(n+5);
  c.resize(k+5);
  for(int i = 0; i <= k; i++) c[i] = 0;
  
  for(int i = 1; i <= n; i++) c[a[i]]++;

  for(int i = 1; i <= k; i++) c[i] = c[i] + c[i-1];

  for(int i = n; i >= 1; i--){
    b[c[a[i]]] = a[i];
    c[a[i]]--;
  } 
}

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

  a.resize(n+5);
  int k = 0;

  for(int i = 0; i < n; i++){
    cin >> a[i+1];
    if(a[i+1] > k) k = a[i+1];
  }

  CountingSort(n, k);

  for(int i = 1; i <= n; i++){
    if(i != 1) cout << " ";
    cout << b[i];
  }

  cout << endl;

  return 0;

}



Measured memory_bytes: 18404
#include <iostream>
#include <cmath>
#include <string>
#include <typeinfo>
using namespace std;
int main()
{
    string s;
    cin >> s;
    int min = 10000;
    for (int i = 0; i < s.size() - 2; i++)
    {

        int a = (int(s[i]) - 48) * 100 + (int(s[i + 1]) - 48) * 10 + int(s[i + 2]) - 48;

        if (abs(753 - a) < min)
        {
            min = abs(753 - a);
        }
    }
    cout << min;
}

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

int main(){
    int n, a1[100], a2[100];
    cin>>n;
    for(int i=0; i<n; i++) cin>>a1[i];
    for(int i=0; i<n; i++) cin>>a2[i];

    int t=0;
    t+=a1[0];
    for(int i=0; i<n; i++) t+=a2[i];
    int mxt=t;

    for(int i=1; i<n; i++){
        t+= a1[i]-a2[i-1];
        mxt=max(mxt, t);
    }

    cout<<mxt<<endl;

    return 0;
}


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

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

	if (s.length() == 6)
		if (s[2] == s[3] && s[4] == s[5]) {
			cout << "Yes" << endl;
                        return 0;
                }

	cout << "No" << endl;
}

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

int main(){
  ll N,X,T;
  cin >> N >> X >> T;
  ll ans=0;
  if(N%X==0){
    cout << N/X*T << endl;
    return 0;
  }
  else{
    cout << N/X*T+T << endl;
    return 0;
  }
}



Measured memory_bytes: 3596
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define rep(i,n) for(ll i=0;i<n;i++)
#define INF 1e9+7
#define LLINF 1e18
using namespace std;
const int MOD = 1e9 +7;



int main(){
    int a[10],m,k;
    m=10;
    k=INF;
    rep(i,5) cin>>a[i];
    rep(i,5){
        if(a[i]%10!=0 && m>a[i]%10){
            m =a[i]%10;
        }
    }
    int ans=0;
    rep(i,5){
        if(a[i]%10==0) ans += a[i];
        else ans += a[i]/10*10+10;
    }
    if(m==10) cout <<ans<<endl;
    else cout << ans-(10-m)<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#define ll long long
using namespace std;
int main(){
    int n,k;
    cin>>n>>k;
    vector<int> h(n);
    for(int i=0;i<n;i++){
        cin>>h[i];
    }
    vector<int> dp(n,1000000000);
    dp[0]=0;
    dp[1]=abs(h[0]-h[1]);
    for(int i=2;i<n;i++){
        for(int j=1;j<=min(i,k);j++){
            dp[i]=min(dp[i-j]+abs(h[i]-h[i-j]),dp[i]);
        }        
    }
    cout<<dp[n-1]<<endl;
    return 0;
}

Measured memory_bytes: 1024
while True :
    n = int(input())
    
    if n == 0 :
        break
    else :
        for i in range(1, n) :
            n *= i
            
        N = str(n)
        l = len(N)
        
        s = 0
        for j in range(l - 1, -1, -1) :
            if N[j] == "0" :
                s += 1
            else :
                break
            
        print(s)


Measured memory_bytes: 5708
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second

const int mx=200010;
const ll mod=1e9+7;


int main(){
  ld s;
  cin >> s;
  s /= (ld)3;
  ld ans = s*s*s;
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}


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

int main(){
  int n;
  cin >> n;
  string s;
  cin >> s;
  map<int,vector<int>> m;
  rep(i,n) m[s[i]-'0'].push_back(i);
  int ans = 0;
  rep(i,10) {
    rep(j,10) {
      rep(k,10) {
        bool can = true;
        if(m[i].size() == 0) can = false;
        else {
          int a = m[i][0];
          int b = upper_bound(m[j].begin(),m[j].end(),a) - m[j].begin();
          if(m[j].size() == 0 || b == m[j].size()) can = false;
          else {
            int c = upper_bound(m[k].begin(),m[k].end(),m[j][b]) - m[k].begin();
            if(m[k].size() == 0 || c == m[k].size()) can = false;
            else ans++;
          }
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 512
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		//		new Main().solveA();
		//		new Main().solveB();
		//		new Main().solveC();
		new Main().solveC2();
		// new Main().solveD();
	}

	private void solveA() {
		Scanner scanner = null;
		int numA = 0;
		int numB = 0;
		int numC = 0;

		try {
			scanner = new Scanner(System.in);
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numC = scanner.nextInt();

			int wk = numB;
			int res = 0;
			while (wk >= numA && res < numC) {
				wk -= numA;
				res++;
			}

			System.out.println(res);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveB() {
		Scanner scanner = null;
		int numA = 0;
		int numB = 0;
		int numK = 0;

		try {
			scanner = new Scanner(System.in);
			numA = scanner.nextInt();
			numB = scanner.nextInt();
			numK = scanner.nextInt();

			List<Integer> wk = new ArrayList<Integer>();
			for (int i = 1; i <= Math.max(numA, numB); i++) {
				if (numA % i == 0 && numB % i == 0) {
					wk.add(i);
				}
			}

			System.out.println(wk.get(wk.size() - 1 - numK));

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private int getList(List<Character> wk) {

		if (wk.size() < 2) {
			return 0;
		}

		int res = 0;
		int i1 = 0;
		int i2 = 1;
		for (int i = 1; i < wk.size(); i++) {
			if (wk.get(i) != wk.get(i - 1)) {
				i1 = i - 1;
				i2 = i;
				break;
			}
			if (i == wk.size() - 1) {
				return 0;
			}
		}
		while (i2 < wk.size()) {

			char c1 = wk.get(i1);
			char c2 = wk.get(i2);
			if (c1 != c2) {
				wk.remove(i2);
				wk.remove(i1);
				res += 2;
			} else {
				i1 = i2;
				i2 = i2 + 1;
			}
		}
		return getList(wk) + res;
	}

	private void solveC() {
		Scanner scanner = null;
		char[] wkS;

		try {
			scanner = new Scanner(System.in);
			wkS = scanner.next().toCharArray();

			List<Character> wk = new ArrayList<Character>();
			for (char c : wkS) {
				wk.add(c);
			}

			System.out.println(getList(wk));

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveC2() {
		Scanner scanner = null;
		char[] wkS;

		try {
			scanner = new Scanner(System.in);
			wkS = scanner.next().toCharArray();

			int cnt0 = 0;
			int cnt1 = 0;
			for (char c : wkS) {
				if (c == '0') {
					cnt0++;
				} else if (c == '1') {
					cnt1++;
				}
			}

			System.out.println(Math.min(cnt0, cnt1) * 2);

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}

	private void solveD() {
		Scanner scanner = null;
		int numN = 0;
		int numK = 0;
		int numS = 0;

		try {
			scanner = new Scanner(System.in);
			numN = scanner.nextInt();

			System.out.println("");

		} finally {
			if (scanner != null) {
				scanner.close();
			}
		}
	}
}

Measured memory_bytes: 26916
#include <iostream>
using namespace std;
int A[100];
int main(void){
    // Your code here!
    int N = 0;
    int D = 0;
    int X = 0;
    int total = 0;
    
    cin >> N;
    cin >> D;
    cin >> X;
    
    for(int i = 0; i < N; i++){
        cin >> A[i];
    }
    
    for(int i = 1; i <= D; i++){
        for( int j = 0; j < N; j++ ){
            if( (i%A[j]) == 1){
                total++;
                // << j << ","<<total<<","<<i%A[j]<<endl;
            }
            else if( A[j] ==1){
                total++;
            }
        }
    }
    
    total += X;
    cout << total;
    
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define endl "\n"
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define mp make_pair
#define mm(a) memset(a,0,sizeof(a))
#define rep(i,a,b) for(ll i = a; i < b; i++)
#define repn(i,a,b) for(ll i = a; i >= b; i--)
#define pb push_back
#define ff first
#define ss second
#define fto(k,m) for(auto k:m)
#define in_edges(m) repp(i, 1, m){ ll a, b; cin >> a >> b; adj[a].pb(b), adj[b].pb(a);}
#define debug(this) cerr<<"> "<<#this<<" : "<<this<<"\n"
#define MOD 1000000007
#define sz(a) ll((a).size())
#define pii 3.1415926535897
#define ld long double
#define print(a,n) rep(i,1,n)cout <<a[i] <<" ";
#define BRAHAMASTRA ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
// stoll(s);
int main()
{
   BRAHAMASTRA
   ll t; t=1;
//    cin >>t;
   while(t--)
   { 
       ll n; cin >>n;
       map<string,ll>m;
       rep(i,0,n)
       {
           string f; cin >>f;
           m[f]++;
       }
           cout<<"AC"<<" x "<<m["AC"]<<endl;
           cout<<"WA"<<" x "<<m["WA"]<<endl;
           cout<<"TLE"<<" x "<<m["TLE"]<<endl;
           cout<<"RE"<<" x "<<m["RE"]<<endl;
   }
}



Measured memory_bytes: 3652
//
//  love_golf.cpp
//  learningCplusplus
//
//  Created by Tran Duc Chinh on 2020/04/04.
//  Copyright © 2020 Tran Duc Chinh. All rights reserved.
//

#include <iostream>
#include <queue>
#include <math.h>
using namespace std;
typedef long long ll;
ll mod = 1000000007;
#define PI 3.14159265

int main(int argc, const char* argv[]) {

  int k, a, b;
  std::cin >> k >> a >> b;
  bool carry = false;

  for (int i = a; i <=b; i++) {
    if (i % k == 0) {
      carry = true;
      break;
    }
  }
  if (carry) {
    std::cout << "OK" << std::endl;
  }
  else {
    std::cout << "NG" << std::endl;
  }
  return 0;
}


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





using namespace std;






int main (){
int n,k,q;
  int t;

  cin>>n>>k>>q;

  
vector<int> vec(n,k-q);  


  
  
 for(int i=0; i<q; i++){
    cin>>t;
   t--;
   vec[t]++;

} 

 
for(int i=0; i<vec.size(); i++){

   if( vec.at(i)>0)cout<<"Yes"<<endl;
	else{cout<<"No"<<endl;}
}  
  
  return 0;
}


Measured memory_bytes: 1024
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10**7)

n, k = map(int, input().split())
A = list(map(int, input().split()))
dp = [-1]*(k+1)
def dfs(k):
  if dp[k] != -1:
    return dp[k]
  for a in A:
    if k-a >= 0 and dfs(k-a) == 0:
      dp[k] = 1
      return 1
  dp[k] = 0
  return 0
result = dfs(k)
if result:
  print("First")
else:
  print("Second")

Measured memory_bytes: 95272
#include <bits/stdc++.h>
using namespace std;
int main(){
    string s,t;
    cin >> s >> t;
    int a,b;
    cin >> a >> b;
    string u;
    cin >> u;
    if(s==u) cout << a-1 << ' ' << b << endl;
    else cout << a << ' ' << b-1 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int calc_digit(long long n){
    int res=0;
    while(n){
        n=n/10;
        res++;
    }
    return res;
}

int main() {
    long long n;cin>>n;
    int res=(1<<29);
    for(long long i=1;i*i<=n;i++){
        if(n%i==0){
            long long b=n/i;
            int f=max(calc_digit(i),calc_digit(b));
            res=min(res,f);
        }
    }
    cout<<res<<endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int n, cnt;
    int p[100];

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

        for(int i = n; i >= 1; --i) {
            cnt = 0;
            for(int j = 0; j < n; ++j) {
                if (i <= p[j]) {
                    cnt += 1;
                }
            }

            if (cnt >= i) {
                cout << i << endl;
                break;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3104
#include <iostream>
#include <vector>
#include <cmath>

using namespace std;

int main() {
    int n,m; cin >> n >> m;
    vector<vector<int> > s(m, vector<int>());
    vector<int> p(m);
    for(int i = 0; i < m; i++) {
        int k; cin >> k;
        for(int j = 0; j < k; j++) {
            int tmp; cin >> tmp;
            s[i].push_back(tmp);
        }
    }
    for(int i = 0; i < m; i++) {
        cin >> p[i];
    }
    int sum = 0;
    for(int i = 0; i < pow(2,n); i++) {
        bool isOK = true;
        for(int j = 0; j < m; j++) {
            int nums = 0;
            for(int k = 0; k < s[j].size(); k++) {
                if(i >> (s[j][k]-1) & 1)
                    nums++;
            }
            if(nums%2 != p[j]) {
                isOK = false;
                break;
            }
        }
        if(isOK)
            sum++;
    }
    cout << sum << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
# define pb push_back
# define FOR(i,a,n) for(int i=a;i<n;i++)
# define mp make_pair
# define RFOR(i,a,n) for(int i=n;i>a;i--)
# define pii pair<long long int,long long int>
#define ub upper_bound
#define lb lower_bound
#define MOD 1000000007
typedef long long int ll;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
        cout.tie(0);
	ll n,k;
	cin>>n;
	ll flag=0;
	ll flag1=0;
	ll var=0;
	ll mark;
	vector<char> vec;
	for(int i=1;i<31;i++)
	{
		var+=pow(26,i);
		if(var==n)
		{
			flag++;
			mark=i;
	    }
	}
	if(flag>0)
	{
		for(int i=0;i<mark;i++)
		vec.pb('z');
	}
	else
	{
	while(n)
	{
		k=n%26;
		if(k==0)
		vec.pb('z');
		else
		vec.pb(k+96);
		n/=26;
		if(k==0)
		n--;
    }
    }
	for(int i=vec.size()-1;i>=0;i--)
	cout<<vec[i];
}

Measured memory_bytes: 3996
#include <stdio.h>

int m ;
int d ;
int dayc ;

const int days[13] = { 0 , 31 , 29 , 31 , 30 , 31 , 30 , 31 , 31 , 30 , 31 , 30 , 31 } ;

int main ( )
{
	while ( scanf ( "%d %d" , &m , &d ) == 2 && m && d ) {
		dayc = 0 ;
		for ( int i = 0 ; i < m ; i++ ) {
			dayc += days[i] ;
		}
		dayc += d ;
		dayc-- ;
		dayc %= 7 ;
		switch ( dayc ) {
			case 0 :
				printf ( "Thursday\n" ) ;
				break ;
			case 1 :
				printf ( "Friday\n" ) ;
				break ;
			case 2 :
				printf ( "Saturday\n" ) ;
				break ;
			case 3 :
				printf ( "Sunday\n" ) ;
				break ;
			case 4 :
				printf ( "Monday\n" ) ;
				break ;
			case 5 :
				printf ( "Tuesday\n" ) ;
				break ;
			case 6 :
				printf ( "Wednesday\n" ) ;
				break ;
		}
	}
	return 0 ;
}

Measured memory_bytes: 1012