akhauriyash/Code-Regression huggingface dataset:
#define _USE_MATH_DEFINES // for C++  
#include "bits/stdc++.h"
#define LL long long
#define NUM 1000000007
 
using namespace std;
 
int main() {
    char a, b, c;
    cin >> a >> b >> c;
    if (100*a+10*b+c==100*c+10*b+a)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}

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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            const int M_MAX = 1000000;
            int S = int.Parse(Console.ReadLine());
            List<int> an = new List<int>();

            an.Add(S);
            int next;
            for (int i = 1; i < M_MAX; i++)
            {
                next = Fn(an[i - 1]);
                if (an.Contains(next))
                {
                    Console.WriteLine(i + 1);
                    return;
                }
                an.Add(next);
            }
        }

        private static int Fn(int n)
        {
            return n % 2 == 0 ? n / 2 : 3 * n + 1;
        }
    }
}


Measured memory_bytes: 13148
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define int long long
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, k;
    string s;
    cin >> n >> s >> k;
    k--;
    rep(i, 0, n){
        if(s[i] != s[k]) s[i] = '*';
    }
    cout << s << endl;
}


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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()

void solve() {
  string s;
  cin >> s;
  int n = s.size();
  if ((s[0] == s[n - 1]) ^ (n % 2)) {
    cout << "First" << '\n';
  }
  else {
    cout << "Second" << '\n';
  }
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) solve();
}


Measured memory_bytes: 3768
#include<stdio.h>

int main(){

char x[10];

char map[10][10];
char P[10][10];


for(int i=0;i<8;i++){
scanf("%s",x);
for(int j=0;j<8;j++)
map[i][j]=x[j];

}


for(int i=0;i<8;i++)
for(int j=0;j<8;j++)
if(i<4&&j<4)P[j][7-i]=map[i][j];
else if(i<4&&j>=4)P[j][7-i]=map[i][j];
else if(i>=4&&j>=4)P[j][7-i]=map[i][j];
else if(i>=4&&j<4)P[j][7-i]=map[i][j];

printf("90\n");
for(int i=0;i<8;i++){
for(int j=0;j<8;j++)
	printf("%c",P[i][j]);

printf("\n");
}
char PP[10][10];
char PPP[10][10];

for(int i=0;i<8;i++)
for(int j=0;j<8;j++)
if(i<4&&j<4)PP[j][7-i]=P[i][j];
else if(i<4&&j>=4)PP[j][7-i]=P[i][j];
else if(i>=4&&j>=4)PP[j][7-i]=P[i][j];
else if(i>=4&&j<4)PP[j][7-i]=P[i][j];

printf("180\n");
for(int i=0;i<8;i++){
for(int j=0;j<8;j++)
	printf("%c",PP[i][j]);

printf("\n");
}

for(int i=0;i<8;i++)
for(int j=0;j<8;j++)
if(i<4&&j<4)PPP[j][7-i]=PP[i][j];
else if(i<4&&j>=4)PPP[j][7-i]=PP[i][j];
else if(i>=4&&j>=4)PPP[j][7-i]=PP[i][j];
else if(i>=4&&j<4)PPP[j][7-i]=PP[i][j];

printf("270\n");
for(int i=0;i<8;i++){
for(int j=0;j<8;j++)
	printf("%c",PPP[i][j]);

printf("\n");
}




return 0;
}

Measured memory_bytes: 948
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define FOR(i, a, b) for(int i = (int)a; i <= (int)b; i++)
#define DEC(i, a, b) for(int i = (int)a; i >= (int)b; i--)
typedef pair<int, int> pi;
typedef pair<pi, int> pii;
typedef pair<pi, pi> pipi;
#define f first
#define s second
typedef vector<int> vi;
typedef vector<pi> vpi;
typedef vector<pii> vpii;
#define pb push_back
#define pf push_front
#define all(v) v.begin(), v.end()
#define disc(v) sort(all(v)); v.resize(unique(all(v)) - v.begin());
#define INF (int) 1e9 + 100
#define LLINF (ll) 1e18
#define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define sandybridge __attribute__((optimize("Ofast"), target("arch=sandybridge")))
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());    //can be used by calling rng() or shuffle(A, A+n, rng)
inline ll rand(ll x, ll y) { ++y; return (rng() % (y-x)) + x; } //inclusivesss

ll n, arr[1000005], allgcd;
map<ll, bool> occ;

void done(string s) {
	cout << s;
	exit(0);
}

void fac(int x) {
	bool even = ((x % 2) == 0);
	while (x % 2 == 0) {
		if (occ[2]) done("setwise coprime");
		x /= 2;
	}
	if (even) occ[2] = 1;
	for (ll i = 3; i <= sqrt(x); i += 2) {
		bool div = ((x % i) == 0);
		while (x % i == 0) {
			if (occ[i]) done("setwise coprime");
			x /= i;
		}
		if (div) occ[i] = 1;
	}
	if (x > 2) {
		if (occ[x]) done("setwise coprime");
		occ[x] = 1;
	}
}

int main() {
	fastio; cin >> n;
	FOR(i, 1, n) cin >> arr[i];
	allgcd = arr[1];
	FOR(i, 2, n) allgcd = gcd(allgcd, arr[i]);
	if (allgcd != 1) done("not coprime");
	FOR(i, 1, n) fac(arr[i]);
	cout << "pairwise coprime";
}


Measured memory_bytes: 11416
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 && b==c && a%2==0){
            System.out.println(-1);
            return;
        }
        
        for(int i=0; i<1_000_000_000; i++){
            if(a%2==1 || b%2==1 || c%2==1){
                System.out.println(i);
                return;
            }
            int ah = a/2;
            int bh = b/2;
            int ch = c/2;
            a = bh+ch;
            b = ah+ch;
            c = ah+bh;
        }
    }
}


