akhauriyash/Code-Regression huggingface dataset:
//============================================================================
// Name        : ATcoder.cpp
// Author      : Akari Fujii
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cctype>
#include <string>
#include<algorithm>
using namespace std;
typedef long long ll;
int main() {

	string o,e;
	int d=0;
	cin>>o;
	cin>>e;
	if(e.size()==o.size()){
	for(int i=0; i<e.size(); ++i){
		cout<<o[i]<<e[i];

	}

	}else{
		for(int i=0; i<e.size(); ++i){
			cout<<o[i]<<e[i];
		}
		for(int i=0; i<o.size(); ++i){
			d++;
		}
		cout<<o[d-1]<<endl;
		}

	return 0;
}


Measured memory_bytes: 256
//सत्यान्न प्रमदितव्यम्  ||
//Still, Taking my time to perfect the beats
//And I still got love for the streets, it's the A-D-D-U

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define nt _int128
#define fir first
#define sec second
#define fast_as_levi ios_base::sync_with_stdio(false) , cin.tie(NULL);
#define debug(x) cout<<x<<"\n";
#define debugged cout<<"debugged\n";
#define inf 0x3f3f3f3f
#define LINF  0x3f3f3f3f3f3f3f3fll
#define rall(v) v.rbegin(),v.rend()
#define all(v) v.begin(),v.end() 

const ll mod = 999983;
#define mx 1000005
const ll mxi = 10005;

int main()
{
    fast_as_levi;
    ll x;
    cin>>x;
    for(int i=-1000;i<=1000;i++)
    {
        for(int j=-1000;j<=1000;j++)
        {
            ll z = pow(i,5) - pow(j,5); 
            if(z==x)
            {
                // cout<<pow(i,5)<<" "<<pow(j,5)<<" "<<x<<"\n";
                return cout<<i<<" "<<j , 0 ;
            }
        }
    }
}

Measured memory_bytes: 4104
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;
typedef long double lb;
#define int long long
#define double long double
#define endn "\n"
typedef pair<int,int> P;
template<class T> inline bool chmin(T& a, T b){if(a>b){a = b;return 1;}return 0;}
template<class T> inline bool chmax(T& a, T b){if(a<b){a = b;return 1;}return 0;}
const int MOD = 1000000007;
//const int MOD = 998244353;
template<class T> inline int add(T& a, T b, T M = MOD){a=(a+M)%M;b=(b+M)%M;a=(a+b)%M;return a;};
template<class T> inline int mul(T& a, T b, T M = MOD){if(a>=M)a%=M;if(b>=M)b%=M;a*=b;if(a>=M)a%=M;return a;};
const ll INF = 1e16;
const double EPS = 1e-10;
const double PI = 3.141592653589793;
const string abc="abcdefghijklmnopqrstuvwxyz";
const string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 

////////////////////////////////////////////////////////////////////
///////////////////////___modpow___////////////////////
ll modpow(ll a,  ll n, const ll &MOD = MOD){
  ll ret = n == 0 ? 1 : modpow(a, n/2, MOD);
  (ret *= ret) %= MOD;
  if(n%2)((ret *= a) %= MOD);
  return ret;
}
///////////////////////___modinv___////////////////////
ll modinv(ll d, const ll &MOD = MOD){
  return modpow(d, MOD-2, MOD);
}
////////////////////////////////////////////////////////////////////

int n,a[110000];
vector<P> b;
map<int,int> cnt, sum;
int ans[110000];P p[110000];
signed main(){
  cin>>n;rep(i,n)cin>>a[i];
  b.push_back(P(0,-1)); b.push_back(P(0,-1));int last = 0;
  rep(i,n)if(last < a[i]){
    b.push_back(P(a[i], i));
    last = a[i];
  }
  sort(a,a+n);
  int s = 0;
  rep(i,n){
    if(i > 0 && a[i] != a[i-1] || i == 0)cnt[a[i]] = i;
    if(i > 0 && a[i] != a[i-1] || i == 0)sum[a[i]] = s;
    s += a[i];
  }
  repd(i,2,b.size()){
    int num = b[i].first, ind = b[i].second, pnum = b[i-1].first;
    ans[ind] = (n-cnt[num])*(num-pnum);
    //cout << i << " " << ans[ind] << endl;
    ans[ind] += (sum[num] - sum[pnum])-pnum*(cnt[num]-cnt[pnum]);
  }
  rep(i,n){
    cout << ans[i] << endl;
  }
}



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

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

int main()
{
    int n, x;
    int cnt = 0;

    while (1)
    {
        cin >> n >> x;
        if (n == 0 && x == 0)
        {
            break;
        }

        for (int i = 1; i <= n; ++i)
        {
            for (int j = i + 1; j <= n; j++)
            {
                for (int k = j + 1; k <= n; k++)
                {
                    if (i + j + k == x)
                    {
                        ++cnt;
                    }
                }
            }
        }
        cout << cnt << endl;
        cnt = 0;
    }
    return 0;
}


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

