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

typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;

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

const ll INF = 1e18;
const ll MOD = 998244353;
const ll MX = 1000001;

int N;

void solve() {
    cin >> N;
    vector<l_l> a(N);
    for (int i = 0; i < N; i++) {
		cin >> a[i].first;
		a[i].second = i + 1;
	}
	sort(a.begin(), a.end());
	for (auto& i : a) {
		cout << i.second << " ";
	}
}

int main() {
	cin.sync_with_stdio(0); cin.tie(0);
    ll T = 1; // cin >> T;
    while (T--) solve();
    return 0;
    // You should actually read the stuff at the bottom
}

/* Stuff to Look For
 * -----------------
 * Int overflow, array bounds
 * Initializing all variables, avoid weird behavior
 * Edge cases(n = 0, n = 1)
 * Just return 0 after result
 */


Measured memory_bytes: 2432
import java.io.*;
import java.util.*;

public class Main {
  private static int getPower(int card) {
    if (card == 1) {
      return 14;
    }
    return card;
  }
  
  private static String solve(int a, int b) {
    int aPower = getPower(a);
    int bPower = getPower(b);
    if (aPower > bPower) {
      return "Alice";
    } else if (aPower < bPower) {
      return "Bob";
    } else {
      return "Draw";
    }
  }
  
  private static void execute(ContestReader reader, PrintWriter out) {
    out.println(solve(reader.nextInt(), reader.nextInt()));
  }
  
  public static void main(String[] args) {
    ContestReader reader = new ContestReader(System.in);
    PrintWriter out = new PrintWriter(System.out);
    execute(reader, out);
    out.flush();
  }
}

class ContestReader {
  private BufferedReader reader;
  private StringTokenizer tokenizer;
  
  ContestReader(InputStream in) {
    reader = new BufferedReader(new InputStreamReader(in));
  }
  
  public String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }
  
  public int nextInt() {
    return Integer.parseInt(next());
  }
  
  public long nextLong() {
    return Long.parseLong(next());
  }
  
  public double nextDouble() {
    return Double.parseDouble(next());
  }
  
  public String[] next(int n) {
    String[] array = new String[n];
    for (int i = 0; i < n; i++) {
      array[i] = next();
    }
    return array;
  }
  
  public int[] nextInt(int n) {
    int[] array = new int[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextInt();
    }
    return array;
  }
  
  public long[] nextLong(int n) {
    long[] array = new long[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextLong();
    }
    return array;
  }
  
  public double[] nextDouble(int n) {
    double[] array = new double[n];
    for (int i = 0; i < n; i++) {
      array[i] = nextDouble();
    }
    return array;
  }
  
  public char[] nextCharArray() {
    return next().toCharArray();
  }
  
  public int[][] nextInt(int n, int m) {
    int[][] matrix = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextInt();
      }
    }
    return matrix;
  }
  
  public long[][] nextLong(int n, int m) {
    long[][] matrix = new long[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextLong();
      }
    }
    return matrix;
  }
  
  public double[][] nextDouble(int n, int m) {
    double[][] matrix = new double[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        matrix[i][j] = nextDouble();
      }
    }
    return matrix;
  }
  
  public char[][] nextCharArray(int n) {
    char[][] matrix = new char[n][];
    for (int i = 0; i < n; i++) {
      matrix[i] = next().toCharArray();
    }
    return matrix;
  }
}


Measured memory_bytes: 19796
#include <iostream>

using namespace std;

int main()
{
	int a[4], b[4];
	
	while ( cin >> a[0] >> a[1] >> a[2] >> a[3] >> b[0] >> b[1] >> b[2] >> b[3] ) {
		
		int hit_cnt = 0;
		int blow_cnt = 0;
		
		for (int i=0; i<4; i++) {
			if (a[i] == b[i]) { hit_cnt++; a[i] = b[i] = -1; }
		}
		
		for (int i=0; i<4; i++) {
			if (a[i] == -1) continue;
			for (int j=0; j<4; j++) {
				if (a[i] == b[j]) { blow_cnt++; a[i] = b[j] = -1; break; }
			}
		}
		
		cout << hit_cnt << " " << blow_cnt << endl;
	}	
		
	return 0;
}

Measured memory_bytes: 3092
#include <cstdio>

const int N=100005;

int fst[N],v[N],mask[N],tot=0;

struct Edge{
	int to,nxt;
}e[N*2];

void addedge(int x,int y){
	e[++tot].to=y;e[tot].nxt=fst[x];fst[x]=tot;
}

void dfs(int x,int father){
	mask[x]=0;v[x]=0;
	for (int i=fst[x];i;i=e[i].nxt){
		int y=e[i].to;
		if (y!=father){
			dfs(y,x);
			int s=mask[x]&mask[y],j=0;
			mask[x]|=mask[y];
			for (;s;s>>=1) j++;
			if (j>v[x]) v[x]=j;
			for (;(mask[x]>>v[x])&1;v[x]++);
			for (j=0;j<v[x];j++) mask[x]^=mask[x]&(1<<j);
		}
	}
	mask[x]|=1<<v[x];
}

int main(){
	int n;
	scanf("%d\n",&n);
	for (int i=1;i<n;i++){
		int x,y;
		scanf("%d%d\n",&x,&y);
		addedge(x,y);
		addedge(y,x);
	}
	dfs(1,0);
	int ans=0;
	for (int i=1;i<=n;i++)
		if (v[i]>ans) ans=v[i];
	printf("%d\n",ans);
}

Measured memory_bytes: 7424
import bisect
total = 0
N = int(input())
A = list(map(int, input().split()))
hu = [i for i in A if i < 0]
sei = [i for i in A if i >= 0]
hu.sort()
sei.sort()
if len(hu) % 2 == 0:
    print(sum(sei)+sum(hu)*-1)
else:
    if sei:
        print(sum(sei)+sum(hu)*-1 - min(-1*hu[-1], sei[0])*2)
    else:
        print(sum(sei)+sum(hu)*-1 + 1*hu[-1]*2)