Measured memory_bytes: 24020
#include <cmath>
#include <cstdio>
#include <vector>
#include <list>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <stack>
#include <fstream>
#include <queue>
#include <iomanip>
#include <iterator>
#include <map>
#include <unordered_map>
#include <set>
#include <assert.h>
#include <numeric>
#define fast ios_base::sync_with_stdio(false)
#define mxn (ll)(1e5)
#define mod (ll)(1e9+7)
#define mod1 (ll)(998244353)
#define ll long long int
#define ld long double
#define vi vector<ll>
#define vvi vector<vi >
#define pi pair<ll,ll>
#define vvpi vector<vector<pi > >
#define vpi vector<pi >
#define vppi vector<pair<ll,pi > >
#define vs vector<string>
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define eb emplace_back
#define mkp make_pair
#define fs first
#define se second
#define crz(v,n) v.clear(),v.resize(n+1,0)
#define print(v) for(ll it=0;it<v.size();it++) cout<<v[it]<<" ";cout<<endl
#define printp(v) for(ll it=0;it<v.size();it++) cout<<v[it].first<<" "<<v[it].second<<endl
using namespace std;
int main(){fast;
	int h,w,i,j,k,s=0;cin>>h>>w>>k;vs v(h);
	for(i=0;i<h;i++) cin>>v[i];
	for(i=0;i<(1<<h);i++){
		for(j=0;j<(1<<w);j++){
			int c=0;
			for(int ii=0;ii<h;ii++){
				for(int jj=0;jj<w;jj++){
					if(((1<<ii)&i)&&((1<<jj)&j)&&v[ii][jj]=='#') c++;
				}
			}s+=(c==k);
		}
	}cout<<s<<endl;
}


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

typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;
typedef vector< vector< vector<ll> > > vvvint;
typedef vector<string> vstring;
typedef vector< vector<string> > vvstring;
typedef vector<char> vchar;
typedef vector< vector<char> > vvchar;
typedef vector<long double> vdouble;
typedef vector< vector<long double> > vvdouble;
typedef vector< vector< vector<long double> > > vvvdouble;
typedef pair<ll,ll> pint;
typedef vector<pint> vpint;
typedef vector<bool> vbool;

#define rep(i,n) for(ll i=0;i<n;i++)
#define repf(i,f,n) for(ll i=f;i<n;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define ALL(obj) (obj).begin(), (obj).end()
// #define LLONG_MAX 9223372036854775806
#define vmax(vec) *max_element(vec.begin(), vec.end())
#define vmin(vec) *min_element(vec.begin(), vec.end())
#define vsort(vec) sort(vec.begin(), vec.end())
#define vsortgr(vec) sort(vec.begin(), vec.end(), greater<ll>())
#define MOD 1000000007
// #define MOD 998244353
// #define MOD LLONG_MAX
const double PI=3.14159265358979323846;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0,};

void printv(vint &v){
    for(auto e:v) cout<<e<<" ";
        cout<<endl;
    }

// 繰り返し二乗法
ll power(ll a, ll b){
    if(a==1)return a;
    // if(a==0)re
    ll res=1;
    while(b>0){
        if(b&1) res=res*a%MOD;
        a=a*a%MOD;
        b>>=1;
    }
    return res;
}

const int MAX=2100000;

ll fact[MAX], fact_inv[MAX];

void init_fact(ll n){
    fact[0]=1;
    // 階乗の計算
    for(ll i=0; i<n; i++) fact[i+1]=fact[i]*(i+1)%MOD;
    fact_inv[n]=power(fact[n], MOD-2);
    // 逆元の計算
    for(ll i=n-1;i>=0;i--) fact_inv[i]=fact_inv[i+1]*(i+1)%MOD;
}

ll comb(ll n, ll r){
    return (fact[n]*fact_inv[r])%MOD*fact_inv[n-r]%MOD;
}

ll perm(ll n, ll r){
    return (fact[n]*fact_inv[n-r])%MOD;
}

int main() {
    cout<<fixed<<setprecision(10);

    ll n; cin>>n;
    vint a(n), b(n);
    rep(i,n) cin>>a[i]>>b[i];

    ll s = 0;
    ll ans = 0;
    vpint vp;

    rep(i,n){
        ans += a[i];
        if(a[i] > b[i]){
            s += a[i] - b[i];
            vp.emplace_back(b[i], a[i] - b[i]);
        }
    }

    if(vp.size() == 0){
        cout<<0<<endl;
        return 0;
    }

    sort(ALL(vp), greater<pint>());
    for(auto p:vp){
        s -= p.second;
        if(s <= 0){
            ans -= p.first;
            cout<<ans<<endl;
            return 0;
        }
    }


    return 0;

}

Measured memory_bytes: 896
import Foundation


import Foundation

let input_line: String = readLine()!
let split: [String] = input_line.components(separatedBy: " ") //ブランクで区切られている場合

let A = Int(split[0])!
//String -> Intの型変換はnilが返る可能性があるので、ラップされたOptional<Int>型が返るので強制アンラップ
let B = Int(split[1])!

if (A+B < 10){
    print(A+B)
}else{
    print("error")
}


