akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define ggr getchar();getchar();return 0;
#define prique priority_queue
constexpr auto mod = 1000000007;
#define inf 1e15
#define key 1e9
using namespace std;
typedef pair<int, int>P;
template<class T> inline void chmax(T& a, T b) {
	a = std::max(a, b);
}
template<class T> inline void chmin(T& a, T b) {
	a = std::min(a, b);
}
//combination(Nが小さい時はこれを使う
const int MAX = 330000;
int fac[MAX], finv[MAX], inv[MAX];
// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		finv[i] = finv[i - 1] * inv[i] % mod;
	}
}

// 二項係数計算
long long COMB(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}
bool prime(int n) {
	int cnt = 0;
	for (int i = 1; i <= sqrt(n); i++) {
		if (n % i == 0)cnt++;
	}
	if (cnt != 1)return false;
	else return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}

//繰り返し二乗法（Nが大きい時の場合のcombination)
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= (i % mod); res %= mod;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}
//UnionFind
class UnionFind {
protected:
	int* par, * rank, * size;
public:
	UnionFind(unsigned int size) {
		par = new int[size];
		rank = new int[size];
		this->size = new int[size];
		rep(i, size) {
			par[i] = i;
			rank[i] = 0;
			this->size[i] = 1;
		}
	}
	int find(int n) {
		if (par[n] == n)return n;
		return par[n] = find(par[n]);
	}
	void unite(int n, int m) {
		n = find(n);
		m = find(m);
		if (n == m)return;
		if (rank[n] < rank[m]) {
			par[n] = m;
			size[m] += size[n];
		}
		else {
			par[m] = n;
			size[n] += size[m];
			if (rank[n] == rank[m])rank[n]++;
		}
	}
	bool same(int n, int m) {
		return find(n) == find(m);
	}
	int getsize(int n) {
		return size[find(n)];
	}
};
int dight(int n) {
	int ans = 1;
	while (n >= 10) {
		n /= 10;
		ans++;
	}
	return ans;
}
int dight_sum(int n) {
	int sum = 0;
	rep(i, 20)sum += (n % (int)pow(10, i + 1)) / (pow(10, i));
	return sum;
}
int dight_min(int n) {
	int ans = 9;
	while (n >= 10) {
		ans = min(ans, n % 10);
		n /= 10;
	}
	ans = min(ans, n);
	return ans;
}
int dight_max(int n) {
	int ans = 0;
	while (n >= 10) {
		ans = max(ans, n % 10);
		n /= 10;
	}
	ans = max(ans, n);
	return ans;
}
string s;
signed main() {
	cin >> s;
	rep(i, s.size()) {
		if (s[i] == '?')cout << 'D';
		else cout << s[i];
	}
	cout << endl;
	ggr
}


Measured memory_bytes: 3828
import sys
input = sys.stdin.readline

n, m = [int(i) for i in input().split()]
a = [int(i) for i in input().split()]

num = [0] * n

count = None
for i, v in enumerate(a):
    num[i] = v // 2

    _v = num[i]
    _count = 0
    while True:
        if _v % 2 == 0:
            _v = _v // 2
            _count += 1
        else:
            break
    if count is None:
        count = _count
    elif count != _count:
        print(0)
        sys.exit(0)