Measured memory_bytes: 14480
// #pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define N 1000000007
#define N2 998244353
#define Nmax 100001
#define INF (ll)1e18
#define pll pair<ll,ll>
#define mp make_pair
#define fi first
#define se second
#define vv vector
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(ll i=m;i<(n);i++)
#define repr(i,n) repr2(i,n,0)
#define repr2(i,m,n) for(ll i=m;i>=(n);i--)
#define get(n) ll (n); scanf("%lld",&(n));
#define get2(n,k) ll (n),(k); scanf("%lld%lld",&(n),&(k));
#define get3(n,m,k) ll (n),(m),(k); scanf("%lld%lld%lld",&(n),&(m),&(k));
#define gets(s) string (s); cin >> (s);
#define ALL(c) (c).begin(),(c).end()
#define fill_nums(A,n) vector<ll> A((n)); for(ll i=0;i<n;i++) scanf("%lld",&A[i]);
#define fill_edges(adj,m) for(ll i=0;i<m;i++) {ll a, b; scanf("%lld %lld",&a,&b); adj[a-1].pb(b-1); adj[b-1].pb(a-1);}
#define fill_direct(adj,m) for(ll i=0;i<m;i++) {ll a, b; scanf("%lld %lld",&a,&b); adj[a-1].pb(b-1);}
#define pi 3.1415926535897
#define noop

int main() {

    get2(m1,d1)
    get2(m2,d2);
    if(m2!=m1)
        printf("1\n");
    else
        printf("0\n");

    return 0;  
}



Measured memory_bytes: 764
# -*- coding: utf-8 -*-

n,x=map(int,input().split())
a=list(map(int,input().split()))

ans=0
a.sort()
for i in a:
    if i<=x:
        x-=i
        ans+=1
    else:
        break
else:
    if x>0:
        ans-=1

print(ans)




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

#define CIN_ONLY if(1)
struct cww{cww(){
    CIN_ONLY{
        ios::sync_with_stdio(false);cin.tie(0);
    }
}}star;
#define fin "\n"
#define FOR(i,bg,ed) for(int i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
#define fi first
#define se second
#define pb push_back
#define DEBUG if(0)
#define REC(ret, ...) std::function<ret (__VA_ARGS__)>
template <typename T>inline bool chmin(T &l,T r)
{bool a=l>r;if(a)l=r;return a;}
template <typename T>inline bool chmax(T &l,T r)
{bool a=l<r;if(a)l=r;return a;}
template <typename T>
istream& operator>>(istream &is,vector<T> &v){
    for(auto &it:v)is>>it;
    return is;
}
    
int main(){
    set<int> s;
    int N,M=0;
    cin>>N;
    
    REP(i,N){
        int a;
        cin>>a;
        a/=400;
        if(a>=8)M++;
        else s.insert(a);
    }
    cout<<max((int)s.size(),1)<<" "<<s.size()+M<<endl;
    
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] res = new int[N + 1];
		int index = 1;
		for (int i = 1; i <= N; i++) {
			int tmp = sc.nextInt();
			res[tmp] = index;
			index++;
		}
		for (int i = 1; i <= N; i++) {
			System.out.print(res[i] + " ");
		}

	}
}


Measured memory_bytes: 60852
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <cmath>
#include <cstdio>
#include <cctype>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <complex>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cwchar>
#include <cwctype>
#include <exception>
#include <locale>
#include <numeric>
#include <new>
#include <stdexcept>
#include <limits>
#include <valarray>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <list>
#include <utility>
#include <bitset>
#include <algorithm>
#include <functional>
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define MP make_pair
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int INF=1e9+7;
int a[200005];
int main(){
	int n;
	scanf("%d",&n);
	rep1(k,n)scanf("%d",&a[k]);
	for(int k=n;k>0;k-=2)printf("%d ",a[k]);
	for(int k=n%2+1;k<n;k+=2)printf("%d ",a[k]);
	return 0;
}

Measured memory_bytes: 2944
// たなこふ先生の input マクロ (´･_･`)
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn solv(hs: Vec<usize>, ans: usize) -> usize {
    let mut zero_flg = true;
    let mut one_flg = false;

    let mut ans = ans;
    let mut hs_next = Vec::with_capacity(hs.len());

    for h in hs {
        if h > 0 {
            hs_next.push(h - 1);
            if zero_flg {
                ans += 1;
                zero_flg = false;
                one_flg = true;
            }
        } else {
            hs_next.push(0);
            zero_flg = true;
        }
    }

    if one_flg {
        solv(hs_next, ans)
    } else {
        ans
    }
}

fn main() {
    input! {
        n : usize,
        hs : [usize; n],
    }

    println!("{}", solv(hs, 0));
}


Measured memory_bytes: 4352
#include <iostream>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <unordered_set>
#include <vector>
#include <utility>
#include <algorithm>
#include <queue>
#include <cstdint>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

constexpr ll inf = INT64_MAX / 4;
constexpr double pi = asin(1) * 2;
constexpr ll mod = 1000000007;


ll mpow(ll base, ll power) {
    if (power == 0) return 1;
    ll t = mpow(base, power / 2);
    return (t * t * (power % 2 ? base : 1)) % mod;
}

int main() {
    int n, a[100000];
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    multiset<int> b;
    for (int i = 0; i < n; i++) {
        auto v = b.lower_bound(a[i]);
        if (b.empty() || v == b.begin()) {
            b.insert(a[i]);
        } else {
            v--;
            b.erase(v);
            b.insert(a[i]);
        }
    }
    cout << b.size() << endl;
}


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

int main() {
  int N, t=0, cnt = 0;
  
  cin >> N;
  
  vector<int> vec(N);
  
  for (int i = 0; i < N; i++) {
    cin >> vec.at(i);
  }
  
  sort(vec.begin(), vec.end());
  
  for (int i = 0; i < N; i++) {
    if (vec.at(i) > t) {
      cnt++;
      t = vec.at(i);
    }
  }
  
  cout << cnt << endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin() , v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)


