akhauriyash/Code-Regression huggingface dataset:
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

const mod = 1000000007

func mpow(a, b int) int {
	if b == 0 {
		return 1
	} else if b%2 == 0 {
		tmp := mpow(a, b/2)
		return tmp * tmp % mod
	}
	return mpow(a, b-1) * a % mod
}

var fracMemo = []int{1, 1}

func mfrac(n int) int {
	if len(fracMemo) > n {
		return fracMemo[n]
	}
	if len(fracMemo) == 0 {
		fracMemo = append(fracMemo, 1)
	}
	for len(fracMemo) <= n {
		size := len(fracMemo)
		fracMemo = append(fracMemo, fracMemo[size-1]*size%mod)
	}
	return fracMemo[n]
}

var ifracMemo = []int{1, 1}

func mifrac(n int) int {
	if len(ifracMemo) > n {
		return ifracMemo[n]
	}
	if len(ifracMemo) == 0 {
		fracMemo = append(ifracMemo, 1)
	}
	for len(ifracMemo) <= n {
		size := len(ifracMemo)
		ifracMemo = append(ifracMemo, ifracMemo[size-1]*mpow(size, mod-2)%mod)
	}
	return ifracMemo[n]
}

func nCr(n, r int) int {
	if n == r {
		return 1
	}
	if n < r || r < 0 {
		return 0
	}
	ret := 1
	ret *= mfrac(n)
	ret %= mod
	ret *= mifrac(r)
	ret %= mod
	ret *= mifrac(n - r)
	ret %= mod
	return (ret)
}

var C [52][52]int // C[n][k] -> nCk

func combTable(N int) {
	C[0][0] = 1
	for i := 1; i <= N; i++ {
		for j := 0; j <= N; j++ {
			if j == 0 || j == i {
				C[i][j] = 1
			} else {
				C[i][j] = C[i-1][j-1] + C[i-1][j]
			}
		}
	}
}

func main() {
	sc.Split(bufio.ScanWords)

	N, P := getInt(), getInt()
	d1 := 0
	d2 := 0
	for i := 0; i < N; i++ {
		a := getInt()
		if a%2 == 0 {
			d2++
		} else {
			d1++
		}
	}

	off := 0
	if P == 1 {
		off = 1
	}

	combTable(51)
	// out(C[0][0])

	ans := 0
	for i := 0; i <= d2; i++ {
		for j := off; j <= d1; j += 2 {
			// out(i, j, "C", d2, i, "C", d1, j)
			ans += C[d2][i] * C[d1][j]
		}
	}
	out(ans)
}


Measured memory_bytes: 640
N = int(input())
A = [int(a) for a in input().split()]
B = [int(a) for a in input().split()]
AB = sorted(list(set(A + B)))
D = {ab: i+1 for i, ab in enumerate(AB)}
A = [D[a] for a in A]
B = [D[a] for a in B]