import fractions
import functools
# FYI: https://note.nkmk.me/python-gcd-lcm/
def lcm(numbers):
    return functools.reduce(lambda x, y: (x * y) // fractions.gcd(x, y), numbers, 1)

point = lcm(num)
print(int((m // point) / 2 + 0.5))


Measured memory_bytes: 79840
import java.util.*;

public class Main
{
	public static void main(String[] args)
	{
		Scanner s=new Scanner(System.in);
		
		int a=s.nextInt();
		System.out.println(a+(int)Math.pow(a,2)+(int)Math.pow(a,3));
		s.close();
	}
}


Measured memory_bytes: 35480
// #include<iostream>
// using namespace std;
// #include<cctype>

// int main(){
//     char c;
//     while(true){
//         cin>>c;
    //     if(c=='\n')break;
    //     if(isalpha(c)){
    //         if(islower(c)){
    //             c=toupper(c);
    //             cout<<c;
    //         }
    //         else{
    //             c=tolower(c);
    //             cout<<c;
    //         }
    //     }
    //     else{cout<<c;}
    // }
    // cout<<endl;
//     return 0;
// }
//これだとスペースを無視しちゃう。
#include<cstdio>
#include<cctype>
int main(){
    char c;
    while(true){
        scanf("%c",&c);
                if(c=='\n')break;
        if(isalpha(c)){
            if(islower(c)){
                c=toupper(c);
                printf("%c",c);
            }
            else{
                c=tolower(c);
                printf("%c",c);
            }
        }
        else{printf("%c",c);}
    }
    printf("%c",'\n');
    return 0;
}


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

int main () {
  string S;
  cin >> S;
  int N = S.size();
  vector<int>num(N);
  
  for (int i = 0; i < N; i++) {
    num.at(i) = S.at(i) - '0';
    num.at(i) -= 49;
  }
  
  int Min;
  int count = 0;
  
  for (int i = 0; i < 26; i++) {
    for (int j = 0; j < N; j++) {
      if (num.at(j) == i){
        break;
      }
      else if (j == N-1){
        Min = i;
        count++;
      }
    }
    if (count > 0){
      break;
    }
  }
  
  if (N != 26){
    cout << S;
    printf("%c", Min + 'a'); 
  }
  else {
    if (S == "zyxwvutsrqponmlkjihgfedcba"){
      cout << -1 << endl;
      return 0;
    }
    reverse(num.begin(), num.end());
    for (int i = 0; i < 25; i++) {
      if (num.at(i) > num.at(i+1)){
        for (int j = 0; j < 26-i-2; j++) {
          cout << S.at(j);
        }
        for (int k = 0; k <= i; k++) {
          if (num.at(k) >= num.at(i+1)){
            printf("%c", num.at(k) + 'a');
            break;
          }
        }
        cout << endl;
        return 0;
      }
    }
  }
}

Measured memory_bytes: 3604
#include <cstdio>
#include <cmath>

int main()
{
	int n, a, b;
	int cnt = 0;

	scanf("%d %d %d", &n, &a, &b);

	for (int i = 1; i <= n; ++i)
	{
		int s = i == 10000 ? 1 :
			i % 10 +
			(i / 10) % 10 +
			(i / 100) % 10 +
			(i / 1000) % 10;
		if (a <= s && s <= b)
		{
			cnt += i;
		}
	}

	printf("%d\n", cnt);

	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repp(i, a, b) for (int i = a; i <= (b); ++i)
#define repr(i, a, b) for (int i = a; i >= (b); --i)
#define bit(n) (1LL << (n))
#define len(x) ((ll)(x).size())
#define debug(var) cout << "[" << #var << "]\n" << var << endl
#define int long long
typedef long long ll;
const int INF = 1001001001001001001ll;
const ll LINF = 1001001001001001001ll;
const int MOD = 1000000007;
const double EPS = 1e-9;

template <typename T>
ostream& operator<<(ostream& s, const vector<T>& v) {
  int len = v.size();
  for (int i = 0; i < len; ++i) {
    s << v[i];
    if (i < len - 1)
      s << ' ';
  }
  return s;
}

template <typename T>
ostream& operator<<(ostream& s, const vector<vector<T>>& vv) {
  int len = vv.size();
  for (int i = 0; i < len; ++i) {
    s << vv[i];
    if (i != len - 1)
      s << '\n';
  }
  return s;
}

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;
}

__attribute__((constructor)) void initial() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}

signed main() {
  string S;
  cin >> S;

  int N = len(S);

  rep(i, N) {
    repp(j, i, N - 1) {
      int L1 = i + 1;
      int L2 = N - j;

      string S1 = S.substr(0, L1);
      string S2 = S.substr(j, L2);
      string SS = S1 + S2;

      if (SS == "keyence") {
        cout << "YES\n";
        return 0;
      }
    }
  }
  cout << "NO\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	long long int a,b;cin>>a>>b;
  	if(a<=0 && b>=0){
    	cout<<"Zero"<<endl;
      	return 0;
    }
  
    if(a>0 && b>0){
    	cout<<"Positive"<<endl;
      	return 0;
    }
  
    if(a<0 && b<0){
    	if((a-b)%2==0){
        	cout<<"Negative"<<endl;
        }else{
        	cout<<"Positive"<<endl;
        }    
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#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 rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
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 (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

int D = 60;
int MAX_N = 200010;

vvi arrive(D,vi(MAX_N));


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);  
	int n;
	ll k;
	cin >> n >> k;

	rep(i,n){
		cin >> arrive[0][i];
		--arrive[0][i];
	}

	rep(i,D-1){
		rep(j,n){
			arrive[i+1][j] = arrive[i][arrive[i][j]];
		}
	}

	int tmp = 0;
	for(int i = D-1; i >= 0; --i){
		ll l = 1ll<<i;
		if(l & k) tmp = arrive[i][tmp];
	}
	cout << tmp +1 << endl;
	return 0;
}


Measured memory_bytes: 50816
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
  
using namespace std;
using namespace __gnu_pbds;
 
#define ll long long
#define uint unsigned int
#define ull  unsigned long long
#define pb push_back
#define mk make_pair
#define ins insert
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define X first
#define Y second
#define umap unordered_map
#define speed() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define setvalue(d,s,e,n) for(int qwe = s; qwe < e; ++qwe) d[qwe] = n
#define mset multiset
#define pqueue priority_queue
   
template<class T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
        
const int  N = 2e5 + 314;
const int INF = 1e9;
const double PI = acos(-1);
const int MOD = 1e9 + 7;
const double eps = 1e-9;
const long long LINF = 1e18 + 3141;
int dp[N];
void solve(){
    int n;
    string s;
    cin >> n >> s;
    // wwwr
    set <int> u;
    for(int c : s)
        u.ins(c);
    if(u.size() == 1){
        cout << 0;
        return;
    }
    int rr = 0, rw = 0;
    for(int c : s){
        if(c == 'W')
            rw++;
        else
            rr++;
    }
    int ans = INF;
    int lr = 0, lw = 0;
    for(int c : s){
        if(c == 'W'){
            rw--;
            lw++;
        }
        else{
            rr--;
            lr++;
        }
        int f = min(lw, rr);
        // 
        ans = min(ans, f + lw - f + rr - f);
    }
    cout << ans << "\n";
    //
}
 
int main(){
    speed();
    int t = 1;
    // cin >> t;
    while(t--)solve();
}

Measured memory_bytes: 3720
fun main(args: Array<String>) {
    // Your code here!
    var input = readLine()!!.split(" ").map{x->x.toInt()}
    var c = 1
    if(input[0] != input[1]) c++
    if(input[0]!=input[2] && input[1]!=input[2]) c++
    println(c)
}


Measured memory_bytes: 36244
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
//#pragma GCC optimize("Ofast")
//#define _GLIBCXX_DEBUG
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
//#define int ll
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define floatprec(dig) fixed << setprecision(dig)
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
#define invar(typ, var) typ var; cin >> var;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
template <class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template <class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX / 2;
const ll LLINF = 1LL<<60;
constexpr ll MOD = 1000000007;
const double EPS = 1e-9;

unordered_map<ll, ll> memo;

ll solve(ll h) {
  if(h==1) return 1;
  if(memo.find(h) != memo.end()) {
    return memo[h];
  }
  
  ll r = solve(h/2) * 2LL + 1LL;
  memo.emplace(h, r);
  return r;
}

signed main(void) {
  cin.tie(0); ios::sync_with_stdio(false);
  
  ll H;
  cin >> H;
  
  fin(solve(H));
}

Measured memory_bytes: 256
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define PB push_back
#define MP make_pair
#define ll long long
#define MOD 1000000007

inline int toInt(string s){int v;istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x){ostringstream sout;sout<<x;return sout.str();}

ll dp[100002][13] = {};

int main(){
    std::ios::sync_with_stdio(false);
    string s;
    cin >> s;
    dp[0][0] = 1;
    int n = s.length();
    int base = 1;
    for(int i=1;i<=n;++i)
    {
        int index = n - i;
        if(s[index] == '?')
        {
            for(int j=0;j<=9;++j)
            {
                for(int k=0;k<13;++k)
                {
                    dp[i][(k + j * base) % 13] += dp[i-1][k];
                    dp[i][(k + j * base) % 13] %= MOD;
                }
            }
        }
        else
        {
            int offset = s[index] - '0';
            for(int j=0;j<13;++j)
            {
                dp[i][(j + offset * base) % 13] += dp[i-1][j];
                dp[i][(j + offset * base) % 13] %= MOD;
            }
        }
        base = base * 10 % 13;
    }

    cout << dp[n][5] << endl;
}

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


void solve(std::vector<long long> x){
    for (int i = 0; i < x.size(); i++) {
        if (x[i] == 0) {
            cout << i + 1 << endl;
        }
    }
}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    std::vector<long long> x(5);
    for(int i = 0 ; i < 5 ; i++){
        scanf("%lld",&x[i]);
    }
    solve(std::move(x));
    return 0;
}


Measured memory_bytes: 3680
#include<stdio.h>
int main()
{
  int num[6];
  int top=0,front=1,right=2,left=3,back=4,bottom=5;
  int i,j,n;
  int x,y;
  int rep;
  int aftertop,afterfront;
  for(i=0;i<6;i++) scanf("%d",&num[i]);
  scanf("%d",&n);
  for(i=0;i<n;i++)
    {
      scanf("%d%d",&x,&y);
      for(j=0;j<6;j++)
    {
      if(x==num[j])
        {
          aftertop=j;
          break;
        }
    }
      for(j=0;j<6;j++)
    {
      if(y==num[j])
        {
          afterfront=j;
          break;
        }
    }
      top=0;
      front=1;
      right=2;
      left=3;
      back=4;
      bottom=5;
      while((top!=aftertop)&&(front!=afterfront))
    {
      rep=top;
      top=front;
      front=bottom;
      bottom=back;
      back=rep;
    }
      while(top!=aftertop)
    {
      rep=top;
      top=right;
      right=bottom;
      bottom=left;
      left=rep;
    }
      while(front!=afterfront)
    {
      rep=front;
      front=right;
      right=back;
      back=left;
      left=rep;
    }
      printf("%d\n",num[right]);
    }
  return 0;
}


Measured memory_bytes: 1928
#どっちで出すか注意, rstrip注意
#提出前に見返すこと！
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate
    #from itertools import product
    from bisect import bisect_left,bisect_right
    import heapq
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    mod = 10**9 + 7

    n = input().rstrip()
    s = ''
    for i in n:
        if i=='1':
            s += '9'
        else:
            s += '1'
    print(s)

if __name__ == '__main__':
    main()

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

int n;
vector<int> dp(50, 0);

int solve(int i){
    if(dp[i] > 0) return dp[i];
    if(i == 0) return dp[0] = 1;
    if(i == 1) return dp[1] = 1;
    return dp[i] = solve(i-1) + solve(i-2);
}

int main(){
    cin >> n;
    cout << solve(n) << endl;
}


Measured memory_bytes: 3076
#include <bits/stdc++.h>
#ifdef HIRO
#define d(f_, ...) printf((f_), ##__VA_ARGS__)
#else
#define d(f_, ...)
#endif

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector< pair<int, int> > vii;
typedef vector< pair<long long, long long> > vllll;
typedef map<int, int> mii;
typedef map<long long, long long> mllll;
typedef queue<int> qi;
typedef queue< pair<int, int> > qp;
#define mp make_pair
#define pi 3.14159265358979323846
#define MAX max_element
#define MIN min_element
#define all(v) v.begin(), v.end()
#define gt(T) greater<T>()
#define sum(v) accumulate(v.begin(), v.end(), 0ll)
#define uni(v) do{ \
  sort(v.begin(), v.end()); \
  decltype(v)::iterator result = unique(v.begin(), v.end()); \
  v.erase(result, v.end()); \
}while(0)
#define fi(init, n) for(int i = init; i < n; ++i)
#define fj(init, n) for(int j = init; j < n; ++j)
#define fk(init, n) for(int k = init; k < n; ++k)
#define zero(x) memset(x, 0, sizeof(x))
#define negative(x) memset(x, ~0, sizeof(x))
#define bitsum(x) __builtin_popcount(x)
const ll MOD = 1e9 + 7;
const int INF = 1e9;
const int di[] = { 0, 1, 0, -1 };
const int dj[] = { 1, 0, -1, 0 };

template<typename T>
T gcd(T a, T b) {
	return b ? gcd(b, a % b) : a;
}
template<typename T>
T lcm(T a, T b) {
	return a / gcd(a, b) * b;
}
template<typename T>
int finder(vector<T> vec, T number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) return 1;
	else return 0;
}
ll frac(ll n){
	if (n == 0) return 1;
	return (n * frac(n - 1)) % MOD;
}
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;
}