Measured memory_bytes: 14156
#include<iostream>
using namespace std;
int main(void) {
	int n;
	cin >> n;
	int a[101];
	for (int i(1); i <= n; i++) {
		cin >> a[i];
	}
	for (int i(1); i <= n; i++) {
		if (a[i] % 2 == 0) {
			if (a[i] % 3 == 0 || a[i] % 5 == 0);
			else {
				cout << "DENIED" << endl;
				break;
			}
		}
		if (i == n)cout << "APPROVED" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <tuple>
#include <queue>
#include <set>
#include <math.h>
#include <array>
#include <list>
#include <set>
const int MOD=1000000007;
const int INF=1000000000;
using namespace std;
typedef long long ll;
typedef tuple<ll,int,int> tup;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vp;
set<char> st;
string s;
int main(int argc,char const* argv[])
{
  cin >> s;
  sort(s.begin(),s.end());
  if(s=="abc") cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
s = input()
m = {}
for k in 'abcdefghijklmnopqrstuvwxyz':
    upper = k.upper()
    m[k] = upper
    m[upper] = k
    
r = ''
for t in s:
    if t in m:
        r += m[t]
    else:
        r += t
        
print(r)

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

#define ll long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define debug3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define debugB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

template<typename T>
void printA(vector<T> &printArray, char between = ' ') {
   int paSize = printArray.size();
   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
   if (between != '\n') {cerr << endl;}
}

// ------------------------------------------------------------------------------------------

int sy, sx, ty, tx;

int main() {
   cin >> sx >> sy >> tx >> ty;
   string ans = "";
   ans += string(abs(sy - ty), 'U');
   ans += string(abs(sx - tx), 'R');

   ans += string(abs(sy - ty), 'D');
   ans += string(abs(sx - tx), 'L');

   ans += 'L';
   ans += string(abs(sy - ty)+1, 'U');
   ans += string(abs(sx - tx)+1, 'R');
   ans += 'D';

   ans += 'R';
   ans += string(abs(sy - ty)+1, 'D');
   ans += string(abs(sx - tx)+1, 'L');
   ans += 'U';

   cout << ans << endl;

   return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const long long mod = pow(10, 9) + 7;
const long long MOD = 998244353;
const long long INF = 1LL << 60;
const int inf = pow(10, 9) + 7;
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, int B) {return (A + (B - 1)) / B;}
long long divCeil(int A, long long B) {return (A + (B - 1)) / B;}
long long divCeil(long long A, long long B) {return (A + (B - 1)) / B;}

int main()
{
  string S;
  cin >> S;
  int N = S.size();

  string ans = "NO";
  for (int i = 0; i < N; i++)
  {
    for (int j = 0; j < N; j++)
    {
      string s = S;
      s.erase(i, j - i);
      if (s == "keyence")
      {
        ans = "YES";
        break;
      }
    }
  }

  cout << ans << endl;
}

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

using namespace std;

#define pb push_back
#define eb emplace_back

typedef long long ll;
typedef unsigned long long ull;

// 46786 - 106

void oneCase() {
   int h, w;
   cin >> h >> w;
   vector<string> b(h);
   for (auto& el : b) {
       cin >> el;
   }
   vector<pair<int, int>> ed = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}, {1, 1}, {1, -1}, {-1,1}, {-1, -1}};
   for (int r = 0; r < h; ++r) {
       for (int c = 0; c < w; ++c) {
           if (b[r][c] == '#') {
               continue;
           }
           int cnt = 0;
           for (auto p : ed) {
               auto di = p.first;
               auto dj = p.second;
               if (r + di >= 0 && r + di < h && c + dj >= 0 && c + dj < w && b[r + di][c + dj] == '#') {
                   ++cnt;
               }
           }
           b[r][c] = '0' + cnt;
       }
   }
   for (auto& e : b) {
       cout << e << "\n";
   }

}


int main() {
    int t = 1;
//    cin >> t;
    while (t--) {
       oneCase();
    }

    return 0;
}


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

int main()
{
  const int t = 753;
  string S;
  cin >> S;
  int ans = 1000;
  for (int i = 0; i < S.size() - 2; i++)
  {
    string str = S.substr(i, 3);
    int now = stoi(str);
    int res = abs(t - now);
    ans = min(res, ans);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!

#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;

signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);

    map<char, int> mp;
    mp['J'] = 0;
    mp['O'] = 1;
    mp['I'] = 2;

    int N;
    cin >> N;
    string s;
    cin >> s;
    vector<int> a(N);
    rep(i, N) {
        a[i] = mp[s[i]];
    }

    const int mod = 10007;
    VV dp(N, V(1<<3, 0));
    rep(s, 1<<3) {
        // at first J has the key
        if ( !((s >> a[0]) & 1) || !(s & 1) ) continue;
        dp[0][s] = 1;
    }
    rep(i, N - 1) {
        rep(s1, 1<<3) {
            if ( !((s1 >> a[i]) & 1) ) continue;
            rep(s2, 1<<3) {
                if ( !((s2 >> a[i + 1]) & 1) ) continue;
                if ( !(s1 & s2) ) continue;
                (dp[i + 1][s2] += dp[i][s1]) %= mod;
            }
        }
    }

    cout << accumulate(all(dp[N - 1]), 0) % mod << endl;

}

Measured memory_bytes: 3212
n, k=map(int, input().split())
s=list(map(int, list(input())))
if s[0]==0:
    renzoku_list=[0]
else:
    renzoku_list=[]
sum=1
before=s[0]
for i in range(1, n):
    if s[i]==before:
        sum=sum+1
        before=s[i]
    else:
        renzoku_list.append(sum)
        sum=1
        before=s[i]
renzoku_list.append(sum)
if s[n-1]==0:
    renzoku_list.append(0)
ruisekiwa=[0]
for i in range(len(renzoku_list)):
    ruisekiwa.append(renzoku_list[i]+ruisekiwa[i])

length=len(renzoku_list)

max=0

if (length-1)//2<=k:
    print(n)
else:
    for i in range(len(ruisekiwa)-(2*k+1)):
        if i%2==0:#i=0,2,4,...
            sum=ruisekiwa[i+2*k+1]-ruisekiwa[i]
            if sum>=max:
                max=sum
    print(max)


Measured memory_bytes: 54008
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define all(x) x.begin(),x.end()
#define LOL cout<<'\n';
#define MOD 1000000007
#define sz(x) ((int)x.size())
#define INF LONG_LONG_MAX
#define NINF LONG_LONG_MIN
#define deb(x) cout << "[" << (#x) << "=" << x << "]" << '\n';
#define deb2(x,y) cout << "[" << (#x) << "=" << x << "] [" << (#y) << "=" << y << "]" << '\n';
#define deb3(x,y,z) cout << "[" << (#x) << "=" << x << "] [" << (#y) << "=" << y << "] [" << (#z) << "=" << z << "]" << '\n';

const int N=1e5+7;
int n,m,k,q,l,r,x,y,z;
int a[N],b[N],c[N];
string s,t;
int ans=0,cnt=0,f=0;

void solve(){
	cin>>n;
	for(int i=0 ; i<n ; i++) cin>>a[i];
	for(int i=0 ; i<n ; i++){
		if(a[i]==0) f=1;
	}
	if(f){
		cout<<0;LOL
		return;
	}
	ld d=0;
	for(int i=0 ; i<n ; i++){
		d+=log10(a[i]);
	}
	if(d>18.1){
		cout<<-1;LOL
		return;
	}
	cnt=1;
	ans=1000000000000000000;
	for(int i=0 ; i<n ; i++){
		cnt*=a[i];
		if(cnt>ans){
			cout<<-1;LOL
			return;
		}
	}
	if(cnt>ans){
		cout<<-1;LOL
		return;
	}
	else{
		cout<<cnt;LOL
	}
}

signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
  cout<<setprecision(2);
  int _=1; //cin>>_;
  for(int i=1 ; i<=_ ; i++) solve();
  return 0;
}


