akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

void func(vector<vi> v){
	//dbg(v);
	vector<pi> ans;
	rep(i, v.size()) rep(j, i){
		for(int x : v[i]) for(int y : v[j]) ans.emplace_back(x, y);
	}
	cout << ans.size() << endl;
	rep(i, ans.size()) cout << ans[i].first << " " << ans[i].second << (i==ans.size()-1?"\n":" ");
}

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	int n; cin >> n;
	
	vector<vi> v;
	if(n % 2) v.pb(vi(1, n--));
	for(int l = 1, r = n; l < r; l++, r--){
		v.pb(vi({l, r}));
	}
	
	func(v);
	
	return 0;
}

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

map<int, int> ma;

void prime(int x) {
    for (int i = 2; i * i <= x; i++) {
        while (x % i == 0) {
            ma[i]++;
            x /= i;
        }
    }
    if (x != 1) ma[x]++;
}

void fact(int x) {
    if (x == 1) return;
    prime(x);
    fact(x - 1);
}

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

    fact(N);
    vector<int> v;
    for (auto m : ma) {
        v.push_back(m.second);
    }

    int ans = 0;
    for (int i = 0; i < v.size(); i++) {
        if (v[i] >= 74) ans++;
        if (v[i] >= 2) {
            for (int j = 0; j < v.size(); j++) {
                if (v[j] >= 4 && j != i) {
                    for (int k = j + 1; k < v.size(); k++) {
                        if (v[k] >= 4 && k != i) {
                            ans++;
                        }
                    }
                }
            }
        }
        if (v[i] >= 24) {
            for (int j = 0; j < v.size(); j++) {
                if (v[j] >= 2 && i != j) {
                    ans++;
                }
            }
        }
        if (v[i] >= 14) {
            for (int j = 0; j < v.size(); j++) {
                if (v[j] >= 4 && i != j) {
                    ans++;
                }
            }
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<numeric>
#include<functional>
#include<string>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>
#include<queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<n;i++)
#define ll long long
#define INF 2147483647
using namespace std;
using Graph=vector<vector<int>>;

int main(){
  int n; cin>>n; int a[n],b[n];
  rep(i,n){
    cin>>a[i]>>b[i];
  }
  sort(a,a+n);
  sort(b,b+n);
  if(n%2==1){
    cout<<b[(n-1)/2]-a[(n-1)/2]+1;
  }else{
    cout<<b[n/2]+b[n/2-1]-a[n/2]-a[n/2-1]+1;
  }
}


Measured memory_bytes: 5160
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<cstring>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<fstream>

#define MOD (1000000007)

using namespace std;

typedef long long int Int;

constexpr Int TEN(int n) { return n == 0 ? 1 : 10 * TEN(n-1); }

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

    Int sum = 0;
    for(Int i = 1;i <= N;i++) {
        if(i % 3 != 0 && i % 5 != 0) {
            sum += i;
        }
    }

    cout<<sum<<endl;

    return 0;
}


Measured memory_bytes: 3192
#include<bits/stdc++.h>
using namespace std;
long long x[100001];
long long y[100001];
int main()
{
	long long n,a,b,s=0;
	cin>>n>>a>>b;
	for(int i=1;i<=n;i++)
		cin>>x[i];
	for(int i=1;i<=n-1;i++)
		y[i]=x[i+1]-x[i];
	for(int i=1;i<=n-1;i++)
	{
		if(b<=y[i]*a)
			s+=b;
		else
			s+=y[i]*a;
	}
	cout<<s;
}

Measured memory_bytes: 1792
#include <stdio.h>
#include <stdlib.h>
#define MAX 100001
#define MAX2 50001
int main() {
int i,j;
int left,right,mid;
int n,m,a[MAX],b[MAX2],key,count=0;
scanf("%d",&n);
for(i=0;i<n;i++){
    scanf("%d",&a[i]);
}
scanf("%d",&m);
for(i=0;i<m;i++){
    scanf("%d",&b[i]);
}

for (j = 0; j < m; j++) {
  left=0;
  right=n;
  key=b[j];
  while (left<right) {
    mid=(left+right)/2;
if(a[mid]==key){
  count++;
  break;}
else if(a[mid]<key) {left=mid+1;}
else right=mid;
}}
printf("%d\n",count);
return 0;
}


Measured memory_bytes: 2280
#include <iostream>
#define rep(S, L) for (int i = S; i < L; ++i)
using namespace std;

int main() {
  int x;
  cin >> x;
  if (x == 3 || x == 5 || x == 7) {
    cout << "YES" << endl;
  } else {
    cout << "NO" << endl;
  }
  return 0;
}


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

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

  int total;
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j <= n - i; j++) {
      total = 10000 * i + 5000 * j + (n - i - j ) * 1000;
      if (total == y) {
        printf("%d %d %d\n", i, j, n - i - j);
        return 0;
      }
    }
  }

  cout << "-1 -1 -1" << endl;

  return 0;
}


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

int main() {
    int n;
    cin >> n;
    vector<int> b(n);
    for (int i = 0; i < n-1; ++i) cin >> b[i];

    int ans=b[0];
    for(int i=1;i<n;++i){
      if(b[i-1]<=b[i]){
        ans+=b[i-1];
      }
      else{
        ans+=b[i];
      }
    }
    ans+=b[n-2];
    cout << ans << endl;
}


Measured memory_bytes: 256
package main

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

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	readString, readBytes = newReadString(os.Stdin)
}

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

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

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

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

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

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

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

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