int main(int argc, char** argv) {
#ifdef HIRO
  string quiz(argv[1]);
  string id(argv[2]);
  string filename("input/" + quiz + "/" + id + ".txt");
  ifstream fin(filename);
  if (fin.peek() == ifstream::traits_type::eof()) {
    cout << "No input.";
    return 0;
  }
  ifstream cin(filename);
  std::cin.rdbuf(cin.rdbuf());
#endif
  ll ans = 0;
  string s;
  cin >> s;
  int n = s.size();
  char now = s[0];
  fi(1, n) {
    if(s[i] != now) {
      ans++;
      now = s[i];
    }
  }

  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 512
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
constexpr int MOD = 1000000007;
constexpr int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
using Graph = vector<vector<int>>;



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

	int H, W, K;
	cin >> H >> W >> K;
	char c[H][W];
	rep(i,H){
		rep(j,W){
			cin >> c[i][j];
		}
	}
	int ans1 = INF;
	for(int bit=0;bit<(1<<(H-1));bit++){
		int tmp = __builtin_popcount(bit);
		vector<int> cnt(tmp+1, 0);
		bool ok = true;
		rep(i,W){
			int now = 0;
			rep(j,H){
				if(c[j][i] == '1') cnt[now]++;
				if(1 & (bit>>j)) now++;
			}
			if(*max_element(cnt.begin(), cnt.end()) > K){
				if(ok){
					tmp = INF;
					break;
				}
				tmp++;
				rep(q,cnt.size()){
					cnt[q] = 0;
				}
				--i;
				ok = true;
				continue;
			}
			ok = false;
		}
		ans1 = min(ans1, tmp);
	}
	cout << ans1 << endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String args[]) throws Exception {
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	String strArray[] = br.readLine().split(" ");
	int A = Integer.parseInt(strArray[0]);
	int B = Integer.parseInt(strArray[1]);

	System.out.println(Math.max(Math.max(A + B, A - B), A * B));

    }
}