int main(){
  ll n, h, w, cnt=0; cin >> n >> h >> w;
  rep(i, n){
    ll a,b; cin >> a >> b;
    if(h <= a && w <= b) cnt++;
  }
  cout << cnt << endl;
}

Measured memory_bytes: 256
// AtCoder Beginner Contest 119 - Problem D: Lazy Faith (https://atcoder.jp/contests/abc119/tasks/abc119_d)
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

const ll oo { 1LL << 60 };

vector<ll> solve(const vector<ll>& xs, const vector<ll>& ys, const vector<ll>& qs)
{
    ll N = xs.size(), M = ys.size();
    vector<ll> as(N), bs(M);

    for (ll i = 0; i < N; ++i)
        as[i] = -xs[N - 1 - i];

    for (ll i = 0; i < M; ++i)
        bs[i] = -ys[M - 1 - i];

#ifdef DEBUG
    cout << "as = ";
    for (ll i = 0; i < N; ++i)
        cout << as[i] << (i + 1 == N ? '\n' : ' ');

    cout << "bs = ";
    for (ll i = 0; i < M; ++i)
        cout << bs[i] << (i + 1 == M ? '\n' : ' ');
#endif

    vector<ll> ans;

    for (auto q : qs)
    {
        auto it = lower_bound(as.begin(), as.end(), -q);
        auto La = it == as.end() ? -*(--it) : -*it;

        auto jt = lower_bound(xs.begin(), xs.end(), q);
        auto Ra = jt == xs.end() ? *(--jt) : *jt;

        it = lower_bound(bs.begin(), bs.end(), -q);
        auto Lb = it == bs.end() ? -*(--it) : -*it;

        jt = lower_bound(ys.begin(), ys.end(), q);
        auto Rb = jt == ys.end() ? *(--jt) : *jt;

#ifdef DEBUG
cout << "q = " << q << ", La = " << La << ", Ra = " << Ra << ", Lb = " << Lb << ", Rb = " << Rb << '\n';
#endif

        auto dist = oo;
        vector<ll> As { La, Ra };
        vector<ll> Bs { Lb, Rb };

        for (auto a : As)
            for (auto b : Bs)
                dist = min(dist, abs(q - a) + abs(a - b));

        for (auto b : Bs)
            for (auto a : As)
                dist = min(dist, abs(q - b) + abs(a - b));

        ans.push_back(dist);
    }

    return ans;
}

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

    ll A, B, Q;
    cin >> A >> B >> Q;

    vector<ll> xs(A), ys(B), qs(Q);

    for (ll i = 0; i < A; ++i)
        cin >> xs[i];

    for (ll i = 0; i < B; ++i)
        cin >> ys[i];

    for (ll i = 0; i < Q; ++i)
        cin >> qs[i];

    auto ans = solve(xs, ys, qs);

    for (auto x : ans)
        cout << x << '\n';

    return 0;
}


Measured memory_bytes: 5368
# from math import factorial,sqrt
# from itertools import permutations as permus
# from fractions import gcd
# from collections import deque,Counter
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import scipy as scp

# 入力の受け取り
n = int(input())
arrH = list(map(int,input().split()))

hight = 0
ans = 0
for i in range(n):
    if arrH[i]>=hight:
        ans +=1
    hight = max(hight,arrH[i])

print(ans)
# print("{:.10f}".format(ans))
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する



Measured memory_bytes: 3060
#include<stdio.h>

int main(){
    int a,b,c,i,temp;
scanf("%d %d %d",&a,&b,&c);
    for(i=0;i<2;i++){
        if(a>b){
            temp=a;
            a=b;
            b=temp;
        }
        if(b>c){
            temp=b;
            b=c;
            c=temp;
        }
    }
    printf("%d %d %d\n",a,b,c);
}


Measured memory_bytes: 2108
#include <iostream>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <algorithm>
#include <set>
#include <string>
#include <queue>
#include <iomanip>

using namespace std;
#define rep(i, N) for(int (i) = 0; (i) < (N); (i) ++)
typedef long long ll;

vector<pair<ll, ll>> pF;


void prime_fact(ll n){
// 素因数分解
for(ll i = 2; i * i <= n; i ++){
ll cnt = 0;
while(n % i == 0){
cnt ++;
n /= i;
}
pair<ll, ll> f = {i, cnt};
pF.push_back(f);
}
if(n != 1){
pF.push_back({n, 1});
}
}