ans = 1 << 100
for m in range(1<<N):
    b = bin(m)
    if b[::2].count("1") != b[1::2].count("1"): continue
    C = [[], []]
    for i in range(N):
        p = m >> i & 1
        q = p + i & 1
        C[q].append(((A[i] if p == 0 else B[i]) << 5) + i)
    if len(C[1]) != N // 2: continue
    C[0].sort()
    C[1].sort()
    CC = [C[i&1][i//2] for i in range(N)]
    for i in range(1, N):
        if CC[i-1] >> 5 > CC[i] >> 5: break
    else:
        CCC = [c % 32 for c in CC]
        t = 0
        for i in range(N):
            for j in range(i):
                if CCC[i] < CCC[j]: t += 1
        ans = min(ans, t)
print(ans if ans < 1 << 100 else -1)

Measured memory_bytes: 50520
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <cstdlib>
#include <numeric>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <unordered_map>
#include <memory.h>

// pi = atan(1)*4;

using namespace std;

int main(void)
{
	char c;

	cin >> c;

	if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u')
	{
		cout << "vowel" << '\n';
	}
	else
	{
		cout << "consonant" << '\n';
	}

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <math.h>
#include <algorithm>
#include <cstdio>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#define ll long long
const int N=1e6+10;
using namespace std;
int k,x;
int main(){
   cin>>k>>x;
   if(k*500>=x)
        cout<<"Yes"<<endl;
   else
       cout<<"No"<<endl;

    return 0;
}


Measured memory_bytes: 256
use strict;

my ($N, $L) = split(/ /, <>);

my @taste = ();
my $taste_sum_org = 0;

for(my $i=0; $i<$N; $i++) {
    $taste[$i] = $L + $i;
    $taste_sum_org += $taste[$i];
}

# for(my $i=0; $i<$N; $i++) {
#     print STDERR "$i: $taste[$i]\n";
# }
# print STDERR "SUMORG=$taste_sum_org\n";

my $mindiff_taste = $taste_sum_org;
my $min_diff = abs($taste_sum_org);
for(my $j=0; $j<$N; $j++) {
    my $ref_taste_sum = 0;
    for(my $i=0; $i<$N; $i++) {
        next if $i==$j;
        $ref_taste_sum += $taste[$i];
    }

    my $ref_diff = abs($taste_sum_org - $ref_taste_sum);
    if( $min_diff > $ref_diff ) {
        $mindiff_taste = $ref_taste_sum;
        $min_diff = $ref_diff;
    }
}

print $mindiff_taste;


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

#define H 30
#define W 30

int height, width, nChain; 
int cellTmp[H][W];
int disappear[H][W];                          

bool chainSearch(){
    for (int i = 0; i < height; i++){
        for (int j = 0; j < width; j++){
            disappear[i][j] = 0;
        }
    }
    
    bool isDisappeared = false;
    for (int i = 0; i < height; i++){
        for (int j = 0; j < width-1; j++){
            if (disappear[i][j]){
                continue;
            }
            int nowNum = cellTmp[i][j];
            int compNum = cellTmp[i][j+1];
            int cnt = 1;
            while (nowNum == compNum && nowNum > 0){
                cnt++;
                if (j+cnt < width){
                    compNum = cellTmp[i][j+cnt];
                }
                else{
                    break;
                }
            }
            if (cnt >= nChain){
                for (int k = j; k < j+cnt; k++){
                    disappear[i][k] = 1;
                }
                isDisappeared = true;
            }
        }
    }
    return isDisappeared;
}

// 消すのも同時にやってるのビミョー
long addScore(){
    int score = 0;
    for (int i = 0; i < height; i++){
        for (int j = 0; j < width; j++){
            if (disappear[i][j]){
                score += cellTmp[i][j];
                cellTmp[i][j] = 0;
            }
        }
    }
    return score;
}

void fallStone(){
    for (int i = height-1; i >= 0; i--){
        for (int j = 0; j < W; j++){
            if (cellTmp[i][j] != 0){
                continue;
            }
            for (int k = i-1; k >= 0 ; k--){
                if (cellTmp[k][j] != 0){
                    swap(cellTmp[k][j], cellTmp[i][j]);
                    break;
                }
            }
        }
    }
    return;
}


int main() {
    int cell[H][W];
    cin >> height >> width >> nChain; 
    for (int i = 0; i < height; i++){
        for (int j = 0; j < width; j++){
            char c;
            cin >> c;
            cell[i][j] = atoi(&c);
        }
    }
    
    long scoreMax = 0;
    for (int i = 1; i < height; i++){
        for (int j = 0; j < width; j++){
            for (int i1 = 0; i1 < height; i1++){
                for (int j1 = 0; j1 < width; j1++){
                    cellTmp[i1][j1] = cell[i1][j1];
                }
            }
            long score = 0;
            int nDisap = 0;
            cellTmp[i][j] = 0;
            fallStone();
            bool isDisappear = chainSearch();
            while(isDisappear){
                score += addScore() * pow(2,nDisap);
                fallStone();
                isDisappear = chainSearch();
                nDisap++;
            }
            scoreMax = (scoreMax < score) ? score : scoreMax;
        }
    }
    
    cout << scoreMax << endl;

    return 0;
}


Measured memory_bytes: 4048
#!/usr/bin/env python

def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))
    t = 1
    visited = [-1] * (n+1)
    visited[1] = 0
    t_list = [1]
    i = 0

    while k > 0:
        i += 1
        k -= 1
        t = a[t-1]
        if visited[t] == -1:
            visited[t] = i
            t_list.append(t)
        else:
            loop = t_list[visited[t]:]
            l = len(loop)
            break

    if k > 0:
        k -= (k // l) * l
        t = loop[k]

    print(t)


if __name__ == '__main__':
    main()


Measured memory_bytes: 32304
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import numpy as np

def main():
    n,k,q = map(int,input().split())
    points=np.array([k]*n)
    i=0
    while i < q:
        point=int(input().rstrip())
        points-=1
        points[point-1]+=1
        i+=1
    for data in points:
        if data > 0:
            print("Yes")
        else:
            print("No")
if __name__=="__main__":
    main()

Measured memory_bytes: 28204
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<cassert>
#include<cassert>
#include<unordered_map>
#include<unordered_set>
#include<functional>
#include<queue>
#include<stack>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<sstream>
#include<iomanip>
#include<cstdio>
#include<cstdlib>
#include<numeric>
#include<random>
#include<chrono>
#include<bitset>
using namespace std;

#define all(x) (x).begin(), (x).end()
#define pb push_back
#define xx first
#define yy second
#define sz(x) (int)(x).size()
#define gc getchar
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mp make_pair

#ifndef ONLINE_JUDGE
#  define LOG(x) (cerr << #x << " = " << (x) << endl)
#else
#  define LOG(x) ((void)0)
#endif

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;

const double PI=acos(-1);
const ll INF = 1LL<<62;
const ll MINF = -(1LL<<62);

template<typename T> T getint() {
	T val=0;
	char c;
	
	bool neg=false;
	while((c=gc()) && !(c>='0' && c<='9')) {
		neg|=c=='-';
	}

	do {
		val=(val*10)+c-'0';
	} while((c=gc()) && (c>='0' && c<='9'));

	return val*(neg?-1:1);
}

//mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); uniform_int_distribution<int>(0, n-1)(rng)


int main() {
	IO;
	int n,k;
	cin>>n>>k;
	string s;
	cin>>s;
	s[k-1]=tolower(s[k-1]);
	cout<<s<<"\n";
	return 0;
}


Measured memory_bytes: 3644
using System;

namespace ABC142A
{
    class Program
    {
        static void Main(string[] args)
        {
            int n;
            n = int.Parse(Console.ReadLine());
            double a = n / 2 + 1;
            double b = n;
            double c = n / 2;

            if (n % 2 == 1)
                Console.WriteLine(a / b);
            else
                Console.WriteLine(c / b);
            Console.ReadKey();


        }
    }
}


Measured memory_bytes: 13140
#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 MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
int main(int argc, char* argv[]) {
    int n,d;
    cin >> n >> d;
    int i = 0;
    while(1){
        if((d*2+1)*i >= n) break;
        i ++;
    }
    cout << i << endl;
    return 0;
}


Measured memory_bytes: 256
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

"""
・変色の回数を決め打つ
・どの色として捕獲しておくべきだったかが決まる
・左とのminをとることで遷移
"""

import numpy as np

N,X = map(int,readline().split())
A = np.array(read().split(),np.int64)

INF = 10 ** 18
answer = INF
for change in range(N+100):
    x = A.sum() + change * X
    if answer > x:
        answer = x
    x = min(A[0],A[-1])
    A[1:] = np.minimum(A[:-1],A[1:])
    A[0] = x

print(answer)

Measured memory_bytes: 14532
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cassert>
#include <climits>
#define bogo_sort   std::sort
#define bozo_sort   std::stable_sort
#define alles(obj)  obj.begin(), obj.end()
#define elif        else if
#define unless(flg) if(!(flg))
#define elless(flg) else if(!(flg))
#define echo        std::cout <<
#define read        std::cin >>
#define endl        std::endl
#define fin         << '\n'
#define bash        push_back
#define makePair    std::make_pair
#define _           << ' ' <<
// type-define
#define Stack       std::stack
#define Queue       std::queue
#define Set         std::set
#define PQueue      std::priority_queue
#define Vector      std::vector
#define Pair        std::pair
#define Map         std::map
#define UMap        std::unordered_map
#define Greater     std::greater
using String  =     std::string;
using llong   =     long long;
using boolean =     bool;
using Pii     =     Pair<int, int>;
using Vi      =     Vector<int>;
using Vii     =     Vector<Pii>;
// utils
constexpr int   dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
constexpr int   dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
constexpr int   INF  = 0x3f3f3f3f;
constexpr llong LINF = 0x3f3f3f3f3f3f3f3fLL;

namespace {
    llong power ( llong x, llong n, llong mod ) {
        llong ans = 1;
        while ( n > 0 ) {
            if ( n & 1 ) ans = ( ans * x ) % mod;
            x = ( x * x ) % mod;
            n >>= 1;
        }
        return ans;
    }
    llong power ( llong x, llong n ) { return power( x, n, 1000000007 ); }
    llong gcd   ( llong x, llong y ) { return x % y ? gcd( y, x % y ) : y; }
    llong lcm   ( llong x, llong y ) { return ( x / gcd(x, y) * y ); }
    llong abs   ( llong n )          { return ( n < 0 ) ? -n : n; }
    template<class A, class B>inline bool chmax ( A &a, const B &b ) { return b > a ? a = b, true : false; }
    template<class A, class B>inline bool chmin ( A &a, const B &b ) { return b < a ? a = b, true : false; }
    boolean isMovable ( int x, int y, int w, int h ) {
        return ( x >= 0 && y >= 0 && x < w && y < h );
    }
}

namespace Rlyeh {

    signed call_of_Cthulhu( signed datum ) {

        int a, b;
        read a >> b;
        echo (( a < 9 && b < 9 ) ? "Yay!" : ":(") fin;

        return 0;
    }
}

signed main(){std::cin.tie(0); std::ios::sync_with_stdio(false); echo std::fixed << std::setprecision(8); int main_result = Rlyeh::call_of_Cthulhu(114514); return main_result;}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
 
#define 中心() main()
#define 返 return
#define 入力(a) cin >> a
#define 出力(a) cout << a << endl
#define 再帰(s,t) for(整数 s = 0; s < 整数(t); s += 1)
#define 間帰(s,t,u) for(整数 s = t; s < 整数(u); s += 1)
#define 如果(a) if(a)
#define 場合(a) while(a)
#define 脱出 break
#define 真 true
#define 定数 const
#define 和 +
#define 差 -
#define 積 *
#define 余 %
#define 且 &&
#define 又 ||
#define 是 =
#define 是不是 ==
#define 不是 !=
#define 是大 >
#define 是小 <
#define 是以上 >=
#define 是以下 <=
#define 他 else
#define 測長(a) a.length()
 
using namespace std;
 
typedef int 整;
typedef void 無;
typedef long long 整数;
typedef vector<整数> 整数配列;
typedef vector<整数配列> 二次元整数配列;
typedef string 文字列;
 
整数 大(整数 a, 整数 b){返 max(a,b);}
整数 小(整数 a, 整数 b){返 min(a,b);}
 
整数 回目;
整数配列 各桁(4);
 
無 入力関数()
{
    入力(回目);
}
 
無 解()
{
    間帰(s,1,4)
    {
        整数 法 是 10;        
        各桁[s] 是 回目 余 法;
        回目 是 回目 差 各桁[s];
        回目 是 回目 / 法;
    }
 
    如果(各桁[3] 是小 各桁[2] 又 各桁[3] 是小 各桁[1]){
        各桁[3] 是 各桁[3] 和 1;
    }
    
    整数 答 是 各桁[3] 積 100 和 各桁[3] 積 10 和 各桁[3];
    出力(答);
}
 
整 中心()
{
    入力関数();
    解();
    返 0;
}

Measured memory_bytes: 888
#include<bits/stdc++.h>
 
using namespace std;
 
long long k, a, b, res;
 
void solve()
{
  cin >> k >> a >> b;
  if(a >= b - 2 || k <= a) 
  {
    cout << 1 + k << endl;
    return;
  }
  res += b;
  k -= (a + 1);
  res += k / 2 * (b - a) + k % 2;
  cout << res << endl;
}
 
int main()
{
  solve();
}

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

using namespace std;

int main()
{
	vector<string> s;
	string t;
	string ans;
	int n, l;
	
	cin >> n >> l;
	
	for (int i = 0; i < n; i++) {
		cin >> t;
		s.push_back(t);
	}
	
	sort(s.begin(), s.end());
	
	for (int i = 0; i < n; i++) {
		ans += s[i];
	}
	
	cout << ans << endl;
	
	return (0);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N, M, X;
  cin >> N >> M >> X;
  int A[M];
  for(int i = 0; i < M; i++){
   cin >> A[i];
  }
  int left = 0;
  int right = 0;
  for(int i = 0; i < M; i++){
       if(A[i] < X){
        left++;
      }
      else{
        right++;
      }
   }
    int answer = min(left, right);
    cout << answer << endl;
}


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

typedef long long ll;
const ll INF = 1e18;
const int BIG = 1e9 + 555;

int n, a, b;

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

	cin >> n >> a >> b;
	cout << min(n * a, b) << '\n';
	return 0;
}

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

int main() {
    string N; cin >> N;
    if((N[0]==N[1] && N[1]==N[2]) ||
       (N[1]==N[2] && N[2]==N[3]))
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
//Utkarsh.25dec
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#define ll long long int
#define ull unsigned long long int
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define loop(i,a,b) for(ll i=a;i<=b;i++)
#define vi vector <int>
#define vs vector <string>
#define vc vector <char>
#define vl vector <ll>
#define all(c) (c).begin(),(c).end()
#define max3(a,b,c) max(max(a,b),c)
#define min3(a,b,c) min(min(a,b),c)
#define deb(x) cerr<<#x<<' '<<'='<<' '<<x<<'\n'
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// ordered_set s ; s.order_of_key(val)  no. of elements strictly less than val
// s.find_by_order(i)  itertor to ith element (0 indexed)
typedef vector<vector<ll>> matrix;
ll power(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll modInverse(ll a){return power(a,mod-2);}
const int N=500023;
bool vis[N];
vector <int> adj[N];
void solve()
{
    string s;
    cin>>s;
    int n=s.length();
    for(int i=0;i<n;i++)
    {
        adj[s[i]].pb(i);
    }
    ll ans=0;
    for(int i=0;i<n;i++)
    {
        for(char ch='a';ch<='z';ch++)
        {
            if(ch==s[i])
                continue;
            ll add=adj[ch].end()-lower_bound(all(adj[ch]),i);
            ans+=add;
        }
    }
    ans++;
    cout<<ans<<'\n';
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int T=1;
    //cin>>T;
    int t=0;
    while(t++<T)
    {
        //cout<<"Case #"<<t<<":"<<' ';
        solve();
        //cout<<'\n';
    }
    cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
}

Measured memory_bytes: 16584
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <bitset>
#include <set>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define all(i,n) (i),(i+n)

int dx4[4]={1,0,-1,0};
int dy4[4]={0,-1,0,1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

typedef pair<int, int> P;
typedef pair<string, int> SP;
typedef long long ll;

const int INF = 1e9;
const ll LLINF = 1e18;
const int MAX_V = 1e6+1;
const ll mod = 1000000007;

// --------------------------------------
int n;
string s[2];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> n >> s[0] >> s[1];

  ll ans = 1;
  int x = 0;
  int pre = -1;

  while(x < n) {
    if(s[0][x] == s[1][x]) {
      if(pre < 0) ans = 3;
      else if(pre == 0) ans = ans * 2 % mod;
      else ans = ans * 1 % mod;
      x++; pre = 0;
    } else {
      if(pre < 0) ans = ans * 6 % mod;
      else if(pre == 0) ans = ans * 2 % mod;
      else ans = ans * 3 % mod;
      x += 2; pre = 1;
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
if __name__ == "__main__":
    N = input()
    
    if int(N[-1]) in [2, 4, 5, 7, 9]:
        ret = "hon"
    elif int(N[-1]) in [0, 1, 6, 8]:
        ret = "pon"
    else:
        ret = "bon"
    print(ret)


Measured memory_bytes: 9168
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;

int main()
{
    double x1,y1,x2,y2;
    cin >> x1 >> y1 >> x2 >> y2;
    double data = sqrt((x2-x1)*(x2-x1) + (y2-y1)*(y2-y1));
    printf("%lf\n", data);
    return 0;
}

Measured memory_bytes: 3264
package main

/*
ハッシュ
*/

import (
	"bufio"
	"bytes"
	"fmt"
	"log"
	"os"
	"strconv"
	"strings"
)

type key string

func (k key) toUint64() uint64 {
	var sum uint64
	for _, r := range k {
		sum = uint64(r) + 31*sum
	}
	return sum
}

func h1(str string, hashSize int) uint64 {
	return key(str).toUint64() % uint64(hashSize)
}
func h2(str string, hashSize int) uint64 {
	return key(str).toUint64()%uint64(hashSize-1) + 1
}
func hashFunc(str string, hashSize, count int) uint64 {
	return (h1(str, hashSize) + uint64(count)*h2(str, hashSize)) % uint64(hashSize)
}

type dict []string

func (d dict) insert(key string) {
	count := 0
	for {
		h := hashFunc(key, len(d), count)
		if d[h] == key {
			// 格納済み
			return
		}
		if d[h] == "" {
			d[h] = key
			return
		}
		count++
		// このハッシュ実装は最大格納サイズと最大データ数が同じため
		// countを上げれば,必ずどこかに格納される.
	}
}
func (d dict) find(key string) bool {
	count := 0
	for {
		h := hashFunc(key, len(d), count)
		if d[h] == key {
			return true
		}
		if d[h] == "" {
			return false
		}
		count++
		// このハッシュ実装は最大格納サイズと最大データ数が同じため
		// countを上げれば,必ずどこかに格納される.
	}
}

func main() {
	scanner := makeScanner(8192)
	n := eGetInt(scanner)
	hashSize := 1000003
	d := make([]string, hashSize)
	for i := 0; i < n; i++ {
		fields := eGetFields(scanner)
		cmd, key := fields[0], fields[1]
		if cmd == "insert" {
			(dict(d)).insert(key)
		} else { // "find"
			if (dict(d)).find(key) {
				fmt.Println("yes")
			} else {
				fmt.Println("no")
			}
		}
	}
}

////////////////////////////////////////////////////////////////////////////////
// ライブラリ
////////////////////////////////////////////////////////////////////////////////
func makeScanner(max int) *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]uint8, 0, 8192), max)
	return scanner
}
func eGetLine(r *bufio.Scanner) string {
	if r.Scan() {
		return r.Text()
	}
	err := r.Err()
	if err != nil {
		log.Fatal(err)
	}
	// EOF
	return ""
}
func eGetInt(r *bufio.Scanner) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetFields(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Fields(line)
}
func eGetInts(r *bufio.Scanner) []int {
	fields := eGetFields(r)
	var ints []int
	for _, f := range fields {
		ints = append(ints, eAtoi(f))
	}
	return ints
}
func eGetChars(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Split(line, "")
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}

type ints []int

func (s ints) String() string {
	var buf bytes.Buffer
	sep := ""
	for _, v := range s {
		buf.WriteString(fmt.Sprintf("%s%d", sep, v))
		sep = " "
	}
	return buf.String()
}

func reverse(a ints) ints {
	r := make(ints, len(a))
	for i := 0; i < len(a); i++ {
		r[i] = a[len(a)-1-i]
	}
	return r
}



Measured memory_bytes: 39148
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define ALL(a) (a).begin(), (a).end()
typedef vector<ll> vi;
typedef vector<vector<ll>> vvi;
typedef pair<ll, ll> pii;
const ll INF = 1LL << 58;
const ll MOD = 1000000007;
typedef vector<pii> vpii;
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;
}

signed main()
{
    //  以降 cin の入力元が 'input.txt' になる
    //std::ifstream in("input.txt");
    //std::cin.rdbuf(in.rdbuf());
    int X, Y, A, B, C;
    vector<pair<int, int>> ABC;
    cin >> X >> Y >> A >> B >> C;

    REP(i, A)
    {
        int tmp;
        cin >> tmp;
        ABC.push_back(make_pair(tmp, 1));
    }
    REP(i, B)
    {
        int tmp;
        cin >> tmp;
        ABC.push_back(make_pair(tmp, 2));
    }
    REP(i, C)
    {
        int tmp;
        cin >> tmp;
        ABC.push_back(make_pair(tmp, 3));
    }

    sort(ALL(ABC));
    reverse(ALL(ABC));
    int ans = 0;
    int cnum = 0;

    REP(i, ABC.size())
    {
        pair<int, int> tmp = ABC[i];
        if (X + Y - cnum == 0)
            break;
        if (tmp.second == 1)
        {
            if (X > 0)
            {
                ans += tmp.first;
                X--;
            }
        }
        else if (tmp.second == 2)
        {
            if (Y > 0)
            {
                ans += tmp.first;
                Y--;
            }
        }
        else if (tmp.second == 3)
        {
            ans += tmp.first;
            cnum++;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 10348
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<vector>
#include<utility>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
#include<iomanip>
#include<list>
#include<deque>
using namespace std;
//#define MODE 1
#ifdef MODE
#define DEB(X) cout<< #X <<": "<<X<<" ";
#define END cout<<endl;
#else
#define DEB(X) {}
#define END {}
#endif
typedef long long ll;
#define int ll
#define uset unordered_set
#define umap unordered_map
typedef std::pair<int,int> P;
struct edge{int to,cost;};
const int INF=100000000000000000;
const int INF2=9223372036854775807;
const int MOD=1000000007;
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define min(X,Y) (((int)(X)<(int)(Y))?(X):(Y))
#define max(X,Y) (((int)(X)>(int)(Y))?(X):(Y))
#define MAX(X,Y) (*max_element(X,Y))
#define MIN(X,Y) (*min_element(X,Y))
#define NP(X,Y) next_permutation(X,Y)
#define setp(X,Y) cout<<fixed<<setprecision(Y)<<X;
int ceil2(int a,int b){if(a%b==0){return a/b;}else{return a/b+1;}}
int pow2(int a,int b){int r=1;for(int i=1;i<=b;i++){r*=a;}return r;}
int Log2(int a){int t=0;while(1){if(a==0||a==1){break;}a/=2;t++;}return t;}

int N;
int K;
int A[1010];
int B[1010];
vector<int> C;

signed main(){
	cin>>N>>K;
	REP(i,N){
		cin>>A[i];
		B[i+1]=B[i]+A[i];
	}
	for(int i=0;i<N;i++){
		for(int j=i;j<N;j++){
			C.push_back(B[j+1]-B[i]);
		}
	}
	int ans=0;
	for(int i=42;0<=i;i--){
		int now=ans+(1LL<<i);
		int cnt=0;
		REP(j,C.size()){
			if((C[j]&now)==now){
				cnt++;
			}
		}
		if(cnt>=K)ans=now;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 6256
#include <iostream>
#include <fstream>
#include <iomanip>
#include <climits>
#include <limits>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <functional>
#include <numeric>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <unordered_map>
#include <random>
#include <cmath>
#include <complex>

using namespace std;

typedef long long int ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;

const int INFL = (int)1e9;
const ll INFLL = (ll)1e18;
const double INFD = numeric_limits<double>::infinity();
const double PI = 3.14159265358979323846;
#define Loop(i, n) for(int i = 0; i < (int)n; i++)
#define Loopll(i, n) for(ll i = 0; i < (ll)n; i++)
#define Loop1(i, n) for(int i = 1; i <= (int)n; i++)
#define Loopll1(i, n) for(ll i = 1; i <= (ll)n; i++)
#define Loopr(i, n) for(int i = (int)n - 1; i >= 0; i--)
#define Looprll(i, n) for(ll i = (ll)n - 1; i >= 0; i--)
#define Loopr1(i, n) for(int i = (int)n; i >= 1; i--)
#define Looprll1(i, n) for(ll i = (ll)n; i >= 1; i--)
#define Loopitr(itr, container) for(auto itr = container.begin(); itr != container.end(); itr++)
#define printv(vector) Loop(i, vector.size()) { cout << vector[i] << " "; } cout << endl;
#define rnd(d) (ll)((double)d + (d >= 0 ? 0.5 : -0.5))
#define floorsqrt(x) ((ll)sqrt((double)x) + ((ll)sqrt((double)x) * (ll)sqrt((double)x) <= (ll)x ? 0 : -1))
#define ceilsqrt(x) ((ll)sqrt((double)x) + ((ll)x <= (ll)sqrt((double)x) * (ll)sqrt((double)x) ? 0 : 1))
#define ceildiv(a, b) ((ll)a / (ll)b + ((ll)a % (ll)b == 0 ? 0 : 1))
#define bitmanip(m,val) static_cast<bitset<(int)m>>(val)

/*******************************************************/

int main() {
  int n; cin >> n;
  vll a(n), b(n);
  bool same = true;
  int larger = 0;
  ll larger_minb = LLONG_MAX;
  Loop(i, n) {
    cin >> a[i] >> b[i];
    if (a[i] != b[i]) same = false;
    if (a[i] > b[i]) {
      larger++;
      larger_minb = min(larger_minb, b[i]);
    }
  }
  ll ans = 0;
  if (!same) {
    if (larger >= 2) {
      ans = accumulate(a.begin(), a.end(), 0LL) - larger_minb;
    }
    else {
      Loop(i, n) {
        if (a[i] <= b[i]) ans += b[i];
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 512
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQG = priority_queue<T, vector<T>, greater<T> >;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {return a < b && (a = b, true);}
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {return a > b && (a = b, true);}
template<typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) { return is >> p.first >> p.second;}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) { return os << p.first << ' ' << p.second;}



//head



int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int x;
	cin >> x;
	if(x >= 30) cout << "Yes" << endl;
	else cout << "No" << endl;
}

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

using namespace std;

int main() {
	long long n;
	scanf("%lld", &n);
	
	string res = "";
	
	while (n > 0) {
		n--;
		res += (n % 26) + 'a';
		n /= 26;
	}
	
	reverse(res.begin(), res.end());
	
	cout << res << endl;
}


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

int main(){
	int n; string s;
	cin>>n>>s;
	if(n % 2) cout<<"No";
	else{
		bool check = 1;
		for(int i = 0; i < n/2; i++){
			if(s[i] != s[i + n/2]){
				cout<<"No";
				check = 0;
				break;
			}
		}
		if(check) cout<<"Yes";
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define Hello ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define endl '\n'
int main()
{
    Hello
    ll n, R = 0, G = 0, B = 0, ans = 0, diff = 0;
    string s;
    cin >> n >> s;
    for(int i = 0; i < n; i++){
        R += (s[i] == 'R');
        G += (s[i] == 'G');
        B += (s[i] == 'B');
    }
    /*for(auto i : r)
        cout << i << " ";
    cout << endl << endl;
    for(auto i : g)
        cout << i << " ";
    cout << endl << endl;*/
    //cout << "count " << R << " " << G << " " << B << endl;
    for(int a = 0; a < s.size(); a++){
        for(int b = 0; b < s.size(); b++){
            int i = a, j = b;
            if(j < i || s[a] == s[b])
                continue;
            if((2 * j - i >= 0) && (2 * j - i < n) && (s[2 * j - i] != s[a] && s[2 * j - i] != s[b]))
                ans++;
        }
    }
    cout << (R * G * B) - ans;
    return 0;
}

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

bool judgePrime( int a )
{
    for( int i = 2; i <= sqrt(a); i++ )
    {
        if( a % i == 0 )
            return false;
    }
    return true;
}

int main()
{
    int n, a[10000], cnt;
    
    while( cin >> n )
    {
        for( int i = 0; i < n; i++ )
            a[i] = i + 1;
        
        cnt = 0;

        for( int i = 1; i < n - 1; i++ )
            if( judgePrime( a[i] ) && judgePrime( n - i ) )
                cnt++;
        
        cout << cnt << endl;
    }
    return 0;
}


Measured memory_bytes: 3140
//...Bismillahir Rahmanir Rahim...
// Code by    Asad Bin Saber

#include <bits/stdc++.h>

using namespace std;

// typedefs...
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<ll, ll> pll;

// constants...
const double PI = acos(-1);

// defines...
#define MP make_pair
#define PB push_back
#define si(a) scanf("%d", &a)
#define sii(a, b) scanf("%d%d", &a, &b)
#define siii(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define sl(a) scanf("%lld", &a)
#define sll(a, b) scanf("%lld%lld", &a, &b)
#define slll(a, b, c) scanf("%lld%lld%lld", &a, &b, &c)

int gcd(int a, int b) {
    while (b) {
        a %= b;
        swap(a, b);
    }
    return a;
}
ll lcm(ll a, ll b)
{
    return (a*b/gcd(a, b));
}
ll comb(ll a, ll b)
{
    ll x = max(a-b, b), ans=1;

    for(ll K=a, L=1; K>=x+1; K--, L++){
        ans *= K;
        ans /= L;
    }

    return ans;
}



void task()
{
    //code here...
    
    ll n, ans=0;
    cin >> n;
    ll ara[n];
    
    for(ll K=0; K<n; K++) cin >> ara[K];
    
    sort(ara, ara+n);
    
    ans += ara[n-1];
    //if(n>2) ans += ara[n-2];
    //if(n>3) ans += ara[n-2];
    //n-=2;
    ll i = 2;
    for(int K=1; K<=(n-2)/2; K++){
		ans += 2*ara[n-i];
		i++;
		//cout << n << "\n";
		/*ans += ara[n-i];
		n--;
		if(n==0 || i>=n) break;
		ans += ara[n-i];
		n--;
		i++;*/
	}
	if(n%2==1) ans += ara[n-i];
    
    //for(int K=n-5; K>=0; K--) ans += ara[K+2];
    
    //ans += (n-2)*(ara[n-2]);
    
    cout << ans << "\n";
}


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

    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    task();

    return 0;
}




Measured memory_bytes: 5216
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
using str = string;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
const double PI = 3.141592653589793238;
const ll mod = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define REP(i, m, n) for (int i = m; i < (int)n; i++)
#define all(a) (a).begin(), (a).end()
#define allg(a) (a).begin(), (a).end(), greator<>()
#define d20 std::setprecision(20)
#define veci vector<int>
#define vecll vector<long long int>
#define vecb vector<bool>
#define vecd vector<double>
template <typename T>
T lcm(T a, T b)
{
	return a / __gcd(a, b) * b;
}

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

Measured memory_bytes: 3624
#include <stdio.h>

#define arr_print_d0dn(a, n) for(int i=0;i<(n)-1;++i)write_uint((a)[i]),*_o++=' ';write_uint((a)[(n)-1]),*_o++='\n'

#define INPUT__LENGTH (20000000)
char _in[INPUT__LENGTH];
char *_i = _in;
int read_uint() {
    int n = 0;
    while(47 < *_i && *_i < 58) n = 10 * n + (*_i++ & 0xf);
    _i++;
    return n;
}
#define OUTPUT__LENGTH (20000000)
char _out[OUTPUT__LENGTH];
char *_o = _out;
void write_uint(int n) {
    if(!n) {
        *_o++ = '0';
        return;
    }
    char buf[11];
    int i = 0;
    while(n) buf[i++] = (n % 10 + '0'), n /= 10;
    while(i--) *_o++ = buf[i];
}
void counting_sort(int *dst, const int *src, const int N, const int max) {
    // 'int c[max+1] = {}' cannot initialize
    int c[10001] = {};
    for(int i = 0; i < N; ++i) c[src[i]]++;
    for(int i = 1; i < max; ++i) c[i] += c[i - 1];
    for(int i = N - 1; i >= 0; --i) {
        int x = src[i];
        int y = c[x];
        dst[c[src[i]]-- - 1] = src[i];
    }
}
int main(int argc, char **argv) {
    fread_unlocked(_in, 1, INPUT__LENGTH, stdin);
    int n = read_uint();
    int a[n], b[n];
    for(int i = 0; i < n; ++i) a[i] = read_uint();
    counting_sort(b, a, n, 10000);
    arr_print_d0dn(b, n);
    fwrite_unlocked(_out, 1, _o - _out, stdout);
    return 0;
}



Measured memory_bytes: 36280
import sys, os, math, bisect, itertools, collections, heapq, queue
# from scipy.sparse.csgraph import csgraph_from_dense, floyd_warshall
from decimal import Decimal
from collections import defaultdict

# import fractions

sys.setrecursionlimit(10000000)

ii = lambda: int(sys.stdin.buffer.readline().rstrip())
il = lambda: list(map(int, sys.stdin.buffer.readline().split()))
fl = lambda: list(map(float, sys.stdin.buffer.readline().split()))
iln = lambda n: [int(sys.stdin.buffer.readline().rstrip()) for _ in range(n)]

iss = lambda: sys.stdin.buffer.readline().decode().rstrip()
sl = lambda: list(map(str, sys.stdin.buffer.readline().decode().split()))
isn = lambda n: [sys.stdin.buffer.readline().decode().rstrip() for _ in range(n)]

lcm = lambda x, y: (x * y) // math.gcd(x, y)
# lcm = lambda x, y: (x * y) // fractions.gcd(x, y)

MOD = 10 ** 9 + 7
MAX = float('inf')


def main():
    if os.getenv("LOCAL"):
        sys.stdin = open("input.txt", "r")

    A = ii()
    print(A + A**2 + A**3)



if __name__ == '__main__':
    main()


Measured memory_bytes: 10116
#include <bits/stdc++.h>
#define ll long long int
#define M 1000000007

using namespace std;

int main()
{
    int n,m;
    cin>>n;
    int a[n][3];
    for(int i = 0; i<n; i++)
        cin>>a[i][0]>>a[i][1]>>a[i][2];
    int dp[n+1][3];
    dp[0][0] = dp[0][1] = dp[0][2] = 0;
    for(int i = 1; i<=n; i++)
    {
        dp[i][0] = max((dp[i-1][1]+a[i-1][1]),(dp[i-1][2]+a[i-1][2]));
        dp[i][1] = max((dp[i-1][0]+a[i-1][0]),(dp[i-1][2]+a[i-1][2]));
        dp[i][2] = max((dp[i-1][1]+a[i-1][1]),(dp[i-1][0]+a[i-1][0]));
    }
    cout<<max(dp[n][0],max(dp[n][1],dp[n][2]));
    
    return 0;
}

Measured memory_bytes: 5940
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
 
int main(){
  int x, n;
  cin >> x >> n;
  if(n == 0){
    cout << x << endl;
  }else{
    int ans = 0;
    vector<int> p(n);
    for(int i = 0; i < n; i++){
      cin >> p[i];
    }
    for(int i = 0; i < 102; i++){
      int count = 0;
      for(int j = 0; j < n; j++){
        if(i == p[j]){
          count++;
        }
      }
      if(count == 0 && (i <= x || (x < i && x - ans > i - x))){
        ans = i;
      }
    }
    cout << ans << endl;
  }
}


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

#define rep(i, a, b) for (ll i = (a); i < (b); i++)
typedef uint64_t ull;
typedef int64_t ll;
typedef pair<ll, ll> PLL;

signed main() {
    ll N,M;
    cin>>N>>M;
    vector<PLL> v(M);
    rep(i,0,M){
        cin>>v[i].first>>v[i].second;
    }
    sort(begin(v),end(v),[](const PLL &x, const PLL &y){
            return x.second<y.second;
            });

    ll ans = 0;
    ll k = -1; // 以前の切断で[k k+1]間を削除した
    rep(i,0,M){
        ll s = v[i].first;
        ll e = v[i].second;
        if (k+1 <= s || e <= k){
            k = e-1;
            ans++;
            // cout<<"k="<<k<<endl;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1792
package main

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

var (
	readString func() string
	stdout     *bufio.Writer
)

func init() {
	readString = newReadString(os.Stdin)
	stdout = bufio.NewWriter(os.Stdout)
}

func newReadString(ior io.Reader) func() string {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	return func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 0, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readIntSlice(n int) []int {
	b := make([]int, n)
	for i := 0; i < n; i++ {
		b[i] = readInt()
	}
	return b
}

func readLengthAndSlice() []int {
	n := readInt()
	return readIntSlice(n)
}

func printf(f string, args ...interface{}) (int, error) {
	return fmt.Fprintf(stdout, f, args...)
}

func println(args ...interface{}) (int, error) {
	return fmt.Fprintln(stdout, args...)
}

func minInt(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func minUint(a, b uint) uint {
	if a < b {
		return a
	}
	return b
}

func minInt64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func minUint64(a, b uint64) uint64 {
	if a < b {
		return a
	}
	return b
}

func maxInt(a, b int) int {
	if a < b {
		return b
	}
	return a
}

func maxUint(a, b uint) uint {
	if a < b {
		return b
	}
	return a
}
func maxInt64(a, b int64) int64 {
	if a < b {
		return b
	}
	return a
}

func maxUint64(a, b uint64) uint64 {
	if a < b {
		return b
	}
	return a
}

func absInt(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func absInt64(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

// readString() string
// readInt() int
// readIntSlice(n int) []int
// readLengthAndSlice() []int
func main() {
	defer stdout.Flush()

	n := readInt()
	a := readInt()

	n %= 500
	if a >= n {
		println("Yes")
	} else {
		println("No")
	}
}


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

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

    vector<string> vec(N);
    for (int i = 0; i < N; i++) {
        cin >> vec.at(i);
    }

    bool flag = false;
    for (int i = 0; i < N; i++) {
        if (vec.at(i) == "Y") {
            flag = true;
        }
    }

    if (flag) {
        cout << "Four" << endl;
    }
    else {
        cout << "Three" << endl;
    }
}

Measured memory_bytes: 256
n = int(input())
a = [int(x) for x in input().split()]
s = [a[0]]
cnt = 1
res = 0
for i in range(1, len(a)):
    if a[i-1] != a[i]:
        res += cnt // 2
        cnt = 1
        s.append(a[i])
    else:
        cnt += 1
res += cnt // 2
print(res)


Measured memory_bytes: 3060
import java.util.Scanner;
public class Main {


public static void main(String[] args) {
	// TODO 自動生成されたメソッド・スタブ
	Scanner sc = new Scanner(System.in);
	int n = sc.nextInt();
	float x;
	int jpn=0;
	float btc=0;
	for(int i=0;i<n;i++) {
		x=sc.nextFloat();
		String s = sc.nextLine();
		if(s.contains("JPY")) {
			jpn += x;
		}else {
			btc += x;
		}

	}
	sc.close();
	System.out.println(btc*380000 + jpn);
}

}


Measured memory_bytes: 24148
/*
 _____ ____ _____   ___   ___  __  ___  
|_   _/ __ \_   _| |__ \ / _ \/_ |/ _ \ 
  | || |  | || |      ) | | | || | (_) |
  | || |  | || |     / /| | | || |\__, |
 _| || |__| || |_   / /_| |_| || |  / / 
|_____\____/_____| |____|\___/ |_| /_/   
*/
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define per(i, a, b) for (long long i = (a); i > (b); i--)
#define a(x) (x.begin(), x.end())
#define ar(x) (x.rbegin(), x.rend())
#define pb push_back
#define Pb() pop_back()
#define ll long long int
#define ull unsigned long long int
#define pii pair<int, int>
#define pll pair<ll, ll>
#define sc scanf
#define scin(x) sc("%d", &(x))
#define scln(x) sc("%lld", &(x))
#define pf prllf
#define ms(a, b) memset(a, b, sizeof(a))
#define mp make_pair
#define db double
#define EPS 10E-10
#define ff first
#define ss second
#define sqr(x) (x) * (x)
#define vi vector<int>
#define vl vector<ll>
#define vii vector<vector<int>>
#define vll vector<vector<ll>>
#define DBG pf("HI\n")
#define MOD 1000000007
#define CIN                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0)
#define RUN_CASE(t, T) for (__typeof(t) t = 1; t <= T; t++)
#define CASE(t) prllf("Case %d: ", t)
#define CASEL(t) prllf("Case %d:\n", t)
#define intlimit 2147483647
#define longlimit 9223372036854775807
#define infinity (1 << 28)
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) ((a) * (b) / gcd(a, b))
#define PI 2 * acos(0.0)
using namespace std;
int main()
{
    CIN;
   ll n;
   cin >> n;
   cout << n*(n-1)/2;
}

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

int main() {
    string S;
    cin >> S;
    bool flag = true;
    string T = S;
    reverse(T.begin(), T.end());
    if(S != T){
        cout << "No";
        return 0;
    }
    string U = "";
    rep(i, (S.size()-1)/2){
        U += S[i];
    }
    string U2 = U;
    reverse(U2.begin(), U2.end());
    if(U != U2){
        cout << "No";
        return 0;
    }
    string V = "";
    rep(i, (S.size()+3)/2){
        U += S[i];
    }
    string V2 = V;
    reverse(V2.begin(), V2.end());
    if(V != V2){
        cout << "No";
        return 0;
    }
    cout << "Yes";
}

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

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
#define ld long double
#define ll long long
#define mod 1000000007
#define IINF INT_MAX
#define INF 1LL << 30


int main() {
    int n; cin >> n;
    V<ll> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];

    ll s = 0;
    for(int i = 0; i < n; i++){
        s ^= a[i];
    }
    for(int i = 0; i < n; i++){
        a[i] ^= s;
    }
    for(int i = 0; i < n; i++){
        cout << a[i] << endl;
    }


    return 0;
}


Measured memory_bytes: 4736
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define bit(n,k) (((ll)n>>(ll)k)&1) /*nのk bit目*/
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> T;
//const ll MOD=1000000007LL;
const ll MOD=998244353LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
vl dx={-1,-1,-1,0,0,1,1,1};
vl dy={1,-1,0,1,-1,1,0,-1};

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

Measured memory_bytes: 256
#!/usr/bin/env python3
#AGC32 A

import sys
import math
import bisect
from heapq import heappush, heappop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
mod = 10**9 + 7

ans = []
n = int(input())
b = list(map(int,input().split()))
for i in range(n):
    for j in range(len(b))[::-1]:
        if j+1 == b[j]:
            ans.append(b[j])
            b.remove(b[j])
            break
    else:
        print(-1)
        quit()
ans = ans[::-1]
for i in range(n):
    print(ans[i])


Measured memory_bytes: 38512