Measured memory_bytes: 21204
#include <iostream>

using namespace std;

int main(){
  int h,m,s;
  cin >> s;
  h = s / 3600;
  s = s % 3600;
  m = s / 60;
  s = s % 60;
  cout << h << ":" << m << ":" << s << endl;
  return 0;
}

Measured memory_bytes: 3088
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>

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

using namespace std;
typedef vector<vector<int> > Graph;

void DFS(Graph &g, int u, int &clock, vector<int> &low, vector<int> &disc, vector<bool> &seen, vector<int> &parent, vector<bool> &ap) {
    int children = 0;
    for(int v: g[u]) {
        children++;
        if (! seen[v]) {
            clock++;

            disc[v] = clock;
            low[v] = clock;
            seen[v] = true;
            parent[v] = u;

            DFS(g, v, clock, low, disc, seen, parent, ap);

            low[u] = min(low[u], low[v]);

            if (parent[u] == -1 && children > 1)
                ap[u] = true;
            if (parent[u] != -1 && low[v] >= disc[u])
                ap[u] = true;

        } else if (v != parent[u]) {
            low[u]  = min(low[u], disc[v]);
        }
    }
}

int main () {
    int V, E;
    cin >> V >> E;

    Graph g(V);
    vector<bool> ap(V, false);

    FOR(i,E) {
        int s, t;
        cin >> s >> t;

        g[s].push_back(t);
        g[t].push_back(s);
    }
    int clock = 2;
    vector<int> low(V, 0);
    vector<int> disc(V, 0);
    vector<int> parent(V, -1);
    vector<bool> seen(V, false);
    disc[0] = 1;
    low[0] = 1;
    seen[0] = true;

    DFS(g, 0, clock, low, disc, seen, parent, ap);

    FOR(i, V)
        if (ap[i])
            cout << i << endl;
}