using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define reps(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define allsort(v) sort(v.begin(),v.end())
#define allsortg(v)sort(v.begin(),v.end(),greater<int>());
const ll mod = 1e9 + 7;
const int INF = 1e9;

//拡張ユークリッド
//ax+by=1となるx,y
ll extgcd(int a, int b, int&x, int& y) {
	int d = a;
	if (b != 0) {
		d = extgcd(b, a%b, y, x);
		y -= (a / b)*x;
	}
	else {
		x = 1; y = 0;
	}
	return d;
}

//逆元
ll mod_inverse(int a, int m) {
	int x, y;
	extgcd(a, m, x, y);
	return (m + x%m) % m;
}

//n!=a p^eとしたときのa mod p
ll fact[200001]; //n! mod pのテーブルO(p)
ll mod_fact(int n, int p, int& e) {
	e = 0;
	if (n == 0)return 1;
	//pの倍数部分
	ll res = mod_fact(n / p, p, e);
	e += n / p;
	if (n / p % 2 != 0)return res*(p - fact[n%p]) % p;
	return res*fact[n%p] % p;
}

//nCk mod p O(log_p n)
ll mod_comb(int n, int k, int p) {
	if (n<0 || k<0 || n<k)return 0;
	int e1, e2, e3;
	ll a1 = mod_fact(n, p, e1), a2 = mod_fact(k, p, e2), a3 = mod_fact(n - k, p, e3);
	if (e1>e2 + e3)return 0;
	return a1*mod_inverse(a2*a3%p, p) % p;
}


int main() {
	cin.sync_with_stdio(false);
	int H, W, A, B;
	cin >> H >> W >> A >> B;
	ll k = 1;
	rep(i, H + W + 1) {
		if (i == 0)fact[i] = 1;
		else {
			k *= i;
			fact[i] = k%mod;
			k %= mod;
		}
	}
	ll ans = 0;
	rep(i,H - A) {
		ans += mod_comb(B - 1 + i, B - 1, mod)*mod_comb(W - 1 - B + H - 1 - i, W - 1 - B, mod);
		ans %= mod;
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1792
#include <cstdio>
#include <algorithm>
#define maxn 1000010
using namespace std;
char s[maxn];
struct node{
	int l,r;
}a[maxn];
int tot;
int cmp(node a,node b){
	return a.l-a.r>b.l-b.r;
}
int main(){
	int n,i,j,l,r,ln,rn;
	ln=rn=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		l=r=0;
		scanf("%s",s+1);
		for(j=1;s[j];j++){
			if(s[j]=='(')l++;
			else if(s[j]==')'){
				if(l)l--;
				else r++;
			}
		}
		if(l&&!r)ln+=l;
		else if(!l&&r)rn+=r;
		else if(l&&r) a[++tot]=(node){l,r};
	}
	sort(a+1,a+1+tot,cmp);
	for(i=1;i<=tot;i++)
		if(ln<a[i].r)return printf("No\n"),0;
		else ln-=a[i].r,ln+=a[i].l;
	if(ln!=rn)return printf("No\n"),0;
	printf("Yes\n");
	return 0;
}

Measured memory_bytes: 3220
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderA
{
    static void Main()
    {
        var sc = new Scanner();

        int n = sc.NextInt();
        int x = sc.NextInt();

        int[] m = new int[n];
        for (int i = 0; i < n; i++)
        {
            m[i] = sc.NextInt();
        }

        int answer = n;
        x = x - m.Sum();
        answer += x / m.Min();

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

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

int main(){
  int W,H,x,y;
  cin >> W >> H >> x >> y;
  double area=(double)W*H/2;
  double gx=(double)W/2;
  double gy=(double)H/2;
  if(gx==x && gy==y) cout << fixed << setprecision(6) << area << " " << 1 <<endl;
  else  cout << fixed << setprecision(6) << area << " " << 0 <<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int N=1e5+10;
#define ll long long
#define mem(x) memset(x,0,sizeof(x))
#define sca(x) scanf("%d",&x)
#define scall(x) scanf("%lld",&x)
int main()
{
	int x;cin>>x;
	if(x>=400&&x<=599)
	cout<<8<<endl;
	else if(x>=600&&x<=799)
	cout<<7<<endl;
	else if(x>=800&&x<=999)
	cout<<6<<endl;
	else if(x>=1000&&x<=1199)
	cout<<5<<endl;
	else if(x>=1200&&x<=1399)
	cout<<4<<endl;
	else if(x>=1400&&x<=1599)
	cout<<3<<endl;
	else if(x>=1600&&x<=1799)
	cout<<2<<endl;
	else if(x>=1800&&x<=1999)
	cout<<1<<endl;
}

Measured memory_bytes: 3628
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <limits>
#include <fstream>
using namespace std;
typedef long long ll;
#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = (A); I < (B); ++I)
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //ai>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //ai>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define REV(x) (reverse(x.begin(),x.end())) //reverse
#define TO(x,t,f) ((x)?(t):(f))
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define FILV(x,a) fill(x.begin(),x.end(),a)
#define FILA(ar,N,a) fill(ar,ar+N,a)
#define NEXTP(x) next_permutation(x.begin(),x.end())
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(a%b==0)return b;return gcd(b,a%b);}
ll lcm(ll a,ll b){ll c=gcd(a,b);return ((a/c)*(b/c)*c);}//saisyo kobaisu
#define pb push_back
#define pri(aa) cout<<(aa)<<endl
#define mp(x,y) make_pair(x,y)
#define fi first
#define se second
const ll INF=1e18+7;
const ll MOD=1e9+7;


int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll N,T,A;
	cin >> N >> T >> A;
	vector<ll> H(N);
	FOR(i,0,N)cin>>H[i];
	double ans=10000000;
	ll ansi;
	FOR(i,0,N){
		double t = double(T)-0.006*H[i];
		if(abs((double)A-t)<ans){
			ans = abs((double)A-t);
			ansi = i;
		}
	}
	cout << ansi+1 << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
string s;cin>>s;
  int n=s.size();
  if(n%2!=0)cout<<"No";
  else
  {int f=0;
    for(int i=0;i<n;i+=2)
  {
   if(s[i]=='h' && s[i+1]=='i')continue;
    else{f++;break;}
  }
   if(f==0)cout<<"Yes";
   else cout<<"No";
  }
  return 0;
}


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

int main() {
    long long A, V, B, W, T;
    cin >> A >> V >> B >> W >> T;
    if (abs(A - B) <= (V - W) * T) {
        cout << "YES" << endl;
    }
    else {
        cout << "NO" << endl;
    }
}

Measured memory_bytes: 3636
N, M = map(int, input().split())
cnt = 0
ls = [0]
for i in range(1, 110):
    ls.append(ls[i - 1] + i)
if N == 0:
    N +=1
if M == 0:
    M += 1

print(ls[N-1] + ls[M-1])

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

public class Main {
    static StringTokenizer st;
    static BufferedReader br;  
    static PrintWriter out;
 
    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));
        
        int X = nextInt();
        int Y = nextInt();
        int Z = nextInt();

        System.out.println(Z + " " + X + " " + Y);

    }
    
      
    public static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
    public static long nextLong() throws IOException {
        return Long.parseLong(next());
    }

    public static double nextDouble() throws IOException {
        return Double.parseDouble(next());
    }

    static String next() throws IOException {
        while (st == null || !st.hasMoreTokens())
            st = new StringTokenizer(br.readLine().trim());
        return st.nextToken();
    }
}

