akhauriyash/Code-Regression huggingface dataset:
N,K = map(int,input().split())
num = 0
dicta = {}
for i in range(N):
    a,b = map(int,input().split())
    if a not in dicta:
        dicta[a] = b
    else:
        dicta[a] += b

dicts = sorted(dicta.items(), key = lambda x:x[0])
for i,v in dicts:
    num += v
    if num >= K:
        print(i)
        break

Measured memory_bytes: 54488
use std::io::{BufRead, Read};

pub struct Scanner<R>
where
    R: BufRead,
{
    reader: R,
}

impl<R> Scanner<R>
where
    R: BufRead,
{
    pub fn new(reader: R) -> Self {
        Self { reader }
    }

    pub fn next<T>(&mut self) -> T
    where
        T: ::std::str::FromStr,
        <T as ::std::str::FromStr>::Err: ::std::fmt::Debug,
    {
        self.reader
            .by_ref()
            .bytes()
            .map(|b| b.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>()
            .parse::<T>()
            .unwrap()
    }
}

fn main() {
    let stdin = std::io::stdin();
    let stdin = stdin.lock();
    let mut sc = Scanner::new(stdin);

    loop {
        let n: i32 = sc.next();
        let x: i32 = sc.next();
        if n == 0 && x == 0 {
            break;
        }

        let mut combination_count = 0i32;

        for i in 1..n + 1 {
            for j in i + 1..n + 1 {
                for k in j + 1..n + 1 {
                    if i + j + k == x {
                        combination_count += 1;
                        break;
                    }
                }
            }
        }
        println!("{}", combination_count);
    }
}



Measured memory_bytes: 5028
n, k = map(int, input().split())
s = str(input())

sl = []
c = 1
if (s[0] == "1"):
    sl.append(0)
for i in range(n):
    if (i != 0):
        if (s[i] == s[i-1]):
            c += 1
        else:
            sl.append(c)
            c = 1
sl.append(c)

ruisekiwa = [0]
sums = []
ans = 0
w = 2*k+1

if (w > len(sl)):
    print(n)
    exit()
for i in range(len(sl)):
    ruisekiwa.append(ruisekiwa[i] + sl[i])
# print(sl)
# print(ruisekiwa)
for i in range(len(sl)):
    if(k % 2 == 1 and i % 2 == 0 or k % 2 == 0 and i % 2 == 1):
        left = i-k
        if (left < 0):
            left = 0
        right = i + k+1
        if (right >= len(ruisekiwa)):
            right = len(ruisekiwa)-1
        # print(ruisekiwa[right], "-", ruisekiwa[left],
        #      "=", ruisekiwa[right]-ruisekiwa[left])
        ans = max(ans, ruisekiwa[right]-ruisekiwa[left])
print(ans)

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

typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define each(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); ++itr)
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define fi first
#define se second

const int INF=12345678;

//weight,price
typedef pair<int,int> pi;

int main()
{
    int s,d,m;
    while(cin >>s >>d >>m)
    {
        vector<vector<pi>> kanmi(s);
        vector<int> f(d);

        rep(i,s)
        {
            int k;
            cin >>k;
            rep(j,k)
            {
                int w,p;
                cin >>w >>p;
                kanmi[i].pb(pi(w,p));
            }
        }
        rep(i,d) cin >>f[i];

        //i????????£??????????¢????????????????????????§???
        int dp[301]={0};

        rep(i,d)
        {
            //????????\???j??????????????????????????????
            rep(j,kanmi[f[i]].size())
            {
                for(int x=m; x>=0; --x)
                {
                    //?????????
                    if(x+kanmi[f[i]][j].se<=m)
                    {
                        dp[x+kanmi[f[i]][j].se] = max(dp[x+kanmi[f[i]][j].se], dp[x]+kanmi[f[i]][j].fi);
                    }
                }

            }
        }

        int ax=0,ay=0;
        rep(i,m+1)
        {
            //printf("dp[%d]=%d\n", i,dp[i]);
            if(dp[i]>ax)
            {
                ax=dp[i];
                ay=i;
            }
        }

        printf("%d %d\n",ax,ay);
    }
    return 0;
}

Measured memory_bytes: 3156
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int n;
    string s;
    cin >> n;
    int a[4] = {0,0,0,0};
    for(int i=0;i<n;i++){
        cin >> s;
        if(s == "AC") a[0]++;
        else if(s == "WA") a[1]++;
        else if(s == "TLE") a[2]++;
        else if(s == "RE") a[3]++;
    }
    cout << "AC x " <<a[0] << endl;
    cout << "WA x " << a[1] << endl;
    cout << "TLE x " << a[2] << endl;
    cout << "RE x " << a[3] << endl;
}

Measured memory_bytes: 3628
using System;
public class Hello{
    public static void Main(){
        string[] input=Console.ReadLine().Split(' ');
        int A=int.Parse(input[0]);
        int B=int.Parse(input[1]);
        int H=int.Parse(input[2]);
        int M=int.Parse(input[3]);
        
        double theta=2.0*Math.PI*Math.Abs(H/12.0+M/12.0/60.0-M/60.0);
        Console.WriteLine(Math.Sqrt(A*A+B*B-2*A*B*Math.Cos(theta)));
    }
    
}


Measured memory_bytes: 18596
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<(n);i++)
#define rep2(i,a,n) for(int i=a;i<n;i++)
#define been(ix) (ix).begin(),(ix).end()
using namespace std;
typedef long long ll; 
typedef vector<int> vi;
typedef vector<long long> vl;
const ll INFL = 1e18;
const int INF = 1001001001; 
typedef pair<int,int> P;
#define foreach(ix,i) for(auto& (ix) : (i))
typedef long double ld;
const int mod =1000000007;