Measured memory_bytes: 5172
#include <iostream>
#include <cstdio>
#define _USE_MATH_DEFINES
#include <math.h>
#include <vector>

using namespace std;

void solve()
{
	int n, x;
	while (cin >> n >> x, n || x)
	{
		int ans = 0;
		for (int i = 1; i <= n - 2; ++i)
		{
			for (int j = i + 1; j <= n - 1; ++j)
			{
				if (x - i - j <= n && x - i - j > j)
				{
					++ans;
				}
				//for (int k = j + 1; k <= n; ++k)
				//{
				//	if (i + j + k == x)
				//	{
				//		++ans;
				//	}
				//}
			}
		}
		cout << ans << endl;
	}
}

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

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

N, K = map(int, readline().split())

P = 10 ** 9 + 7

def mod_prod(a,b):
    return a * b % P

def mod_fact(a):
    ret = 1
    for i in range(a):
        ret = ret * (i + 1) % P
    return ret

def mod_pow(a, n):
    ret = 1
    while n > 0:
        if n % 2 == 1:
            ret = ret * a % P
        a = a * a % P
        n = n // 2
    return ret

def mod_div(a, b):
    b_inv = mod_pow(b, P - 2)
    return a * b_inv % P

def mod_comb(a,b):
    ret = 1
    b = min(b, a - b)
    for i in range(b):
        ret *= a - i
        ret %= P
    ret = mod_div(ret, mod_fact(b))
    return ret


a = [0] * (K + 1)
a[-1] = 1

for i in range(K - 1, 0, -1):
    x = K // i
    x = mod_pow(x, N)
    for j in range(i * 2, K + 1, i):
        x -= a[j]
    a[i] = x % P

ans = 0
for i in range(1, K+1):
    ans += i * a[i]
    ans %= P

print(ans)


Measured memory_bytes: 74808
#include <cstdio>
#include <cmath>
#include <algorithm>
#define file(s) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout);
using namespace std;
typedef long long ll;
const int MAXN = 200005;
const ll INF = 1e18;
int n, Q;
ll f[MAXN], pl[MAXN << 2], mi[MAXN << 2];

void update(int o, int ls, int rs) {
    pl[o] = min(pl[ls], pl[rs]), mi[o] = min(mi[ls], mi[rs]);
}

void build(int o, int l, int r) {
    if (l == r) {
        pl[o] = f[l] + l, mi[o] = f[l] - l;
        return;
    }
    int mid = (l + r) >> 1, ls = o << 1, rs = ls | 1;
    build(ls, l, mid), build(rs, mid + 1, r);
    update(o, ls, rs);
}

ll query_plus(int o, int l, int r, int p) {
    if (p <= l)
        return pl[o];
    int mid = (l + r) >> 1; ll res = query_plus(o << 1 | 1, mid + 1, r, p);
    if (p <= mid)
        res = min(res, query_plus(o << 1, l, mid, p));
    return res;
}

ll query_minus(int o, int l, int r, int p) {
    if (r <= p)
        return mi[o];
    int mid = (l + r) >> 1; ll res = query_minus(o << 1, l, mid, p);
    if (p > mid)
        res = min(res, query_minus(o << 1 | 1, mid + 1, r, p));
    return res;
}

void modify(int o, int l, int r, int p, ll v) {
    if (l == r) {
        pl[o] = min(pl[o], v + l), mi[o] = min(mi[o], v - l);
        return;
    }
    int mid = (l + r) >> 1;
    if (p <= mid)
        modify(o << 1, l, mid, p, v);
    else
        modify(o << 1 | 1, mid + 1, r, p, v);
    update(o, o << 1, o << 1 | 1);
}

ll query(int o, int l, int r) {
    if (l == r)
        return pl[o] - l;
    int mid = (l + r) >> 1;
    return min(query(o << 1, l, mid), query(o << 1 | 1, mid + 1, r));
}

int main() {
    int a, last; ll lazy = 0, _min;
    scanf("%d %d %d %d", &n, &Q, &a, &last);
    for (int i = 1; i <= n; i++)
        f[i] = i == a ? 0 : INF;
    build(1, 1, n);
    for (int t = 1, x; t <= Q; t++) {
        scanf("%d", &x);
        lazy += abs(x - last);
        _min = min(query_plus(1, 1, n, x) - x, query_minus(1, 1, n, x) + x);
        modify(1, 1, n, last, _min - abs(x - last)), last = x;
    }
    printf("%lld", query(1, 1, n) + lazy);
	return 0;
}