func maxInt64(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

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

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

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumInt64(a []int64) int64 {
	var ret int64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

// sort ------------------------------------------------------------

type int64Array []int64

func (s int64Array) Len() int           { return len(s) }
func (s int64Array) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s int64Array) Less(i, j int) bool { return s[i] < s[j] }

type xxx struct {
	x int
}

type sortArray []xxx

func (s sortArray) Len() int           { return len(s) }
func (s sortArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }

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

var a map[int]struct{}
var xy map[int]map[int]int

func main() {
	n := readInt()
	m := readInt()
	xy = make(map[int]map[int]int)
	for i := 0; i < m; i++ {
		x := readInt()
		y := readInt()
		readInt()
		if _, ok := xy[x-1]; !ok {
			xy[x-1] = make(map[int]int)
		}
		if _, ok := xy[y-1]; !ok {
			xy[y-1] = make(map[int]int)
		}
		xy[x-1][y-1] = 0
		xy[y-1][x-1] = 0
	}
	a = make(map[int]struct{})
	for i := 0; i < n; i++ {
		a[i] = struct{}{}
	}

	ans := 0
	for {
		next := -1
		for i := range a {
			next = i
			break
		}
		if next == -1 {
			break
		} else {
			dfs(next)
			ans++
		}
	}

	fmt.Println(ans)
}

func dfs(node int) {
	delete(a, node)
	for next := range xy[node] {
		if _, ok := a[next]; ok {
			dfs(next)
		}
	}
}


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

using namespace std;

int N;
string per;
string c;
int  D[1001];
long long int a[1001][2][2][2];

long long int dp(int d, bool J, bool O, bool I ,bool yJ, bool yO, bool yI){
	if(d > 0){
		if(D[d] == 0){
			if(J == 0) return 0;
		}
		if(D[d] == 1){
			if(O == 0) return 0;
		}
		if(D[d] == 2){
			if(I == 0) return 0;
		}

		if(d > 1){
			if(!((J == 1 && yJ == 1) || (O == 1 && yO == 1) || ( I == 1 && yI == 1))) return 0;
		}
	}
	
	//cout << d << endl;

	if(a[d][J][O][I] >= 0) return a[d][J][O][I];

	if(d == N) return a[d][J][O][I] = 1;

	long long int b = 0;
	if(d == 0){
		for(int o = 0;o < 2;o++){
			for(int i = 0;i < 2;i++){
				b += (dp(d+1,1,o,i,J,O,I) % 10007);
			}
		}
	}else{
		for(int j = 0;j < 2;j++){
			for(int o = 0;o < 2;o++){
				for(int i = 0;i < 2;i++){
					b += (dp(d+1,j,o,i,J,O,I) % 10007);
				}
			}
		}
	}
	return a[d][J][O][I] = b % 10007;
}

int main(){
	fill_n(D,1001,-1);
	fill_n(***a,1001*2*2*2,-1);
	cin >> N;
	cin >> per;
	for(int i = 0;i <= N;i++){
		c = per.substr(i,1);
		if(c == "J"){
			D[i+1] = 0;
		}else if(c == "O"){
			D[i+1] = 1;
		}else if(c == "I"){
			D[i+1] = 2;
		}
 	}

 	cout << dp(0,0,0,0,0,0,0) << endl;
 	return 0;

}

Measured memory_bytes: 3212
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

//a^b % MOD
long long mod_pow(ll a,ll b){
	long long ret = 1;
	long long c = a;
	for(int i = 0;i <= 60;i++){
		if(b & (1LL << i))ret = (ret * c) % MOD;
		c = (c * c) % MOD;
	}
	return ret;
}

//ａをbで割る
long long mod_div(long long a,long long b){
	long long tmp = MOD - 2,c = b,ret = 1;
	while(tmp > 0){
		if(tmp & 1){
			ret *= c;ret %= MOD;
		}
		c *= c;c %= MOD;tmp >>= 1;
	}
	return a*ret%MOD;
}

#define MAX_K 333333
vector<long long> fact(MAX_K);
long long combination(long long n, long long r){
    if(n < r || n < 0 || r < 0)
        return 0;
	if(fact[0] != 1){
		fact[0] = 1;
		for(long long i = 1;i < MAX_K;i++)fact[i] = (fact[i-1] * i) % MOD;
	}
    long long ret = fact[n];
	long long tmp = (fact[r] * fact[n-r]) % MOD;
    return mod_div(ret,tmp);
}

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

	ll n, m, k;cin >> n >> m >> k;
	ll ans = 0;
	for(ll i = 0;i <= k;i++){
		ll tmp = combination(n - 1, i);
		ll seica = m * mod_pow(m - 1, n - i - 1) % MOD;
		ans = (ans + tmp * seica % MOD) % MOD;
	}

	cout << ans << endl;

	return 0;
}


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

int x, y;

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

	cin >> x >> y;
	!(y % 2) && (y >= 2 * x) && (2 * x >= y / 2) ? cout << "Yes\n" : cout << "No\n";
  
  	return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i = ((ll) a); i < ((ll) n); i++)
using namespace std;
typedef long long ll;

string S;
int i;

ll dfs() {
  ll ret = 0;
  i++;

  if('0' <= S[i] && S[i] <= '9') {
    while('0' <= S[i] && S[i] <= '9') {
      ret = ret * 10 + (S[i] - '0');
      i++;
    }
    ret = (ret + 1) / 2;
  } else {
    vector<ll> x;
    while(S[i] == '[') x.push_back(dfs());
    sort(x.begin(), x.end());
    REP(j, 0, (x.size() + 1) / 2) ret += x[j];
  }

  i++;
  return ret;
}

int main(void) {
  ll N;
  cin >> N;
  REP(j, 0, N) {
    cin >> S;
    i = 0;
    cout << dfs() << endl;
  }
}