int main(){
  int a,b;cin>>a>>b;
  b+=a*3;
  cout<<b/2<<endl;
}

Measured memory_bytes: 256
while True:
    try:
        a = list(input())
    except:
        break
    ans = ""
    for i in range(len(a)-a.count("@")*2):
        if a[i] == "@":
            ans += a[i+2]*int(a[i+1])
            del a[i+1:i+3]
        else:
            ans += a[i]
    print(ans)
    


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

#include <ext/pb_ds/assoc_container.hpp> //required
#include <ext/pb_ds/tree_policy.hpp> //required

using namespace __gnu_pbds; 
using namespace std;

template <typename T> using ordered_set =  tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; 
typedef long long  ll;
typedef vector<ll> VL;
typedef vector<int> VI;
typedef pair<ll,ll> PLL;
typedef pair<int,int> PII;
#define pb push_back

#define F first
#define S second
#define SZ(a) int((a).size())
#define ALL(a) a.begin(),a.end()
#define fr(i,x,y) for(ll i=x;i<y;i++)
#define frr(i,x,y) for(ll i=x-1;i>=y;i--)
#define inf 1e18+1
const ll mod=1000000007;
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll power(ll a,ll b){ll ans=1;while(b!=0){if(b&1){ans*=a;}a=a*a;b>>=1;}return ans;}
ll powerm(ll a,ll b){ll ans=1;while(b!=0){if(b&1){ans*=a;ans%=mod;}a=a*a;a%=mod;b>>=1;}return ans%mod;}
// string to integer stoi()
// string to long long stoll()
// string.substr(position,length);
// integer to string to_string();

void solve()
{
    ll n;
    cin>>n;
    VL arr(n);
    map<ll,ll> mp;
    fr(i,0,n)
    {
        cin>>arr[i];
        mp[arr[i]]++;
    }
    ll ct=0;
    fr(i,0,n)
    {
        ll flag=1;
        for(ll j=1;j*j<=arr[i];j++)
        {
            if(arr[i]%j==0)
            {
                ll x=j;
                ll y=arr[i]/j;
                if(x==arr[i])
                {
                    if(mp[x]>1)
                        flag=0;
                }
                else
                {
                    if(mp.count(x))
                        flag=0;
                }
                if(y==arr[i])
                {
                    if(mp[y]>1)
                        flag=0;
                }
                else
                {
                    if(mp.count(y))
                        flag=0;
                }
            }
        }
        if(flag==1)
            ct++;
    }
    cout<<ct<<endl;
    return;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    ll t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }
    return 0;
}
/* stuff you should look for
        * int overflow, array bounds
        * special cases (n=1?)
        * do smth instead of nothing and stay organized
        * WRITE STUFF DOWN
*/
// BITMASK:
// 1)When some constrall is of the order of 15-20, think of bitmask DP.
// 2)When some constrall is around 40, try out meet in the middle
// 3) See Strings,palindromes,prefix,suffix etc -> KMP,Z algorithm

Measured memory_bytes: 17188
//g++ -std=c++11
#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef long double ld;

typedef pair <int, int> pi;
typedef pair <ll, ll> pl;
typedef pair <ld, ld> pd;

typedef vector <int> vi;
typedef vector <ll> vl;
typedef vector <ld> vd;
typedef vector <pi> vpi;
typedef vector <pl> vpl;

#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define ins insert

const int INF = 1000000000;
const int MAXN = 200000;
const int MOD = 1000000007;
const char nl = '\n';

int main() {

    std::ios::sync_with_stdio(false);
    cin.tie(nullptr);

    ll n, ans = 0;
    cin >> n;

    for(ll i=2; i*i<=n; i++) {
    	int j = 1;
    	if(n%i==0) {
    		ll cont = 0;
    		while(n%i==0) {
    			n/=i;
    			cont++;
    			if(cont == j) {
    				ans++;
    				j++;
    				cont = 0;
    			}
    		}
    	}
    }
    if(n>1) ans++;

    cout << ans << nl;
    return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
int main()
{  int a[5]={105,165,195,135,189};
   int ans=0,n;
   cin>>n;
   sort(a,a+4);
   if(n>=195)
     cout<<5;
   else if(n>=189)
     cout<<4;
   else if(n>=165)
     cout<<3;
   else if(n>=135)
     cout<<2;
   else if(n>=105)
     cout<<1;
   else 
     cout<<0;
   return 0;
} 

Measured memory_bytes: 256
import java.io.File;
import java.io.FileNotFoundException;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(System.in);

        int n = s.nextInt();
        int k = s.nextInt(); // blueNum

        int blueNum = k;
        int redNum = n - blueNum;

        m_facs = new int[n + 1];
        m_facs[0] = 1;
        for (int i = 1; i <= n; ++i) {
            m_facs[i] = mul(m_facs[i - 1], i);
        }


        for (int i = 1; i <= k; i++) {
            System.out.println(calc(i, blueNum, redNum));
        }

    }

    private static final BigInteger CC = BigInteger.valueOf(1000000007);

    private static long calc(int i, int blueNum, int redNum) {
        long blueTori = kumi(blueNum, i);

        long redBothTori = kumi(redNum, i + 1);
        long redSideTori = kumi(redNum, i);
        long redNorTori = kumi(redNum, i - 1);

        BigInteger blueToriBi = BigInteger.valueOf(Math.max(1, blueTori));


        BigInteger redBothToriBi = blueToriBi.multiply(BigInteger.valueOf(Math.max(0, redBothTori)));
        BigInteger redSideToriBi = blueToriBi.multiply(BigInteger.valueOf(Math.max(0, redSideTori)));
        BigInteger redNorToriBi = blueToriBi.multiply(BigInteger.valueOf(Math.max(0, redNorTori)));

        BigInteger result = redBothToriBi.add(redSideToriBi).add(redSideToriBi).add(redNorToriBi);

        long resultLong = result.mod(CC).longValue();
        if (i == 1 && resultLong == 0) {
            resultLong = 1;
        }

        return resultLong;
    }

    private static long kumi(int num, int groupNum) {
        if (groupNum == 0) return 0;
        if (num == groupNum) return 1;
        if (num < groupNum) return 0;
        return ncr(num - 1, groupNum - 1);
    }

    private static final int M = 1000000007;
    private static int[] m_facs;

    private static int mul(int a, int b) {
        return BigInteger.valueOf(a).multiply(BigInteger.valueOf(b)).mod(CC).intValue();
    }

    private static int fac(int n) {
        return m_facs[n];
    }

    private static int pow(int a, int m) {
        switch (m) {
            case 0:
                return 1;
            case 1:
                return a;
            default:
                int p1 = pow(a, m / 2);
                int p2 = mul(p1, p1);
                return ((m % 2) == 0) ? p2 : mul(p2, a);
        }
    }

    private static int div(int a, int b) {
        return mul(a, pow(b, M - 2));
    }

    private static int ncr(int n, int r) {
        if (n < r) {
            return 0;
        }
        if (n == r) {
            return 1;
        }
        int res = fac(n);
        res = div(res, fac(r));
        res = div(res, fac(n - r));
        return res;
    }
}