Measured memory_bytes: 36928
n, t=gets.split.map(&:to_i)
a=gets.split.map(&:to_i)

s=0
tt=0
a.each do |e|
  if e<tt
    s+=(e-tt)+t
    tt=e+t
  elsif e==tt
    s+=t
    tt+=t
  else
    s+=t
    tt=e+t
  end
end

puts s


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

using namespace std;

#define sqr(a) ((a)*(a))
#define all(a) (a).begin(), (a).end()

const long long MOD = (int) 1e9 + 7;

long long binPow(long long a, long long b) {
    if (b == 0)
        return 1;

    long long ans = binPow(a, b / 2);
    ans = ans * ans % MOD;

    if (b % 2)
        ans = ans * a % MOD;

    return ans;
}

int main() {
//    freopen("input.txt", "r", stdin);
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    string a;
    cin >> a;

    if (a == "SUN") {
        cout << 7 << "\n";
    }
    if (a == "MON") {
        cout << 6 << "\n";
    }
    if (a == "TUE") {
        cout << 5 << "\n";
    }
    if (a == "WED") {
        cout << 4 << "\n";
    }
    if (a == "THU") {
        cout << 3 << "\n";
    }
    if (a == "FRI") {
        cout << 2 << "\n";
    }
    if (a == "SAT") {
        cout << 1 << "\n";
    }
}


Measured memory_bytes: 768
import java.util.Scanner;

object Main {

  def main(args: Array[String]): Unit = {
    val scan: Scanner = new Scanner(System.in)

    val wordA = scan.next()
    val wordB = scan.next()
    val wordC: String = scan.next()


    val lastWordWordA = wordA.charAt(wordA.length() - 1)
    val firstWordWordB = wordB.charAt(0)

    val lastWordWordB = wordB.charAt(wordB.length() - 1)
    val firstWordWordC = wordC.charAt(0)

    if (lastWordWordA == firstWordWordB && lastWordWordB == firstWordWordC) {
      println("YES")
    } else {
      println("NO")
    }
  }
}

Measured memory_bytes: 25624
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;

typedef long long LL;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for (int i = N; i >= 0; i--)

template<typename Container>
bool include(const Container& c, const typename Container::value_type& v) {
  return ( c.end() != std::find(c.begin(),c.end(),v) );
}

template<class T>
vector<T> unique_vec(const vector<T> &v) {
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  return v;
}

int main() {
  int L, R, d;
  cin >> L >> R >> d;

  int cnt = 0;
  for (int i = L; i <= R; i++) {
    if (i % d == 0) {
      cnt++;
    }
  }

  cout << cnt << endl;

  return 0;
}


Measured memory_bytes: 3632
#include<stdio.h>

int main(void){
    int num;
    int sum = 0;
    scanf("%d",&num);
    int tako[num];

    for(int i = 0; i < num; i++){
        scanf("%d",&tako[i]);
    }

    for(int j = 0; j < num-1; j++){
        for(int k = j+1; k < num ; k++){
            sum+=tako[j]*tako[k];
        }
    }
    printf("%d",sum);

    return 0;
}

Measured memory_bytes: 128
//============================================================================
// Name        : CompleteBinaryTree.cpp
// Author      : Ken
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <vector>
using namespace std;

class BinaryHeap{
private:
	vector<int> contents;

public:
	BinaryHeap(){}

	void insert(int elem){
		contents.push_back(elem);

		int i = contents.size() - 1;

		while(i > 0){
			int j = (i+1)/2 - 1;
			if(contents.at(i) > contents.at(j)){
				swap(i, j);
				i = j;
			}else{
				break;
			}
		}
	}

	void swap(int i, int j){
		int tmp = contents.at(i);
		contents.at(i) = contents.at(j);
		contents.at(j) = tmp;
	}

	void writeHeap(){
		for(int i=0; i<contents.size(); i++){
			cout << " " << contents.at(i);
		}
		cout << "\n";
	}

	void maxHeapify(int i){
		int l = i * 2 + 1;
		int r = i * 2 + 2;
		int largest = -1;
		if(l < contents.size() and contents.at(l) > contents.at(i)){
			largest = l;
		}else{
			largest = i;
		}

		if(r < contents.size() and contents.at(r) > contents.at(largest)){
			largest = r;
		}

		if(largest != i){
			int tmp = contents.at(i);
			contents.at(i) = contents.at(largest);
			contents.at(largest) = tmp;
			maxHeapify(largest);
		}
	}

	void buildMaxHeap(){
		for(int i = (contents.size()+1)/2 - 1; i>=0; i--){
			maxHeapify(i);
		}
	}

	int extract(){
		int max = contents.at(0);
		contents.at(0) = contents.at(contents.size()-1);
		contents.pop_back();
		maxHeapify(0);

		return max;
	}

	/***
	void writeContent(int index){
		cout << "node " << index+1 << ": key = " << contents.at(index) << ", ";

		int parent_index = (index+1)/2 - 1;
		int left_index = (index+1) * 2 - 1;
		int right_index = (index+1) * 2;
		if(parent_index >= 0){
			cout << "parent key = " << contents.at(parent_index) << ", ";
		}
		if(left_index < contents.size()){
			cout << "left key = " << contents.at(left_index) << ", ";
		}
		if(right_index < contents.size()){
			cout << "right key = " << contents.at(right_index) << ", ";
		}
		cout << "\n";
	}
	***/

};