Measured memory_bytes: 3252
# -*- coding: utf-8 -*-
N,M=map(int,input().split())
A=list(map(int,input().split()))
import heapq
A=[-1*i for i in A]
heapq.heapify(A)
for _ in range(M):
    a=heapq.heappop(A)
    a=-1*a
    a=a//2
    a=-1*a
    heapq.heappush(A,a)
print(-1*sum(A))

Measured memory_bytes: 14252
#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int64_t i = 0; i < n; ++i)
using namespace std;

int main() {
  vector<int> v = {1, 2, 4, 8, 16, 32, 64};
  int c = 0, n;
  cin >> n;
  while(n > 0){
    ++c;
    n /= 2;
  }
  cout << v[c-1] << endl;
  return 0;
}

Measured memory_bytes: 256
n = int(input())
A = [list(map(int, input().split())) for _ in range(n)]

def chmax(a, b):
    if a > b:
        return a
    else:
        return b

dp = [[ 0 for _ in range(3)]for _ in range(n+10)]

for i in range(3):
    dp[0][i] = A[0][i]

for i in range(1, n):
    for j in range(3):
        for k in range(3):
            if j != k:
                dp[i][k] = chmax(dp[i][k], dp[i-1][j]+A[i][k])

print(max(dp[n-1]))