Measured memory_bytes: 64996
#include <algorithm>
#include <cstdint>
#include <iostream>
#include <vector>

using namespace std;

vector<int> ReadVector(int size)
{
    vector<int> vec(size);
    for (auto &num : vec) {
        cin >> num;
    }
    return vec;
}

int CountSmaller(const vector<int> &vec, int val)
{
    int pos = -1;
    int power = (1 << 25);

    while (power > 0) {
        int next_pos = pos + power;
        power >>= 1;

        if (next_pos < (int)vec.size() && vec[next_pos] < val) {
            pos = next_pos;
        }
    }
    return pos + 1;
}

int CountGreater(const vector<int> &vec, int val)
{
    int pos = -1;
    int power = (1 << 25);

    while (power > 0) {
        int next_pos = pos + power;
        power >>=  1;

        if (next_pos < (int)vec.size() && vec[next_pos] <= val) {
            pos = next_pos;
        }
    }
    return vec.size() - pos - 1;
}

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

    auto a = ReadVector(n);
    auto b = ReadVector(n);
    auto c = ReadVector(n);

    sort(a.begin(), a.end());
    sort(c.begin(), c.end());

    int64_t res = 0;
    for (const auto &num : b) {
        res += 1LL * CountSmaller(a, num) * CountGreater(c, num);
    }

    cout << res << "\n";
    return 0;
}



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

using namespace std;

int digit_sum(int x) {
  int ret = 0;
  while (x) {
    ret += x % 10;
    x /= 10;
  }
  return ret;
}