Measured memory_bytes: 4676
#pragma region header
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};
constexpr ll mod = 1e9+7;
constexpr int inf = INT32_MAX/2;
constexpr ll INF = LLONG_MAX/2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i % mod;
}
ll gcd(ll a, ll b) {        //最大公約数
    if(b == 0) return a;
    return gcd(b, a % b); 
}
ll lcm(ll a, ll b) {      //最小公倍数
    return a * b / gcd(a, b);
}
int keta(ll n) {        //桁数を求める
    if(n == 0) return 1;
    int count = 0;
    while(n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
ll ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while(n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
#pragma endregion
#define int long long
int ans[4];
signed main() {
    int n,k;cin >> n >> k;
    vector<P> ans(n);
    rep(i, n) cin >> ans[i].first >> ans[i].second;
    sort(all(ans));
    int rui=0;
    rep(i, n) {
        rui+=ans[i].second;
        if(rui>=k) {
            cout << ans[i].first << endl;
            return 0;
        }
    }
    return 0;
}

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

int main(int argc, char* argv[]){
    int N, A[2][101], cnt, mx = 0;

    cin >> N;
    for(int i = 0; i < 2; i++){
        for(int j = 0; j < N; j++){
            cin >> A[i][j];
        }
    }
    for(int i = 0; i < N; i++){
        for(int j = 0; j < N; j++){
            cnt = 0;
            for(int k = 0; k < N; k++){
                if(k == j) cnt += (A[0][k] + A[1][k]);
                if(k < j) cnt += A[0][k];
                if(k > j) cnt += A[1][k];
            }
            if(cnt > mx) mx = cnt;
        }
    }
    cout << mx << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (k); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define INF 114514810
#define MOD 1000000007
#define ALL(a) begin(a),end(a)
#define MS(m,v) memset(m,v,sizeof(m))
#define D10  fixed<<setprecision(10)
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> P;
typedef long long ll;
struct edge
{
	int from, to, cost;
	bool operator < (const edge& e) const { return cost < e.cost; }
	bool operator >(const edge& e) const { return cost > e.cost; }
};
///*************************************************************************************///
///*************************************************************************************///
///*************************************************************************************///

int V;
int d[100001];
vector<edge> es[100001];

void dijkstra(int s)
{
	fill(d, d + V, INF);
	d[s] = 0;
	priority_queue<P, vector<P>, greater<P>> que;
	que.push(P(0, s));
	while (!que.empty())
	{
		P p = que.top(); que.pop();
		int v = p.second;
		if (d[v] < p.first) continue;
		REP(i, es[v].size())
		{
			edge e = es[v][i];
			if (d[e.to] > d[v] + e.cost)
			{
				d[e.to] = d[v] + e.cost;
				que.push(P(d[e.to], e.to));
			}
		}
	}
}

int main()
{
	cin >> V;
	REP(i, V)
	{
		int u, k; cin >> u >> k;
		REP(i, k)
		{
			int c, v; cin >> v >> c;
			es[u].push_back(edge{ u, v, c });
		}
	}
	dijkstra(0);
	REP(i, V)
	{
		cout << i << " " << d[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define maxs(a, b) a = max(a, b)
#define mins(a, b) a = min(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll linf = (1ll << 61);
const int inf = 1001001001;
const int mod = 1000000007;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s, t;
	cin >> s >> t;
	reverse(s.begin(), s.end());
	reverse(t.begin(), t.end());
	int n = s.size(), k = t.size();
	bool elf = false;
	rep(i, n) {
		string tmp = s.substr(i, k);
		bool ok = true;
		rep(j, k) if (tmp[j] != '?') if (tmp[j] != t[j]) ok = false;
		if (ok) {
			elf = true;
			for (int j = i; j < i + k; ++j) {
				s[j] = t[j - i];
			}
			break;
		}
	}
	if (!elf) {
		cout << "UNRESTORABLE" << endl;
		return 0;
	}
	rep(i, n) if (s[i] == '?') s[i] = 'a';
	reverse(s.begin(), s.end());
	cout << s << endl;
	return 0;
}


Measured memory_bytes: 3588
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <functional>
#include <cmath>
#define SIZE 25
#define MX (1<<21)+2

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
typedef pair <int,string> PS;

vector < vector <int> > cnt[SIZE];
P nxt[SIZE][MX][2];
char str[MX];
int N,K;

//文字列は先頭から見ていく
void make()
{
	for(int i=0;i<=N;i++)
	{
		for(int j=0;j<(1<<i);j++)
		{
			for(int t=0;t<2;t++)
			{
				nxt[i][j][t]=P(-1,-1);
				if(i>0)
				{
					int S=j;
					for(int k=i-1;k>=0;k--)
					{
						if(t==1&&(S>>k&1))
						{
							nxt[i][j][t]=P(k,S-(1<<k));
							break;
						}
						else if(t==0&&!(S>>k&1))
						{
							nxt[i][j][t]=P(k,S);
							break;
						}
						if(S>>k&1) S-=(1<<k);
					}
				}
			}
		}
	}
}
PS solve(string now="",int dep=0)
{
	//深さ dep のを使う
	int sum=0;
	for(int i=0;i<=N-dep;i++)
	{
		for(int j=0;j<cnt[i][dep].size();j++)
		{
			sum+=cnt[i][dep][j];
		}
	}
	//printf("%d : %s\n",sum,now.c_str());
	if(sum<K) return PS(0,"");
	PS ans=PS(-dep,now);
	if(dep<N)
	{
		for(int t=0;t<2;t++)
		{
			string ns=now;
			if(t==0) ns+="0";
			else ns+="1";
			for(int i=0;i<N-dep;i++)
			{
				for(int j=0;j<cnt[i][dep+1].size();j++)
				{
					cnt[i][dep+1][j]=0;
				}
			}
			for(int i=0;i<=N-dep;i++)
			{
				for(int j=0;j<cnt[i][dep].size();j++)
				{
					P p=nxt[i][j][t];
					if(p!=P(-1,-1))
					{
						cnt[p.first][dep+1][p.second]+=cnt[i][dep][j];
					}
				}
			}
			ans=min(ans,solve(ns,dep+1));
		}
	}
	return ans;
}
int main()
{
	scanf("%d %d",&N,&K);
	make();
	for(int i=0;i<=N;i++)
	{
		for(int j=0;j<=N-i;j++)
		{
			vector <int> v((1<<i));
			cnt[i].push_back(v);
		}
	}
	for(int i=0;i<=N;i++)
	{
		scanf("%s",&str);
		for(int j=0;j<1<<i;j++)
		{
			cnt[i][0][j]=str[j]-'0';
		}
	}
	PS ans=solve();
	printf("%s\n",ans.second.c_str());
	return 0;
}


Measured memory_bytes: 98544
#include<bits/stdc++.h>
using namespace std;
int N;
int M[256];
int toint(string s){
  int res = 0;
  for(int i=0;i<(int)s.size();i++){
    if( s[i] >='2' && s[i] <= '9' ){
      res += M[(int)s[i+1]] * (s[i]-'0');
      i++;
    } else {
      res += M[(int)s[i]];
    }
  }
  return res;
}
string ctos(char c){
  string s = " ";
  s[0] = c;
  return s;
}
string tostr(int n){
  string s = "";
  char dr[]="ixcm";
  int id = 0;
  while( n > 0 ){
    if( n % 10 > 0) s+=dr[id];
    if( n % 10 > 1) s+=ctos(n%10 + '0');
    id ++;
    n/=10;
  }
  reverse(s.begin(),s.end());
  return s;
}
int main(){
  M['m'] = 1000;
  M['c'] = 100;
  M['x'] = 10;
  M['i'] = 1;
  cin >> N;
  for(int t=1;t<=N;t++){
    string s1,s2;
    cin >> s1 >> s2;
    cout << tostr(toint(s1) + toint(s2)) << endl;
  }
}

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

int main(){
    int A,B,K;
    cin >> A >> B >> K;
    int a[101];
    int cnt = 0;
    for(int i = 1; i < 1000;++i){
        if(A%i == 0 && B%i == 0){
            a[cnt] = i;
            ++ cnt;
        }
    }
    cout << a[cnt - K] << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (b); i++)
#define rrep(i, a, b) for (int i = a; i >= (b); i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <class T>
inline bool chmin(T& a, T b) {
   if (a > b) {
      a = b;
      return true;
   }
   return false;
}
template <class T>
inline bool chmax(T& a, T b) {
   if (a < b) {
      a = b;
      return true;
   }
   return false;
}
void hr() {
   cerr << "--------------" << endl;
}
const int INF = 1001001001;
const int MOD = 1000000007;

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

   int n;
   cin >> n;
   vector<int> a(n);
   rep(i, 0, n) cin >> a[i];
   int ans = 0;
   rep(i, 0, n) {
      if ((i + 1) % 2 == 1 && a[i]%2 == 1) ans++;
   }
   cout << ans << endl;
   return 0;
}

Measured memory_bytes: 3640
#include<stdio.h>
#include<string>
#include<math.h>
#include<stdlib.h>
#include<set>
#include<bitset>
#include<map>
#include<vector>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<ctime>
#include<complex>
#include<list>
using namespace std;

typedef pair<int,int> pii;
const int N=1e5+5;
int n,q,L;
set<pii> St;
int a[N];
int nxt[20][N];
int p2[20];

int main(){
	p2[0]=1;
	for(int i=1;i<20;i++) p2[i]=p2[i-1]*2;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		int x;
		scanf("%d",&x);
		a[i]=x;
		St.insert(pii(x,i));
	}
	scanf("%d",&L);
	for(int i=0;i<n;i++){
		St.insert(pii(a[i]+L,n));
		set<pii>::iterator it=St.find(pii(a[i]+L,n));
		it--;
		nxt[0][i]=(*it).second;
		it++;
		St.erase(it);
	}
//	for(int i=0;i<n;i++) printf("%d %d\n",i,nxt[0][i]);
	for(int i=1;i<20;i++) for(int j=0;j<n;j++) nxt[i][j]=nxt[i-1][nxt[i-1][j]];
	scanf("%d",&q);
	while(q--){
		int b,e,ans=0;
		scanf("%d%d",&b,&e);
		b--;e--;
		if(b>e) swap(b,e);
		for(int i=19;i>=0;i--) if(nxt[i][b]<e){
			b=nxt[i][b];
			ans+=p2[i];
		}
		printf("%d\n",ans+1);
	}
	return 0;
}

Measured memory_bytes: 13696
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//int times = Integer.parseInt(sc.nextLine());
		//int bit = 0;

        String s = sc.nextLine();
        int cnt = 0;

        for(int i=0;i<3;i++){
            char x = s.charAt(i);

            if(x == '1'){
                cnt ++;
            }
        }
        System.out.println(cnt);

	}
}


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

int main()
{
	int n, a, b;
	cin >> n >> a >> b;
	int ans_1, ans_2, ans;
	ans_1 = n * a;
	ans_2 = b;
	if ( ans_1 > ans_2 )
		ans = ans_2;
	else
		ans = ans_1;
		
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#define _USE_MATH_DEFINES
#include<math.h>
#include<vector>
#include<array>
#include<algorithm>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<set>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<ll> vec;
typedef vector<vector<ll>> mat;
typedef pair<ll,ll> P;
typedef map<ll,ll> MP;
typedef priority_queue<ll> PQ;
typedef stack<ll> ST;
typedef queue<ll> QUE;
#define pb push_back
#define st first
#define nd second
#define SZ(x) ((int)(x).size())
#define FOR(i,s,n) for(int i=(int)(s); i< (int)(n); i++)
#define rep(i,n) FOR(i,0,n)
#define all(x) (x).begin(),(x).end()
#define each(x,c) for(auto x: (c))
#define LB(x,a) lower_bound(all(x), a)
#define UB(x,a) upper_bound(all(x), a)
const ll mod=1e9+7;
const ll INF=1e18;
const double EPS=1.0e-10;
const double PI=M_PI;

//累乗(aのk乗)
ll matpow(ll a,int k){
    ll dp=1,mt=a;
    while(k>0){
        if(k & 1)dp=(dp*mt)%mod;
        mt=(mt*mt)%mod;
        k/=2;
    }
    return dp;
}

int main(){
    int N; ll K; scanf("%d %lld", &N, &K);
    ll ans = K;
    vec dp(K+1); dp[K]=1;
    for(int i=K-1; i>0; i--){
        dp[i] = matpow(K/i, N);
        ll res = 0;
        FOR(j, 2, K/i+1){
            res = (res + dp[i*j]) % mod;
        }
        dp[i] = (dp[i] - res + mod) % mod;
        ans = (ans + i * dp[i]) % mod; 
    }
    printf("%lld\n", ans);
}

Measured memory_bytes: 4044
#include<stdio.h>

int main()
{
    int n,i;
    scanf("%d",&n);
    double x,a;
    scanf("%lf",&x);
    for(i=1; i<n; i++)
    {
        scanf("%lf",&a);
        x=(x*a*1.0)/(x+a)*1.0;
    }
    printf("%.14lf\n",x);

    return 0;

}


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

int main(){
    int n, k;
    cin >> n >> k;
    int a[n];
    for(int i = 0; i < n; i++) cin >> a[i];
    cout << ((n - 1) % (k - 1) ? (n - 1) / (k - 1) + 1 : (n - 1) / (k - 1)) << endl;
    return 0;
}

Measured memory_bytes: 640
#include<stdio.h>
int main(){
    int W,H,x,y,r;

    scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);

    if(x>=r && x+r<=W && y>=r && y+r<=H) { 
        printf("Yes\n");
    }
    else {
        printf ("No\n");
    }
    return 0;
}


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

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

Measured memory_bytes: 3076
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
int main(){
    string s,t;
    cin >> s >> t;
    int cnt=0;
    rep(i,0,s.size()){
        if(s[i]!=t[i]){
            cnt++;
        }
    }
    cout<<cnt<<endl;
  return 0;
}

Measured memory_bytes: 3920
#include "bits/stdc++.h"
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x) x
#define rep(...) MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c) c.begin(),c.end()
#define mp make_pair
#define write(x) cout<<(x)<<'\n'
using namespace std; typedef long long ll; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
template<class T, class U>bool chmax(T& a, U&& b) { return a < b ? a = b, 1 : 0; }
template<class T, class U>bool chmin(T& a, U&& b) { return b < a ? a = b, 1 : 0; }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

int main() {
    int H, W, A, B;
    cin >> H >> W >> A >> B;

    rep(i, H) {
        string S;
        rep(j, W) {
            if ((i < B) ^ (j < A)) S.push_back('1');
            else S.push_back('0');
        }

        write(S);
    }
}

Measured memory_bytes: 1280
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		//頂点の数
		int n = sc.nextInt();
		//定数（∞として扱う）
		final int inf = Integer.MAX_VALUE;
		//u:頂点の番号　k:出字数 v:隣接する頂点の番号 c:隣接する頂点への辺の重み
		int u, k, v, c;
		int min;
		//全て定数で初期化
		int[] d = new int[n];
		Arrays.fill(d, inf);
		//頂点を訪問したかを示す
		int[] visit = new int[n];
		int white = 0, gray = 1, black = 2;
		
		int[][] M = new int[n][n];
		for(int i=0; i<n; i++) { for(int j=0; j<n; j++) { M[i][j] = inf; } }
		
		for(int i=0; i<n; i++) {
			u = sc.nextInt();
			k = sc.nextInt();
			//出字数分だけ
			for(int j=0; j<k; j++) {
				v = sc.nextInt();
				c = sc.nextInt();
				M[u][v] = c;
			}
		}
		
		d[0] = 0;
		visit[0] = gray;
		while( true ) {
			min = inf;
			int indexU = -1;
			for(int i=0; i<n; i++) {
				if(min > d[i] && visit[i] != black) {
					indexU = i;
					min = d[i];
				}
			}
			if(indexU == -1) break;
			visit[indexU] = black; //訪問済みに変更
			for(v=0; v<n; v++) {
				if(visit[v]!=black && M[indexU][v]!=inf) {
					if(d[v] > d[indexU] + M[indexU][v]) {
						d[v] = d[indexU] + M[indexU][v];
						visit[v] = gray;
					}
				}
			}
		}
		
		for(int i=0; i<n; i++) {
			if(d[i] == inf) { System.out.println(i+" "+-1); }
			else { System.out.println(i+" "+d[i]); }
		}
	}
}