int main() {
	string order;
	int input;
	BinaryHeap bh;

	while(true){
		cin >> order;

		if(order == "insert"){
			cin >> input;
		    bh.insert(input);
		    //bh.writeHeap();
		}else if(order == "extract"){
			int max = bh.extract();
			cout << max << "\n";
			//bh.writeHeap();
		}else if(order == "end"){
			break;
		}
	}
}



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

#define ll long long
#define ull unsigned ll

#define vi vector <int>
#define ii pair <int, int>
#define vii vector <ii>
#define vll vector <ll>
#define vull vector <ull>
#define INFL 9e18
#define INF 2e9
#define EPS 1e-9
#define pb push_back
#define emp emplace_back
#define PI acos(-1.0)
#define endl "\n"
#define mp make_pair
#define mod 1000003
#define DEBUG 0




int main ()

{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int n, r;
    cin >> n >> r;
    
    if (n >= 10)
    {
        cout << r << endl;
        return 0;
    }
    
    else
    {
        cout << r + 1000 - 100*n << endl;
        return 0;
    }

    
}

Measured memory_bytes: 256
#include <vector>
#include <array>
#include <algorithm>
#include <iostream>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include <math.h>
#include <assert.h>
#include <queue>
#include <deque>
#include <iomanip>
#include <numeric>
#include <fstream>

using namespace std;

typedef long long ll;
typedef long double ld;

#define fi first
#define se second

#define mp make_pair
#define pb push_back
#define sz(x) ((int)(x).size())

typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<ld> vld;
typedef vector<vector<int>> vvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<ld>> vvd;
typedef vector<string> vs;
typedef vector<bool> vb;

typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

struct Kek {
    Kek(ll t, ll r, ll i) : t(t), r(r), i(i) {}
    Kek() : Kek(0, 0, 0) {}
    bool operator< (const Kek& other) const {
        if (t != other.t) return t < other.t;
        if (r != other.r) return r > other.r;
        return i < other.i;
    }
    ll t, r, i;
};

struct Cmp {
    bool operator()(const Kek& x, const Kek& y) const {
        if (x.r != y.r) return x.r > y.r;
        return x.i < y.i;
    }
};

int main() {
    cout << setprecision(30);
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

    ll n, m;
    cin >> n >> m;
    vector<Kek> w(n);
    for (int i = 0; i < n; ++i) {
        cin >> w[i].t >> w[i].r;
        w[i].i = i;
    }

    sort(w.begin(), w.end());
    set<Kek, Cmp> keks;
    ll ans = 0;
    ll j = 0;
    for (int i = 1; i <= m; ++i) {
        while (j < n && w[j].t <= i) {
            keks.insert(w[j]);
            ++j;
        }
        if (keks.empty()) continue;
        ans += keks.begin()->r;
        keks.erase(keks.begin());
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 8832
N = input()
ans = 0
if N[-1:] == "2" or N[-1:] == "4" or N[-1:] == "5" or N[-1:] == "7" or N[-1:] == "9":
    print('hon')
    exit(0)
if N[-1:] == "0" or N[-1:] == "1" or N[-1:] == "6" or N[-1:] == "8":
    print('pon')
    exit(0)
if N[-1:] == "3":
    print('bon')
    exit(0)

Measured memory_bytes: 9136
import bisect

N = int(input())
A = sorted(list(map(int, input().split())))
B = list(map(int, input().split()))
C = sorted(list(map(int, input().split())))
ans = 0
for i in B:
    left = bisect.bisect_left(A, i)
    right = N - bisect.bisect_right(C, i)
    ans += left * right

print(ans)


Measured memory_bytes: 23744
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>

using namespace std;

bool compare_pair(pair<int, int> a, pair<int, int> b)
{
  return a.first > b.first;
}

int main()
{
  int res_num;

  cin >> res_num;

  map<string, vector<pair<int,int>>> rest_list;
  pair<int, int> rest_val;

  for(int i = 1; i <= res_num; i++){
    string name;
    int val;
    cin >> name >> val;

    auto result = rest_list.find(name);
    if(result == rest_list.end()){
      vector<pair<int,int>> temp;
      temp.push_back(make_pair(val, i));
      rest_list[name] = temp;
    }else{
      vector<pair<int,int>> temp = result->second;
      temp.push_back(make_pair(val, i));
      sort(temp.begin(), temp.end(), compare_pair);
      result->second = temp;
    }
  }

  for(auto p = rest_list.begin(); p != rest_list.end(); p++){
    for(auto list = p->second.begin(); list != p->second.end(); list++){
      cout << list->second << endl;
    }
  }

  return 0;
}

Measured memory_bytes: 256
package main
import "fmt"
func main(){
  var a,b int
  fmt.Scanf("%d %d",&a,&b)
  if a>b {
    fmt.Println("a > b")
  }else if a<b {
    fmt.Println("a < b")
  }else {
    fmt.Println("a == b")
  }
}



Measured memory_bytes: 1152
#include "bits/stdc++.h"
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#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 all(s) s.begin(), s.end()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
const int DIV = 1e9+7;

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

    int ans = 0;
    int maxval=0;
    rrep(i,n){
        int val = 0;
        rep(j, 10){
            if(i%(int)pow(2,j) == 0) val = j;
            else break;
        }
        if(val >= maxval){
            maxval = val;
            ans = i;
        }
    }
    cout << ans << endl;
}


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

class Main{
    public static void main(String args[]){
        int[] h = new int[10];
        Scanner scan = new Scanner(System.in);
        for(int i = 0; i < 10; i++){
            h[i] = Integer.parseInt(scan.next());
        }
        Arrays.sort(h);
        System.out.println(h[9]);
        System.out.println(h[8]);
        System.out.println(h[7]);
    }
}

Measured memory_bytes: 17124
#include <algorithm>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
/* clang-format on */

template <class T>
struct fenwick_tree {
  vector<T> x;
  fenwick_tree(int n) : x(n + 1) {}
  void add(int k, T a) {
    for (++k; k < x.size(); k += k & -k) x[k] += a;
  }
  T sum(int k) {
    T s = 0;
    for (; k > 0; k &= k - 1) s += x[k];
    return s;
  }
  int lower_bound(T a) {
    if (a <= 0) return 0;
    int k = x.size() - 1;
    for (int s : {1, 2, 4, 8, 16}) k |= (k >> s);
    for (int p = ++k; p > 0; p >>= 1, k |= p)
      if (k < x.size() && x[k] < a)
        a -= x[k];
      else
        k ^= p;
    return k + 1;
  }
};

const int SIZE = 1e5 * 4 + 1000;

int main() {
#ifdef LOCAL
  ifstream cin("in.txt");
#endif
  int N;
  while (cin >> N) {
    vector<ll> a(N);
    for (int i = 0; i < N; i++) cin >> a[i];
    ll M = 1ll * (N + 1) * N / 4 + 1;
    ll ng = 0, ok = 1e9 + 10;
    while (ok - ng > 1) {
      ll x = (ng + ok) / 2;
      vector<int> S(N + 1, 0);
      for (int i = 0; i < N; i++) S[i + 1] = S[i] + (a[i] <= x ? 1 : 0);
      for (int i = 0; i <= N; i++) S[i] = 2 * S[i] - i;
      ll cnt = 0;
      fenwick_tree<int> bit(SIZE);
      bit.add(SIZE / 2 + S[0], 1);
      for (int i = 1; i <= N; i++) {
        cnt += bit.sum(SIZE / 2 + S[i]);
        bit.add(SIZE / 2 + S[i], 1);
      }
      if (cnt >= M) {
        ok = x;
      } else {
        ng = x;
      }
    }
    cout << ok << endl;
  }
  return 0;
}


Measured memory_bytes: 3036
#include <stdio.h>

int main()
{
	char a,b;
	scanf ("%c%c",&a,&b);
	if (a=='9' || b=='9')
	{
		printf ("Yes\n");
	}
//	else if (a=='9' && b==9) printf ("Yes\n");
	else printf ("No\n");
}

Measured memory_bytes: 128
#pragma GCC optimize ("O3")
#pragma GCC target ("avx2")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

int D[502][502];
bool E[502][502];
int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);


	int N;
	cin >> N;
	rep(i, N + 2) rep(j, N + 2) D[i][j] = -10;
	rep1(i, N) rep1(j, N) {
		D[i][j] = min(i - 1, j - 1);
		int kari = min(N - i, N - j);
		chmin(D[i][j], kari);
		E[i][j] = 1;
	}

	ll kotae = 0;
	rep(k, N* N) {
		int p;
		cin >> p;
		p--;
		int i = p / N + 1;
		int j = p % N + 1;

		kotae += D[i][j];

		D[i][j]--;
		E[i][j] = 0;

		queue<pair<int, int>> Q;
		Q.push(mp(i, j));
		while (Q.size()) {
			auto p = Q.front();
			Q.pop();

			i = p.first;
			j = p.second;
			int d = D[i][j];

			if (D[i - 1][j] > d + E[i - 1][j]) {
				D[i - 1][j] = d + E[i - 1][j];
				Q.push(mp(i - 1, j));
			}
			if (D[i + 1][j] > d + E[i + 1][j]) {
				D[i + 1][j] = d + E[i + 1][j];
				Q.push(mp(i + 1, j));
			}
			if (D[i][j - 1] > d + E[i][j - 1]) {
				D[i][j - 1] = d + E[i][j - 1];
				Q.push(mp(i, j - 1));
			}
			if (D[i][j + 1] > d + E[i][j + 1]) {
				D[i][j + 1] = d + E[i][j + 1];
				Q.push(mp(i, j + 1));
			}
		}
	}

	co(kotae);



	Would you please return 0;
}