Measured memory_bytes: 74968
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
int main() {
 
    string s;
    cin >> s;
    int n = s.size();
 
    int res = 0;
    for(int i = 0; i < n; ++i){
        for(int j = i; j < n; ++j){
            string sub = s.substr(i, j-i+1);
            int num = sub.size();
 
            bool flg = true;
            for(int k = 0; k < num; ++k){
                char c = sub[k];
                if(c!='A' && c!='C' && c!='G' && c!='T') {
                    flg = false;
                  	break;
                }
            }
 
            if(flg) res = max(res, num);
        }
    }
 
    cout << res << endl;
 
 
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define watch(x) cout<<(#x)<<" is "<<(x)<<endl
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define pb push_back
#define pq priority_queue
#define rep(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define elif else if

using namespace std;
using ll=long long;
using ull=unsigned long long;
using ld=long double;
using pll=pair<ll,ll>;
using pss=pair<string,string>;
using pdd=pair<ld,ld>;
using graph=vector<vector<int>>;
using wgraph=vector<vector<pll>>;

const ll MOD=1000000007;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int ex[8]={1,1,0,-1,-1,-1,0,1};
const int ey[8]={0,1,1,1,0,-1,-1,-1};
const ld E=1e-9;

template<class T> void chmin(T &a, T b){a=min(a, b);}
template<class T> void chmax(T &a, T b){a=max(a, b);}

ll abs1(ll a){if(a>=0)return a;else return -a;}
ll pow1(ll a,ll b,ll p=LLONG_MAX){
  ll ret=1;
  while(b!=0){
    if((b&1)==1)ret*=a;a*=a;
    if(a>=p)a%=p;if(ret>=p)ret%=p;
    b=b>>1;
  }
  return ret;
}
int digit(ll a,ll b=10){int i=0;while(a!=0){a/=b;i++;}return i;}
ll gcd1(ll a,ll b){
  if(a==0 || b==0)return 0;
  ll n;while(a%b!=0){n=a%b;a=b;b=n;}return b;
}
ll solveLinear(ll n,ll m,ll c){
  if(n==0 && m==0)return 0;
  ll a[100],b[100];a[0]=n;b[0]=m;int i=1;
  while(b[i-1]!=0){a[i]=b[i-1];b[i]=a[i-1]%b[i-1];i++;}
  n=i;if(c%a[n-1]!=0)return 0;
  ll x=c/a[n-1],y=0;
  for(i=1;i<n;i++){ll cnt=x;x=y;y=cnt-(a[n-i-1]/b[n-i-1])*y;}
  return x;
}
ll modRev(ll a,ll p=MOD){
  a%=p;ll n=solveLinear(a,p,1);
  n%=p;if(n<0)return n+p;
  return n;
}
ll fact(ll n,ll p=MOD){
  if(n<0)return 0;
  ll ret=1;for(int i=1;i<=n;i++){ret=ret*i;if(ret>=p)ret%=p;}
  return ret;
}
ll perm(ll n,ll k,ll p=MOD){
  if(n<0 || k<0 || n<k)return 0;
  ll ret=1;rep(i,k){ret=ret*(n-i);if(ret>=p)ret%=p;}
  return ret;
}
ll binom(ll n,ll k,ll p=MOD){
  return (perm(n,k,p)*modRev(fact(k)))%p;
}
int bis(vector<int> v,int key){
  int left=-1,right=v.size();
  while(abs1(right-left)>1){
    int mid=left+(right-left)/2;
    if(v[mid]<=key)left=mid;
    else right=mid;
  }
  return left;
}

int main(){
  int i,j,k,cnt=0;
  int n;
  cin>>n;
  int a[n];
  int mx=0,mn=INT_MAX;
  rep(i,n){
    cin>>a[i];
    chmax(mx,a[i]);
    chmin(mn,a[i]);
  }
  if(mx==mn){
    if(n/2>=mx || mx==n-1)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
  }
  if(mx-mn>=2){
    cout<<"No"<<endl;
    return 0;
  }
  rep(i,n){
    if(a[i]==mn)cnt++;
  }
  if((n-cnt)/2>=mx-cnt && mx-1>=cnt)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}


Measured memory_bytes: 640
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
#include<queue>
#include<functional>
#include<map>
#include<set>
#include<cstring>
#include<string>
#include<stack>
#include<stdlib.h>
#include<math.h>
using namespace std;
#define int long long
typedef pair<int, int> pii;
typedef pair<int, char> pic;
typedef priority_queue<pii, vector<pii>, greater<pii> > RPQ;
#define mk make_pair
#define INF (1 << 30)
#define INFL (1ll << 60ll)
#define mod 1000000007

string s, t;
int dp1[200200], dp2[200200];

signed main(){
    cin >> s;
    int N = (int)s.size();
    s += 'O';
    for(int i = 0; i < N; i++){
        if(i + 1 < N && s[i] == 'B' && s[i + 1] == 'C'){
            t += 'D';
            i++;
        }
        else {
            t += s[i];
        }
    }
    int M = (int)t.size();
    for(int i = 0; i < M; i++){
        dp2[i + 1] = dp2[i];
        if(t[i] == 'A'){
            dp1[i + 1] = dp1[i] + 1;
        }
        if(t[i] == 'D'){
            dp1[i + 1] = dp1[i];
            dp2[i + 1] += dp1[i + 1];
        }
    }
    cout << dp2[M] << endl;
    
    return 0;
}
/*


*/

Measured memory_bytes: 3848
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
using namespace std;

int main(){
    long long N;
    cin >> N;
    string ans = "";
    while( N != 0) {
        long long x = (N-1) % 26 + 1;
        N =  (N-1) / 26;
        ans += x + 'a'-1;
    }
    reverse(ans.begin (), ans.end());
    cout << ans << endl;
}




Measured memory_bytes: 3620
#include <algorithm>
#include <cassert>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <vector>

using namespace std;

#define debug(x) (cout << # x ": " << x << endl)
#define int long long int
#define repeat(i, n) for (int i = 0; i < n; ++i)
#define all(x) (x).begin(), (x).end()

#define outv(v) for(int i=0;i<v.size();++i){if(i){cout<<" ";}cout<<v[i];}

class UnionFind {
public:
    UnionFind(int n) {
        for (int i = 0; i < n; i++) {
            _parent.push_back(i);
            _size.push_back(1);
        }
    }

    int find(int index) {
        if (is_root(index)) return index;
        return _parent[index] = find(_parent[index]);
    }

    bool is_root(int index) {
        return _parent[index] == index;
    }

    bool has_same_root(int lhs, int rhs) {
        return find(lhs) == find(rhs);
    }

    void unite(int lhs, int rhs) {
        int l = find(lhs);
        int r = find(rhs);
        if (has_same_root(l, r)) return;
        _size[l] += _size[r];
        _parent[r] = l;
    }

    int size(int index) {
        return _size[find(index)];
    }

private:
    vector<int> _parent;
    vector<int> _size;
};

signed main() {
    int n, m, k;
    cin >> n >> m >> k;

    UnionFind uf(n);
    vector<pair<int, int>> vn;

    repeat(i, m) {
        int a, b;
        cin >> a >> b;
        uf.unite(a - 1, b - 1);
        vn.push_back(make_pair(a - 1, b - 1));
    }

    vector<int> ans;
    repeat(i, n) {
        ans.push_back(uf.size(i) - 1);
    }

    repeat(i, k) {
        int c, d;
        cin >> c >> d;
        vn.push_back(make_pair(c - 1, d - 1));
    }

    for (auto p: vn) {
        int x = p.first, y = p.second;
        if (uf.has_same_root(x, y)) {
            --ans[x];
            --ans[y];
        }
    }

    outv(ans);

    return 0;
}


Measured memory_bytes: 11336
#include<iostream>
#include<algorithm>
using namespace std;
int p[300000], n, m;
pair<int, int>x[300000];
int main() {
    cin >> n >> m; for (int i = 1; i <= n; i++) { p[i] = i; }
    for (int i = 0; i < m; i++) { int r; cin >> r; p[r] = -i; }
    for (int i = 1; i <= n; i++) { x[i] = make_pair(p[i], i); }
    sort(x + 1, x + n + 1);
    for (int i = 1; i <= n; i++) { cout << x[i].second << endl; }
    return 0;
}

Measured memory_bytes: 6236
def main():
    from sys import stdin
    input = stdin.readline

    n, m, r = map(int, input().split())
    l = [int(i) - 1 for i in input().split()]
    d = [[10**8] * n for _ in range(n)]
    for _ in range(m):
        i, j, k = map(int, input().split())
        d[i-1][j-1] = k
        d[j-1][i-1] = k

    # Warshall-Floyd algorithm
    for k in range(n):
        for i in range(n-1):
            for j in range(i+1, n):
                if d[i][j] > d[i][k] + d[k][j]:
                    d[i][j] = d[i][k] + d[k][j]
                    d[j][i] = d[i][j]

    # full search
    # 8! = 40320
    from itertools import permutations

    answer = float('inf')
    for i in permutations(l):
        ans = 0
        for j in range(r-1):
            ans += d[i[j]][i[j+1]]
        if ans < answer:
            answer = ans

    print(answer)

main()


Measured memory_bytes: 9848
n = int(input())
s = [input() for _ in range(n)]
existed = {}
cnt = 0
for i in range(n):
  sorted_s = ''.join(sorted(s[i]))
  if sorted_s in existed:
    cnt += existed[sorted_s]
    existed[sorted_s] += 1
  else:
    existed[sorted_s] = 1
print(cnt)

Measured memory_bytes: 24980
import java.util.*;

public class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int E=in.nextInt(),Y=in.nextInt();
		
		switch(E){
		case 0:
			if(Y<=1911)System.out.println("M"+(Y-1867));
			else if(Y<=1925)System.out.println("T"+(Y-1911));
			else if(Y<=1988)System.out.println("S"+(Y-1925));
			else System.out.println("H"+(Y-1988));
			break;
		
		case 1:
			System.out.println(Y+1867);
			break;
		
		case 2:
			System.out.println(Y+1911);
			break;
		
		case 3:
			System.out.println(Y+1925);
			break;
		
		case 4:
			System.out.println(Y+1988);
			break;
		}
	}
}