int main() {
  int n;
  scanf("%d", &n);
  int ans = (int) 1e9;
  for (int i = 1; i < n; i++) {
    ans = min(ans, digit_sum(i) + digit_sum(n - i));
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
ll n;
ll a[200005] , b[200005];
ll mnm = 1e16;
int main()
{
        cin >> n;
        ll s = 0;
        bool ok = true;
        for(ll i=1;i<=n;i++){


                        cin >> a[i] >> b[i];
                        if(a[i] != b[i]) ok = false;
                        if(a[i] > b[i]) {

                                mnm = min(mnm , b[i]);
                        }
                        s += a[i];
        }
        if(ok) {
                cout << 0 << endl; return 0;
        }
        cout << s - mnm << endl;
        return 0;
}


Measured memory_bytes: 640
function main(input) {
  var str = input.split(" ");
  var fee;

  if(13 <= str[0]){
    fee = str[1];
  }else if(6 <= str[0] && str[0] < 13){
    fee = str[1]/2;
  }else{ 
    fee = 0;
  }

  console.log(fee);
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 21064
#include <iostream>
#include <vector>
using namespace std;
const int MOD = 1000000007;
const int A_MAX = 1000000;

int min_factor[A_MAX+1];

void calc(int n) {
	min_factor[0] = min_factor[1] = -1;
	int i;
	for (i = 2; i*i <= n; i++) {
		if (min_factor[i]) continue;
		min_factor[i] = i;
		for (int j = i*i; j <= n; j += i) {
			if (!min_factor[j]) min_factor[j] = i;
		}
	}
	for (; i <= n; i++) if (!min_factor[i]) min_factor[i] = i;
}

vector<pair<long long, int>> prime_factorization(long long n) {
	vector<pair<long long, int>> v;
	while (n > 1) {
		long long p = min_factor[n];
		int exp = 0;
		while (n % p == 0) {
			n /= p;
			exp++;
		}
		v.emplace_back(p, exp);
	}
	return v;
}

long long mod(long long a) {
	a %= MOD;
	return a >= 0 ? a : a+MOD;
}

long long pow_mod(long long a, long long n) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = (res * a) % MOD;
		n >>= 1;
		a = (a * a) % MOD;
	}
	return res;
}

long long inverse_mod(long long a) {
	long long b = MOD, x = 1, u = 0;
	while (b != 0) {
		long long r = a % b, q = a / b;
		a = b; b = r;
		int nu = x - q*u;
		x = u; u = nu;
	}
	x %= MOD;
	if (x < 0) x += MOD;
	return x;
}

vector<pair<long long, int>> lcm(vector<pair<long long, int>> a, vector<pair<long long, int>> b) {
	vector<pair<long long, int>> v;
	int i = 0, j = 0;
	while (i < a.size() && j < b.size()) {
		if (a[i].first == b[j].first) {
			v.emplace_back(a[i].first, max(a[i].second, b[j].second));
			i++; j++;
		}
		else if (a[i].first < b[j].first) {
			v.push_back(a[i]);
			i++;
		}
		else {
			v.push_back(b[j]);
			j++;
		}
	}
	for (; i < a.size(); ++i) v.push_back(a[i]);
	for (; j < b.size(); ++j) v.push_back(b[j]);
	return v;
}

int main() {
	long long n;
	cin >> n;
	int m = 0;
	vector<int> A(n);
	for (int i = 0; i < n; i++) {
		cin >> A[i];
		m = max(A[i], m);
	}
	calc(m);
	vector<pair<long long, int>> lp;
	for (int i = 0; i < n; i++) {
		auto v = prime_factorization(A[i]);
		lp = lcm(lp, v);
	}
	long long l = 1;
	for (auto x : lp) l = mod(l * pow_mod(x.first, x.second));
	long long ans = 0;
	for (int i = 0; i < n; i++) {
		ans = mod(ans + l * inverse_mod(A[i]) % MOD);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 7912
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Diagnostics;
using System.Numerics;

public class Program
{
    public static void Main(string[] args)
    {
        string[] line = Console.ReadLine().Split(' ');

        int a = int.Parse(line[0]);
        int b = int.Parse(line[1]);

        bool yakusu = b % a == 0;

        Console.WriteLine(yakusu ? (a + b) : (b - a));
        Console.ReadLine();
    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
typedef long long ll;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ll a,b=0;
  cin>>a;
  rep(i,a){
    if(i%2==0){
      b++;
    }
  }
  cout<<float(b)/float(a);
  return 0;
}

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


using namespace std;
using ll = long long;

int id[100002];

int main()
{
	for (int i = 0; i < 100002; i++)
	{
		id[i] = 0;
	}
	int ans = 0;
	int N, M;
	int L[100000], R[100000];
	cin >> N >> M;
	for (int i = 0; i < M; i++)
	{
		cin >> L[i] >> R[i];
		id[L[i]]++;
		id[R[i] + 1]--;
	}
	for (int i = 0; i < N; i++)
	{
		id[i + 1] += id[i];
		if (id[i + 1] == M)
		{
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1408
#define __STDC_FORMAT_MACROS
#define p64 PRId64

#include <algorithm>
#include <cinttypes>
#include <cstdlib>
#include <cstdio>
#include <vector>

using namespace std;
using ll = int64_t;

int main()
{
    int N, K;
    if (scanf("%d%d", &N, &K) < 2) return 0;

    ll ans = 0;
    // a % b = K
    // b固定
    for (int i = 1; i <= N; i++)
    {
        // N = pb + r
        int p = N / i;
        int r = N % i;

        ll tmp = p * (i - min(i,K));
        int minus = 0;

        if (K == 0)
        {
            minus--;
        }

        tmp += r + 1 - min(r + 1, K);
        ans += tmp + minus;
    }

    printf("%" p64 "\n", ans);
    return 0;
}


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

using namespace std;

int n, ans, x[107];

int main()
{
    cin >> n;
    for (int i = 1; i <=  n; ++i) cin >> x[i];
    sort(x+1, x+n+1);
    ans = 1e9+7;
    for (int p = x[1]; p <= x[n]; ++p)
    {
        int sum = 0;
        for (int i = 1; i <= n; ++i)
            sum += (x[i] - p)*(x[i] - p);
        ans = min(ans, sum);
    }
    cout << ans;
    return 0;
}


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

int main(void) {
    int N;
    double sum = 0;
    double base;
    string kind;
    cin >> N;
    for(int i=0;i<N;i++) {
        cin >> base >> kind;
        if(kind == "JPY") {
            sum += base;
        } else {
            sum += (base * 380000);
        }
    }

    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main{

	Scanner sc=new Scanner(System.in);

	int INF=1<<28;
	double EPS=1e-9;

	int n, m;
	int[][] a;

	void run(){
		for(;;){
			n=sc.nextInt();
			m=sc.nextInt();
			if((n|m)==0){
				break;
			}
			a=new int[n][m];
			for(int j=0; j<n; j++){
				for(int i=0; i<m; i++){
					a[j][i]=sc.nextInt();
				}
			}
			solve();
		}
	}

	void solve(){
		// S0Éµ½¢
		int[][] b=new int[n][m];
		int ans=0;
		for(int k=0; k<1<<n; k++){
			for(int j=0; j<n; j++){
				for(int i=0; i<m; i++){
					b[j][i]=(k>>j&1)!=0?1-a[j][i]:a[j][i];
				}
			}
			int sum=0;
			for(int i=0; i<m; i++){
				int c=0;
				for(int j=0; j<n; j++){
					c+=b[j][i];
				}
				sum+=max(c, n-c);
			}
			ans=max(ans, sum);
		}
		println(ans+"");
	}

	void debug(Object... os){
		System.err.println(Arrays.deepToString(os));
	}

	void print(String s){
		System.out.print(s);
	}

	void println(String s){
		System.out.println(s);
	}

	public static void main(String[] args){
		// System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		new Main().run();
	}
}

Measured memory_bytes: 13000
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner((System.in));
		int x = sc.nextInt();
		int y = sc.nextInt();
		
		if (x == 2) {
			if (y == 2) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		} else if (x == 4 || x == 6 || x == 9 || x == 11) {
			if (y == 4 || y == 6 || y== 9 || y == 11) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		} else {
			if (y == 1 || y == 3 || y == 5 || y == 7 || y == 8 || y == 10 || y == 12) {
				System.out.println("Yes");
			} else {
				System.out.println("No");
			}
		}
		
		sc.close();
	}
}


Measured memory_bytes: 21332
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
using namespace std;
typedef long long ll;

int N,T;
int c[100],t[100];

int main(){
    cin>>N>>T;
    rep(i,N) cin>>c[i]>>t[i];

    int ans=100100;
    rep(i,N){
        if(t[i]<=T) ans=min(ans,c[i]);
    }

    if(ans==100100){
        cout<<"TLE"<<endl;
    }else{
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a,b,c,x,y;
    cin >> a >> b >>c;
    x = abs(b-a);
    y = abs(c-a);
    if(x>y){
        cout << "B" << endl;
    }
    else{
        cout << "A" << endl;
    }
}


Measured memory_bytes: 512
package main

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

var sc *bufio.Scanner

func init() {
	// 100MB
	bufsize := 100 * 1024 * 1024
	sc = bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, bufio.MaxScanTokenSize), bufsize)
	sc.Split(bufio.ScanWords)
}
func readInt() int              { return readIntArray(1)[0] }
func readInt2() (int, int)      { a := readIntArray(2); return a[0], a[1] }
func readInt3() (int, int, int) { a := readIntArray(3); return a[0], a[1], a[2] }
func readIntArray(n int) []int {
	s := readStringArray(n)
	a := make([]int, n)
	for i := range a {
		a[i], _ = strconv.Atoi(s[i])
	}
	return a
}
func readString() string            { return readStringArray(1)[0] }
func readString2() (string, string) { a := readStringArray(2); return a[0], a[1] }
func readStringArray(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		sc.Scan()
		a[i] = sc.Text()
	}
	return a
}
func max(ns ...int) int {
	max := ns[0]
	for _, n := range ns {
		if n > max {
			max = n
		}
	}
	return max
}
func min(ns ...int) int {
	min := ns[0]
	for _, n := range ns {
		if n < min {
			min = n
		}
	}
	return min
}
func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func main() {
	N := readInt()
	fmt.Println(math.Ceil(float64(N) / 2.0))
}


Measured memory_bytes: 640
#include <stdio.h>
int main (void) {
    int a, b, c;
    scanf("%d %d %d", &a, &b, &c);
    if ((a == b && a != c) || (b == c && b != a) || (c == a && c != b)) {
        puts("Yes");
    } else {
        puts("No");
    }
}


Measured memory_bytes: 128
w=str(input())
alphabet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
beautiful = True
for i in alphabet:
    if w.count(i)%2==1:
        beautiful = False
        break
if beautiful:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()

using namespace std;

int N,A,B;
vector<int> E[101010];
int D[101010][2];

void dfs(int cur,int pre,int d,int id) {
	D[cur][id]=d;
	for(int e : E[cur]) if(e!=pre) dfs(e,cur,d+1,id);
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>A>>B;
	A--,B--;
	rep(i,N-1) {
		cin>>x>>y;
		E[x-1].push_back(y-1);
		E[y-1].push_back(x-1);
	}
	dfs(A,A,0,0);
	dfs(B,B,0,1);
	
	int ma=0;
	rep(i,N) if(D[i][0]<D[i][1]) ma=max(ma,D[i][1]-1);
	cout<<ma<<endl;
	
}

int main(){
    solve();
    return 0;
}

Measured memory_bytes: 11648
package main

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

func main() {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Split(bufio.ScanWords)

	scanner.Scan()
	n, _ := strconv.Atoi(scanner.Text())

	b := 0
	for i := 0; i < n; i++ {
		scanner.Scan()
		a, _ := strconv.Atoi(scanner.Text())
		if a == b+1 {
			b++
		}
	}
	if b > 0 {
		fmt.Println(n - b)
	} else {
		fmt.Println(-1)
	}
}


Measured memory_bytes: 2176
def minkowski_distance(n, x, y, p):
    if p == float('inf'):
        distance = max([abs(x[i] - y[i]) for i in range(n)])
    else:
        distance = sum([abs(x[i] - y[i]) ** p for i in range(n)]) ** (1 / p)
    return distance

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

f_inf = float('inf')
print(minkowski_distance(n, x, y, 1))
print(minkowski_distance(n, x, y, 2))
print(minkowski_distance(n, x, y, 3))
print(minkowski_distance(n, x, y, f_inf))



Measured memory_bytes: 5652
#include<bits/stdc++.h>
using namespace std;
 
int main()
{
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  if ((a+b)>(c+d)) cout << "Left" <<endl;
  else if((a+b)==(c+d)) cout << "Balanced"<<endl;
  else if((a+b)<(c+d)) cout << "Right" <<endl;
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;

int main() {
    int H, W, K; cin >> H >> W >> K;
    vector<string> str(H), str_copy(H);
    for (int i = 0; i < H; i++) {
        cin>>str.at(i);
    }
    int counter = 0, answer = 0;
    for (int bit1=0; bit1 < (1 << H); bit1++) {
        for (int bit2=0; bit2 < (1 << W); bit2++) {
            counter = 0;
            str_copy = str;
            for (int i = 0; i < H; i++) {
                for (int j = 0; j < W; j++) {
                    if((bit1&(1<<i))||(bit2&(1<<j)))str_copy.at(i).at(j)='R';
                }
            }
            for (int i = 0; i < H; i++) {
                for (int j = 0; j < W; j++) {
                    if (str_copy.at(i).at(j) == '#')counter++;
                }
            }
            if (counter == K)answer++;
        }
    }
    cout << answer << endl;
     return 0;
}

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

enum {
  null = 0,
  one_pair = 1,
  two_pair = 2,
  three_card = 3,
  four_card = 4,
  full_house = 5,
  straight = 6,
};

int main(void) {
  int card[5];
  int pattern;
  
  while(scanf("%d,%d,%d,%d,%d", &card[0],&card[1],&card[2],&card[3],&card[4]) != EOF) {
    sort(card, card + 5);
    
    pattern = null;
    
    // ストレート
    bool check = true;
    for(int i = 0; i < 4; ++i) {
      if(card[i + 1] != card[i] + 1) {
        check = false;
      }
    }
    if(card[0] == 1 && card[1] == 10 && card[2] == 11 && card[3] == 12 && card[4] == 13) {
      check = true;
    }
    if(check) {
      pattern = straight;
    }
    
    // ワンペア・ツーペア
    int count = 0;
    for(int i = 0; i < 4; ++i) {
      if(card[i] == card[i + 1]) {
        ++count;
      }
    }
    if(count == 1) {
      pattern = one_pair;
    }
    if(count == 2) {
      pattern = two_pair;
    }
    
    // スリーカード
    if(card[0] == card[2] || card[1] == card[3] || card[2] == card[4]) {
      pattern = three_card;
    }
    
    // フォーカード
    if(card[0] == card[3] || card[1] == card[4]) {
      pattern = four_card;
    }
    
    // フルハウス
    if((card[0] == card[1] && card[2] == card[4]) || (card[0] == card[2] && card[3] == card[4])) {
      pattern = full_house;
    }
    switch(pattern) {
      case null       : cout << "null" << endl;         break;
      case one_pair   : cout << "one pair" << endl;     break;
      case two_pair   : cout << "two pair" << endl;     break;
      case three_card : cout << "three card" << endl;   break;
      case four_card  : cout << "four card" << endl;    break;
      case full_house : cout << "full house" << endl;   break;
      case straight   : cout << "straight" << endl;     break;
    }
  }
  return 0;
}


Measured memory_bytes: 3124
# ABC 152 B
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
snm = lambda: map(str, input().split())
nl = lambda: list(map(int, input().split()))
a,b=nm()
s=''
t=''
for i in range(b):
    s+=str(a)

for i in range(a):
    t+=str(b)

l=[]
l.append(s)
l.append(t)
l.sort()
print(l[0])


Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
using namespace std;


int main() {
	long long int four=0,odd=0,two=0,a=0, b=0, c, d, n, res = 0, m, tmp = 1,y, q, sum[200000] = {}, x[200000] = {}, v[200000] = {};
	string str[1000];
	cin >> n>>y;
	y /= 1000;
	
	for (int i = 0; i <= n; i++) {
		for (int j = 0; j+i <= n; j++) {

			if (i + 5 * j + 10 * (n - i - j) == y) {
				cout << n - i - j << " " << j << " " << i;
				return 0;
			}

		}
	}
	cout << "-1 -1 -1";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcount
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define df(x) int x = in()
#define dame { puts("-1"); return 0;}
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,vector<T>,greater<T> >
#define bn(x) ((1<<x)-1)
#define newline puts("")
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
inline void priv(vi a) { rep(i,sz(a)) printf("%d%c",a[i],i==sz(a)-1?'\n':' ');}
template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const vector<T>&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,const vector<T>&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
const int MX = 200005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;



int main() {
  int n;
  scanf("%d",&n);
  vl dp(n+1);
  dp[0] = 2;
  dp[1] = 1;
  rrep(i,n) {
    if (i >= 2) {
      dp[i] = dp[i-1]+dp[i-2];
    }
  }
  cout<<dp[n]<<endl;
  return 0;
}






















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

int main() {
	string S; cin >> S;
	int f=0;
	for(int i=0; i<4; ++i){
	    if(S[i]=='+') ++f;
	    else --f;
	}
	cout << f << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<cmath>
#include<ciso646>
#include<cstring>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<utility>



using ll = long long;


using namespace std;

int main()
{/*12日目*/
	int n; cin >> n;
	vector<int> pp(n);
	int co = 1;
	for (int i = 0;i < n;i++) {
		cin >> pp[i];
		}
	for (int i = 1;i < n;i++) {
		if (pp[i - 1] < pp[i])
			pp[i] = pp[i - 1];
		else
			co++;
	}cout << co;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    vector<int> p(N), q(N), order(N);

    for (int i = 0; i < N; i++)
    {
        cin >> p[i];
    }
    for (int i = 0; i < N; i++)
    {
        cin >> q[i];
    }
    order = q;
    sort(order.begin(), order.end());
    
    int cnt = 1;
    int a, b;
    do
    {
        if(order == p) a = cnt;
        if(order == q) b = cnt;
        cnt++;
    } while (next_permutation(order.begin(), order.end()));

    cout << abs(a-b) << endl;
    
}

Measured memory_bytes: 256
N=int(input())
D=list(map(int,input().split()))
D.sort()
M=int(input())
T=list(map(int,input().split()))
T.sort()

i=0
for j in range(M):
    while(D[i]<T[j] and i<N):
        i+=1
        if i==N:
            break
    if i==N:
        print("NO")
        break
    elif D[i]>T[j]:
        print("NO")
        break
    else:
        i+=1
else:
    print("YES")

Measured memory_bytes: 35116
import sys
readline = sys.stdin.readline

N = int(input())
A = list(map(int, input().split()))
A = [0] + A + [0]
s = 0
for i in range(1, N + 2):
    s += abs(A[i] - A[i - 1])
for i in range(1, N + 1):
    ans = - abs(A[i] - A[i - 1]) - abs(A[i + 1] - A[i]) + abs(A[i + 1] - A[i - 1])
    print(s + ans)


Measured memory_bytes: 14176
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		long n=scan.nextLong();
		for(long i=n;;i--) {
			if(Math.sqrt((double)i) ==(int)Math.sqrt((double)i)) {
				System.out.println(i);
				break;
			}
		}
	}

}


Measured memory_bytes: 23764
#include<iostream>
#include<vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <limits>
#include <map>
#include <bitset>

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

using namespace std;
using p = pair<int, int>;
using ll = long long;

vector< vector<int> > memo;

int gcd(int a, int b, int c) {
	int min_num = (a > b) ? b : a;
	if (min_num > c) min_num = c;
	while (min_num != 1) {
		if (a % min_num == 0 && b % min_num == 0 && c % min_num == 0) break;
		min_num--;
	}
	return min_num;
}

int gcd(int a, int b) {
	int m = (a < b) ? a : b;
	while (m != 1) {
		if (a % m == 0 && b % m == 0)break;
		m--;
	}
	return m;
}

int main() {
	int n, m;
	cin >> n >> m;
	int ans = 0;
	rep(i, m) {
		int tmp = 0;
		cin >> tmp;
		ans += tmp;
	}
	if (ans > n) cout << -1 << endl;
	else cout << n - ans << endl;

	return 0;
}


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

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		int [] a = new int[n+1]; //それぞれの料理の配列
		int [] b = new int[n+1]; //それぞれの料理の満足度
		int [] c = new int[n-1]; //追加で得られる満足度
		
		
		for(int i = 0; i < n; i++) {
			a[i] = stdIn.nextInt();
		}
		
		for(int i = 0; i < n; i++) {
			b[i] = stdIn.nextInt();
		}
		
		for(int i = 0; i < c.length; i++) {
			c[i] = stdIn.nextInt();
		}
		
		int sum = 0;  //ここから満足度の合計を出す
		
		for(int i = 0; i < n; i++) {
			sum+=b[i];
			if(a[i+1]-a[i]==1) {
				sum+= c[a[i]-1];
			}
			
		}
		
		System.out.println(sum);
		
		
		
	}

}


Measured memory_bytes: 21844
#include <iostream>
#include <vector>

using namespace std;

int main(){
    int n, k, q;
    cin >> n >> k >> q;
    vector<int> a(q);
    vector<int> score(n, 0);

    int winner = 0;
    for(int i = 0; i < q; i++){
        cin >> winner;
        // for(int j = 0; j < n; j++){
        //     if((j + 1) != winner){
        //         score[j] -= 1;
        //     }
        // }
        score[winner - 1] += 1;
        // for(int i = 0; i < n; i++){
        //     printf("ff::%d\n", score[i]);
        // }
    }

    for(int i = 0; i < n; i++){
        //printf("%d:", score[i]) ;
        if(score[i]  > q - k){
            cout << "Yes" << endl;
        } else
        {
            cout << "No" << endl;
        }
        
    }
}

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

using namespace std;

int main()
{

	int N, k=0;

	cin >> N;

	int p[N];

	for(int i=0;i!=N;i++)
	{
		cin >> p[i];
	}

	for(int i=0; i!=N; i++)
	{
		if(p[i] == i+1){swap(p[i], p[i+1]); k++;}
	}


	cout << k <<endl;

}

Measured memory_bytes: 640
#include <stdio.h>
int main(void)
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a%3==0 || b%3==0 || (a+b)%3==0)
    {
        printf("Possible");
    }
    else
    {
        printf("Impossible");
    }
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int N;
int main() {
	cin >> N;
	int A[N];
	for (int i = 0; i < N; i ++) {
		cin >> A[i];
	}
	for (int i = 0; ; i ++) {
		for (int j = 0; j < N; j ++) {
			if (A[j] % 2 == 1) {
				cout << i << endl;
				return 0;
			} 
			A[j] /= 2;
		}
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
#define REP_R(i, n) for (int i = (int)(n) - 1; (i) >= 0; -- (i))
#define REP3R(i, m, n) for (int i = (int)(n) - 1; (i) >= (int)(m); -- (i))
#define ALL(x) ::std::begin(x), ::std::end(x)
using namespace std;
const long long INF = numeric_limits<long long>::max();
typedef long long ll;


int64_t solve(int64_t a, int64_t b, int64_t c, int64_t d) {
    return max(max(max(a * c, a * d), b * c), b * d);
}

// generated by online-judge-template-generator v4.6.0 (https://github.com/kmyk/online-judge-template-generator)
int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    constexpr char endl = '\n';
    int64_t a, b, c, d;
    cin >> a >> b >> c >> d;
    auto ans = solve(a, b, c, d);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
const int INT_INF = 1 << 30;
#define MOD 1000000007LL
#define endl "\n"

ll ncr(ll n, ll r){
  if(n < r) return 0;
  if(r > n-r) r = n-r;

  ll a = 1, b = 1;
  for(int i = 0; i < r; i++){
    a *= (n - i);
  }
  for(int i = 0; i < r; i++){
    b *= (i + 1);
  }
  return a/b;
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll N;
  cin >> N;
  vll A(N);
  vll sum(N+1, 0);
  map<ll, ll> ma;
  ma[0] = 1LL;
  for(int i = 0; i < N; i++){
    cin >> A.at(i);
    sum.at(i+1) = sum.at(i) + A.at(i);
    if(!ma.count(sum.at(i+1))) ma[sum.at(i+1)] = 1LL;
    else ma.at(sum.at(i+1))++;
  }
  
  ll ans = 0LL;
  for(auto i = ma.begin(); i != ma.end() ; i++){
    ll num = i -> second;
    ans += ncr(num, 2);
  }
  cout << ans << endl;
}

Measured memory_bytes: 15872
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner scan = new Scanner(System.in);
		int count = scan.nextInt();
		int strlenge = scan.nextInt();
		
		String[] output = new String[count];
		for(int i = 0; i < count; i++) {
			 output[i] = scan.next();
		}
		Arrays.sort(output);
		for(int i = 0; i < count; i++) {
			 System.out.print(output[i]);
		}
		scan.close();
	}
}

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

typedef long long ll;

#define MOD 1000000007
#define INF LLONG_MAX
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define irep(it, arr) for(auto it = begin(arr); it != end(arr); it++)

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

int main(){

    string S, T;
    ll ans = 0;

    cin >> S >> T;

    rep(i, 3){
        if(S[i] == T[i])
            ans++;
    }

    cout << ans << endl;

    return 0;
}

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

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

    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));
        }

        public void Solve(ConsoleInput cin)
        {
            var s = cin.Read;
            var rightStr = s.Substring(s.Length - 1);

            if (new string[] { "2", "4", "5", "7", "9" }.Contains(rightStr))
            {
                WriteLine("hon");
            }
            else if (new string[] { "0", "1", "6", "8" }.Contains(rightStr))
            {
                WriteLine("pon");
            }
            else
            {
                WriteLine("bon");
            }
        }
    }
}