Measured memory_bytes: 4892
class Destination
  def initialize name
    @name = name
    @result = 0
  end

  attr_accessor :result
  attr_reader :name
end

answers = []

loop do
  student_num,destination_num = gets.chomp.split(' ').map{|x|x.to_i}
  break if student_num == 0 && destination_num == 0

  destinations = Array.new(destination_num) {|i| Destination.new(i+1)}

  student_num.times do
    questionnaire_list = gets.chomp.split(' ').map{|x|x.to_i}

    destination_num.times do |idx|
      destinations[idx].result += questionnaire_list[idx]
    end
  end

  i = 0
  destinations.sort_by!{|x| [x.result * -1, i += 1]}

  answers << destinations.map{|destination|destination.name}.join(' ')
end

answers.each{|a|puts a}

Measured memory_bytes: 6136
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Math;
using static System.Console;
using static exMath;
using static exReadLine;


class Program
{
    static void Main(string[] args)
    {
        int H, N;
        intReadLine(out H, out N);
        int[] A = ReadLine().Split().Select(int.Parse).ToArray();
        int t = 0;
        for(int i = 0; i < N; i++)
        {
            t += A[i];
        }
        if(t >= H)
        {
            WriteLine("Yes");
        }
        else
        {
            WriteLine("No");
        }
    }
}

static class exReadLine
{
    public static void intReadLine(out int a)
    {
        a = int.Parse(ReadLine());
    }
    public static void intReadLine(out int a, out int b)
    {
        int[] input = ReadLine().Split().Select(int.Parse).ToArray();
        a = input[0];
        b = input[1];
    }
    public static void intReadLine(out int a, out int b, out int c)
    {
        int[] input = ReadLine().Split().Select(int.Parse).ToArray();
        a = input[0];
        b = input[1];
        c = input[2];
    }
    public static void intReadLine(out int a, out int b, out int c, out int d)
    {
        int[] input = ReadLine().Split().Select(int.Parse).ToArray();
        a = input[0];
        b = input[1];
        c = input[2];
        d = input[3];
    }