Measured memory_bytes: 13952
import java.util.Scanner;

class Main {
    public static void main(String[] args) throws Exception{
        Scanner sc = new Scanner(System.in);
        int x = sc.nextInt();
        int y = sc.nextInt();
        int z = sc.nextInt();
        int count = 0;
        for(int i = x; i <= y; i++){
            if(z%i == 0){
                count++;
            }
        }
        System.out.println(count);
    }
}

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

int main ( ) {
    int N;
    string S;
    bool flag = true;

    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> S;

        if (S == "Y") {
            flag = false;
        }
    }

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

Measured memory_bytes: 256
/*
貪欲
後ろから見る
DP
順位表をチェック
二分探索
不変なもの・偶奇に注目

*/
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include <map>
#include<tuple>
#include<set>
using namespace std;
#define INF 1LL<<60
#define MAX 100000
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;
//typedef pair< pair<int,int>,pair<int,int> > p;
//#define int ll int main->signed main
#define bit(n,k) ((n>>k)&1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)
struct edge{ll to,cost,val;};
template<class T,class U>bool chmin(T&a,const U&b){if(a<=b)return false;a=b;return true;}
template<class T,class U>bool chmax(T&a,const U&b){if(a>=b)return false;a=b;return true;}
//__builtin_popcount(S);
//C.erase(unique(C.begin(),C.end()),C.end());

int main(){
    int m1,d1,m2,d2;
    cin>>m1>>d1>>m2>>d2;
    if(m1!=m2) cout<<1<<endl;
    else cout<<0<<endl;
}


Measured memory_bytes: 888
#pragma region header
#include <bits/stdc++.h>
using namespace std;
#define int long long
#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
bool bo[8];
signed main() {
    int n;cin >> n;
    int count = 0;
    
    int cnt = 0;
    rep(i, n) {
        int a;cin >> a;
        if(a<3200&&!bo[a/400]) {
            count++;
            bo[a/400] = true;
        }
        else if(a>=3200) cnt++;
    }
    if(count==0) cout << 1 << ' ';
    else cout << count << ' ';
    cout << count+cnt << endl;
}

Measured memory_bytes: 3632
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
//#include <atcoder/all>
#define rep(i,n) for (int i = 0; i < (n); ++i)
typedef int64_t lint;
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using lb = long double;
//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SI(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
#define debug(x) cerr << #x << ": " << x << "\n"//手動デバッグ
#define debugV(x) for(int i=0;i<((ll)(x).size());i++)cerr << #x <<"at:"<<i<< ": " << x[i] << "\n"//手動デバッグ 
#define YES(c) cout<<((c)?"YES\n":"NO\n"),0
#define Yes(c) cout<<((c)?"Yes\n":"No\n"),0
#define O(p) cout<<p<<"\n",0
#define OS(p) cout<<p<<" ",0
#define ON(p) cout<<p,0
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define inf 2147483647 //int値の最大値
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
#define endl "\n"//endlを置き換える
//略記
#define PB emplace_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define CST(x) cout<<fixed<<setprecision(x)//小数点以下の桁数指定

const int dy[4]={1,0,-1,0};
const int dx[4]={0,1,0,-1};//^>v<