Measured memory_bytes: 26392
program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  a,b,i:integer;
  s,ans:string;
begin
  try
    { TODO -oUser -cConsole Main : abc84a}
    read(a);
    readln(b);
    readln(s);

    ans:='Yes';
    if not(s[a+1]='-') then
      ans:='No'
    else begin
      for i := 1 to a do
        if s[i]='-' then begin
          ans:='No';
          break;
        end;
      for i := a+2 to Length(s) do
        if s[i]='-' then begin
          ans:='No';
          break;
        end;
    end;

    Writeln(ans);
    readln;
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int N, Z, W;
int A[2020];
int dpX[2020];//[2020]; //maximize X-i; Y-j; X-turn i<=j
int dpY[2020];//[2020]; //minimize Y-i; X-j; Y-turn i<=j

int bktkY(int);
int bktkX(int b)
{
  if(~dpX[b]) return dpX[b];
  int Yno = b?A[b]:W;
  int ans = abs(A[N]-Yno);
  for(int i=b+1; i<N; ++i)
    ans = max(ans, bktkY(i));
  return dpX[b] = ans;
}
int bktkY(int b)
{
  if(~dpY[b]) return dpY[b];
  int Xno = b?A[b]:Z;
  int ans = abs(A[N]-Xno);
  for(int i=b+1; i<N; ++i)
    ans = min(ans, bktkX(i));
  return dpY[b] = ans;
}
int main()
{
  scanf("%d%d%d", &N, &Z, &W);
  for(int i=1; i<=N; ++i) scanf("%d", A+i);
  memset(dpX, -1, sizeof dpX);
  memset(dpY, -1, sizeof dpY);
  printf("%d\n", bktkX(0));
  return 0;
}

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

const int N=100005;
int n;
long long h[N],dp[N];

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++) scanf("%lld",&h[i]);
	dp[1]=0,dp[2]=abs(h[2]-h[1]);
	for(int i=3;i<=n;i++) dp[i]=min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]));
	printf("%lld\n",dp[n]);
}

Measured memory_bytes: 1792
def slove():
    import sys
    import bisect
    import collections
    import fractions
    import heapq
    input = sys.stdin.readline
    n, k, q = list(map(int, input().rstrip('\n').split()))
    a = [int(input().rstrip('\n')) for _ in range(q)]
    ls = [k-q] * n
    for v in a:
        ls[v-1] += 1
    for i in range(len(ls)):
        if ls[i] > 0:
            print("Yes")
        else:
            print("No")


if __name__ == '__main__':
    slove()


Measured memory_bytes: 75352
//Common Raccoon Vs Monster
#include <iostream>
using namespace std;
int main() {
	long long h, sum = 0, n;
	cin >> h >> n;
	for (int i = 0; i < n; i++) {
		int temp;
		cin >> temp;
		sum += temp;
	}
	if (h <= sum)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
import static java.lang.Math.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskX solver = new TaskX();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskX {
		public void solve(int testNumber, InputReader in, PrintWriter out) {

			int n = in.nextInt();
			int k = in.nextInt();
			P[] ps = new P[n];
			long[] xs = new long[n];
			long[] ys = new long[n];

			for (int i = 0; i < n; i++) {
				long x = in.nextLong();
				long y = in.nextLong();
				ps[i] = new P(x, y);
				xs[i] = x;
				ys[i] = y;
			}

			long sum = Long.MAX_VALUE;
			for (int x1 = 0; x1 < n; x1++) {
				for (int x2 = 0; x2 < n; x2++) {
					for (int y1 = 0; y1 < n; y1++) {
						for (int y2 = 0; y2 < n; y2++) {
							int count = 0;
							long xl = min(xs[x1], xs[x2]);
							long xr = max(xs[x1], xs[x2]);
							long yd = min(ys[y1], ys[y2]);
							long yu = max(ys[y1], ys[y2]);

							for (int i = 0; i < n; i++) {
								if (xl <= ps[i].x && ps[i].x <= xr
										&& yd <= ps[i].y && ps[i].y <= yu) {
									count++;
								}
								if (count >= k) {
									sum = min(sum, abs(xr-xl)*abs(yu-yd));
								}
							}
						}
					}
				}
			}
			out.println(sum);
		}
	}

	static class P {
		long x, y;
		P(long x, long y) {
			this.x = x;
			this.y = y;
		}
	}

	static class InputReader {
		BufferedReader in;
		StringTokenizer tok;

		public String nextString() {
			while (!tok.hasMoreTokens()) {
				try {
					tok = new StringTokenizer(in.readLine(), " ");
				} catch (IOException e) {
					throw new InputMismatchException();
				}
			}
			return tok.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(nextString());
		}

		public long nextLong() {
			return Long.parseLong(nextString());
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt();
			}
			return res;
		}

		public long[] nextLongArray(int n) {
			long[] res = new long[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextLong();
			}
			return res;
		}

		public InputReader(InputStream inputStream) {
			in = new BufferedReader(new InputStreamReader(inputStream));
			tok = new StringTokenizer("");
		}

	}

}


Measured memory_bytes: 22540
n = int(input())
INF = 10**18
ans = INF


def f(a, b):
    return max(len(str(a)), len(str(b)))