    public static void longReadLine(out long a)
    {
        a = long.Parse(ReadLine());
    }
    public static void longReadLine(out long a, out long b)
    {
        long[] input = ReadLine().Split().Select(long.Parse).ToArray();
        a = input[0];
        b = input[1];
    }
    public static void longReadLine(out long a, out long b, out long c)
    {
        long[] input = ReadLine().Split().Select(long.Parse).ToArray();
        a = input[0];
        b = input[1];
        c = input[2];
    }
    public static void longReadLine(out long a, out long b, out long c, out long d)
    {
        long[] input = ReadLine().Split().Select(long.Parse).ToArray();
        a = input[0];
        b = input[1];
        c = input[2];
        d = input[3];
    }
}

static class exMath
{
    // 最大公約数
    public static int Gcd(int a, int b)
    {
        if (a < b) return Gcd(b, a);
        while (b != 0)
        {
            var r = a % b;
            a = b;
            b = r;
        }
        return a;
    }
    public static long Gcd(long a, long b)
    {
        if (a < b) return Gcd(b, a);
        while (b != 0)
        {
            var r = a % b;
            a = b;
            b = r;
        }
        return a;
    }

    // 最小公倍数
    public static long Lcm(int a, int b)
    {
        return BigMul(a, b) / Gcd(a, b);
    }
    public static long Lcm(long a, long b)
    {
        return a * b / Gcd(a, b);
    }
}

Measured memory_bytes: 19680
N, M, X = map(int, input().split())
A = list(map(int, input().split()))

right_cost = 0
pos = X
for i in range(N-X):
    pos += 1
    if pos in A:
        right_cost += 1
        
left_cost = 0
pos = X
for i in range(X):
    pos -= 1
    if pos in A:
        left_cost += 1

print(min(right_cost, left_cost))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define sz(x)  (long long)(x).size()
#define sqr(x) (x)*(x)
#define sof sizeof
#define resz resize
#define ins insert
#define lowerB lower_bound
#define upperB upper_bound
#define mkp make_pair
#define mkt make_tuple
#define act(a,v) (get<(long long)a>(v))
#define mod 1000000007
#define mod1 998244353
#define N 200003
#define inf 1e18
#define minf -1e18
#define min3(a,b,c) min(a,min(b,c));
#define max3(a,b,c) max(a,max(b,c));
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define sumall(v) accumulate(all(v),(ll)0)
#define suma accumulate
#define FastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define PRECISION(n) std::cout.unsetf ( std::ios::floatfield );std::cout.precision((ll)n)
#define PI M_PI
#define fi first
#define se second
#define here cout<<"RSSB"<<endl
#define showzero cout<<std::showpoint
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*b)/gcd(a,b)
#define br "\n"
#define spac " "
#define zero (ll)0
using namespace  std ;
typedef double db;
typedef long long ll ;
typedef vector<int>vi ;
//typedef vector<l>vl ;
typedef vector<ll>vll ;
typedef vector<vector<ll> >vvl ;
typedef pair<int,int> pii ;
typedef pair<ll,ll> pll ;
typedef vector<pll>vpll;
typedef vector<string>vstr;
typedef vector<tuple<ll,ll,ll> >vtll;
typedef vector<bool>vbool ;
void READ(vll &v, ll n){ll a ;for(ll i=0 ; i<n ; i=i+1){cin>>a ;v.pb(a);}}
void PRINT(vll &v , ll a = 0){for(ll i=a ; i<v.size() ; i=i+1){/*v[i] = max((ll)0,v[i]);*/cout<<v[i]<<"\n" ;}cout<<"\n" ;}
double logy(ll n , ll b){if(b==0){return(-1);}if(n==1){return(0);}return((db)log10(n)/log10(b));}
long long power(long long k , long long n , long long m=mod){long long res = 1;while(n){if(n%2!=0){res = (res*k)%m ;}k = (k*k)%m ;n = n/2 ;}return(res) ;}
double power(double p , ll t){db q = 1;while(t){if(t%2){q*=p;}p*=p;t/=2;}return(q);}
ll dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
ll dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
vpll dr;
void call(){dr.pb(mkp(1,0));dr.pb(mkp(-1,0));dr.pb(mkp(0,1));dr.pb(mkp(0,-1));}
ll n,m,k;
bool ok = false;
bool check(string str)
{
    m = sz(str);
    for(ll i =0 ; i<m ; i++)
    {
        if(str[i]==str[m-1-i])
        {
            continue;
        }
        return(false);
    }
    return(true);
}
int main()
{
    FastIO ;
    PRECISION(20) ;
    ll a,b,c,d,i,j,t,x,y,z,x1,y1,z1,e,f;
    db p,q,r,u,w ;
    char ch,chr ;
    string str,st,str1,str2,str3,str4;
    //ll a1=0,a2=0,b1=0,b2=0,c1=0 ;
    //cin>>str>>str1;
    //call();
    //Constructive is Weak!!
    cin>>str;
    n = (sz(str));
    if(check(str) && check(str.substr(0,n/2)) && check(str.substr(n/2+1)))
    {
        cout<<"Yes\n";
    }
    else
    {
        cout<<"No\n";
    }
}

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

int main() {
    int A, B, C, X;
    cin >> A >> B >> C >> X;
    
    int cnt = 0;
    
    for (int i=0; i<=A; i++) {
        for (int j=0; j<=B; j++) {
            for (int k=0; k<=C; k++) {
                if (i*500 + j*100 + k*50 == X) cnt++;
            }
        }
    }
    cout << cnt << endl;
}

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