template<class T=int> T in(){
    T x;
    cin>>x;
    return (x);
}
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;
}
int gcd(int a, int b) {
    if (b==0) return a;
    else return gcd(b, a%b);
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int two(int n){
	ll ans=1;
	rep(i,n){
		ans*=2;
	}
	return ans;
}
//------------------------------------------------------------





//------------------------------------------------------------
int main() {
	ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
//------------------------------------------------------------
    int n=in();
    vector<P> moto(n);
    vector<P> aftX(n);
    vector<P> aftY(n);
    rep(i,n){
        ll x,y;cin>>x>>y;
        moto[i].first=x;
        moto[i].second=y;
        ll xx=x+y;
        ll yy=x-y;
        aftX[i].first=xx;
        aftY[i].first=yy;
        aftX[i].second=i;
        aftY[i].second=i;
    }
    sort(ALL(aftX));
    sort(ALL(aftY));
    ll comX=abs(moto[aftX[0].second].first-moto[aftX[n-1].second].first);
    comX+=abs(moto[aftX[0].second].second-moto[aftX[n-1].second].second);
    
    ll comY=abs(moto[aftY[0].second].first-moto[aftY[n-1].second].first);
    comY+=abs(moto[aftY[0].second].second-moto[aftY[n-1].second].second);
    
    ll ans=max(comX,comY);
    //debug(comX);
    //debug(comY);
    O(ans);
    
    
    
    
    
    
    
//------------------------------------------------------------
	return 0;
}


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

typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> pll;
#define endl "\n";
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

ll const inf = 1e18;
ll const maxn = 1e6+5;
ll const mod = 1e9+7;

// code begins here

int main(){
    fast;
    
    ll x,y;
    cin>>x>>y;
    
    if((y-2*x)%2==0){
        ll tmpx = (y-2*x)/2;
        ll tmpy = x - tmpx;
        if(tmpx>=0 && tmpy>=0){
            cout<<"Yes"<<endl;
        } else {
            cout<<"No"<<endl;
        }
        
    } else {
        cout<<"No"<<endl;
    }
    
    return 0;
}


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

// @@ !! LIM()

int main(/* int argc, char *argv[] */) {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << setprecision(20);

  ll n; cin >> n;
  vector<ll> B, C;
  for (ll i = 0; i < n; i++) {
    ll a; cin >> a;
    if (i % 2 == 0) B.push_back(a);
    else            C.push_back(a);
  }
  reverse(B.begin(), B.end());
  vector<ll> D(B);
  for (ll x : C) D.push_back(x);
  if (n % 2 == 0) reverse(D.begin(), D.end());
  for (ll i = 0; i < n; i++) {
    if (i > 0) cout << " ";
    cout << D.at(i);
  }
  cout << endl;


  return 0;
}



Measured memory_bytes: 6464
n , m = map(int, input().split())

root = [[] for _ in range(n)]
for i in range(m):
    a, b = map(int, input().split())
    root[a-1].append(b)
    root[b-1].append(a)

kakutei = [1]

answer_li = [0]*n

while kakutei:
    k = kakutei.pop(0)
    for r in root[k-1]:
        if answer_li[r-1] == 0:
            kakutei.append(r)
            answer_li[r-1] = k

answer_li = answer_li[1:]
if 0 in answer_li:
    print('No')
else:
    print('Yes')
    for i in answer_li:
        print(i)


Measured memory_bytes: 34064
//https://atcoder.jp/contests/abc069/tasks/abc069_b

#include<bits/stdc++.h>

using namespace std;

int main(){
	int b;
	int n;
	string s;
	cin >> s;
	n=s.size();
	b=n-2;
	cout<<s[0]<<b<<s[n-1]<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct Fast {
    Fast() {
        std::cin.tie(0);
        ios::sync_with_stdio(false);
        cout.precision(20);
    }
} fast;

/* define */
#define FOR(I, X, Y) for(long long(I) = (X); (I) < (Y); (I)++)
#define REP(I, X, Y) for(long long(I) = (Y)-1; (I) >= (X); (I)--)
#define ALL(X) (X).begin(), (X).end()
#define pb push_back
#define COUNT(V, X)                                                            \
    (upper_bound((V).begin(), (V).end(), X) -                                  \
     lower_bound((V).begin(), (V).end(), X))
#define debug(x) cerr << #x << ':' << x << endl;
#define DEBUG(v)                                                               \
    {                                                                          \
        cerr << #v << ':';                                                     \
        for(auto xv : v) cerr << xv << ' ';                                    \
        cerr << endl;                                                          \
    }
#define Yes(X) cout << (X ? "Yes" : "No") << endl;
#define YES(X) cout << (X ? "YES" : "NO") << endl;
#define ctoi(C) (C - '0')
#define pow2(x) ((long long)((long long)1 << x))

/* alias */
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vii = vector<vector<int>>;
using vl = vector<long long>;
using vll = vector<vector<long long>>;
using pi = pair<int, int>;
using pl = pair<long long, long long>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const long long dx[] = {1, 0, -1, 0};
const long long dy[] = {0, 1, 0, -1};
const long long dx8[] = {1, 1, 0, -1, -1, -1, 0, 1};
const long long dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
const long long dx9[] = {1, 1, 0, -1, -1, -1, 0, 1, 0};
const long long dy9[] = {0, 1, 1, 1, 0, -1, -1, -1, 0};
const int INF = 1000000007;
const long long LINF = 1000000000000000007;

/* func */
template <typename T1, typename T2> inline bool chmin(T1 &a, const T2 &b) {
    if(a > b) a = b;
    return a > b;
}
template <typename T1, typename T2> inline bool chmax(T1 &a, const T2 &b) {
    if(a < b) a = b;
    return a < b;
}
long long max(long long x, int y) {
    return max(x, (long long)y);
}
long long max(int x, long long y) {
    return max((long long)x, y);
}
long long min(long long x, int y) {
    return min(x, (long long)y);
}
long long min(int x, long long y) {
    return min((long long)x, y);
}

/* liblary */

/* main */

signed main() {
    int N;
    int A = 0, Un = 0;
    cin >> N;
    string S;
    FOR(i, 0, N) {
        cin >> S;
        if(S == "A") A++;
        if(S == "Un") Un++;
        if(A < Un) {
            cout << "NO" << endl;
            return 0;
        }
    }
    YES(A == Un);
}


Measured memory_bytes: 3228
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC134
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            List<int> a = new List<int>();
            for(int i = 0; i < n; i++)
            {
                a.Add(int.Parse(Console.ReadLine()));
            }
            var aOrdered = a.OrderByDescending(x => x);
            var firstMax = aOrdered.First();
            var secondMax = aOrdered.Skip(1).First();
            if (firstMax == secondMax)
            {
                for(int i = 0; i < n; i++)
                {
                    Console.WriteLine(firstMax);
                }
            }
            else
            {
                for(int i = 0; i < n; i++)
                {
                    if(a[i] == firstMax)
                    {
                        Console.WriteLine(secondMax);
                    }
                    else
                    {
                        Console.WriteLine(firstMax);
                    }
                }
            }
        }
    }
}