int main(){
    int X;
    cin >> X;
    if(X == 7 || X == 5 || X == 3){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;

typedef pair<int, int> pii;
typedef pair<double, int> pdi;
typedef long long ll;

int main(void)
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int n; cin >> n;
    vector<ll> v(n); for (ll& l : v) cin >> l;

    ll result = 0, range_max = -1;
    for (ll l : v)
    {
        if (l <= range_max) result += range_max-l;
        else range_max = max(range_max, l);
    }

    cout << result << endl;
    return 0;
}


Measured memory_bytes: 4764
import java.util.*
import java.math.*
import java.lang.Math.*

private val readString: ()->String = {readLine()!!}
private val readInt: ()->Int = { readLine()!!.toInt() }
private val readLong: ()->Long = { readLine()!!.toLong() }
private val readListInt: ()->List<Int> = { readLine()!!.split(' ').map(String::toInt) }
private val readListLong: ()->List<Long> = { readLine()!!.split(' ').map(String::toLong) }
private val errPrintln: (String)->Unit = { msg -> System.err.println(msg) }
private val MOD = 1e9.toLong()+7


fun solveC(D:Int, G:Int, P:Array<Int>, C:Array<Int>): Int {
    var res = Int.MAX_VALUE

    for (p in 0 until (0b01 shl D)) {
        var ptn = p
        var score = 0
        var count = 0
        val solved = Array<Boolean>(D){false}
        for (i in D-1 downTo  0) {
            val point = 100*(i+1)
            if ((ptn and 0b01) == 1) {
                score += point * P[i] + C[i]
                count += P[i]
                solved[i] = true
            }
            ptn = ptn shr 1
        }
        if (score < G) {
            for (i in D - 1 downTo 0) {
                if (solved[i]) continue

                val point = 100 * (i + 1)
                val dcnt = min((G - score + point - 1) / point, P[i] - 1)
                count += dcnt
                score += point * dcnt

                if (score >= G) break
            }
        }
        if (G <= score) {
            res = Math.min(res, count)
        }
    }

    return res
}


fun main(args: Array<String>) {
    val (D,G) = readListInt()
    val P = Array<Int>(D){0}
    val C = Array<Int>(D){0}

    for(i in 0 until D) {
        val pc = readListInt()
        P[i] = pc[0]
        C[i] = pc[1]
    }

    val ans = solveC(D, G, P, C)

    println(ans)
}


Measured memory_bytes: 38324
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#define log(x) cout<<x<<endl
#define pb push_back
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
using namespace std;

int main(){
    int n,a,b;
    cin>>n>>a>>b;
    if(n*a>b){
        cout<<b;
    }
    else if(n*a<b){
        cout<<n*a;
    }
    else{
        cout<<b;
    }
}

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

#define ll long long
#define ld long double

using namespace std;

const int MAXN = 1001 * 1001 , MOD = 1e9 + 7 ;

string s[MAXN] ;


int cmp(string s , string t , char x)
{
    int n = s.size() ;
    for(int i = 0 ; i < n ; i ++  ) if(s[i]=='?') s[i] = x ;
    if(s<t) return 0 ;
    if(s==t) return 1 ;
    return 2 ;
}

int main() {
    ios::sync_with_stdio(0) ;
    cin.tie(0) ; cout.tie(0) ;
    int n ;
    cin >> n ;
    for(int i = 0 ; i < n ; i ++ )
        cin >> s[i] ;
    string t ;
    cin >> t ;

    int x = 0 , y = 0 ;

    int m = t.size() ;

    for(int i = 0 ; i < n ; i ++ )
    {
        if(!cmp(s[i],t,'z'))
            x ++ ;
    }


    for(int i = 0 ; i < n ; i ++ )
    {
        if(cmp(s[i],t,'a')==2)
            y ++ ;
    }

  //  cout << x << ' ' << y << endl ;

    //for(int i = 1 ; i <= n ; i ++ )
    vector<int> v ;
    for(int i = x + 1 ; i + y  <= n + 1 ; i ++ )
        v.push_back(i) ;
    x = v.back() ;
    v.pop_back() ;
    for(auto u : v) cout << u << ' ' ;
    cout << x ;
    cout << endl ;

    return 0;
}


Measured memory_bytes: 8576
#include<bits/stdc++.h>
#define pb push_back
#define ppb pop_back
#define mer make_pair
#define fi first
#define se second
using namespace std;
typedef long long ll;
 
map<string,bool> mp;
 
int main(){
	//my new name is Veex
	//clock_t
	string str;
	int k;
	cin>>str>>k;
	set<string> v;
	for(int i=0;i<str.size();i++){
		string s="";
		for(int j=1;j<=str.size()-i;j++){
			s+=str[i+j-1];
			v.insert(s);
			if(v.size()>k)
				v.erase(--v.end());
		}
	}
	cout<<*(--v.end());
	//((double)(clock()-start1)/CLOCKS_PER_SEC)*1000;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
 int a, b;
  cin >> a >> b;
  double c = static_cast<double>(a) / b;
  cout << (a / b) << " " << (a % b) << " " << std::fixed << std::setprecision(8) << (double(a) / b) << endl;
}



Measured memory_bytes: 3236
#include <stdio.h>

int main(void) {
  int x[5] = {0};
  int i;
  for(i = 0; i < 5; ++i)
    x[i] = i + 1;
  for(i = 0; i < 5; ++i)
    scanf("%d", &x[i]);
  for(i = 0; i < 5; ++i){
    if(x[i] == 0)
      break;
  }
  printf("%d\n", i + 1);
  return 0;
}

Measured memory_bytes: 1684
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
using namespace std;

int main(){
    string N;
    int ans = 0;
    cin >> N;
    
    for(int i = 0; i < 4; i++)
    {
        
        if (N[i] == '2') {
            ans++;
        }
        
    }
    cout << ans <<endl;
    
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		int[] cpd=new int[n+1];	//cal/d
		int[] cal=new int[n];
		int a=sc.nextInt();	//生地の価格
		int b=sc.nextInt();	//トッピング1つの価格
		int c=sc.nextInt(); //生地の価格
		for(int i=0;i<n;i++) cal[i]=sc.nextInt();
		Arrays.sort(cal);
		for(int i=0;i<=n;i++){
			cpd[i]=c;
			for(int j=0;j<i;j++)	//iの数だけトッピングを追加する
				cpd[i]+=cal[n-1-j];	//大きな順に追加する
			cpd[i]/=(a+i*b);	//cpd=総カロリー/価格
		}
		Arrays.sort(cpd);
		System.out.println(cpd[n]);
		sc.close();
	}
}

Measured memory_bytes: 18140
/* *****fireice**** */

#include<bits/stdc++.h>

#define ll long long int
#define ld long double
#define vi vector<int>
#define vc vector<char>
#define vl vector<ll>
#define vii vector<pair<int,int>>
#define vll vector<pair<ll,ll>>
#define pii pair<int,int>
#define pb push_back
#define eb emplace_back
#define el '\n'
#define N 1000000007
#define re return
#define F first
#define S second
#define L length
#define deb(x) cout<<#x<<" "<<x<<el;
#define mp make_pair
#define PI 3.14159265
#define all(a) (a).begin(),(a).end()
#define forup(i,n) for(int i=0;i<n;i++)
#define forf(i,x,n) for(int i=x;i<n;i++)
#define ford(i,n) for(int (i)=(n)-1;i>=0;(i)--)
#define take(a,n) forup(i,n) cin>>a[i];
using namespace std;