int main() {
  int N, t, c;
  cin >> N;
  t = N; c = 0;
  while(t > 0) {
    c += t % 10;
    t /= 10;
  }
  if(N % c == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 3584
#include <iostream>
#include <vector>
using namespace std;
int main(void){
	int a,n,key,j;
	cin >> n;
	vector<int> A;
	for(int i=0;i<n;i++){
		cin >> a;
		A.push_back(a);
	}
	for(int j=0;j<n-1;j++){
			cout << A[j] << " ";
	}
	cout << A[n-1] << endl;
	for(int i=1;i<n;i++){
		key = A[i];
		j = i - 1;
		while(j >= 0 && A[j] > key){ 
			A[j+1] = A[j];
			j--;
		}
		A[j+1] = key;
		for(int j=0;j<n-1;j++){
			cout << A[j] << " ";
		}
		cout << A[n-1] << endl;
	}
	
	
}

Measured memory_bytes: 3112
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vin=vector<int>;
using vll=vector<long long>;
using vvin=vector<vector<int>>;
using vvll=vector<vector<long long>>;
using vstr=vector<string>;
using vvstr=vector<vector<string>>;
using vch=vector<char>;
using vvch=vector<vector<char>>;
using vbo=vector<bool>;
using vvbo=vector<vector<bool>>;
using vpii=vector<pair<int,int>>;
using pqsin=priority_queue<int,vector<int>,greater<int>>;
#define mp make_pair
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep2(i,s,n) for(int i=(s);i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define decp(n) cout<<fixed<<setprecision((int)n)
#define _GLIBCXX_DEBUG
const int inf=1e9+7;

int main(){
    string s;cin>>s;
    int k;cin>>k;
    bool tmp=true;
    rep(i,k){
        if(s[i]!='1'){
            tmp=false;
            break;
        }
    }
    if(tmp){
        cout<<'1'<<endl;
        return 0;
    }
    rep(i,s.size()){
        if(s[i]!='1'){
            cout<<s[i]<<endl;
            return 0;
        }
    }
}

Measured memory_bytes: 256
#![allow(unused_imports, unused_macros, dead_code)]

macro_rules! min {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| min!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = min!($($ys),*);
        if $x < t { $x } else { t }
    }}
}
macro_rules! max {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        it.next().map(|z| it.fold(z, |x, y| max!(x, y)))
    }};
    ($x:expr) => ($x);
    ($x:expr, $($ys:expr),*) => {{
        let t = max!($($ys),*);
        if $x > t { $x } else { t }
    }}
}
macro_rules! ewriteln {
    ($($args:expr),*) => { let _ = writeln!(&mut std::io::stderr(), $($args),*); };
}
macro_rules! trace {
    ($x:expr) => { ewriteln!(">>> {} = {:?}", stringify!($x), $x) };
    ($($xs:expr),*) => { trace!(($($xs),*)) }
}
macro_rules! put {
    (.. $x:expr) => {{
        let mut it = $x.iter();
        if let Some(x) = it.next() { print!("{}", x); }
        for x in it { print!(" {}", x); }
        println!("");
    }};
    ($x:expr) => { println!("{}", $x) };
    ($x:expr, $($xs:expr),*) => { print!("{} ", $x); put!($($xs),*) }
}

const M: i64 = 1_000_000_007;

macro_rules! update {
    ($dict:expr, $key:expr, $val:expr) => {{
        if let Some(x) = $dict.get(&$key) {
            if *x < $val {
                $dict.insert($key, $val);
            }
        } else {
            $dict.insert($key, $val);
        }
    }}
}

fn main() {
    let mut sc = Scanner::new();
    let n: usize = sc.cin();
    let a: Vec<i64> = sc.vec(n);
    let mut infants = (0..n).map(|i|
        (a[i], i)
    ).collect::<Vec<_>>();
    infants.sort();
    infants.reverse();

    let mut memo = std::collections::HashMap::new();
    memo.insert((0, 0), 0i64);

    for i in 0..n {
        for left in 0..=i {
            let right = i - left;
            let (a, pos) = infants[i];
            // trace!(infants[i]);
            update!(memo, (left + 1, right), memo[&(left, right)] + a * (pos as i64 - left as i64).abs());
            update!(memo, (left, right + 1), memo[&(left, right)] + a * (n as i64 - pos as i64 - right as i64 - 1).abs());
            // trace!(left + 1, right, memo[&(left + 1, right)]);
            // trace!(left, right + 1, memo[&(left, right + 1)]);
        }
    }
    put!(memo.values().max().unwrap());

}

use std::io::{self, Write};
use std::str::FromStr;
use std::collections::VecDeque;

struct Scanner { stdin: io::Stdin, buffer: VecDeque<String>, }
impl Scanner {
    fn new() -> Self { Scanner { stdin: io::stdin(), buffer: VecDeque::new() } }
    fn cin<T: FromStr>(&mut self) -> T {
        while self.buffer.len() == 0 {
            let mut line = String::new();
            let _ = self.stdin.read_line(&mut line);
            for w in line.split_whitespace() {
                self.buffer.push_back(String::from(w));
            }
        }
        self.buffer.pop_front().unwrap().parse::<T>().ok().unwrap()
    }
    fn chars(&mut self) -> Vec<char> { self.cin::<String>().chars().collect() }
    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> { (0..n).map(|_| self.cin()).collect() }
}


Measured memory_bytes: 155816
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    if(a+b>=c){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
  

  
}

Measured memory_bytes: 21844
#include <stdio.h>

char w[101];
int a[26];

int main(void){
    int l=0;
    scanf("%s", w);
    while(w[l++]) {
        a[w[l-1]-97]++;
    }

    for(int i=0; i<26; i++) {
        if(a[i]%2) {
            printf("No");
            return 0;
        }
    }
    printf("Yes");
    return 0;
}


Measured memory_bytes: 128
#include <iostream>

std::string yesno(bool b) {
    return b ?
        "Alice" : "Borys";
        // "YES" : "NO";
        // "yes" : "no";

}


int main() {
    int a, b, n;
    std::cin >> n >> a >> b;
    bool alicewin;
    while(true){
        if(a+1 == b) {
            alicewin = false;
            break;
        }
        a++;
        if(b-1 == a) {
            alicewin = true;
            break;
        }
        b--;
    }
    std::cout << yesno(alicewin) << std::endl;



}


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

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

    map<string,int> cnt;

    int n;
    cin>>n;
    for(int i=0; i<n; ++i){
        string s;
        cin>>s;
        cnt[s]++;
    }
    cout<<"AC x "<<cnt["AC"]<<'\n';
    cout<<"WA x "<<cnt["WA"]<<'\n';
    cout<<"TLE x "<<cnt["TLE"]<<'\n';
    cout<<"RE x "<<cnt["RE"]<<'\n';
    return 0;
}