Measured memory_bytes: 24792
#include <array>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iterator>
#include <tuple>
#include <utility>
#include <limits>
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cstdint>
#include <cassert>

using namespace std;

template<typename T, size_t N>
constexpr size_t NELEMS(T (&)[N]) { return N; }

#define FOR(i, start, end) for(int i = (start); i < (end); ++i)
#define REP(i, n) FOR(i, 0, n)

#define DEBUG
#undef DEBUG

using ll = long long;

int N;
ll K;
ll BIN[100005];

int main()
{
    cin >> N >> K;
    REP(_, N) {
        int a, b;
        cin >> a >> b;
        BIN[a] += b;
    }

    FOR(i, 1, 100000+1) {
        K -= BIN[i];
        if(K <= 0) {
            cout << i << "\n";
            break;
        }
    }

    return 0;
}


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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) ((a+b-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/2

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;

template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T> void YesNo(T a) {cout<<(a?"Yes":"No")<<endl;}
template<class T> void YESNO(T a) {cout<<(a?"YES":"NO")<<endl;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
void uniq(vector<int> &vec){sort(vec.begin(), vec.end());vec.erase(unique(vec.begin(), vec.end()), vec.end());}
void start(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);}

signed main() {
    string s;
    cin>>s;
    map<char,int> ma;
    REP(i,0,s.size()) ma[s[i]]++;
    bool ans=true;
    for(auto x : ma) if(x.second!=2) ans=false;
    YesNo(ans);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> p2;
int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  ll a,b,c;
  cin>>a>>b>>c;
  if(c>a+b&&4*a*b<(c-a-b)*(c-a-b))
    cout<<"Yes";
  else
    cout<<"No";
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define END '\n'
#define int long long
#define pb push_back
#define pii pair<int, int>
#define ff first
#define ss second
#define trace(x) cerr<<x<<END;
#define loop(i, a, b) for(int i = (a); i < (b); i++)
#define loopb(i, b, a) for(int i = (b); i > (a); --i) 
const int mod = 1e9+7;
const int mod1 = 998244353;
const int inf = 9223372036854775807ll;
 
void solve()
  {
   int x,y;
   cin>>x>>y;
   if(y>=2*x && y%2 == 0 && (2*x) >= (y/2))
     cout<<"Yes";
   else
     cout<<"No";
  } 
signed main()
 {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0); 
 
     solve();
  //cerr<<END<<1.0*clock();
  return 0;
} 

Measured memory_bytes: 3636
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scan = new Scanner(System.in);
    String S =  scan.nextLine();
    int maru = 0;
    int batsu = 0;
    int sum = 0;
    for (int i = 0; i < S.length(); i++) {
      sum++;
      if (S.charAt(i) == 'o') {
        maru++;
      } else {
        batsu++;
      }
    }
    if (batsu >= 8) {
      System.out.println("NO");
    } else {
      System.out.println("YES");
    }

  }
}


Measured memory_bytes: 20816
#define _GLIBCXX_DEBUG//TLEの原因になるので注意！！！！！！！！！！！
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair
#define sz(x) int(x.xise())
#define mod 1000000007
#define reps(i,s,n) for(int i = s; i < n; i++)
deque<int> deq;
//#define int long long

//cerrはコメントアウトしなくても通る//ただしTLEを引き起こすことがある

int main(){
    string s;
    cin >> s;
    int n=s.size();
    int k=n/2;
    int ans=0;
    rep(i,k){
        if(s[i]!=s[n-1-i]){
            ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
package main

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

func main() {

	sc := bufio.NewScanner(os.Stdin)
	sc.Scan()
	in := sc.Text()

	sec, _ := strconv.Atoi(in)
	hour := sec / 3600
	min := sec % 3600 / 60
	sec = sec % 3600 % 60
	fmt.Printf("%v:%v:%v\n", hour, min, sec)
}



Measured memory_bytes: 1092
#include <stdio.h>
#include<math.h>
int main()
{
    char s[4];
    int n,i,c0=0,c1=0,c2=0,c3=0;
    scanf("%d",&n);
    while(n--)
    {
        scanf("%s",s);
        if(s[0]=='A')
            c0++;
        else if(s[0]=='W')
            c1++;
        else if(s[0]=='T')
            c2++;
        else if(s[0]=='R')
            c3++;
    }
    printf("AC x %d\n",c0);
    printf("WA x %d\n",c1);
    printf("TLE x %d\n",c2);
    printf("RE x %d\n",c3);



}


Measured memory_bytes: 1732
n = int(input())
a = list(map(int, input().split()))

alice = 0
bob = 0

a.sort(reverse = True)

i = 0

while True:
    if i >= n:
        break
    alice += a[i]
    i += 1
    if i >= n:
        break
    bob += a[i]
    i += 1

print(alice - bob)



Measured memory_bytes: 3060
#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;
typedef vector<string> vs;
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
const int DIV = 1e9+7;

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

Measured memory_bytes: 256