Measured memory_bytes: 39956
(defun solver ()
  (let ((N (read)) (K (read))
        (array (make-array 100001 :initial-element 0)))
    (do ((i 0 (incf i))) ((= i N))
        (let ((a (read)) (b (read)))
        (incf (aref array a) b)))
    (let ((count 0))
    (do ((j 0 (incf j))) ((> j 100000))
        (incf count (aref array j))
        (when (>= count K)
          (return (format t "~A~%" j)))))))

(solver)

Measured memory_bytes: 57704
#include<stdio.h>

int main()
{
	int i=0;
	int l,r,d;
	int ans=0;
	int a[5]={0};
	scanf("%d %d %d",&l,&r,&d);
	for(i=l;i<=r;i++)
    {
	    if(i%d==0)ans++;
    }
	printf("%d",ans);
}

Measured memory_bytes: 1736
#include <bits/stdc++.h>
using namespace std;
using  unll = unsigned long long;

int main() {
  string a,b,c;
  cin >> a >> b >> c;
  char key = 'x';
  while( 1 > 0 ){
    if( key == 'a' || key == 'x'){
      if( a.size() == 0 ){
        cout << 'A' << endl;
        return 0;
      }
      key = a.front();
      if(a.size() >= 2){
        a = a.substr(1);
      }else{
        a = "";
      }
    }
    if( key == 'b' ){
      if( b.size() == 0 ){
        cout << 'B' << endl;
        return 0;
      }
      key = b.front();
      if(b.size() >= 2){
        b = b.substr(1);
      }else{
        b = "";
      }
    }
    if( key == 'c' ){
      if( c.size() == 0 ){
        cout << 'C' << endl;
        return 0;
      }
      key = c.front();
      if(c.size() >= 2){
        c = c.substr(1);
      }else{
        c = "";
      }
    }
  }
    
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <iomanip>
int main()
{
    double n;
    std::cin >> n;
    double ans = 0;
    double x,y;
    double i;
    double v,w;
    v = 1;
    w = 0;
    std::vector<double> data(n, 0);
    for(i = 0; i < n; i++)
    {
        std::cin >> x >> y;
        data[i] = y;
        if(v < x)
        {
            v = x;
            w = i;
        }
    }

    ans = v + data[w];
    std::cout << std::setprecision(10) << ans << std::endl;
    return 0;
}

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

template <typename T>
std::ostream &operator<<(std::ostream &out, const std::vector<T> &v){
    if(!v.empty()) {
        out << '[';
        std::copy(v.begin(), v.end(), std::ostream_iterator<T>(out, ", "));
        out << "\b\b]";
    }
    return out;
}

template <typename T1, typename T2>
std::ostream &operator<<(std::ostream &out, const std::pair<T1, T2> &p) {
    out << "[" << p.first << ", " << p.second << "]";
    return out;
}

vector<int> alphabet(26);
int main(){
    string w;
    cin >> w;
    for(int i = 0 ; i < w.size(); i++){
        if (w[i] == 'a'){
            alphabet[0]++;
        }
        if (w[i] == 'b'){
            alphabet[1]++;
        }
        if (w[i] == 'c'){
            alphabet[2]++;
        }
        if (w[i] == 'd'){
            alphabet[3]++;
        }
        if (w[i] == 'e'){
            alphabet[4]++;
        }
        if (w[i] == 'f'){
            alphabet[5]++;
        }
        if (w[i] == 'g'){
            alphabet[6]++;
        }
        if (w[i] == 'h'){
            alphabet[7]++;
        }
        if (w[i] == 'i'){
            alphabet[8]++;
        }
        if (w[i] == 'j'){
            alphabet[9]++;
        }
        if (w[i] == 'k'){
            alphabet[10]++;
        }
        if (w[i] == 'l'){
            alphabet[11]++;
        }
        if (w[i] == 'm'){
            alphabet[12]++;
        }
        if (w[i] == 'n'){
            alphabet[13]++;
        }
        if (w[i] == 'o'){
            alphabet[14]++;
        }
        if (w[i] == 'p'){
            alphabet[15]++;
        }
        if (w[i] == 'q'){
            alphabet[16]++;
        }
        if (w[i] == 'r'){
            alphabet[17]++;
        }
        if (w[i] == 's'){
            alphabet[18]++;
        }
        if (w[i] == 't'){
            alphabet[19]++;
        }
        if (w[i] == 'u'){
            alphabet[20]++;
        }
        if (w[i] == 'v'){
            alphabet[21]++;
        }
        if (w[i] == 'w'){
            alphabet[22]++;
        }
        if (w[i] == 'x'){
            alphabet[23]++;
        }
        if (w[i] == 'y'){
            alphabet[24]++;
        }
        if (w[i] == 'z'){
            alphabet[25]++;
        }
    }
    
    for(int i = 0; i < 26; i++){
        if(alphabet[i] % 2 == 1){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
N, M = map(int, input().split())

beautiful_l = [0]* N
delicious_l = [0]* N
popular_l = [0]* N

for i in range(N):
    beautiful_l[i], delicious_l[i], popular_l[i] = map(int, input().split())

def rtn_max_value(x, y, z):
    global M, beautiful_l, delicious_l, popular_l
    total_items = []
    if(x and y and z):
        total_items = [x + y + z for (x,y,z) in zip(beautiful_l, delicious_l, popular_l)]
    elif(x and y and not(z)):
        total_items = [x + y - z for (x,y,z) in zip(beautiful_l, delicious_l, popular_l)]
    elif(x and not(y) and z):
        total_items = [x - y + z for (x,y,z) in zip(beautiful_l, delicious_l, popular_l)]
    elif(x and not(y) and not(z)):
        total_items = [x - y - z for (x,y,z) in zip(beautiful_l, delicious_l, popular_l)]
    elif(not(x) and y and z):
        total_items = [-x + y + z for (x,y,z) in zip(beautiful_l, delicious_l, popular_l)]
    elif(not(x) and y and not(z)):
        total_items = [-x + y - z for (x,y,z) in zip(beautiful_l, delicious_l, popular_l)]
    elif(not(x) and not(y) and z):
        total_items = [-x - y + z for (x,y,z) in zip(beautiful_l, delicious_l, popular_l)]
    else:
        total_items = [-x - y - z for (x,y,z) in zip(beautiful_l, delicious_l, popular_l)]

    total_items.sort(reverse=True)
    return sum(total_items[:M])

result = 0
for x in range(0, 2):
    for y in range(0, 2):
        for z in range(0, 2):
            tmp = rtn_max_value(bool(x), bool(y) ,bool(z))
            if(result < tmp):
                result = tmp
print(result)

Measured memory_bytes: 3192
N = int(input())
S = input()
a = []

# 閾値nで数号を分割
def cal(n):
    result = 0
    former = set()
    latter = set()
    for i in range(N):
        if i <= n:
            former.add(S[i])
        else:
            latter.add(S[i])
    union = former & latter
    if result < len(union):
        result = len(union)
    return result

for i in range(N):
    a.append(cal(i))
print(max(a))

Measured memory_bytes: 3064
#N = int(input())
#A = [int(x) for x in input().split()]
#a, b, c = map(int, input().split())
#name1 = str(input())
#alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}
x = int(input())
if x < 1200:
    print("ABC")
else:
    print("ARC")


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n, m, x;
  cin >> n >> m >> x;
  int less_x = 0;
  rep(i, 0, m) {
    int a;
    cin >> a;
    if (a < x)
      less_x++;
  }
  cout << min(less_x, m - less_x) << endl;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10 ** 9)

n = int(input())
edges = [[] for _ in range(n)]
for _ in range(n - 1):
    a, b, c = map(int, input().split())
    a -= 1
    b -= 1
    edges[a].append([b, c])
    edges[b].append([a, c])
    
q, k = map(int, input().split())

check = [False for _ in range(n)]
dist = [0 for _ in range(n)]
def dfs(pos, b_pos):
    for n_pos, c in edges[pos]:
        if n_pos == b_pos:
            continue
        check[n_pos] = True
        dist[n_pos] = c + dist[pos]
        dfs(n_pos, pos)

check[k - 1] = True
dfs(k - 1, -1)

for _ in range(q):
    x, y = map(int, input().split())
    x -= 1
    y -= 1
    print(dist[x] + dist[y])

Measured memory_bytes: 134304
#include<iostream>
using namespace std;
int main() {
  unsigned int Seconds, Hours, Minutes;   //　秒　時間　分　を宣言。
  cin >> Seconds;   //　秒数を入力
  Hours = Seconds / 3600;   //　時間を計算
  Minutes = ( Seconds % 3600 ) / 60;   //　分を計算
  Seconds = ( Seconds % 3600 ) % 60;   //　秒を計算
  cout << Hours << ':' << Minutes << ':' << Seconds << endl;    //　時間:分:秒を出力。
}



Measured memory_bytes: 3112
#include <stdio.h>
#include <algorithm>
using namespace std;

char after[26] = {
	'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'
};
char str[26] = {
	'D', 'E', 'F', 'G', 'H',
	'I', 'J', 'K', 'L',
	'M', 'N', 'O', 'P',
	'Q', 'R', 'S', 'T',
	'U', 'V', 'W', 'X',
	'Y', 'Z', 'A', 'B', 'C'
};


int main(){
	char buf[1234];
	scanf("%s", buf);
	for (int a = 0; a < 1000; a++){
		for (int b = 0; b < 26; b++){
			if (buf[a] == '\0'){ puts(""); return 0; }
			if (buf[a] == str[b]){
				printf("%c", after[b]);
				break;
			}
		}
	}
}

Measured memory_bytes: 2596
use std::collections::HashMap;
use std::io::*;
use std::str::FromStr;

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

fn main() {

    let n:usize = read();
    let s: Vec<String> = (0..n).map(|_| read()).collect();
    let mut map = HashMap::new();

    for i in s.iter() {
        let count = map.entry(i).or_insert(0);
        *count += 1;
    }

    println!("{}", map.len());
}


Measured memory_bytes: 19592
#include <bits/stdc++.h>
#define ld long double
#define int long long
using namespace std;
const int N = 2e5 + 50;
const int mod = 1e9 + 7;
const int inf = 1e17;
int dx[] = {0, 1, -1, 0, -1, 1, 1, -1};
int dy[] = {1, 0, 0, -1, -1, 1, -1, 1};
int arr[20], ans;
int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);	
	int a, b;
	cin >> a >> b;
	if(b % a == 0){
		cout << a + b;
	}else{
		cout << b - a;
	}
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define ll long long
#define INF 1000000007
#define EPS 0.000001
#define f first
#define s second
#define in(n) scanf("%lld", &n)
#define ina(arr,n) for(ll x = 0; x < n; x++) in(arr[x]);
#define loop(i,n) for(ll i=0;i<n;i++)
#define leep(i,n) for(ll i=1;i<=n;i++)

int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    if(a+b+c>=22)cout<<"bust";
    else cout<<"win";
}


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

using namespace std;

int main(void) {
  int N;
  cin >> N;
  vector<int> A(N);
  for (auto& v : A) {
    cin >> v;
  }

  size_t maxi = 0;
  for (size_t i = 0; i < A.size(); ++i) {
    if (A[maxi] < A[i]) {
      maxi = i;
    }
  }
  size_t maxi2 = (maxi == 0 ? 1 : 0);
  for (size_t i = 0; i < A.size(); ++i) {
    if (i != maxi && A[maxi2] < A[i]) {
      maxi2 = i;
    }
  }

  for (size_t i = 0; i < A.size(); ++i) {
    if (i == maxi) {
      cout << A[maxi2] << endl;
    } else {
      cout << A[maxi] << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 4052
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    istream& in(cin);
    ostream& out(cout);
    double l;
    in>>l;
    cout<<setprecision(20)<<(l/3.0)*(l/3.0)*(l/3.0)<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,tot;
vector<int>ed[200001];
vector<int>e[200001];
int topo[200001];
int in[200001];
int sg[200001];
void toposort()
{
	queue<int> q;
	for(int i=1;i<=n;i++)
		in[i]=0;
	for(int u=1;u<=n;u++)
	{
		for(int i=0;i<ed[u].size();i++)
		{
			int to=ed[u][i];
			in[to]++;
		}
	}
	for(int i=1;i<=n;i++)
		if(in[i]==0)
			q.push(i);
	while(!q.empty())
	{
		int u=q.front();
		q.pop();
		topo[++tot]=u;
		for(int i=0;i<ed[u].size();i++)
		{
			int to=ed[u][i];
			in[to]--;
			if(in[to]==0)
				q.push(to);
		}
	}
}
signed main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		int x;
		scanf("%d",&x);
		ed[i].push_back(x);
		e[x].push_back(i);
	}
	toposort();
	for(int i=1;i<=n;i++)
		if(in[i]!=0)
			topo[++tot]=i;
	for(int j=1;j<=n;j++)
	{
		int u=topo[j];
		map<int,int> mp;
		for(int i=0;i<e[u].size();i++)
		{
			int to=e[u][i];
			if(in[to]==0) mp[sg[to]]=1;
		}
		while(mp[sg[u]]==1)++sg[u];
	}
	int num=-1,cnt=0;
	for(int i=1;i<=n;i++)
		if(in[i]!=0)
		{
			if(num==-1) num=sg[i];
			if(num!=sg[i])
			{
				printf("POSSIBLE");
				return 0;
			}
			cnt++;
		}
	if(num==-1||cnt%2==0)printf("POSSIBLE");
	else printf("IMPOSSIBLE");
	return 0;
}


Measured memory_bytes: 23424