Measured memory_bytes: 26676
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
#include <functional>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define EB emplace_back
#define GREATER(T) T, VT<T> greater<T>
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

const int MAX = 1e5 + 10;
int N, M;
string S;
int r[MAX];

int main(void) {
    cin >> N >> M;
    cin >> S;

    {
        int pre = N + 1;
        RREP(i, N + 1) {
            if (S[i] == '0') {
                if (pre - i > M) {
                    cout << -1 << endl;
                    return 0;
                }
                pre = i;
            }
            r[i] = pre;
        }
    }

    VI ans;
    int cur = N;
    while (cur > 0) {
        if (cur <= M) {
            ans.EB(cur);
            cur = 0;
        } else {

            const int target = cur - M;
            if (S[target] == '0') {
                ans.EB(M);
                cur = target;
            } else {
                ans.EB(cur - r[target]);
                cur = r[target];
            }

        }
    }

    REVERSE(ans);
    REP(i, ans.size()) {
        printf("%d%c", ans[i], (i + 1 == (int)ans.size() ? '\n' : ' '));
    }
}


Measured memory_bytes: 1528
#include <iostream>

int main(){
    int a,b,c,total,i,j;

    total=0;

    std::cin >> a >> b >> c;

        for(i=a;i<=b;i++){
            if(c%i==0){
                total = total +1;
            }
            else{
                continue;
            }
        }

    std::cout<<total<<std::endl;

    return 0;

}



