akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define rep(i,n,m) for(int i = (n); i <(m); i++)
using namespace std;
using ll = long long;

int main()
{
    int a, b, c;
    cin >> a >> b >> c;

    if (a + c - 2* b ==0)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
    return 0;
}

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

int main() {
vector<pair<int,int>> p;
int n; cin>>n;
int a,b;
for(int i=0;i<n;i++){
    cin>>a>>b;
    int l= a-b;
    int r= a+b;
    p.push_back(make_pair(l,r));
    
}
sort(p.begin(),p.end());
reverse(p.begin(),p.end());
int ans=0;
int pos= INT_MAX;

for(int i=0;i<n;i++){
  if(pos>= p[i].second){
      ans++;
      pos= p[i].first;
  }
    
}
 cout<<ans;
  return 0;
}

Measured memory_bytes: 1400
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <vector>
#include <functional>
#include <queue>
#include <unordered_set>
#include <climits>

using namespace std;
typedef long long ll;

ll N, M, Q;
ll a[51];
ll b[51];
ll c[51];
ll d[51];

ll ans = 0;

void Recursive(int level, int m, int a_[]){
	if(level == N){
		a_[N] = a_[level-1] + m;
		
		ll sum = 0;
		for(int i = 1; i <= Q; i++){
			if(a_[b[i]]-a_[a[i]] == c[i]){
				sum += d[i];
			}
		}
		ans = max(ans, sum);
		
		/*
		for(int i = 1; i <= N; i++){
			cout << a[i] << " ";
		}
		cout << sum << endl;
		*/
	}
	else{
		for(int i = 0; i <= m; i++){
			int aa[20];
			for(int j = 0; j < N; j++){
				aa[j] = a_[j];
			}
			aa[level+1] = a_[level] + i;
			Recursive(level+1, m-i, aa);
		}
	}
}