Measured memory_bytes: 3668
n, t = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)
b = Array.new(a.size)

max = nil

(a.size-1).downto(0) do |i|
  max = a[i] if max.nil?
  max = a[i] if a[i] > max
  b[i] = max - a[i]
end

print b.count(b.max)


Measured memory_bytes: 9220
use std::io::*;
use std::str::FromStr;

#[allow(unused_macros)]
macro_rules! scan {
  ($e:expr; $t:ty) => {
    $e.get::<$t>()
  };
  ($e:expr; $($t:ty), *) => {
    ($($e.get::<$t>(),)*)
  };
  ($e:expr => $i:expr; $t:ty) => {
    (0..$i).map(|_| $e.get::<$t>()).collect::<Vec<$t>>()
  };
  ($e:expr => $row:expr, $col:expr; $t:ty) => {
    (0..$i).map(|_| scan!($e => $col; $t)).collect::<Vec<$t>>()
  }
}

struct Scanner<R: Read> {
  reader: R
}

#[allow(dead_code)]
impl<R: Read> Scanner<R> {
  fn new(reader: R) -> Scanner<R> {
    Scanner { reader: reader }
  }
  fn safe_get<T: FromStr>(&mut self) -> Option<T> {
    let token = self.reader.by_ref().bytes().map(|c| c.unwrap() as char)
      .skip_while(|c| c.is_whitespace())
      .take_while(|c| !c.is_whitespace())
      .collect::<String>();
    if token.is_empty() { None } else { token.parse().ok() }
  }
  fn get<T: FromStr>(&mut self) -> T {
    if let Some(v) = self.safe_get() { v } else {
      writeln!(stderr(), "Terminated with EOF").unwrap();
      std::process::exit(0);
    }
  }
}

trait Writable {
  fn write(&self, sep: &'static str) -> String;
}

impl<T: ToString> Writable for Vec<T> {
  fn write(&self, sep: &'static str) -> String {
    self.iter().map(|e| e.to_string()).collect::<Vec<String>>().join(sep)
  }
}

fn main() {
  let cin = stdin();
  let cin = cin.lock();
  let mut sc = Scanner::new(cin);
  let s = scan!(sc; String);
  let f: i32 = (&s[0..2]).parse().unwrap();
  let r: i32 = (&s[2..4]).parse().unwrap();
  let ans = if is_between(f, 1, 12) && !is_between(r, 1, 12) {
    "MMYY"
  }
  else if !is_between(f, 1, 12) && is_between(r, 1, 12) {
    "YYMM"
  }
  else if is_between(f, 1, 12) && is_between(r, 1, 12) {
    "AMBIGUOUS"
  }
  else {
    "NA"
  };
  println!("{}", ans);
}

fn is_between<T: Ord>(value: T, from: T, to: T) -> bool {
  from <= value && value <= to
}


Measured memory_bytes: 4352
def call(n):
    for i in range(1,n+1):
        # 3で割れるかを判定する
        if i % 3 == 0:
            print(f' {i}',end='')
        else:
            # 数字に3が含まれるかを判定する
            tmp = i
            while tmp > 0:
                if tmp % 10 == 3:
                    print(f' {i}',end='')
                    break
                tmp //= 10
    #末尾で改行
    print()


call(int(input()))



Measured memory_bytes: 5888
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	    int r = sc.nextInt();
	    int D = sc.nextInt();
	    int x = sc.nextInt();
	    sc.close();
	    
	    for (int i=0; i<10; i++){
	    	x=r*x-D;
	    	System.out.println(x);
	    }
	}

}


Measured memory_bytes: 23764
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, c) for (int i = 0; i < (int)c; i++)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;
//const int inf = 1e9; //1(1倍)e(指数)9(10^9)
//const ll MX = 1e18; //1(1倍)e(指数)18(10^18)
//const ll MOD = 1e9 + 7; //1000000007で割った余りを聞かれたら使う
//加算代入演算子は+=
//int 2^31 10^9まで
//intは10桁、long longは18桁、doubleは308桁、long double は4932桁
//10^10くらいまででdoubleは誤差が発生しちゃう。なるべく整数にすること
//doubleからlong longにキャストするときは、+0.5で切り捨ての誤差を調整
//__int128()で128bit対応の整数（多倍長整数）
//||は片方が成り立つとき
int main()
{
    int n;
    scanf("%d", &n);
    int ans = 1;
    for(int i = 1; i <= n; i++) {
        int temp = i;
        while(temp % 2 == 0 && temp != 1) { //1以外でiを割る2してく
            temp /= 2;
        }
        if(temp == 1) ans = max(i, ans); //2で割り切れると最後1になる。その時の一番大きなiを探す
    }
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
using namespace std;

int main(){
    long long int n,c=0,min=900000000000000;
    cin>>n;
    vector<long long int>a(5);
    for(int i=0;i<5;i++){
       cin>>a[i];
       if(min>=a[i]){
           min=a[i];
       }
    }

    cout<<(n-1)/min+5<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
typedef long long ll;
int main(){
    ll n,m;
    cin>>n>>m;
    ll height[n];
    ll i;
    for(i=0;i<n;i++){
        cin>>height[i];
    }
    vector<vector<ll> >S(n);
    for(i=0;i<m;i++){
        ll t1,t2;
        cin>>t1>>t2;
        S[t1-1].push_back(t2);
        S[t2-1].push_back(t1);
    }
    ll count = 0;
    for(i=0;i<n;i++){
        ll flag = 1;
        auto it = S[i].begin();
        while(it!=S[i].end()){
            if(height[i] <= height[*it-1]){
                flag = 0;
                break;
            }
            it++;
        }
        if(flag){
            count++;
        }
    }
    cout<<count<<endl;
    return 0;
}

Measured memory_bytes: 9824