for i in range(1, int(n**.5)+1):
    if n % i == 0:
        ans = min(f(i, n//i), ans)

print(ans)


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


int main(){
    double PI = acos(-1);
    double R;
    cin >> R;

    printf("%.20f\n", 2.0*R*PI);
    return 0;
}

Measured memory_bytes: 3740
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Collections;

public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		Integer[] a =new Integer[10];    //?????????????????????

		for(int i = 0; i < a.length; i++){
			a[i] = Integer.parseInt(br.readLine());
			if(a[i] < 0 || a[i] >10000){
				i--;
			}
		}

		Arrays.sort(a,Collections.reverseOrder());

		for(int i = 0; i < 3; i++){
			System.out.println(a[i]);
		}

	}
}

Measured memory_bytes: 24176
#include<stdio.h>
int recursive(int a,int b)
{
    if(b==0)return 1;
    else return a*recursive(a,b-1);
}
int main()
{
    int i,n,co=0;
    while(scanf("%d",&n)==1)
    {
        int ara[n];
        for(i=0;i<n;i++)scanf("%d",&ara[i]);
        for(i=0;i<n;i++)
        {
            if(ara[i]%2==0)co++;
        }
        printf("%d\n",recursive(3,n)-recursive(2,co));
        co=0;
    }
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define all(v) (v).begin(), (v).end()
#define siz(v) (ll)(v).size()
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define repi(i, x, n) for (ll i = x; i < (ll)(n); i++)
#define lb lower_bound
#define ub upper_bound
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
vector<ll> dx = {-1, 1, 0, 0}, dy = {0, 0, -1, 1};

signed main()
{
    ll n, k, ans = 1;
    cin >> n >> k;

    vector<ll> v(n);
    rep(i, n) cin >> v[i];

    bool sf = false;
    set<ll> se, ise;

    ll s = 0, g = k - 1, cnt = 0;
    rep(i, k)
    {
        if (i && v[i - 1] < v[i])
        {
            cnt++;
            if (cnt >= k - 1)
            {
                sf = true;
            }
        }
        else
        {
            cnt = 0;
        }
        se.insert(v[i]);
        ise.insert(-v[i]);
    }

    for (g = k; g < n;)
    {
        bool flag = false;
        ll mn = *se.lb(-1), mx = -*(ise.lb(-INF));

        if (v[s] > mn || v[g] < mx)
        {
            flag = true;
        }

        if (v[g - 1] < v[g])
        {
            cnt++;
            if (k - 1 <= cnt)
            {
                if (sf)
                {
                    flag = false;
                }
                else
                {
                    sf = true;
                }
            }
        }else{
            cnt=0;
        }
        //cout<<cnt<<endl;

        se.erase(v[s]);
        se.insert(v[g]);
        ise.erase(-v[s]);
        ise.insert(-v[g]);

        s++;g++;
        if (flag)
        {
            ans++;
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 20608
#include <bits/stdc++.h>
#define pb push_back
#define fs first
#define sc second
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)x.size()
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;
typedef vector<pii> vpii;

const int N=110000;
int n, x[N];

int gcd(int x, int y) {
    while(y) {
        int t=y;
        y=x%t;
        x=t;
    }
    return x;
}

int win() {
    int i, t, io, ne;
    for(t=x[0], i=1; i<n; i++) t=gcd(t, x[i]);
    for(i=0; i<n; i++) x[i]/=t;
    for(io=-1, ne=i=0; i<n; i++) {
        if(x[i]%2==0) ne++;
        else if(x[i]>1) io=i;
    }
    if(ne%2) return 1;
    if(ne<n-1 || io==-1) return 0;
    x[io]--;
    return !win();
}

int main() {
    scanf("%d", &n);
    for(int i=0; i<n; i++) scanf("%d", &x[i]);
    printf(win()? "First\n" : "Second\n");
    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>

#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long int
#define mod 1000000007
#define inf 1e18+42
#define endl "\n"
#define pi 3.1415926535897932384626433832795028841971693993751058
#define maxn 100005

#define out1(a) cout<<#a<<" "<<a<<endl
#define out2(a,b) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<endl
#define out3(a,b,c) cout<<#a<<" "<<a<<" "<<#b<<" "<<b<<" "<<#c<<" "<<c<<endl

#define rep(i,a,b) for(int i=a;i<b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)
#define fori(it,A) for(auto it=A.begin();it!=A.end();it++)

#define ft first
#define sd second
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define zero(x) memset(x,0,sizeof(x));
 
using namespace std;

int binpow(int a, int b) {
    int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

//START OF CODE ->->->->->->->

void solve()
{
    int n,m;
    cin>>n>>m;

    // map< int,priority_queue<int> > p;
    vector< pair<int,int> > p;

    rep(i,0,n)
    {
        int a,b;
        cin>>a>>b;

        p.pb(mp(a,b));
    }
    int ans = 0;
    sort(all(p));
    priority_queue<int> s;
    int idx = 0;
    rep(i,1,m+1)
    {
        while( idx < n && p[idx].ft <= i )
        {
            s.push(p[idx].sd);
            idx++;
        }

        if ( !s.empty() )
        {
            ans += s.top();
            s.pop();
        }
    }
    cout<<ans<<endl;
}

//END OF CODE ->->->->->->->->

signed main()
{
    fast;
    int t = 1;
    // cin>>t;

    while(t--)
    {
        solve();
    }
    return 0;
}



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

const int maxN = 1e5 + 10;

int n, h[maxN], f[maxN];

int abs(int x)
{
    return max(x, -x);
}

int main()
{
   // freopen("input.txt", "r", stdin);
    scanf("%d", &n);
    for (int i = 1 ; i <= n; ++i)
        scanf("%d", &h[i]);
    f[1] = 0, f[2] = abs(h[1] - h[2]);
    for (int i = 3; i <= n; ++i)
        f[i] = min(f[i - 1] + abs(h[i - 1] - h[i]), f[i - 2] + abs(h[i - 2] - h[i]));
    printf("%d", f[n]);
}

Measured memory_bytes: 1024
//Created by Aminul on 9/26/2020.

import java.io.*;
import java.util.*;

import static java.lang.Math.*;

public class Main {
    public static void main(String[] args) throws Exception {
        InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int OFFSET = 300000 + 10;
        SegTree_iterative segTree = new SegTree_iterative(OFFSET + OFFSET + OFFSET + 10);
        int n = in.nextInt(), k = in.nextInt();
        int res = 0;
        for (int i = 0; i < n; i++) {
            int x = in.nextInt();
            int l = x - k, r = x + k;
            x += OFFSET;
            l += OFFSET;
            r += OFFSET;
            int val = 1 + segTree.query(l, r);
            segTree.update(x, val);
            res = max(res, val);
        }

        pw.println(res);

        pw.close();
    }

    static class SegTree_iterative {
        int t[];
        int n;

        SegTree_iterative(int N) { // 0-based indexing
            t = new int[2 * N];
            n = t.length;
        }

        public int get(int i) {
            return t[i + n / 2];
        }

        public int operation(int a, int b) {
            return max(a, b); // chane to min(a, b) or (a+b) for different ops
        }

        public void update(int i, int value) {
            i += n / 2;
            t[i] = operation(t[i], value);
            for (; i > 1; i >>= 1)
                t[i >> 1] = operation(t[i], t[i ^ 1]);
        }

        public int query(int a, int b) {
            int res = Integer.MIN_VALUE; // for sum, res = 0; for min, res = -inf ..etc
            for (a += n / 2, b += n / 2; a <= b; a = (a + 1) >> 1, b = (b - 1) >> 1) {
                if ((a & 1) != 0)
                    res = operation(res, t[a]);
                if ((b & 1) == 0)
                    res = operation(res, t[b]);
            }
            return res;
        }
    }

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

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        public String next() throws Exception {
            while (tokenizer == null || !tokenizer.hasMoreTokens())
                tokenizer = new StringTokenizer(reader.readLine());
            return tokenizer.nextToken();
        }

        public int nextInt() throws Exception {
            return Integer.parseInt(next());
        }
    }
}

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

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

using namespace std;

int main(){
	int n;
	string s; cin>>n>>s;
	rep(i,s.length()) s[i]='A'+(s[i]-'A'+n)%26;
	cout<<s<<'\n';
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
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;
}
typedef long long int ll;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
const double EPS = 1e-7;
const int INF = INT_MAX;
const ll LLINF = INT64_MAX;
const double PI = acos(-1);
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

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

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<ll> a(n), b(n);
    ll asum = 0, bsum = 0;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        asum += a[i];
    }
    for (int i = 0; i < n; i++)
    {
        cin >> b[i];
        bsum += b[i];
    }
    if (asum < bsum)
    {
        cout << -1 << endl;
        return 0;
    }
    ll minus = 0;
    vector<ll> plus;
    int ans = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] - b[i] < 0)
        {
            minus -= (a[i] - b[i]);
            ans++;
        }
        else
        {
            plus.push_back(a[i] - b[i]);
        }
    }
    sort(RALL(plus));
    ll tmp = 0;
    int index = 0;
    while (tmp < minus)
    {
        tmp += plus[index];
        ans++;
        index++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 2936
#include<stdio.h>
int main(){
    int A,B,M,sum;
    scanf("%d %d %d",&A,&B,&M);
    int a[A],b[B],c[3*M];
    int a_min=100000;
    int b_min=100000;
    for(int i=0;i<A;i++){
        scanf("%d",&a[i]);
        if(a_min>a[i]){
            a_min=a[i];
        }
    }
    for(int i=0;i<B;i++){
        scanf("%d",&b[i]);
        if(b_min>b[i]){
            b_min=b[i];
        }
    }
    int min=a_min+b_min;
    for(int i=0;i<3*M;i++){
        scanf("%d",&c[i]);
    }
    for(int i=0;i<3*M;i=i+3){
        sum=a[c[i]-1]+b[c[i+1]-1]-c[i+2];
        if(min>sum){
            min=sum;
        }
    }
    printf("%d\n",min);
    return 0;
}

Measured memory_bytes: 2176
#include <stdint.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

using namespace std;

using int_type = int64_t;

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

int_type gcd(int_type a, int_type b) {
    return b == 0 ? a : gcd(b, a % b);
}
int_type lcm(int_type a, int_type b) {
    return (a * b) / gcd(a, b);
}

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

    int_type K, X;
    cin >> K >> X;

    if (500 * K >= X) {
        cout << "Yes";
    } else {
        cout << "No";
    }

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
int n,a[100005];
int dp[100005];
int fun(int pos)
{
    if (pos==n-1)
    {
        return 0;
    }
    if (dp[pos]!=-1) return dp[pos];
    int ret1=1e7;
    int ret2=1e7;

    ret1=abs(a[pos]-a[pos+1])+fun(pos+1);
    if (pos+2<=n-1)
    ret2=abs(a[pos]-a[pos+2])+fun(pos+2);

    return dp[pos]=min(ret1,ret2);

}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
//    cout<<fixed;
//    cout<<setprecision(10);

    cin>>n;
    for (int i=0;i<n;i++) cin>>a[i];
    memset(dp,-1,sizeof(dp));
    int ans=fun(0);
    cout<<ans<<endl;

    return 0;
}


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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a*b/gcd(a, b);
}