int main()
{
	cin >> N >> M >> Q;
	for(int i = 1; i <= Q; i++){
		cin >> a[i] >> b[i] >> c[i] >> d[i];
	}
	int A[20];
	for(int i = 0; i < N; i++){
		A[i] = 1;
	}
	Recursive(1, M-1, A);
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define rep(i, x, y) for(register int i = x; i <= y; ++i)
#define repd(i, x, y) for(register int i = x; i >= y; --i)
#define repl(i, x) for(register int i = fi[x]; i; i = l[i].next)
#define p_b push_back
#define m_p make_pair
#define X first
#define Y second
using namespace std;
typedef long long ll;
const int maxn = 510;
int n, a[maxn];
int read(){
	int num = 0, flag = 1; char c = getchar();
	for(; c < '0' || c > '9'; c = getchar())
		if(c == '-') flag = 0;
	for(; c >= '0' && c <= '9'; c = getchar())
		num = (num<<3)+(num<<1)+c-48;
	return flag? num: -num;
}

void init(){
	n = read(); n = n*2;
	rep(i, 1, n) a[i] = read();
	sort(a+1, a+n+1);
}

void work(){
	ll sum = 0;
	for(int i = 1; i <= n; i += 2)
		sum += a[i];
	printf("%lld\n", sum);
}

int main(){
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	init();
	work();
	return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-


def main():
    from collections import deque
    import sys
    input = sys.stdin.readline

    n, m = map(int, input().split())
    p = [[] for _ in range(n)]
    d = deque()
    d.append(0)
    is_used = [False for _ in range(n)]
    is_used[0] = True
    ans = [0 for _ in range(n)]

    for i in range(m):
        ai, bi = map(int, input().split())
        ai -= 1
        bi -= 1

        p[ai].append(bi)
        p[bi].append(ai)

    while d:
        di = d.popleft()

        for e in p[di]:
            if is_used[e]:
                continue

            is_used[e] = True
            ans[e] = di + 1

            d.append(e)

    print('Yes')
    print('\n'.join(map(str, ans[1:])))


if __name__ == '__main__':
    main()


Measured memory_bytes: 45564
#include <stdio.h>
#include <string.h>

int main() {

    int a, b, c, d;
    scanf("%d %d %d %d", &a, &b, &c, &d);

    int isT = 1;
    while (1) {

        if (isT == 1) {

            c -= b;
            if (c <= 0) {
                printf("Yes");
                return 0;
            }

            isT = 0;
        } else {

            a -= d;
            if (a <= 0) {
                printf("No");
                return 0;
            }

            isT = 1;
        }

    }

    return 0;
} 

Measured memory_bytes: 1736
#include <iostream>
using namespace std;
int main() {
    string n;
    cin>>n;
    int sum=0;
    for(int i=0;i<n.size();i++){
        sum+=n[i]-'0';
    }
    if(stoi(n)%sum==0)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 256
n = int(input())
for i in range(n):
    a = list(map(int, input().split()))
    b = 0
    c = 0
    for j in range(10):
        if a[j] > b:
            if a[j] > c:
                if a[j] - b < a[j] - c:
                    b = a[j]
                else:
                    c = a[j]
            else:
                b = a[j]
        elif a[j] > c:
            c = a[j]
        else:
            print("NO")
            break

        if j == 9:
            print("YES")


Measured memory_bytes: 5592
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
#define rep(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; i++)
#define reps(i, n) for (int i = 1, i##_len = (int)(n); i <= i##_len; i++)
#define ALL(v) (v).begin(), (v).end()
#define PUTS(x) cout << (x) << endl;
#define PB push_back
#define MP make_pair
// 何かの個数をカウントする map
template <typename T>
struct countmap {
    std::map<T, long long> dict;

    countmap() {
        dict = map<T, long long>();
    }

    bool contains(T key) {
        return (dict.find(key) != dict.end());
    }

    long long operator[](T key) {
        if (dict.find(key) != dict.end()) {
            return dict[key];
        } else {
            return 0;
        }
    }

    // key に対応する値があれば inc 増加させる，なければキーを新設して inc をセット
    void incrementFor(T key, long long inc = 1) {
        if (dict.find(key) != dict.end()) {
            dict[key] += inc;
        } else {
            dict.emplace(key, inc);
        }
    }

    // for (auto &p: dict) でループできるように
    auto begin() const {
        return dict.begin();
    }

    auto end() const {
        return dict.end();
    }
};


int main() {
    Int n;
    cin >> n;
    auto v = vector<Int>();
    auto m = countmap<Int>();
    rep(i, n) {
        Int a;
        cin >> a;
        v.push_back(a);
        m.incrementFor(a);
    }
    auto sum = 0LL;
    for (auto &p : m) {
        auto val = p.second;
        sum += (val - 1) * val / 2;
    }
    rep(i, n) {
        auto k = v[i];
        auto z = m[k];
        PUTS(sum - (z - 1) * z / 2 + (z - 1) * (z - 2) / 2);
    }
}


Measured memory_bytes: 11120
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define P pair<int,int>
using ll=int64_t;
using namespace std;
#define ketasuu(n) fixed<<setprecision(n)
#define btoe(p) p.begin(),p.end()
#define etob(p) p.rbegin(),p.rend()




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

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
//const int mod=998244353;
using P = pair<int,int>;
using Pl= pair<ll,ll>;
using ld=long double;
using V=vector<int>;
using Vl=vector<ll>;
using VV=vector<vector<int>>;
using VVl=vector<vector<ll>>;

int main(){
    int n;cin >>n;
    Vl a(n);
    ll mx=0;
    ll mn=-1;
    for (int i = 0; i < n; ++i) {
        cin >>a[i];
        if(abs(mx)<=abs(a[i])){
            mx=a[i];
            mn=i;
        }
    }
    vector<P>ans;
    for (int i = 0; i < n; ++i) {
        ans.push_back({i,mn});//+1
    }
    if(mx>=0){
        for (int i = 1; i < n; ++i) {
            ans.push_back({i,i-1});
        }
    }
    else {
        for (int i = n-1; i>0; --i) {
            ans.push_back({i-1,i});
        }
    }
    ll m=ans.size();
    cout <<m<<endl;
    for (int i = 0; i < m; ++i) {
        cout <<ans[i].second+1<<" "<<ans[i].first+1<<endl;
    }
}


Measured memory_bytes: 3664
N, K = list(map(int, input().split()))
A = list(map(int, input().split()))
m = 1000000007
# dp[i][j]: i人目までに合計j個渡したときの場合の数
# i人目に配れるアメは0~A[i-1]個
# 例えばA[i-1]個をi人目に配っていたらi-1人目まではj-A[i-1]個を合計で配っている
# dp[i][j] = dp[i-1][j] + dp[i-1][j-1] + ... + dp[i-1][j-A[i-1]]
# 数列をずらして工夫すると
# dp[i][j-1] = dp[i-1][j-1] + dp[i-1][j-2] + ... + dp[i-1][j-A[i-1]-1]
# となるので、
# dp[i][j] - dp[i][j-1] = dp[i-1][j] - dp[i-1][j-A[i-1]-1]
# 最終的に
# dp[i][j] = dp[i][j-1] + dp[i-1][j] - dp[i-1][j-A[i-1]-1]


dp = [[0 for _ in range(K + 1)] for _ in range(N + 1)]
# i人目までに0個配る方法は1通り
for i in range(N + 1):
    dp[i][0] = 1

for i in range(1, N+1):
    for j in range(1, K + 1):
        dp[i][j] = (dp[i][j - 1] + dp[i - 1][j]) % m
        # i-1人目までに渡すアメの数は0以上でなければならない
        if (j - A[i - 1] - 1) >= 0:
            dp[i][j] = (dp[i][j] + m - dp[i - 1][j - A[i - 1] - 1]) % m
            
print(dp[N][K])

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

int main(){
  ll n;
  cin>>n;
  vector<ll> a(n+1);
  vector<ll> b(n);
  rep(i,n+1){
    cin>>a.at(i);
  }
  rep(i,n){
    cin>>b.at(i);
  }
  ll sum = 0;
  rep(i,n+1){
    sum+=a.at(i);
  }
  for(ll i = 0;i<n;i++){
    if (a.at(i) > b.at(i)){
      a.at(i)-=b.at(i);
      b.at(i) = 0;
    }
    else{
      b.at(i)-=a.at(i);
      a.at(i) = 0;
      if(b.at(i)>0){
        a.at(i+1)-=b.at(i);
        if (a.at(i+1)<0){
          a.at(i+1) = 0;
        }
      }
    }
  }
  ll num = 0;
  rep(i,n+1){
    num+=a.at(i);
  }
  cout <<  sum - num << endl;
}

Measured memory_bytes: 1792
#include <stdio.h>
int main()
{
int a;
int b;
int c;

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

if (a<=b&&b<=c){
printf("%d %d %d\n",a,b,c);
}else if (a<=c&&c<=b){
printf("%d %d %d\n",a,c,b);
}else if (b<=a&&a<=c){
printf("%d %d %d\n",b,a,c);
}else if (b<=c&&c<=a){
printf("%d %d %d\n",b,c,a);
}else if (c<=a&&a<=b){
printf("%d %d %d\n",c,a,b);
}else if (c<=b&&b<=a){
printf("%d %d %d\n",c,b,a);
}

return 0;
}


Measured memory_bytes: 2040
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll GCD(ll x,ll y){
    if(y == 0) return x;
    else return GCD(y,x%y);
}
const int MOD = 1000000007;

int main() {
   int N; long long X;
    cin >> N >> X;
    vector<long long> x(N); for (int i = 0; i < N; ++i) cin >> x[i], x[i] -= X;
    long long g = abs(x[0]);
    for (int i = 0; i < N; ++i) g = GCD(g, abs(x[i]));
    cout << g << endl;
}



Measured memory_bytes: 1024
#include <iostream>
#include <unordered_set>
#include <vector>
#include <climits>
#include <algorithm>
#include <set>


using namespace std;
typedef long long ll;



int main() {

    int a,b,c;
    cin>>a>>b>>c;

    if( a+b+c >= 22 ) cout<<"bust";
    else cout<<"win";

     return 0;
}

Measured memory_bytes: 888
-- modules to import
import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as DataByStrChr8



-- functions for input

read_Integer      = fst . fromJust . DataByStrChr8.readInteger
read_list_Integer = map read_Integer . DataByStrChr8.words

get_Integer      = read_Integer      <$> DataByStrChr8.getLine
get_list_Integer = read_list_Integer <$> DataByStrChr8.getLine



-- functions for ABC 064, Task A

calculate_target :: [Integer] -> Integer
calculate_target [red, green, blue] = 100 * red + 10 * green + blue

is_multiple :: Integer -> Integer -> Bool
is_multiple target base
        | mod target base == 0 = True
        | otherwise            = False

evaluate_given_data :: [Integer] -> Bool
evaluate_given_data [red, green, blue] = is_multiple (calculate_target [red, green, blue]) 4



-- main process is below

main :: IO ()
main = do

        -- STEP.01
        -- read out the given integers
        [red, green, blue] <- get_list_Integer

        -- STEP.02
        -- evaluate the given integets
        -- output the result of the evaluation
        putStrLn $ if (evaluate_given_data [red, green, blue]) then "YES" else "NO"

-- End of this source code

Measured memory_bytes: 380
#include<iostream>
using namespace std;
int main(){
    int l, r, d, cnt = 0;
    cin >> l >> r >> d;
    for(int i = l; i < r+1; i++){
        if(i % d == 0){
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 3620
#include <iostream>
using namespace std;
int main(){
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        int a[10];
        for (int j=0;j<10;j++)
            cin >> a[j];
        int left,right;
        left = a[0];
        right = 0;
        for (int j=1;j<10;j++){
            if(a[j]<left && a[j]<right){
                cout << "NO" << endl;
                break;
            }
            else{
                if(j==9){
                    cout << "YES" << endl;
                    break;
                }
                else{
                if(a[j]>left && a[j]<right)
                    left = a[j];
                else{
                    if(a[j]<left && a[j]>right)
                        right = a[j];
                    else{
                        if(left<right)
                            right = a[j];
                        else
                            left = a[j];
                    }
                }
            }
        }
        }
    }
}

Measured memory_bytes: 1156
#include <bits/stdc++.h>
 
using namespace std;
 
#define MAX 110
#define INF 1e9
typedef pair<int,int> pii;
typedef pair<pii,int> State;
 
struct Edge{
    int to,cost;
    Edge() {}
    Edge(int to,int cost) : to(to),cost(cost) {}
};
 
int V,E;
vector<Edge> G[MAX];
 
int dijkstra(){
    priority_queue<State,vector<State>,greater<State> > Q;
    Q.push(State(pii(0,0),0));
    int dp[MAX][2];
    fill(dp[0],dp[0]+MAX*2,INF);
    dp[0][0] = 0;
 
    while(!Q.empty()){
	State p = Q.top(); Q.pop();
	int v = p.first.second,s = p.second;
 
	if(dp[v][s] < p.first.first) continue;
 
	for(int i = 0 ; i < (int)G[v].size() ; i++){
	    if(dp[v][s] + G[v][i].cost < dp[G[v][i].to][s]){
		dp[G[v][i].to][s] = dp[v][s] + G[v][i].cost;
		Q.push(State(pii(dp[G[v][i].to][s],G[v][i].to),s));
	    }
	    if(s) continue;
	    int d = G[v][i].to;
	    for(int j = 0 ; j < (int)G[d].size() ; j++){
		if(dp[v][0] < dp[G[d][j].to][1]){
		    dp[G[d][j].to][1] = dp[v][0];
		    Q.push(State(pii(dp[G[d][j].to][1],G[d][j].to),1));
		}
	    }
	}
    }
    return min(dp[V-1][0],dp[V-1][1]);
}
 
int main(){
    int a,b,c;
    while(cin >> V >> E, V){
	for(int i = 0 ; i < V ; i++){
	    G[i].clear();
	}
	for(int i = 0 ; i < E ; i++){
	    cin >> a >> b >> c;
	    a--, b--;
	    G[a].push_back(Edge(b,c));
	    G[b].push_back(Edge(a,c));
	}
	cout << dijkstra() << endl;
    }
    return 0;
}

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

template <class T> using V = vector<T>;
template <class S, class T> using P = pair<S, T>;
template <class... T> using TP = tuple<T...>;

using ll = long long;
using db = double;
using ldb = long db;
using str = string;
using vll = V<ll>;
using vvll = V<V<ll>>;
using pll = P<ll,ll>;
using tpll = TP<ll,ll,ll>;
using vpll =V<pll>;
using vst = V<str>;
using vch = V<char>;

#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(b);i>(ll)(a);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) __lcm(a,b)
#define co(a) cout<<a<<endl
#define ci(a) cin>>a
#define pb(a) push_back(a)
#define pob pop_back()
#define mp make_pair
#define mt make_tuple
#define pbmp(a,b) push_back(mp(a,b))
#define subs(a,b) substr(a,b)
#define cfs(a) cout<<fixed<<setprecision(a)
#define INF 1e16
#define mod 1e9+7


int main() {
  ll a,b,c,d;
  cin>>a>>b>>c>>d;
  ll lcm=c*d/gcd(c,d);
//  co(lcm);
  vll count(6);
  if(a%c==0)count[0]--;
  if(a%d==0)count[1]--;
  if(a%lcm==0)count[5]--;
  count[0]+=a/c;
  count[1]+=a/d;
  count[5]+=a/lcm;
  count[3]+=b/c;
  count[4]+=b/d;
  count[2]+=b/lcm;
  ll ans=0;
  FOR(i,0,3){
    ans-=count[i];
//    co(count[i]);
  }
  FOR(i,3,6){
    ans+=count[i];
//    co(count[i]);
  }
  ans=b-a+1-ans;
  co(ans);
}


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

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int n = sc.nextInt();
		int[] a = new int[n];
		int[] balls = new int[n];
		for(int i = 0; i < n; i++)
			a[i] = sc.nextInt();
		ArrayList<Integer> ans = new ArrayList<>();
		
		for(int i = n; i > 0; i--) {
			int sum = 0;
			for(int j = i * 2; j <= n; j += i)
				sum = (sum + balls[j - 1]) % 2;
			if(a[i - 1] != sum) {
				balls[i - 1]++;
				ans.add(i);
			}
		}
		
		System.out.println(ans.size());
		for(int i = 0; i < ans.size(); i++)
			System.out.print(ans.get(i) + (i == ans.size() - 1 ? "\n" : " "));
	}
}


Measured memory_bytes: 89920
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int a,s;
    
    
        cin>>a>>s;
        if(a==s)
        {
            cout<<"Yes"<<endl;
        }
        else
        {
            cout<<"No"<<endl;
        }
        
    
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include <iomanip>
#include <ios>
#include <vector>
#include <string>
#include <algorithm>
#include <string>
#include<limits>
#include<cstdlib>
#include<functional>
#include<cassert>
#include <cstdio>
#include <stack>
#include <queue>
#include <map>
#define fi(p) for(int i=0;i<(p);i++)
#define ce(d) cout<<d<<endl;
#define ll long long
#define sorts(c) sort((c).begin(),(c).end());

using namespace std;

const int MAX_N = 100000;
const int MAX_W = 100000;


int A[MAX_N + 1];
int B[MAX_N + 1];

void solve() {
	ll N, Q, p, x, a, b;
	string S;


	cin >> N >> S;

//	vector<pair<int, int>> S;
	int count = 0;
	fi(N-1) {
		if (S[i] == S[i + 1]) {
			count++;
		}
	}

	ce(N - count);



}

int main()
{

	solve();

	int a;//止める用
	cin >> a;
	return 0;
}

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

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

#define ll long long
#define mm 1000000007
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define pii pair<int, int>
#define pll pair<ll, ll>
#define siz(x) (int)x.size()

#define show(x) cout<<#x<<" "<<x<<'\n'
#define iosbase ios_base::sync_with_stdio(false); cin.tie(NULL);
#define oset tree<int , null_type, less_equal<int> , rb_tree_tag, tree_order_statistics_node_update>

using namespace std;
using namespace __gnu_pbds;

ll dp[100005][105];
pll a[105];
ll n;

ll fun(ll x,ll i)
{
    if(x<0) return 0;
    if(i<1) return 0;
    
    if(dp[x][i]==-1)
    {
        if(x-a[i].ff>=0)
            dp[x][i]=max(fun(x,i-1),a[i].ss+fun(x-a[i].ff,i-1));
        else dp[x][i]=fun(x,i-1);
    }
    
    return dp[x][i];
}
int main()
{
    iosbase;
    ll w,i;
    cin>>n>>w;
    
    ll x,y;
    memset(dp,-1,sizeof(dp));
    for(i=1;i<=n;i++)
    {
        cin>>x>>y;
        a[i]=mp(x,y);
    }
    ll res=fun(w,n);
    
    
    cout<<res<<endl;
}

Measured memory_bytes: 82304
/**
 *    author:  otera    
**/
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
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; }
//#define int long long

void solve() {
	int a, b; cin >> a >> b;
    if(a > b) swap(a, b);
    rep(i, b) {
        cout << a;
    }
    cout << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <random>
using namespace std;

#define endl '\n'
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define uniq(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

string w;

bool solve() {
    int c[26];
    memset(c, 0, sizeof(c));

    int l = w.size();
    for (int i = 0; i < l; i++) {
        c[w[i]-'a']++;
    }

    for (int i = 0; i < 26; i++)
        if (c[i]%2)
            return false;
    return true;
}

void input() {
    cin >> w;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);

    input();
    cout << (solve() ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int maxn = 200005;
long long f[maxn], s[maxn];
long long ans;
 
int main(){
    int n, x; cin >> n;
    for(int i = 1; i <= n; i++){
        cin>>x;
        f[i] = f[i-1] + x;
        s[i] = s[i-1] ^ x;
    }
    int l = 1;
    ans=0;
    for(int r = 1; r <= n; r++){
        while(f[r] - f[l-1] != (s[r] ^ s[l-1])) l++;
        ans += r - l + 1;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3328
def gcd(a, b)
  return a if b == 0
  gcd(b, a%b)
end

def lcm(a, b)
  a, b = b, a if b > a
  a * b / gcd(a,b)
end

def f(n)
  cnt = 0
  while n%2 == 0
    n /= 2
    cnt += 1
  end
  cnt
end

N, m = gets.split.map(&:to_i)
a = gets.split.map(&:to_i)
a = a.map!{|n| n/2}

flag = true
ni = f(a[0])
N.times do |i|
  if ni != f(a[i])
    flag = false
    break
  end
end

if flag
  a.map!{|n| n/(2**ni)}
  m /= 2 ** ni
  l = 1
  N.times do |i|
    l = lcm(l, a[i])
  end
  puts ((m/l) + 1)/2
else
  puts 0
end

Measured memory_bytes: 12812
/*  -*- coding: utf-8 -*-
 *
 * c.cc: C: Garden
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>

using namespace std;

/* constant */

const int MAX_N = 100000;

/* typedef */

typedef long long ll;

/* global variables */

ll wis[MAX_N], dis[MAX_N];

/* subroutines */

ll check(int n, ll p) {
  ll c = 0;
  for (int i = 0; i < n; i++)
    if (p >= wis[i]) c += (p - wis[i]) / dis[i] + 1;
  return c;
}

/* main */

int main() {
  int n;
  ll k;
  scanf("%d%lld", &n, &k);

  for (int i = 0; i < n; i++) scanf("%lld%lld", &wis[i], &dis[i]);

  ll p0 = 0, p1 = 2000000000000000000LL;
  while (p0 + 1 < p1) {
    ll p = (p0 + p1) / 2;
    if (check(n, p) >= k) p1 = p;
    else p0 = p;
  }
  printf("%lld\n", p1);

  return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<cstdio>
#include<algorithm>
#define Lens 500005

using namespace std;
int N;
int A[Lens];

int lc(int i)
{
	return 2 * i;
}
int rc(int i)
{
	return 2 * i + 1;
}

void maxheapify(int i)
{
	int l = lc(i);
	int r = rc(i);
	if (r <= N)
	{
		if (A[i] > A[l] && A[i] > A[r])
			return;
		else if (A[l] > A[i] && A[l] > A[r])
		{
			swap(A[i], A[l]);
			maxheapify(l);
		}
		else
		{
			swap(A[i], A[r]);
			maxheapify(r);
		}
	}
	else if (l <= N)
	{
		if (A[l] > A[i])
		{
			swap(A[i], A[l]);
		}
	}
	else
		return;


}

int main()
{
	cin >> N;
	for (int i = 1; i <= N; i++)
	{
		cin >> A[i];
	}
	for (int i = N / 2; i > 0; i--)
	{
		maxheapify(i);
	}
	for (int i = 1; i <= N; i++)
	{
		cout << ' ' << A[i];
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 5024
/* ex4_1
   kohei_suzuki */

#include <stdio.h>
#include <math.h>

int main(void){
    double tree, num; //木の本数,一人でみれる範囲
    int pop; //人数（答）

    scanf("%lf %lf",&tree, &num); //入力受取

    pop = ceil(tree / (num*2 + 1)); //(木の本数)/(範囲*2+1)で必要人数を求める
    printf("%d\n", pop);//人数(答)を出力

    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i ++)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> PL;
typedef pair<int,int> P;
const int INF = 1e9;
const int MOD = 17;
const vector<int> dy = {-1,0,1,0};
const vector<int> dx = {0,1,0,-1};

void solve() {
    string S,T; cin >> S >> T;
    int N = S.size(),M = T.size();
    vector<vector<int>> dp(N + 1,vector<int>(M + 1,0));
    rep(i,N)rep(j,M) {
        if (S[i] == T[j]) dp[i + 1][j + 1] = dp[i][j] + 1;
        else dp[i + 1][j + 1] = max(dp[i + 1][j],dp[i][j + 1]);
    }
    printf("%d\n",dp[N][M]);
}

int main() {
    int Q; cin >> Q;
    rep(i,Q) solve();
}


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

using namespace std;

#define USE_CPPIO() ios_base::sync_with_stdio(0); cin.tie(0)
typedef pair<int, int> P;
#define F first
#define S second
#define INF 0x3f3f3f3f
#define MP make_pair
#define PB push_back
#define LL long long

int main()
{
	string str;
	while(cin >> str)
	{	
		string day[7] = {"MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"};

		for(int i = 0; i < 7; i++)
		{
			if(day[i] == str)
			{
				if(i+1 == 7)
					cout << 7 << '\n';
				else
					cout << (7 - (i+1)) << '\n';
			}
		}
	}
	return 0;
}

Measured memory_bytes: 256
use std::cmp;
// use std::collections::HashMap;
// use std::collections::HashSet;


// const INF: i64 = 1_000_000_000;


fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);
    let n = sc.read();
    let mut p_inv = vec![0; n];
    for i in 0..n {
        let p = sc.read::<usize>() - 1;
        p_inv[p] = i;
    }
    let mut max_asc = 0;
    let mut asc = 0;
    for i in 0..n {
        if i == 0 || p_inv[i-1] < p_inv[i] {
            asc += 1;
            max_asc = cmp::max(max_asc, asc);
        } else {
            asc = 1;
        }
    }
    println!("{}", n - max_asc);
}

// thanks, ir5
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}


Measured memory_bytes: 6396
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1'000'000'007;
template <class T> bool chmax(T &a, const T &b) { return (a < b) ? (a = b, 1) : 0; }
template <class T> bool chmin(T &a, const T &b) { return (b < a) ? (a = b, 1) : 0; }

void primeFactors(int a, map<int, int> &facs) {
    double sqrtA = sqrt(a);
    for (int i = 2; i <= sqrtA + 1e-10; ++i) {
        while (a % i == 0) {
            facs[i]++;
            a /= i;
        }
    }
    if (a > sqrtA)
        facs[a]++;
}

int main() {
    int n;
    cin >> n;
    map<int, int> facs;
    for (int i = 1; i <= n; ++i) {
        primeFactors(i, facs);
    }
    ll ret = 1;
    for (auto p : facs) {
        ret = (ret * (p.second + 1)) % MOD;
    }
    cout << ret << endl;
    return 0;
}

Measured memory_bytes: 256
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T

main :: IO ()
main = do
  (a, b) <- ((,) <$> unsafeTextToInt . fst <*> unsafeTextToDouble . snd) . unsafeListToPair . T.words <$> T.getLine :: IO (Int, Double)
  let
    b' = round $ 100 * b :: Int
  print $ a * b' `div` 100

unsafeListToPair :: [a] -> (a, a)
unsafeListToPair [x, y] = (x, y)
{-# INLINE unsafeListToPair #-}

unsafeTextToDouble :: T.Text -> Double
unsafeTextToDouble s = case T.double s of
  Right (x, _) -> x
{-# INLINE unsafeTextToDouble #-}

unsafeTextToInt :: T.Text -> Int
unsafeTextToInt s = case T.signed T.decimal s of
  Right (n, _) -> n
{-# INLINE unsafeTextToInt #-}


Measured memory_bytes: 3828
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll=long long;
using vi = vector<int>;
using Graph = vector<vi>;
using P = pair<int,int>;
const int MOD=(int)1e9+7;
const int INF=(int)1e9;
const ll LINF=(ll)1e18;

int main(){
    ll n;
    cin >> n;
    vector<bool> ans;
    while(n!=0){
        int t = n%2;
        if(t<0) t += 2;

        n = (n-t) / (-2);
        ans.push_back(t);
    }
    reverse(ans.begin(),ans.end());
    if(ans.size()==0) ans.push_back(0);
    for(auto t : ans) cout << t;
}

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

#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define ALL(x) (x).begin(), (x).end()

typedef long long ll;
using namespace std;

int A[200000];
int B[200000];

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

  int N;
  cin >> N;
  REP(i, N) cin >> A[i];
  memcpy(B, A, sizeof(A));
  sort(B, B + N);
  int most_biggest = B[N - 1];
  int second_biggest = B[N - 2];

  REP(i, N) {
    A[i] != most_biggest ? cout << most_biggest << endl
                         : cout << second_biggest << endl;
  }

  return 0;
}


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

using namespace std;
typedef long long ll;

ll mod = 998244353;

struct LazySegmentTree {
private:
    int n;
    vector<ll> node, lazy;

public:
    LazySegmentTree(vector<ll> v) {
        int sz = (int)v.size();
        n = 1; while(n < sz) n *= 2;
        node.resize(2*n-1);
        lazy.resize(2*n-1, 0);

        for(int i=0; i<sz; i++) node[i+n-1] = v[i];
        for(int i=n-2; i>=0; i--) node[i] = node[i*2+1] + node[i*2+2];
    }

    void eval(int k, int l, int r) {
        if(lazy[k] != 0) {
            node[k] += lazy[k];
            if(r - l > 1) {
                lazy[2*k+1] += lazy[k] / 2;
                lazy[2*k+2] += lazy[k] / 2;
            }
            lazy[k] = 0;
        }
    }

    void add(int a, int b, ll x, int k=0, int l=0, int r=-1) {
        if(r < 0) r = n;
        eval(k, l, r);
        if(b <= l || r <= a) return;
        if(a <= l && r <= b) {
            lazy[k] += (r - l) * x;
            eval(k, l, r);
        }
        else {
            add(a, b, x, 2*k+1, l, (l+r)/2);
            add(a, b, x, 2*k+2, (l+r)/2, r);
            node[k] = (node[2*k+1] + node[2*k+2]) % mod;
        }
    }

    ll getsum(int a, int b, int k=0, int l=0, int r=-1) {
        if(r < 0) r = n;
        eval(k, l, r);
        if(b <= l || r <= a) return 0;
        if(a <= l && r <= b) return node[k] % mod;
        ll vl = getsum(a, b, 2*k+1, l, (l+r)/2);
        ll vr = getsum(a, b, 2*k+2, (l+r)/2, r);
        return (vl + vr) % mod;
    }
};

int main() {
  ll N, K; cin >> N >> K;
  vector<ll> L(K), R(K);
  for (ll i = 0; i < K; i++) {
    cin >> L[i] >> R[i];
    R[i]++;
  }
  LazySegmentTree seg( vector<ll>(N, 0) );
  seg.add(0, 1, 1);
  for (ll i = 0; i < N; i++) {
    ll tgt = seg.getsum(i, i+1);
    if (tgt == 0) continue;
    for (ll j = 0; j < K; j++) {
      ll left = i+L[j];
      ll right = i+R[j];
      if (left < N) {
        if (right > N) right = N;
        seg.add(left, right, tgt);
      }
    }
  }
  cout << seg.getsum(N-1, N) << endl;
  return 0;
}


Measured memory_bytes: 13028
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <cmath>
using namespace std;

int to_int(string s){
    int number = 0;
    for(int i=0;i<s.size();i++){
        number *= 10;
        number += s[i] - '0';
    }
    return number;
}

string to_str(int n){
    string s;
    while(n!=0){
        s += n % 10 + 48;
        n /= 10;
    }
    reverse(s.begin(),s.end());
    return s;
}

bool isLeapYear(int year)
{
    if(((year % 4 == 0 ) && (year % 100 != 0)) || (year % 400 == 0))
        return true;
    else
        return false;
}

bool isPrime(int n)
{
    if (n == 2)
        return true;
    if ((n & 1)==0)
        return false;
    for (int i = 3; i*i <= n;i+=2) {
        if (n%i == 0)
            return false;
    }

    return true;
}

/*#define row 5001
#define col 10000

int arr[row][col];

void fib()
{
    arr[0][0] = 0;
    arr[1][0] = 1;
    for(int i=2;i<row;i++){
        for(int j=0;j<col;j++){
            if(arr[i-1][j] + arr[i-2][j] == 0)
                continue;
            arr[i][j] += arr[i-1][j] + arr[i-2][j];
            if(arr[i][j] > 9){
                arr[i][j+1] = arr[i][j]/10;
                arr[i][j] %= 10;
            }
        }
    }
}*/

int main()
{
    int a, b;
    cin >> a >> b;
    if(a == b){
        cout << "Draw" << endl;
        return 0;}
    if(a == 1){
        cout << "Alice" << endl;
        return 0;}
    if(b == 1){
        cout << "Bob" << endl;
        return 0;}

    if(a > b){
        cout << "Alice" << endl;
        return 0;}
    else if(a < b)
        cout << "Bob" << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fr(i,n) for(int i=0;i<(n);++i)
#define foor(i,a,b) for(int i=(a);i<=(b);++i)
#define rf(i,n) for(int i=(n);i--;)
#define roof(i,b,a) for(int i=(b);i>=(a);--i)
#define all(x) x.begin(),x.end()
#define Sort(x) sort(all(x))
#define PQ priority_queue
#define print(x) cout<<(x)<<"\n"
typedef long long ll;
typedef pair<int,int>pii;
typedef pair<ll,ll>pll;
typedef pair<ll,int>pli;
typedef vector<int>vi;
typedef vector<ll>vl;
typedef vector<pii>vpii;
typedef vector<pll>vpll;
typedef vector<pli>vpli;
typedef map<int,int>mii;
typedef map<ll,ll>mll;
template<typename T>vector<T>&operator<<(vector<T>&v,const T t){v.push_back(t);return v;}
template<typename T>multiset<T>&operator<<(multiset<T>&m,const T t){m.insert(t);return m;}
template<typename T>set<T>&operator<<(set<T>&s,const T t){s.insert(t);return s;}
template<typename T,typename U>PQ<T,vector<T>,U>&operator<<(PQ<T,vector<T>,U>&q,const T t){q.push(t);return q;}
template<typename T,typename U>istream&operator>>(istream&s,pair<T,U>&p){return s>>p.first>>p.second;}
template<typename T>istream&operator>>(istream&s,vector<T>&v){fr(i,v.size()){s>>v[i];}return s;}
template<typename T,typename U>ostream&operator<<(ostream&s,const pair<T,U>p){return s<<p.first<<" "<<p.second;}
template<typename T>ostream&operator<<(ostream&s,const vector<T>v){for(auto a:v){s<<a<<endl;}return s;}
vpli dijkstra(const int N,const vpli E[],const int s,const ll inf){vpli d;fr(i,N)d<<pli{inf,i};d[s].first=0;PQ<pli,vpli,greater<pli>>pq;pq<<(d[s]=pli{0,s});while(pq.size()){pli a=pq.top();pq.pop();int v=a.second;if(d[v].first>=a.first){for(pli e:E[v]){if(d[v].first+e.first<d[e.second].first){d[e.second]=pli{d[v].first+e.first,v};pq<<pli{d[v].first+e.first,e.second};}}}}return d;}
ll gcd(ll a,ll b){return a?gcd(b%a,a):b;}

main(){cin.tie(0);ios::sync_with_stdio(false);
	int N;
	cin>>N;
	vi a(N);
	cin>>a;
	int x=0,z=0;
	for(int&_:a)x^=_;
	rf(k,30)if(x&1<<k){
		for(int&_:a){
			_&=(1<<k+1)-1;
			if(_==1<<k){
				x^=(1<<k+1)-1;
				++z;
				break;
			}
		}
	}
	print(x?-1:z);
}


Measured memory_bytes: 640
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <math.h>
#include <vector>
#include <map>
#include <queue>
#include <utility>
#include <algorithm>
#include <string>
#include <set>
#include <random>
using namespace std;
int main() {
  int n, a, b;
  cin >> n >> a >> b;
  cout << min(a, b) << " " << max(0, a + b - n) << endl;
  return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;
class Main{
	static final long MOD = 1_000_000_007; // 10^9+7
    static final int MAX = 2_147_483_646; // intMax 
    static final int INF = 1_000_000_000; // 10^9  
    public static void main(String[] args) throws Exception {
		hayami saori = new hayami();
		int N = saori.saori_hayami();
		int x = saori.saori_hayami();
		int[] a = new int[N];
		for(int i = 0;i < N;i++){
			a[i] = saori.saori_hayami();
		}
		Arrays.sort(a);
		int ans = 0;
		for(int i = 0;i < a.length;i++){
			x -= a[i];
			if(x < 0){
				break;
			}
			ans++;
		}
		if(x > 0 && ans != 0){
			ans--;
		}
		System.out.println(ans);
		
		saori.close();
    }
}

class hayami implements Closeable {
	private final InputStream in = System.in;
	private final byte[] hayami = new byte[1024];
	private int Hayami = 0;
	private int saori = 0;
	private boolean HayamiSaori() {
		if (Hayami < saori) {
			return true;
		}else{
			Hayami = 0;
			try {
				saori = in.read(hayami);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (saori <= 0) {
				return false;
			}
		}
		return true;
	}
	private int SaoriHayami() { 
		if (HayamiSaori()) {
            return hayami[Hayami++];
         }else{
             return -1;
         }
	}
	private static boolean hayami_saori(int hayami) { 
		return 33 <= hayami && hayami <= 126;
	}
	public boolean hayamisaori() { 
		while(HayamiSaori() && !hayami_saori(hayami[Hayami])) Hayami++; return HayamiSaori();
	}
	public String nextHayami() {
		if (!hayamisaori()) throw new NoSuchElementException();
		StringBuilder hayamin = new StringBuilder();
		int saori = SaoriHayami();
		while(hayami_saori(saori)) {
			hayamin.appendCodePoint(saori);
			saori = SaoriHayami();
		}
		return hayamin.toString();
	}
	public long saorihayami() {//nextLong
		if (!hayamisaori()) throw new NoSuchElementException();
		long hayami = 0;
		boolean misao = false;
		int saori = SaoriHayami();
		if (saori == '-') {
			misao = true;
			saori = SaoriHayami();
		}
		if (saori < '0' || '9' < saori) {
			throw new NumberFormatException();
		}
		while(true){
			if ('0' <= saori && saori <= '9') {
				hayami *= 10;
				hayami += saori - '0';
			}else if(saori == -1 || !hayami_saori(saori)){
				return misao ? -hayami : hayami;
			}else{
				throw new NumberFormatException();
			}
			saori = SaoriHayami();
		}
	}
	public int saori_hayami() {//nextInt
		long hayami = saorihayami();
		if (hayami < Integer.MIN_VALUE || hayami > Integer.MAX_VALUE) throw new NumberFormatException();
		return (int) hayami;
	}
	public double Hayamin() { //nextDouble
		return Double.parseDouble(nextHayami());
	}
	public void close() {
		try {
			in.close();
		} catch (IOException e) {
		}
    }
    
}

Measured memory_bytes: 21076
#include <iostream>
#include <vector>
#include <string>
#include <unordered_map>
#include <unordered_set>

int main()
{
	std::string S;
	const std::string keyence("keyence");

	std::cin >> S;

	if (S.size() < keyence.size()) {
		std::cout << "NO\n";
		return 0;
	}

	int i;
	for (i = 0; i < keyence.size(); ++i) {
		if (S[i] != keyence[i])
			break;
	}
	if (i == keyence.size()) {
		std::cout << "YES\n";
		return 0;
	}

	auto rest = keyence.substr(i);
	if (rest == S.substr(S.size() - rest.size())) {
		std::cout << "YES\n";
	} else {
		std::cout << "NO\n";
	}
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
int lis(int size, int *A, int *L);
int main(void)
{
  int i, n, *a, *l;
  scanf("%d", &n);
  a = (int*)malloc(sizeof(int) * n);
  l = (int*)malloc(sizeof(int) * n);
  for (i = 0; i < n; i++) scanf("%d", &a[i]);
  printf("%d\n", lis(n, a, l));
  free(a);
  free(l);
}
int lis(int size, int *A, int *L)
{
  int i, length = 1;
  L[0] = A[0];
  for (i = 0; i < size; i++) {
    if (L[length-1] < A[i]) L[length++] = A[i];
    else {
      int lo = 0, hi = length - 1;
      while (lo <= hi) {
        int mid = (lo + hi) / 2;
        if (A[i] <= L[mid]) hi = mid - 1;
        else lo = mid + 1;
      }
      L[lo] = A[i];
    }
  }
  return length;
}


Measured memory_bytes: 2320
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll max_N = 3e2 + 5, INF = 1e15, MOD = 1e9 + 7;
ll N;
ld DP[max_N][max_N][max_N];

ld expected_turns(ll cnt1, ll cnt2, ll cnt3)
{
    ll cnt0 = N - cnt1 - cnt2 - cnt3;
    if (cnt0 == N)
        return 0;
    if (cnt1 < 0 || cnt2 < 0 || cnt3 < 0 || cnt0 < 0)
        return 0;
    ld &res = DP[cnt1][cnt2][cnt3];
    if (res != ld(-1))
        return res;
    res = (N + cnt1 * expected_turns(cnt1 - 1, cnt2, cnt3) + cnt2 * expected_turns(cnt1 + 1, cnt2 - 1, cnt3) + cnt3 * expected_turns(cnt1, cnt2 + 1, cnt3 - 1));
    res = res / (N - cnt0);
    return res;
}

int main()
{
    cin >> N;
    ll cnt1, cnt2, cnt3, x;
    cnt1 = cnt2 = cnt3 = 0;
    for (int i = 0; i < N; ++i)
    {
        cin >> x;
        if (!x)
            continue;
        if (x == 1)
            ++cnt1;
        else if (x == 2)
            ++cnt2;
        else
            ++cnt3;
    }
    for (int i = 0; i < max_N; ++i)
        for (int j = 0; j < max_N; ++j)
            fill(DP[i][j], DP[i][j] + max_N, ld(-1));
    cout << fixed << setprecision(9) << expected_turns(cnt1, cnt2, cnt3) << "\n";
    return 0;
}

Measured memory_bytes: 447092
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
	int n;
	scanf("%d",&n);
	vector<int> v(n);
	map<int,int> freq;
	for(auto &x:v){
		scanf("%d",&x);
		++freq[x];
	}
	srand(time(0));
	random_shuffle(v.begin(),v.end());
	--freq[v[0]];
	clock_t T=clock();
	for(int i=1;i<v.size() && int(clock()-T)<=1.9*CLOCKS_PER_SEC;++i){
		auto f=freq;
		int l=v[0]^v[i];
		int r=v[i];
		int pl=v[0],pr=v[0];
		bool bad=false;
		for(int j=1;!bad && j<n;++j){
			if(j&1){
				if(--f[r]<0)
					bad=true;
				r^=pr;
				pr^=r;
			}else{
				if(--f[l]<0)
					bad=true;
				l^=pl;
				pl^=l;
			}
		}
		if(!bad && r==pl && l==pr){
			puts("Yes");
			return 0;
		}
	}
	puts("No");
	return 0;
}

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

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

fn main() {
    let n: u64 = read();
    let mut minv: i64 = read();
    let second_v: i64 = read();
    let mut maxv: i64 = second_v - minv;
    if minv > second_v {
        minv = second_v;
    }
    for _ in 2..n {
        let v: i64 = read();
        if maxv < v - minv {
            maxv = v - minv;
        }
        if minv > v {
            minv = v;
        }
    }
    println!("{}", maxv);
}



Measured memory_bytes: 5052
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define PI 3.1415926535

int main() {
    ll a, b;
    cin >> a >> b;
    ll ans;
    if(a >= 13) ans = b;
    else if(a >= 6) ans = b / 2;
    else ans = 0;
    cout << ans << endl;
}


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

using namespace std;

int main()
{
    string strN;
    cin >> strN;

    int digit_sum = 0;
    for(int i = 0; i < strN.size(); ++i){
        digit_sum += (strN[i] - '0');
    }
    istringstream iss(strN);
    int N;
    iss >> N;
    if(N % digit_sum == 0)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;

    return 0;
}



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

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

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

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

s64 com[51][51];

void init()
{
    com[0][0] = 0;
    rep (i, 51)
    {
        rep (j, 51)
        {
            if (j > i) break;
            if (i == 0 || j == 0) com[i][j] = 1;
            else
            {
                com[i][j] = com[i - 1][j] + com[i - 1][j - 1];
            }
        }
    }
}

s64 mypow(s64 x, s64 n)
{
    s64 ret = 1;
    while (n > 0)
    {
        if (n & 1) ret = (ret * x);
        x = (x * x);
        n >>= 1;
    }
    return ret;
}

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

    init();
    int N, P;
    cin >> N >> P;

    s32 A;
    int neven = 0, nodd = 0;
    rep (i, N)
    {
        cin >> A;
        if (A & 1) ++nodd;
        else ++neven;
    }

    s64 ans = mypow(2, neven);
    s64 temp = 0;
    if (P == 0)
    {
        for (int i = 0; i <= nodd; i += 2)
        {
            temp += com[nodd][i];
        }
    }
    else
    {
        for (int i = 1; i <= nodd; i += 2)
        {
            temp += com[nodd][i];
        }
    }

    cout << ans * temp << "\n";
    return 0;
}



Measured memory_bytes: 256
//高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
	double ans = 0;
	int tmp;
	int n; cin >> n;
	vector <double> x, y;
	int xx, yy;
	REP(i, n){
		cin >> xx >> yy;
		x.push_back(xx);
		y.push_back(yy);
	}
	vector<int> t;
	REP(i, n) t.push_back(i);
	int war = 1;
	REP1(i, n) war *= i;
	double d = 0;
	do{
		REP(i, n-1){
			d += sqrt( (x[t[i]] - x[t[i+1]]) * (x[t[i]] - x[t[i+1]])
			+ (y[t[i]] - y[t[i+1]]) *  (y[t[i]] - y[t[i+1]]) );
		}
	}while(next_permutation(t.begin(), t.end() ) );
	
	cout << setprecision(15) << d / (double)war << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long int n,i,j,sum=0;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		if(i%3!=0&&i%5!=0)
		sum=sum+i;
	}
	cout<<sum;
	return 0;
}

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

int main()
{
  int a, b, c;
  cin >> a >> b >> c;
  int d = c;
  int e = b;
  b = a;
  a = e;
  c = a;
  a = d;
  printf("%d %d %d\n", a, b, c);
}

Measured memory_bytes: 256