int gcdExtended(int a, int b, int *x, int *y)
{
    // Base Case
    if (a == 0)
    {
        *x = 0, *y = 1;
        return b;
    }

    int x1, y1; // To store results of recursive call
    int gcd = gcdExtended(b%a, a, &x1, &y1);

    // Update x and y using results of recursive
    // call
    *x = y1 - (b/a) * x1;
    *y = x1;

    return gcd;
}

ll modInverse(int a, int m)
{
    int x, y;
    int g = gcdExtended(a, m, &x, &y);
        // m is added to handle negative x
    ll res = ((ll)x%m + (ll)m) % m;

    return res;
}

ll poww(ll x,ll n)
{
    if(n==0)
        return 1;
    else if(n==1) return x;
    else if(n%2 == 0)        //n is even
        return poww(x*x,n/2);
    else                              //n is odd
        return x*poww(x*x,(n-1)/2);
}

ll modularExponentiation(ll x,ll n,ll M)
{
    ll result=1;
    while(n>0)
    {
        if(n % 2 ==1)
            result=(result * x)%M;
        x=(x*x)%M;
        n=n/2;
    }
    return result;
}

template<typename T>
T maxx(T a,T b)
{
  if(a<b) re b;
  re b;
}
template<typename T, typename... Args>
T maxx(T a,T b, Args... args)
{
    re(maxx(maxx(a,b),args...));
}

template<typename T>
T minn(T a,T b)
{
  if(a<b) re a;
  re b;
}
template<typename T, typename... Args>
T minn(T a,T b, Args... args)
{
    re(minn(minn(a,b),args...));
}

template<typename T>
void read(T& a)
{
  cin>>a;
}
template<typename T, typename... Args>
void read(T& a,Args&... args)
{
  cin>>a; read(args...);
}

template<typename T>
void write(T a)
{
  cout<<a<<' ';
}
template<typename T, typename... Args>
void write(T a,Args... args)
{
  cout<<a<<' '; write(args...);
}

inline ll min(ll a,ll b)
{
  if(a<b) re a;
  else re b;
}
inline ll max(ll a,ll b)
{
  if(a<b) re b;
  else re a;
}

ll gcd(ll a, ll b)
{
    if (a == 0)
       return b;
    if (b == 0)
       return a;

    if (a == b)
        return a;

    if (a > b)
        return gcd(a-b, b);
    else return gcd(a, b-a);
}

ll ncr(int n,int r)
{
  ll ans=1;
  r=min(r,n-r);
  forup(i,r)
  {
    ans=(ans*(n-i)/(i+1))%N;
  }
  re ans;
}

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

  int t=1;
  //cin>>t;
  while(t--)
  {
    ll n,m,k;
    cin>>n;
    vi a(n);
    take(a,n);
    m=0;
    forup(i,n) m+=a[i];
    m/=n;
    k=m+1;
    ll t1=0,t2=0;
    forup(i,n)
    {
      t1+=poww(m-a[i],2);
      t2+=poww(k-a[i],2);
    }
    cout<<min(t1,t2);
  }


  return 0;
}


Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var N, K int
	var S, T string
	fmt.Scan(&N, &S, &K)
	for i := 0; i < N; i++ {
		if S[i] != S[K-1] {
			T += string('*')
		} else {
			T += string(S[i])
		}
	}
	fmt.Println(T)
}


Measured memory_bytes: 512
#include <iostream>
#include <vector>
using namespace std;
int n,k;
vector<vector<int> > adj;
int parent[2001][11];
int dep[2001]={0,};
void dfs2(int here,int dad,int d){
    parent[here][0]=dad;
    dep[here]=d;
    for(int i=0;i<adj[here].size();i++){
        int there=adj[here][i];
        if(there==dad)
            continue;
        dfs2(there,here,d+1);
    }
}
int dfs(int here,int dad,int d,int mx){
    int ans=1;
    if(mx==d)
        return ans;
    for(int i=0;i<adj[here].size();i++){
        int there=adj[here][i];
        if(there==dad)
            continue;
        ans+=dfs(there,here,d+1,mx);
    }
    return ans;
}
int getLca(int u,int v){
    if(dep[u]>dep[v])
        swap(u,v);
    int d=dep[v]-dep[u];
    int i=0;
    while(d){
        if(d&(1<<i)){
            d-=(1<<i);
            v=parent[v][i];
        }
        i++;
    }
    if(u==v)
        return u;
    for(int i=10;i>=0;i--){
        if(parent[u][i]!=parent[v][i])
            u=parent[u][i],v=parent[v][i];
    }
    return parent[u][0];
}
int main(){
    ios::sync_with_stdio(false);
    cin>>n>>k;
    adj.resize(n+1);
    for(int i=0;i<n-1;i++){
        int from,to;
        cin>>from>>to;
        adj[from].push_back(to);
        adj[to].push_back(from);
    }
    int ans=0;
    dfs2(1,-1,0);
    for(int i=1;i<11;i++){
        for(int j=1;j<=n;j++){
            if(parent[j][i-1]<0)
                parent[j][i]=-1;
            else
                parent[j][i]=parent[parent[j][i-1]][i-1];
        }
    }
    if(k%2==0){
        for(int i=1;i<=n;i++)
            ans=max(ans,dfs(i,-1,0,k/2));
    }
    else{
        for(int i=1;i<=n;i++){
            for(int j=i+1;j<=n;j++){
                if(dep[i]+dep[j]-2*dep[getLca(i,j)]==1){
                    ans=max(ans,max(ans,dfs(i,j,0,k/2)+dfs(j,i,0,k/2)));
                }
            }
        }
    }
    cout<<n-ans;
    return 0;
}

Measured memory_bytes: 512
// import chie template :) {{{
import std.stdio, std.algorithm, std.array, std.string, std.math, std.conv,
    std.range, std.container, std.bigint, std.ascii, std.typecons;

// }}}
// nep.scanner {{{
class Scanner
{
    import std.stdio : File, stdin;
    import std.conv : to;
    import std.array : split;
    import std.string : chomp;

    private File file;
    private char[][] str;
    private size_t idx;

    this(File file = stdin)
    {
        this.file = file;
        this.idx = 0;
    }