// pairsをsecond優先キーとして降順ソート
bool compare_by_b(pair<ll, ll> a, pair<ll, ll> b) {
    if(a.second != b.second){
        return a.second > b.second;
    }else{
        return a.first > b.first;
    }
}
int main()
{
    cout << fixed << setprecision(15);
    ll N, H;
    cin >> N >> H;

    vector<P> A(N);

    ll amax = 0;
    ll aid = 0;

    REP(i, N){
        cin >> A[i].first >> A[i].second;

        if(A[i].first > amax){
            amax = A[i].first;
            aid = i;
        }
    }

    sort(A.begin(), A.end(), compare_by_b);

    // REP(i, N){
    //     cerr << A[i].second << endl;
    // }
    ll ans = 0;

    REP(i, N){
        // いい感じの投げるやつがもうないとき
        if(A[i].second <= amax) break;

        H -= A[i].second;
        ans++;
        if(H <= 0){
            cout << ans << endl;
            return 0;
        }
    }
    // cerr << ans << endl;
    if(H > 0){
        ans += (H-1)/amax + 1;
    }
    // while(H>0){
    //     if(H <= amax || H <= A[aid].second){
    //         ans++;
    //         break;
    //     }
    //     H -= amax;
    //     ans++;
    // }
    cout << ans << endl;
    
    return 0;
}

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