Measured memory_bytes: 3120
# coding: utf-8
N = int(input().rstrip())
A = [[0 for _ in range(N)] for _ in range(N)]
for i in range(N):
    line = [int(i) for i in input().rstrip().split()]
    for j in range(line[1]):
        A[line[0]-1][line[j+2]-1] = 1

for i in range(N):
    for j in range(N):
        print(A[i][j],end="")
        if j == N-1:
            print()
        else:
            print(" ",end="")



Measured memory_bytes: 7092
#include <stdio.h>
# include <string.h>
int main(){
	char palavra[101];

	//printf("%d\n", a);
	scanf("%s",palavra);
	int a = strlen(palavra);
	for(int i= 0;i<a;++i){
		palavra[i]='x';
		
		
	}
	
	printf("%s\n",palavra);
	
	
	
	return 0;
	
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
#define forn(i,n) for(int i=0;i<(int)(n);i++)
#define si(c) ((int)(c).size())
#define forsn(i,s,n) for(int i = (int)(s); i<((int)n); i++)
#define dforsn(i,s,n) for(int i = (int)(n)-1; i>=((int)s); i--)
#define all(c) (c).begin(), (c).end()
#define D(a) cerr << #a << "=" << a << endl;
#define pb push_back
#define eb emplace_back
#define mp make_pair
 
typedef long long int ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());


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

    int n,k; cin >> n >> k;
    vi a(n);
    for (auto &x : a) cin >> x;
    forn(iter,k) {
        vi na(n+1);
        forn(i,n) {
            int l = max(0, i - a[i]);
            int r = min(n-1, i+a[i]);
            na[l]++;
            na[r+1]--;
        }
        bool done = true;
        forn(i,n) {
            a[i] = na[i];
            done &= a[i] == n;
            na[i+1] += na[i];
        }
        if (done) break;
    }
    for (auto x : a) cout << x << ' '; cout << endl;

    return 0;
}


Measured memory_bytes: 4976