    private char[] next()
    {
        if (idx < str.length)
        {
            return str[idx++];
        }

        char[] s;
        while (s.length == 0)
        {
            s = file.readln.chomp.to!(char[]);
        }

        str = s.split;
        idx = 0;

        return str[idx++];
    }

    T next(T)()
    {
        return next.to!(T);
    }

    T[] nextArray(T)(size_t len)
    {
        T[] ret = new T[len];

        foreach (ref c; ret)
        {
            c = next!(T);
        }

        return ret;
    }

    void scan()()
    {
    }

    void scan(T, S...)(ref T x, ref S args)
    {
        x = next!(T);
        scan(args);
    }
}
// }}}

void main()
{
    auto cin = new Scanner;
    int n;
    cin.scan(n);
    int sum;
    foreach (i; 0 .. n)
    {
        sum += abs(cin.next!int - cin.next!int) + 1;
    }
    writeln(sum);
}


Measured memory_bytes: 380
fn main() {
    let mut h = 1;
    let mut w = 1;
    h = read();
    w = read();
    while h != 0 || w != 0 {
        for i in 0..h {
            let mut st = String::new();
            for j in 0..w {
                if (i + j) % 2 == 1 {
                    st.push('.');
                } else {
                    st.push('#');
                }
            }
            println!("{}", st);
        }
        println!("");
        h = read();
        w = read();
    }
}

// =========
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{HashMap, HashSet};
#[allow(unused_imports)]
use std::process::exit;

#[allow(dead_code)]
const MOD: isize = 1000000007;

fn read<T: std::str::FromStr>() -> T {
    use std::io::Read;
    let stdin = std::io::stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

// =========



Measured memory_bytes: 5028
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
    WRITER:kakitamasziru/OxOmisosiru
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#define _GLIBCXX_DEBUG
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <iomanip>
#include <limits>//setprecision
//#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
//#include <unordered_map> // unordered_map
//#include <unordered_set> // unordered_set
#include <bitset> // bitset
//#include <cctype> // isupper, islower, isdigit, toupper, tolower
//It is so troublesome that I include bits/stdc++.h !
using namespace std;

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; }
const long long INF = 100100100100100;
const int MOD = 1000000007;
typedef pair<int,int> P;
//NのM乗を求める(繰り返し二乗法)
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //最下位ビット(*N)が1の時は単独でNをかける
    if (M & 1) res = (res * N) % MOD;

    return res %= MOD;
}

int main() {
    double N,K;cin >> N >> K;
    //double bunbo = 1.0;
    //double bunsi = 1.0;
    double ans = 0.0;
    for(int i = 1;i<=N;i++){
        int A = i;
        double count = 0.0;
        double B = N;
        while(A < K){
            count++;
            A *= 2;
            B *= 2;
        }
        ans += (1.000000000/B);
    }

    cout << fixed << setprecision(10) << ans << endl;


    // PLEASE GIVE ME THE "ACCEPTED" !
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long;

int main() {
	string s, t;
	cin >> s >> t;
	int ns = s.size();
	int nt = t.size();
	int ans = 100000;
	for (int i = 0; i < ns - nt+1; i++) {
		int trans = 0;
		for (int j = 0; j < nt; j++) {
			if (t[j] != s[j + i]) {
				trans++;
			}
		}
		ans = min(ans, trans);
	}
	cout << ans << endl;
	return 0;
}

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

int	main()
{
  int	a, b, c, x, count = 0;
  
  cin >> a >> b >> c >> x;
  if (x % 50 != 0)
  {
    cout << count << endl;
    return (0);
  }
  for (int i = 0; i <= a; i++)
  {
    for (int j = 0; j <= b; j++)
    {
      if ((i * 500 + j * 100) > x)
        break;
      if ((x - (i * 500 + j * 100)) / 50 > c)
        continue;
      count++;
    }
  }
  cout << count << endl;
  return (0);
}

Measured memory_bytes: 3616
use std::cmp::min;

fn main() {
    let _: i64 = read();
    let xs: Vec<i64> = read_vec();

    let mut ans = i64::max_value();
    for p in 1..(100 + 1) {
        let tmp_ans = xs.iter().map(|x| (x - p).pow(2)).sum();
        ans = min(ans, tmp_ans);
    }

    println!("{:?}", ans);
}
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}



Measured memory_bytes: 4352
using System;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static void Main(string[] arg){
        int N = int.Parse(Console.ReadLine());     
        string[] tmp = Console.ReadLine().Split(' ');
        ulong[] num = new ulong[N];

        for(int i=0;i<N;i++){
            num[i] = ulong.Parse(tmp[i]);
            if(num[i]==0){
                Console.WriteLine("0");
                return;
            }
        }
        
        ulong ret = 1;
        
        try{
            checked{
                for(int i=0;i<N;i++){
                    ret *= num[i];
                }
            }
        }
        catch(OverflowException ex){
            Console.WriteLine("-1");
            return;
        }

        if(ret>(ulong)Math.Pow(10,18)){
            Console.WriteLine("-1");
            return;
        }else{
            Console.WriteLine(ret);
        }

        return;
    }
}


Measured memory_bytes: 41936
#ifdef DEBUG

#else

#    pragma GCC optimize("O3,no-stack-protector")
#    pragma GCC optimize("unroll-loops")

#    if __cplusplus < 201703L
#        pragma GCC target("avx")
#    else
#        pragma GCC target("avx2")
#    endif

#endif
// 実数の場合
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;
typedef long double Ld;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 998244353;

// 二分累乗法
template <typename T>
T modpow(T a, T n, T mod) {
    T ret = 1;

    if (mod == 1) {
        while (n > 0) {
            if (n & 1) {
                ret = ret * a;
            }
            a = a * a;
            n >>= 1;
        }
    } else {
        while (n > 0) {
            if (n & 1) {
                ret = ret * a % mod;
            }
            a = a * a % mod;
            n >>= 1;
        }
    }

    return ret;
}