#define ar array
#define ff first
#define ss second
#define eb emplace_back
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define all(a) a.begin(), a.end()
#define f0(i, n) for(int i = 0; i < n; ++i)
#define fo(i, k, n) for(int i = k; i < n; ++i)
#define rf0(n, i) for(int i = n-1; ~i; --i)
#define rfo(n, k, i) for(int i = n-1; i >= k; --i)
#define Im_speed ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0)

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

//ifstream f("date.in");
//ofstream g("date.out");

const int nax = 1e9 + 7;
const int mod = 1e9 + 7;
const int inf = (1 << 30);
const ld PI = 3.1415926535897932384626433832795;

int main() {
    Im_speed;

    int n;
    cin >> n;
    if(n < 600) {
        cout << 8;
    }
    else if(n < 800) {
        cout << 7;
    }
    else if (n < 1000) {
        cout << 6;
    }
    else if (n < 1200) {
        cout << 5;
    }
    else if (n < 1400) {
        cout << 4;
    }
    else if (n < 1600) {
        cout << 3;
    }
    else if (n < 1800) {
        cout << 2;
    }
    else {
        cout << 1;
    }

}


Measured memory_bytes: 3608
n = gets.to_i
a = gets.split(" ").map(&:to_i)
i = 0
res = 1
 
if a.include?(0)
 puts i
 return
end
 
while i < a.length do
  res = res * a[i]
  if res > 10 ** 18
    puts "-1"
    return
  end
  i += 1
end
 
puts res

Measured memory_bytes: 21616
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<iomanip>
#include<cassert>
#include<functional>

int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	typedef long long ll;
	
	int d;
	std::cin >> d;
	switch (d){
	case 25:
		std::cout << "Christmas" << '\n';
		break;
	case 24:
		std::cout << "Christmas Eve" << '\n';
		break;
	case 23:
		std::cout << "Christmas Eve Eve" << '\n';
		break;
	case 22:
		std::cout << "Christmas Eve Eve Eve" << '\n';
		break;
	}

	return 0;
}

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

int main()
{
   int n; cin>>n;
   int arr[n][2];
   for(int i=0;i<n;i++){
       for(int j=0;j<2;j++){
           cin>>arr[i][j];
       }
   }
   bool flag = false;
   for(int i=0;i<=n-3;i++){
       int count=0;
       for(int j=i;j<i+3;j++){
           if(arr[j][0]==arr[j][1]) count++;
       }
     //cout<<count<<endl;
       if(count==3){ cout<<"Yes"<<endl;
       flag =true;
       break;}
   }
   if(flag==false) cout<<"No"<<endl;
 
    return 0;
}


Measured memory_bytes: 3640
use std::vec::Vec;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>().split_whitespace().map(|e| e.parse().ok().unwrap()).collect()
}

fn read_touple<T: std::str::FromStr + Copy>() -> (T, T) {
  let v: Vec<T> = read_vec();
  assert_eq!(v.len(), 2);
  (v[0], v[1])
}

fn main() {
    let N: Vec<char> = read::<String>().chars().collect();
    let n = N.len();
    let K: usize = read();
    let mut dp: Vec<Vec<Vec<usize>>> = vec![vec![vec![0; K+1]; 2]; n+1];

    // init
    dp[0][0][0] = 1;



    for i in 0..n {
      let n = N[i] as usize - '0' as usize;
      for k in 0..K+1 {
        dp[i+1][1][k] += dp[i][1][k];
        if n != 0 {
           dp[i+1][1][k] += dp[i][0][k];
        }

        if k > 0 {
          for _ in 1..10 {
            dp[i+1][1][k] += dp[i][1][k-1];
          }
          for _ in 1..n {
            dp[i+1][1][k] += dp[i][0][k-1];
          }
        }
        if n == 0 {
           dp[i+1][0][k] = dp[i][0][k];
        } else {
           if k > 0 {
              dp[i+1][0][k] = dp[i][0][k-1];
           }
        }
      }
    }
    println!("{}", dp[n][0][K] + dp[n][1][K]);
}


Measured memory_bytes: 4352
#include<stdio.h>
main()
{
    int i, n, ans;
    scanf("%d", &n);
    ans = n;
    for(i = 2; i * i < n; i++){
        if(n % i == 0){
            ans -= ans / i;
            while(n % i == 0){
                n /= i;
            }
        }
    }
    if(n > 1){
        ans -= ans / n;
    }
    printf("%d\n", ans);
}

Measured memory_bytes: 1772