vector<Int> factorials, invs;
bool is_ncr_table = false;
// modが素数の場合のみ
void calc_ncr_table(Int n, Int mod) {
    is_ncr_table = true;

    // 1! ~ n! の計算
    Int f = 1;
    factorials.push_back(f);
    for (Int i = 1; i <= n; i++) {
        f *= i;
        f %= mod;
        factorials.push_back(f);
    }

    // n!^-1 の計算
    Int inv = modpow(factorials[n], mod - 2, mod);
    // (n-1)!^-1 ~ 1!^-1 の計算
    invs.assign(n + 1, 1);
    invs[n] = inv;
    for (Int i = n; i >= 1; i--) {
        inv *= i;
        inv %= mod;
        invs[i - 1] = inv;
    }
}

// 一度だけnCrを計算するとき用の関数
Int factorial(Int n, Int mod = 1) {
    Int ret = 1;
    if (mod == 1) {
        for (Int i = 1; i <= n; i++) {
            ret *= i;
        }

        return ret;
    } else {
        for (Int i = 1; i <= n; i++) {
            ret *= i;
            ret %= mod;
        }

        return ret;
    }
}

Int ncr(Int n, Int r, Int mod) {
    if (n < r) {
        return (Int)0;
    } else {
        if (is_ncr_table) {
            // modが素数の場合のみ
            return (factorials[n] * invs[r] % mod) * invs[n - r] % mod;
        } else {
            Int x = 1;
            for (Int i = n - r + 1; i <= n; i++) {
                x *= i;
                x %= mod;
            }
            return x * modpow(factorial(r, mod), mod - 2, mod) % mod;
        }
    }
}

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

    Int n, m, k;
    cin >> n >> m >> k;

    calc_ncr_table(n, MOD);

    Int ans = 0;
    for (Int i = k; i >= 0; --i) {
        Int a, b, c;
        a = m;
        b = ncr(n - 1, n - i - 1, MOD);
        c = modpow(m - 1, n - 1 - i, MOD);
        a = (a * b) % MOD;
        a = (a * c) % MOD;
        ans = (ans + a) % MOD;
    }

    cout << ans << endl;

    return 0;
}

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

int main(void){
    string str;
    int c[7]={'k','e','y','e','n','c','e'};
    int count=0;
    int back=0;
    int flag=0;
    int skip=0,conskip=0;
    cin >> str;
    for(int i=0;i<str.length();i++){
        if(str[i]==c[count]){
            count++;
        }else{
            break;
        }
    }
    for(int i=str.length()-1;i>=0;i--){
        if(str[i]==c[6-back]){
            back++;
        }else{
            break;
        }
    }
    if(back+count>=7){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;

int l[100005];
int pref[100005];
int suff[100005];

void solve() {
  int n;
  cin >> n;
  for(int i = 0; i < n; i++) {
    cin >> l[i];
  }
  for(int i = 0; i < n; i++) {
    pref[i+1] = __gcd(pref[i], l[i]);
    suff[i+1] = __gcd(suff[i], l[n-1-i]);
  }
  int ret = max(pref[n-1], suff[n-1]);
  for(int i = 1; i < n-1; i++) {
    ret = max(ret, __gcd(pref[i], suff[n-1-i]));
  }
  cout << ret << endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  solve();
  /*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
  */
}


Measured memory_bytes: 1408
import java.io.*;
import java.util.*;

public class Main {
    public static final long mod = (long)1e9+7;
    public static final long INF = Long.MAX_VALUE/2;
    public static final int inf = Integer.MAX_VALUE/2;

    static void solve(InputReader in, PrintWriter out){
        int n = in.ni(), m = in.ni();
        out.println(100*pow(2,m)*(18*m+n));
    }
    public static long pow(long x, long n){
        long res = 1;
        while(n > 0){
            if ((n & 1) == 1) {
                res *= x;
                res %= mod;
            }
            x *= x;
            x %= mod;
            n >>= 1;
        }
        return res;
    }

    public static void main(String[] args){
        InputReader in = new InputReader(System.in);
        PrintWriter out = new PrintWriter(System.out);
        solve(in, out);
        out.close();
    }
    public static class InputReader{
        private BufferedReader br;
        private StringTokenizer st;
        public InputReader(InputStream is){
            br = new BufferedReader(new InputStreamReader(is));
            st = null;
        }
        public String ns(){
            if(st == null || !st.hasMoreTokens()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (Exception e){
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }
        public int ni(){
            return Integer.parseInt(ns());
        }
        public long nl(){
            return Long.parseLong(ns());
        }
        public double nd(){
            return Double.parseDouble(ns());
        }
        public char nc(){
            return ns().toCharArray()[0];
        }
        public int[] ni(int n){
            int[] a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = ni();
            }
            return a;
        }
        public long[] nl(int n){
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                a[i] = nl();
            }
            return a;
        }
        public double[] nd(int n){
            double[] a = new double[n];
            for (int i = 0; i < n; i++) {
                a[i] = nd();
            }
            return a;
        }
    }
}

Measured memory_bytes: 23124
N = int(input())
n = N % 10

if n == 2 or n == 4 or n == 5 or n == 7 or n == 9:
    print("hon")
elif n == 0 or n == 1 or n == 6 or n == 8:
    print("pon")
else:
    print("bon")

Measured memory_bytes: 9172
import sys
sys.setrecursionlimit(10**6)
if sys.platform in (['ios','darwin','win32']):
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

def get_sieve_of_eratosthenes(n):
	prime = [2]
	limit = int(n**0.5)
	data = [i + 1 for i in range(2, n, 2)]
	append = prime.append
	while True:
		p = data[0]
		if p > limit:
			return prime + data
		append(p)
		data = [e for e in data if e % p != 0]

def main():
	N = INT()
	primes = get_sieve_of_eratosthenes(10**5+100)
	for p in primes:
		if p>=N:
			print(p)
			sys.exit()

if __name__ == '__main__':
	main()

Measured memory_bytes: 5400
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n,f=0;
    cin>>n;
    string s;
    cin>>s;
    char a[100],b[100];;
    if(n%2==0)
    {
    for(int i=0,j=0;i<(n/2);i++,j++)
     a[j]=s[i];
     
     a[n/2]='\0';
     for(int i=n/2,j=0 ; i<n; i++,j++)
       b[j]=s[i];
      b[n/2]='\0';
      
     for(int i=0;i<n/2;i++)
      if(a[i]!=b[i])
      { cout<<"No";
        f=1;
        break;
      }
      if(f==0)
       cout<<"Yes";
    }
    else
    cout<<"No";
}

Measured memory_bytes: 256
/* In the name of Anton */

/*
* Motto :)
*
*
*
*
*
*/

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

#define rep(i,n) for(int i=0;i<n;i++)
#define repa(i,a,n) for(int i=a;i<=n;i++)
#define repb(i,a,n) for(int i=a;i>=n;i--)
#define trav(x,a) for(auto &x: a)
#define all(x) x.begin(),x.end()
#define sz(x) (int)(x).size()
#define fst first
#define snd second
#define pb push_back
#define mp make_pair
#define vt vector
typedef long double ld;
typedef pair <int,int> pii;
typedef vector <int> vi;
typedef long long ll;

template<class A> void read(vt<A>& v);
template<class T> void read(T& x){
  cin>>x;
}

void read(double &d){
  string t;
  read(t);
  d=stod(t);
}
void read(long double &d){
  string t;
  read(t);
  d=stold(t);
}

template<class H, class... T> void read(H &h, T&...t){
  read(h);
  read(t...);
}

template <class A> void read(vt<A> &x){
  trav(a,x)
    read(a);
}

string to_string(char c){
  return string(1,c);
}

string to_string(bool b){
  return b?"true":"false";
}

string to_string(const char* s){
  return string(s);
}

string to_string(string s){
  return string(s);
}

string to_string(vt<bool> v){
  string res;
  rep(i,sz(v)){
    res+=char('0'+v[i]);
  }
  return res;
}

template<class T> string to_string(T v){
  bool f=1;
  string res;
  trav(x,v){
    if(!f)
      res+=' ';
    f=0;
    res+=to_string(x);
  }
  return res;
}

template<class A> void write(A x){
  cout<<to_string(x);
}

template<class H, class...T> void write(const H& h, const T&...t){
  write(h);
  write(t...);
}

void print(){
  write("\n");
}

template<class H, class...T> void print(const H& h, const T&...t){
  write(h);
  if(sizeof...(t))
    write(' ');
  print(t...);
}

/* -----------------------------------------------------------------------------------------------*/

const ll mod=1e9+7;
const int mxN=1e6+5;

ll dp[mxN][3];

void pre(){

}

void solve(){
  ll n;
  read(n);

  if(n==1){
    print(0);
    return;
  }

  dp[2][0]=64;
  dp[2][1]=17;
  dp[2][2]=2;

  for(int i=3;i<=n;i++){
    dp[i][0]=(dp[i-1][0]*8)%mod;
    dp[i][1]=(dp[i-1][0]+dp[i-1][1]*9)%mod;
    dp[i][2]=(2*dp[i-1][1]+dp[i-1][2]*10)%mod;
  }

  print(dp[n][2]);
}

int main(){
  ios_base::sync_with_stdio(0); cin.tie(0);
  pre();
  int t=1;
  // read(t);
  rep(i,t) solve();
  return 0;
}


Measured memory_bytes: 27076
#include <iostream>
#include <vector>
#include <cmath>
#include <typeinfo>
#include <set>
#include <bitset>
#include <string>
#include <map>
#include <algorithm>
using namespace std;
typedef long long ll;



int main(){
  int h,n,s=0;
  cin >> h >>n;
  int ai;
  for(int i=0; i<n; i++){
    cin >> ai;
    s += ai;
  }
  if(s>=h){
    cout <<"Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
class Mount():
    def __init__(self, i, H):
        self.i = i
        self.H = H
        self.rel_H = []
        self.max_H = 0

    def add_rel_H(self, H):
        self.rel_H.append(H)
        if self.max_H < H:
            self.max_H = H

N, M = map(int, input().split())

d_mount = {}
for i, H in enumerate(input().split()):
	d_mount[i+1] = Mount(i+1, int(H))
    
inputs = [input() for i in range(M)]
for l in inputs:
    A = int(l.split()[0])  # mount id
    B = int(l.split()[1])  # mount id
    d_mount[A].add_rel_H(d_mount[B].H)
    d_mount[B].add_rel_H(d_mount[A].H)

count = 0
for k, v in d_mount.items():
    if len(v.rel_H) == 0:
        count += 1
    elif v.max_H < v.H:
        count += 1
        
print(count)

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

int main(){
  int L,R;
  cin>>L>>R;
  
  int i;
  int min1=1000000;
  for(i=L;i<R;i++){
    if(i==0)continue;
    int a=i%2019;
    for(int j=i+1;j<=R;j++){
      int b=j%2019;
      min1=min(min1,(a*b)%2019);
      if(a==b)
      break;
    }
    if(min1==0)
    break;
  }
  
  cout<<min1<<endl;
}


Measured memory_bytes: 256
n=int(input())
a=list(map(int,input().split()))
b=[0]*64
for i in range(n):
    for j in range(a[i].bit_length()):
        if a[i]>>j & 1: b[j]+=1
c=0
for i in range(64):
    c+=(b[i]*(n-b[i])*2**i) % 1000000007
print(c%1000000007)


Measured memory_bytes: 122808
from heapq import heappush, heappop, heapify

n, k = map(int, input().split())
a = list(map(int, input().split()))


def check(x):
    # 最長の丸太をx以下にできるか
    # 任意の丸太をx以下にできるか
    cnt = sum([(ai - 1) // x for ai in a])
    return cnt <= k


lb = 0  # False
ub = max(a)  # True
while ub - lb > 1:
    mid = (ub + lb) // 2
    # print(mid, check(mid))
    if check(mid):
        ub = mid
    else:
        lb = mid

print(ub)


Measured memory_bytes: 31048