akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
using namespace std;
using ll = long long;
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; }
const ll INF = 1e3;
const ll MOD = 1e9 + 7;


int main(){
    ll a, b, k;
    cin >> a >> b >> k;
    cout << (a - min(a, k)) << " " << (b - min(b, k - min(a, k))) << endl;
}

Measured memory_bytes: 256
import sys
from itertools import accumulate

n, W, *wv = map(int, sys.stdin.read().split())
wv = list(zip(*[iter(wv)] * 2))

def main():
    wv.sort(key=lambda x: x[0])
    min_w = wv[0][0]

    items = [[] for _ in range(4)]
    
    for w, v in wv:
        items[w-min_w].append(v)
    
    for i in range(4):
        items[i].sort(reverse=True)
        items[i].insert(0, 0)
        items[i] = list(accumulate(items[i]))

    res = 0
    s0 = items[0]
    s1 = items[1]
    s2 = items[2]
    s3 = items[3]
    for i in range(len(s0)):
        v0 = s0[i]
        for j in range(len(s1)):
            v1 = s1[j]
            for k in range(len(s2)):
                v2 = s2[k]
                for l in range(len(s3)):
                    v3 = s3[l]
                    if (j + 2*k + 3*l) + min_w * (i+j+k+l) <= W:
                        res = max(res, v0+v1+v2+v3)

    return res

if __name__ == '__main__':
    ans = main()
    print(ans)

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


void solve(long long N, long long K, std::vector<long long> h){
    int res = 0;
    for(int i=0;i<N;++i){
        if(h[i]>=K)res++;
    }
    cout<<res<<endl;
}

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


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
	int a;
	cin >> a;
	int ans = 0;
	ans += a;
	ans += a * a;
	ans += a * a * a;
	cout << ans << endl;
}

Measured memory_bytes: 3536
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("no-stack-protector")
//#pragma GCC target("popcnt")
//#pragma GCC target("sse4")
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define rng(a) a.begin(),a.end()
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define sz(a) (int)(a.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef long double ld;















signed main(){
    string t;
    cin >> t;
    int n = t.size();
    for (int i = 0; i < n; i++){
        if (t[i] == '?') t[i] = 'D';
    }
    cout << t;



}


Measured memory_bytes: 3748
#include <iostream>
#include <queue>
#define sl "\n"
using namespace std ;
const int N = 2e5+5 ;
int  n , k ,a[N];
queue<int> q ;
int main()
{
  cin >> n >> k ;
  for (int i = 0 ; i < n ; i++ ) 
   cin >> a[i] ;
  for (int i = 0 ; i < k ; i++ ) 
   q.push(a[i]) ;
  for (int i = k ; i < n ;i++ ) {
    if (a[i] > q.front()) 
      cout << "Yes";
    else 
      cout << "No";
    cout << sl; 
    q.pop() ;
    q.push(a[i]) ;
  } 
  return  0 ;
}


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

using namespace std;

void dfs(vector<vector<int>> &vertices, vector<vector<int>> &scc, vector<int> &hi, vector<int> &lo, stack<int> &tmp, vector<int> &visit, int curVertice, int& count) {
	//cout << curVertice << " " << count << endl;
	hi[curVertice] = count;
	lo[curVertice] = hi[curVertice];
	count += 1;
	tmp.push(curVertice);
	
	for(int i = 0; i < vertices[curVertice].size(); i++) {
		int nextVertice = vertices[curVertice][i];
		if(hi[nextVertice] == -1) {
			//find vertice hasnt been visited -> visit it
		 	dfs(vertices, scc, hi, lo, tmp, visit, nextVertice, count);
			lo[curVertice] = min(lo[curVertice], lo[nextVertice]);
			//cout << "1 curVertice: " << curVertice << " lo: " << lo[curVertice] << endl;	
		} else {
			//find strongly connected components -> update to all vertices belong to that scc
			if(visit[nextVertice] == 0) {
				lo[curVertice] = min(lo[curVertice], hi[nextVertice]);
			}
			//cout << "2 curVertice: " << curVertice << " lo: " << lo[curVertice] << endl;	
		}
	}
	
	if(hi[curVertice] == lo[curVertice]) {
		vector<int> newscc;
		while(tmp.top() != curVertice) {
			newscc.push_back(tmp.top());
			visit[tmp.top()] = 1;
			tmp.pop();
		}
		
		if(tmp.top() == curVertice) {
			newscc.push_back(tmp.top());
			visit[tmp.top()] = 1;
			tmp.pop();
		}	

		scc.push_back(newscc);
	}
	return;
}

int findSCC(vector<vector<int>> &scc, int x) {
	for(int i = 0; i < scc.size(); i++) {
		for(int j = 0; j < scc[i].size(); j++) {
			if(scc[i][j] == x) {
				return i;
			}
		}
	}
	return -1;
}

int main() {
	int v, e;
	cin >> v >> e;

	vector<vector<int>> vertices(v);
	for(int i = 0; i < e; i++) {
		int a, b;
		cin >> a >> b;
		vertices[a].push_back(b);
	}

	int q;
	cin >> q;
	
	vector<pair<int, int>> questions;
	for(int i = 0; i < q; i++) {
		int a, b;
		cin >> a >> b;
		questions.push_back(make_pair(a, b));
	}

	vector<vector<int>> scc;
	vector<int> hi(v, -1);
	vector<int> lo(v, -1);
	stack<int> tmp;
	vector<int>visit(v, 0);

	int count = 0;
	for(int i = 0; i < v; i++) {
		if(hi[i] == -1) {
			dfs(vertices, scc, hi, lo, tmp, visit, i, count);
		}
	}
 	
	for(int i = 0; i < questions.size(); i++)  {
		int q1 = findSCC(scc, questions[i].first);
		int q2 = findSCC(scc, questions[i].second);

		if(q1 == q2) {
			cout << 1 << endl;
		} else cout << 0 << endl;
	}

	// for(int i = 0; i < scc.size(); i++) {
	// 	cout << "strongly connected components " << i + 1 << ": " << endl;
	// 	for(int j = 0; j < scc[i].size(); j++) {
	// 		cout << scc[i][j] << " ";
	// 	}
	// 	cout << endl;
	// }
	return 0;
}


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

string S, C;
int Q, T, F;
bool reversed;
deque<char> dq;

int main() {
    cin >> S >> Q;

    for (int i = 0; i < S.length(); i++)
        dq.push_back(S[i]);

    reversed = false;
    for (int i = 1; i <= Q; i++) {
        cin >> T;

        if (T == 1)
            reversed = !reversed;
        else {
            cin >> F >> C;

            if (F == 1) {
                if (reversed)
                    dq.push_back(C[0]);
                else
                    dq.push_front(C[0]);
            } else {
                if (reversed)
                    dq.push_front(C[0]);
                else
                    dq.push_back(C[0]);
            }
        }
    }

    if (reversed) {
        for (int i = dq.size() - 1; i >= 0; i--)
            cout << dq[i];
    } else {
        for (int i = 0; i < dq.size(); i++)
            cout << dq[i];
    }

    cout << endl;
}


Measured memory_bytes: 896
#define LOCAL
#define _USE_MATH_DEFINES
#include <array>
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

template <typename A, typename B>
ostream& operator <<(ostream& out, const pair<A, B>& a) {
  out << "(" << a.first << "," << a.second << ")";
  return out;
}
template <typename T, size_t N>
ostream& operator <<(ostream& out, const array<T, N>& a) {
  out << "["; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T>
ostream& operator <<(ostream& out, const vector<T>& a) {
  out << "["; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "]";
  return out;
}
template <typename T, class Cmp>
ostream& operator <<(ostream& out, const set<T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& v : a) { out << (first ? "" : ", "); out << v; first = 0;} out << "}";
  return out;
}
template <typename U, typename T, class Cmp>
ostream& operator <<(ostream& out, const map<U, T, Cmp>& a) {
  out << "{"; bool first = true;
  for (auto& p : a) { out << (first ? "" : ", "); out << p.first << ":" << p.second; first = 0;} out << "}";
  return out;
}
#ifdef LOCAL
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#else
#define trace(...) 42
#endif
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
#define SZ(x) (int)((x).size())
const int INF = 1 << 29;
const int MOD = 1e9 + 7;
mt19937 mrand(random_device{}());
int rnd(int x) { return mrand() % x; }

struct fast_ios {
  fast_ios() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
  };
} fast_ios_;

int main() {
  string s, t;
  cin >> s >> t;
  int n = SZ(s), m = SZ(t), best = INF;
  for (int i = 0; i + m <= n; ++i) {
    int cnt = 0;
    for (int j = 0; j < m; ++j) {
      cnt += s[i + j] != t[j];
    }
    best = min(best, cnt);
  }
  cout << best << '\n';
  return 0;
}


Measured memory_bytes: 3160
#include <bits/stdc++.h>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define str string
#define fi first
#define se second
#define pb push_back
#define SET(a, b) memset(a, b, sizeof(a))
#define eps 1e-6
#define pi atan(1) * 4
#define mod 1000000007
#define inf 1000000000
#define llinf 1000000000000000000
#define FOR(i, a, b, c) for (int i = (a); i <= (b); i += (c))
#define FORD(i, a, b, c) for (int i = (a); i >= (b); i -= (c))
#define FORl(i, a, b, c) for (ll i = (a); i <= (b); i += (c))
#define FORDl(i, a, b, c) for (ll i = (a); i >= (b); i -= (c))
using namespace std;
int freq[2][100005];
int lft[100005], rgt[100005];
int main () {
	int n;
	scanf("%d", &n);
	SET(freq, 0);
	FOR(i, 1, n, 1) {
		int t;
		scanf("%d", &t);
		if (i & 1) freq[0][t]++;
		else freq[1][t]++;
	}
	lft[0] = rgt[100001] = 0;
	FOR(i, 1, 100000, 1) {
		lft[i] = max(lft[i - 1], freq[1][i]);
	}
	FORD(i, 100000, 1, 1) {
		rgt[i] = max(rgt[i + 1], freq[1][i]);
	}
	int mx = 0;
	FOR(i, 1, 100000, 1) {
		mx = max(mx, freq[0][i] + max(lft[i - 1], rgt[i + 1]));
	}
	printf("%d\n", n - mx);
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
using namespace std;
 
template <class T> using V = vector<T>;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);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 M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
ll combi(ll n,ll m) {
  ll ans=1;
  rFOR(i,n,n-m){
    ans*=i;
  }
  FOR(i,1,m+1){
    ans/=i;
  }
  return ans;
}
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n,k;
  	ci(n>>k);
  vpll A(n);
  FOR(i,0,n){
    ci(A[i].fi>>A[i].se)
  }
  SORT(A);
  ll count=0;
  FOR(i,0,n){
    count+=A[i].se;
    if(k<=count){
      co(A[i].fi)
        break;
    }
  }
}
      

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


class Program
{
    static void Main(string[] args)
    {
        // 入力
        //var s = Console.ReadLine();
        var n = int.Parse(Console.ReadLine());
        int[] aa = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int[] a = new int[n + 1];
        a[0] = 0;
        for (int i = 0; i < aa.Length; i++)
        {
            a[i + 1] = aa[i];
        }

        int[] tmp = new int[n + 1];
        for (int i = a.Length - 1; i > 0; i--)
        {
            var t = 0;
            for (int k = i; k < tmp.Length; k += i)
            {
                t += tmp[k];
            }

            if (a[i] == 1 && t % 2 == 0) tmp[i]++;
            else if (a[i] == 0 && t % 2 == 1) tmp[i]++;
        }

        // for (int i = 0; i < tmp.Length; i++)
        // {
        //     long t = 0;
        //     for (int k = i + 1; k - 1 < tmp.Length; k += (i + 1))
        //     {
        //         t += a[k - 1];
        //     }
        //     if (t % 2 != a[i])
        //     {
        //         var ans = -1;
        //         Console.WriteLine(ans);
        //         return;
        //     }
        //}

        var m = tmp.Where(x => x == 1).Count();
        Console.WriteLine(m);
        for (int i = 1; i < tmp.Length; i++)
        {
            if (tmp[i] == 1) Console.Write(i + " ");
        }
    }
}

Measured memory_bytes: 29532
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const int inf = 1000000000;

int main(){
    int n;
    cin >> n;
    if(n >= 30){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3636
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A=sc.nextInt(),B=sc.nextInt();
		if(A>12)System.out.println(B);
		else if(A>5)System.out.println(B/2);
		else System.out.println(0);
	}
}


Measured memory_bytes: 21972
#include<iostream>
using namespace std;
const int N = 100000;
int prime[N+10];
int pre[N+10];
void isPrime() {
	prime[1] = 1;
	for(int i = 2; i * i <= N; i++) {
		if(!prime[i]) {
			for(int j = i * i; j <= N; j += i)
				prime[j] = 1;
		}
	}
}
bool isLike(int x) {
	if (prime[x] == 0 && prime[(x+1) / 2] == 0) {
		return true;
	}
	return false;
}
void pre_sum(){
	for (int j = 1; j <= 100000; j++) {
		if (isLike(j)) {
			pre[j] = pre[j - 1] + 1;
		} else {
			pre[j] = pre[j - 1];
		}
	}
}
int main() {
	isPrime();
	pre_sum();
	int n, a, b;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a >> b;
		cout << pre[b] - pre[a-1] << endl;
	}
}


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

int main(){
    
    int N;
    int A,B;
    cin >> N;
    cin >> A >> B;
    if((B-A)%2==0)cout << "Alice" <<endl;
    else cout << "Borys" <<endl;
}
    
    



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

#define llong long long
#define inf 999999999
#define mp make_pair
#define pb push_back
#define fn fill_n
typedef pair<int, int> P;
typedef pair<P, int> PP;
typedef pair<PP, int> PPP;
typedef struct data{
	int now;
	int cost;
}data;
int nh[4] = {1, 0, -1, 0};
int nw[4] = {0, 1, 0, -1};





int main(){
	int a, b;
	cin >> a >> b;
	int c = 0;
	int d = b;
	while(true){
		if(d / 10 == 0) break;
		else{
			c++;
			d = d/ 10;
		}
	}
	for(int i = 0; i <= c; i++){
		a = a * 10;
	}
	int e = a + b;
	if((double)sqrt(e) == (int)sqrt(e)) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define N 100010
#define M 1010

using namespace std;


int read() {
	int s = 0, f = 0; char ch = getchar();
	while (!isdigit(ch)) f |= (ch == '-'), ch = getchar();
	while (isdigit(ch)) s = s * 10 + (ch ^ 48), ch = getchar();
	return f ? -s : s;
}

int main() {
	char s;
	cin >> s;
	if ('a' <= s && s <= 'z') puts("a");
	else if ('A' <= s && s <= 'Z') puts("A");
}

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

int A[2000001];
int B[2000001];
int C[10001];

int main()
{
    int n, m;
    ios_base::sync_with_stdio(false);
    cin >> n;
    for(int i = 0; i < n; ++i){
        cin >> A[i];
        ++C[A[i]];
    }
    
    for(int i = 1; i < 10001; ++i) C[i] = C[i] + C[i - 1];
    
    for(int i = n - 1; i >= 0; --i){
        B[C[A[i]] - 1] = A[i];
        --C[A[i]];
    }
    
    for(int i = 0; i < n; ++i){
        if(i != 0) cout << ' ';
        cout << B[i];
    }
    cout << endl;
}

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

using namespace std;

int h,v,k;
int row[10],column[10];
char matrix[10][10];

int main(){

    cin>>h>>v>>k;
    for(int i=0;i<h;i++)
        cin >> matrix[i];
    int uk=0;
    for(int i=0;i<h;i++){
        for(int j=0;j<v;j++){
            if(matrix[i][j]=='#'){
                row[i]++;
                column[j]++;
            }
        }
    }
    int rj=0;
    for(int row_mask=0;row_mask<(1<<h);row_mask++){
        for(int column_mask=0;column_mask<(1<<v);column_mask++){
            int zbr=0;
            for(int i=0;i<h;i++){
                for(int j=0;j<v;j++){
                    if(matrix[i][j]=='#' && (row_mask&(1<<i))==0 && (column_mask&(1<<j))==0)
                        zbr++;
                }
            }
            if(zbr==k)
                rj++;
        }
    }
    cout <<rj<<endl;

}



Measured memory_bytes: 3600
//#pragma GCC         optimize("O3")
#include            <bits/stdc++.h>
#include            <ext/pb_ds/assoc_container.hpp>
#include            <ext/pb_ds/tree_policy.hpp>
#define FastIO      ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define pb          push_back
#define mp          make_pair
#define mem(x,i)    memset(x,i,sizeof(x))
#define ff          first
#define ss          second
#define popcount(x) __builtin_popcount(x)
#define all(x)      x.begin(),x.end()
#define Case(t)     for(int ks=1;ks<=t;ks++)
#define fileout     freopen("output.txt","w",stdout)
#define filein      freopen("input.txt","r",stdin)
#define D(x)        cerr<< __LINE__ <<": "<< #x << " = "<<(x) <<'\n';
#define endl        '\n'

using namespace std;
using namespace __gnu_pbds;

using ll  = long long;
using ld  = long double;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pil = pair<int,ll>;

const int INF    = 0x3f3f3f3f;
const ll LL_INF  = 0x3f3f3f3f3f3f3f3f;
const double PI  = acos(-1);
const double eps = 1e-4;
const int mod    = 998244353;
const int mx     = 2e5+5;
template <typename T>  using orderedSet =
    tree<T, null_type, less<T>,
    rb_tree_tag, tree_order_statistics_node_update>;//find_by_order,order_of_key*/

/*------------------------------Graph Moves----------------------------*/
//const int fx[]= {+1,-1,+0,+0};
//const int fy[]= {+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/

//ll powmod(ll a,ll b){ll res=1;a%=mod; assert(b>=0);for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
/*----------------------BitMask-----------------------------------------*/
//inline int setBit(int N,int pos){return N=N | (1<<pos);}
//inline int resetBit(int N,int pos){return N= N & ~(1<<pos);}
//inline bool checkBit(int N,int pos){return (bool) (N& (1<<pos));}

using namespace std;

int main()
{
    int n;
    cin>>n;
    int arr[n];
    int xxor=0;
    for(int i=0;i<n;i++) {cin>>arr[i];xxor^=arr[i];}
    for(int i=0;i<n;i++) cout<<(int)(xxor^arr[i])<<' ';cout<<endl;
}


Measured memory_bytes: 4416
import java.util.*;
public class Main{
    static Scanner kbd = new Scanner(System.in);
    public static void main(String[] args){
    while(kbd.hasNext()){
        String cards = kbd.next();
        if(!cards.equals("-")){
        solve(cards);
        }
    }
    }
  
    static void solve(String cards){
    int m = kbd.nextInt();
    while(m > 0){
        int a = kbd.nextInt();
        String fore = cards.substring(0, a);
        String back = cards.substring(a, cards.length());
        cards = back+fore;
        m--;
    }
    System.out.println(cards);
    }
}


Measured memory_bytes: 26564
#include <bits/stdc++.h>
#define LL long long
using namespace std;
const int N=105;
int n,p,x;
LL dp[N][2];
int main()
{
    scanf("%d%d",&n,&p);
    dp[0][0]=1;
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&x);
		x&=1;
        dp[i][0]=dp[i-1][0],dp[i][1]=dp[i-1][1];
        if(x) dp[i][1]+=dp[i-1][0],dp[i][0]+=dp[i-1][1];
        else dp[i][1]+=dp[i-1][1],dp[i][0]+=dp[i-1][0];
    }
    printf("%lld\n",dp[n][p]);
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>

#define IO std::ios_base::sync_with_stdio(false); std::cin.tie(NULL);

#define MOD 1000000007
#define ull unsigned long long int
#define ll  long long int
#define MAX 100005

using namespace std;

int main() {

    //IO
    //freopen("entrada.txt", "r", stdin);

    int a, b, c;

    cin >> a >> b >> c;

    swap(a, b);
    swap(a, c);

    printf("%d %d %d\n", a, b, c);

    return 0;
}



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

#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define REP(i, n) for(int i = 0; i < (n); ++i)
#define REPr(i, n) for(int i = (n)-1; i >= 0; --i)
#define FORq(i, m, n) for(int i = (m); i <= (n); ++i)
#define FORqr(i, m, n) for(int i = (n); i >= (m); --i)
#define MP make_pair
#define SIN(x, S) (S.count(x) != 0)
#define M0(x) memset(x, 0, sizeof(x))
#define FILL(x, y) memset(x, y, sizeof(x))
#define MM(x) memset(x, -1, sizeof(x))
#define ALL(x) (x).begin(), (x).end()
#define DB(x) cerr << #x << " = " << x << endl
#define DB2(x, y)                                                              \
    cerr << "(" << #x << ", " << #y << ") = (" << x << ", " << y << ")\n";
#define DEBUG                                                                  \
    int x12345;                                                                \
    cin >> x12345;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
const long long MOD = 1e9 + 7;
///////////////////////////////////////////////
// for template
template <class T> inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
///////////////////////////////////////////////
/// 🍈( '-' 🍈 |AC|
int main() {
    vector<bool> B(2000002);
    int N; cin >> N;
    vector<int> A(N);
    REP(i,N){
        cin >> A[i];
    }
    sort(ALL(A));

    REP(i,N){
        if ((i != 0) and (A[i] == A[i-1])){
            B[A[i]] = true;
            continue;
        }

        int D = A[i];
        int k = 2;
        while(k * D <= 1e6){
            int n = k * D;
            B[n] = true;
            k++;
        }
    }

    int ans = N;
    REP(i,N){
        if (B[A[i]]) ans -= 1;
    }

    cout << ans << endl;
}

Measured memory_bytes: 4228
#include<iostream>
#include<vector>
#include<string>
#define rep(i, start, end) for (int i = (int)start; i < (int)end; ++i)
#define rrep(i, start, end) for (int i = (int)start - 1; i >= end; --i)
#define iter(i, c) for (auto i = (c).begin(); i != (c).end(); ++i)
#define riter(i, c) for (auto i = (c).rbegin(); i != (c).rend(); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
using namespace std;
using ll = long long;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    string S;
    cin >> N >> S;
    string s = S.substr(0, N / 2);
    if (S == s + s) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using static Assistant.Input;
using static Assistant.Debug;
using System.Linq;
using Assistant;

namespace ABC164B
{
    class Program
    {
        static void Main(string[] args)
        {
            var A = RInt;
            var B = RInt;
            var C = RInt;
            var D = RInt;

            while (true)
            {
                C -= B;
                A -= D;
                if (C <= 0)
                {
                    Console.WriteLine("Yes");
                    break;
                }
                if(A<=0)
                {
                    Console.WriteLine("No");
                    break;
                }
            }


        }


    }


}

namespace Assistant
{
    static class Input
    {
        static List<string> line = new List<string>();
        static int index = 0;
        static String RNext()
        {
            if (line.Count <= index) line.AddRange(Console.ReadLine().Split());
            return line[index++];
        }
        public static int RInt => int.Parse(RNext());
        public static long RLong => long.Parse(RNext());
        public static int[] RInts => Console.ReadLine().Split().Select(int.Parse).ToArray();
        public static long[] RLongs => Console.ReadLine().Split().Select(long.Parse).ToArray();
        public static string RString => RNext();
        //以下未テスト
        public static int[] RIntsC(int c) => Enumerable.Repeat(0, c).Select(x => int.Parse(RNext())).ToArray();
        public static long[] RLongsC(int c) => Enumerable.Repeat(0, c).Select(x => long.Parse(RNext())).ToArray();
        public static char[][] RMap(int h) => Enumerable.Repeat(0, h).Select(x => Console.ReadLine().ToCharArray()).ToArray();
    }

    static class Debug
    {
        static public void Draw2D(int[,] map, int mode = 1)
        {
#if DEBUG
            int W = map.GetLength(0);
            int H = map.GetLength(1);

            int[,] map2 = new int[W + 1, H + 1];
            for (int i = 0; i < W + 1; i++)
            {
                for (int j = 0; j < H + 1; j++)
                {
                    if (i == 0 && j == 0) map2[i, j] = 0;
                    else if (i == 0) map2[i, j] = j - 1;
                    else if (j == 0) map2[i, j] = i - 1;
                    else map2[i, j] = map[i - 1, j - 1];
                }
            }

            for (int i = 0; i < W + 1; i++)
            {
                for (int j = 0; j < H + 1; j++)
                {
                    if (mode == 0) Console.Write(map2[i, j] % 10);
                    if (mode == 1) Console.Write(map2[i, j] + " ");
                }
                Console.WriteLine();
            }
            Console.WriteLine();
#endif
        }

        public static void Draw1D(int[] array, int mode = 0)
        {
#if DEBUG
            Console.WriteLine(string.Join(" ", array));
#endif
        }
    }
}


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

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

  int n, k;
  cin >> n >> k;

  int p[n];
  for (int i = 0; i < n; ++i) cin >> p[i];

  sort(p, p+n);
  int ans = 0;

  for (int i = 0; i < k; ++i) ans += p[i];

  cout << ans << '\n';

  return (0);
}


Measured memory_bytes: 3660
K = int(input())
for i in range(min(K//9,3)):
    for j in range(9):
        print(str(j+1)+('9'*i))
if K <= 27:
    for i in range(K%9):
        print(str(i+1) + '9'*(K//9))
else:
    c = 27
    keta = 4
    while c < K:
        n = 1
        while True:
            if 10**(n-1) <= 9*keta < 10**n:
                break
            n += 1
        for i in range(10**(n-1),10**n):
            s = str(i)
            array = list(map(int, list(s)))
            n9 = 0
            for w in str(i)[::-1]:
                if w == '9':
                    n9 += 1
                else:
                    break
            if i < (9*(keta-n)+sum(array))*10**n9:
                print(str(i)+'9'*(keta-n))
                c += 1
                if c == K:
                    break
        keta += 1      

Measured memory_bytes: 3188
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;

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

	int a;
	a=D*2+1;
	int ans;
	ans=N/a;
	if(N%a!=0) ans+=1;

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

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

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

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


#define li          long long int
#define uli         unsigned long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

bool ok[100100];
li cnt[100100];

int main() {
    li n,m;
    li res=0;
    li res2=0;
    cin>>n>>m;
    rep(i,m){
        li p;
        string s;
        cin>>p>>s;
        if(s=="AC"){
            if (!ok[p]){
                ok[p]=true;
                res++;
            }
        }else {
            if(!ok[p]){
                cnt[p]++;
            }
        }
    }
    rep(i,n+1){
        if(ok[i])res2+=cnt[i];
    }
    cout<<res<<" "<<res2<<endl;



    return 0;
}


Measured memory_bytes: 4432
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int D = scanner.nextInt();
		if (D == 25)
			System.out.println("Christmas");
		else if (D == 24)
			System.out.println("Christmas Eve");
		else if (D == 23)
			System.out.println("Christmas Eve Eve");
		else if (D == 22)
			System.out.println("Christmas Eve Eve Eve");
		scanner.close();
	}
}

Measured memory_bytes: 21076
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << (x) << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
	return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
	o<<"{";
	for(const T& v:vc) o<<v<<",";
	o<<"}";
	return o;
}
using ll = long long;
template<class T> using V = vector<T>;
template<class T> using VV = vector<vector<T>>;
int main(){
	string s;
	cin>>s;
	int N = s.size();
	for(int i=0;i<N;i++) for(int j=i;j<=N;j++){
		string t = s.substr(0,i) + s.substr(j);
		if(t=="keyence"){
			puts("YES");
			return 0;
		}
	}
	puts("NO");
}

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

int main(){
    string s;
    cin >> s;
    vector<char> vec;
    for(int i = 0; i < s.size(); i++){
        vec.push_back(s.at(i));
    }

    sort(vec.begin(), vec.end());

    if(vec[0] == vec[1] && vec[2] == vec[3] && vec[0] != vec[2]){
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

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

	vector<int> arr(n);

	for(int i = 0; i < n; i++) cin >> arr[i];

	sort(arr.begin(), arr.end());
	
	int mid = n/2 - 1;

	int ans = arr[mid+1] - arr[mid];

	cout << ans << endl;	






	return 0;
}

Measured memory_bytes: 1024
from collections import deque
n = int(input())
b = list(map(int,input().split()))
ans = deque()
for _ in range(n):
    for i in range(len(b))[::-1]:
        if b[i] == i + 1:
            ans.appendleft(b[i])
            b.pop(i)
            break
        if i == 0:
            print(-1)
            exit(0)
for i in ans:
    print(i)

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

int main(void){
	int n, m, field[21][21], num;
	int x, y, i, j;
	char vec;
	scanf("%d",&n);
	while(n != 0){
		memset(field,0,sizeof(field));
		for(i = 0;i < n;i++){
			scanf("%d%d",&x,&y);
			field[y][x] = 1;
		}
		x = y = 10;
		scanf("%d%*c",&m);
		for(i = 0;i < m;i++){
			vec = getchar();
			scanf("%d%*c",&num);
			switch(vec){
			case 'N':
				for(j = 1;j <= num;j++)
					field[y + j][x] = 0;
				y = y + num;
				break;
			case 'S':
				for(j = 1;j <= num;j++)
					field[y - j][x] = 0;
				y = y - num;
				break;
			case 'W':
				for(j = 1;j <= num;j++)
					field[y][x - j] = 0;
				x = x - num;
				break;
			case 'E':
				for(j = 1;j <= num;j++)
					field[y][x + j] = 0;
				x = x + num;
				break;
			}
		}
		for(i = 0;i <= 20;i++){
			for(j = 0;j <= 20;j++)
				if(field[i][j]) break;
			if(j != 21 && field[i][j]) break;
		}
		if(i == 21 && j == 21)
			printf("Yes\n");
		else
			printf("No\n");
		scanf("%d",&n);
	}
	return 0;
}

Measured memory_bytes: 1016
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for _ in range(N)]
def dp2(ini, i, j): return [[ini]*i for _ in range(j)]
def dp3(ini, i, j, k): return [[[ini]*i for _ in range(j)] for _ in range(k)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value

## 3進数
'''
N = ii()

shiki = [1]
for i in range(10):
    tmp = shiki[-1]*3
    shiki.append(tmp)

ele = [3, 5, 7]
l = []
for keta in range(3, 10):
    maxx = shiki[keta]
    for i in range(maxx):
        ten = 10**(keta-1)
        tmp = 0
        for j in reversed(range(keta)):
            tmp += ele[i//shiki[j]] * ten
            i %= shiki[j]
            ten //= 10
        l.append(tmp)

cnt = 0
for num in l:
    if num > N:
        break
    num = str(num)
    if all(e in num for e in ['3', '5', '7']):
        cnt += 1
            
print(cnt)
'''

def n_shinsu(k, n):
    bi=''
    while n!=0:
        bi+=str(n%abs(k))
        if k<0:n=-(-n//k)
        else:n=n//k
    return bi[::-1]

N = ii()
maxx = 8
l = []
ele = [3, 5, 7]
for keta in range(3, 10):
    maxx = (maxx+1) * 3 - 1
    for i in range(maxx):
        tmp = n_shinsu(3, i).zfill(keta)
        ten = 1
        num = 0
        for moji in tmp[::-1]:
            num += ele[int(moji)] * ten
            ten *= 10
        l.append(num)

cnt = 0
for num in l:
    if num > N:
        break
    num = str(num)
    if all(e in num for e in ['3', '5', '7']):
        cnt += 1
            
print(cnt)

Measured memory_bytes: 4328
#include <iostream>
using namespace std;
 
int main(){
    string N;
    cin >> N;
    if(N[1] == N[2] && (N[0] == N[1] || N[2] == N[3])){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
n = int(input())
b = list(map(int, input().split()))
maxa = [0] * n
maxa[0], maxa[n - 1] = b[0], b[n - 2]
for i in range(1, n - 1):
  maxa[i] = min(b[i - 1], b[i])
print(sum(maxa))

Measured memory_bytes: 3064
import java.util.*;
 
public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
        int D = sc.nextInt();
      	int T = sc.nextInt();
      	int S = sc.nextInt();
      	if(D <= S*T) System.out.println("Yes");
      	else System.out.println("No");
	}
}

Measured memory_bytes: 35576
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

a,b = inm()
for i in range(1,11000):
    if (i*8)//100==a and (i*10)//100==b:
        print(i)
        exit()
print(-1)


Measured memory_bytes: 39152
n = gets.chomp.to_i

counts = Array.new(n, 0)
for i in 1...100 do
  for j in i...100 do
    for k in j...100 do
      n1 = i * i + j * j + k * k +
           i * j + j * k + k * i
      next if n1 > n
      gain = 1
      if i == j
        if j == k
          gain = 1
        else
          gain = 3
        end
      else
        if j == k
          gain = 3
        else
          gain = 6
        end
      end
      counts[n1 - 1] += gain
    end
  end
end

puts counts


Measured memory_bytes: 14348
n=int(input())
H=list(map(int,input().split()))
ans=0

while True:
    flag=0
    m=200 #最小値
    for h in H:
        if h==0:
            continue
        else:
            m=min(h,m)
    if m==200:
        break
    else:
        for i in range(n):
            if H[i]==0:
                flag=0
                continue
            else:
                if flag==0:
                    ans+=m
                flag=1
                H[i]-=m
print(ans)

Measured memory_bytes: 3064
S = gets.chomp.to_s
N = S.length
a = "false"

(0..N-1).each do |i|
  if S[i] == S[N-1-i]
    a = "true"
  else
    a = "false"
  end
end

if S[0..(N-3)/2] == S[(N+1)/2..N-1] && a == "true"
  puts "Yes"
else
  puts "No"
end

Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,a[100],sum=0,mid,ans=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
		sum+=a[i];
	}
	mid=round(sum/double(n));
	for(int i=0;i<n;i++)
		ans+=pow(mid-a[i],2);
	cout<<ans<<endl;
}


Measured memory_bytes: 256
fun main(args: Array<String>) {
    nikkei20192quala_b()
}

private fun mod(x: Long) = x % (998244353).toLong()

fun nikkei20192quala_b() {
    val n = readLine()!!.toInt()
    val dList = readLine()!!.split(" ").map { it.toInt() }

    if (dList.first() != 0) return println(0)

    val eachCount = dList.groupBy { it }.mapValues { it.value.size }

    if (eachCount[0] != 1) return println(0)

    var answer = 1L
    var depth = 0
    while (eachCount[depth + 1] != null) {
        depth++
        (1..eachCount[depth]!!).forEach { answer = mod(answer * eachCount[depth - 1]!!) }
    }

    if (depth < dList.max()!!) return println(0)

    println(answer)
}


Measured memory_bytes: 83252
let (n, p) = Scanf.scanf "%d %d\n" @@ fun n p -> (n, p)

let rec prime_fact acc i n =
  if n = 0 then acc
  else if n < i * i then n :: acc
  else if n mod i = 0 then prime_fact (i :: acc) i (n / i)
  else prime_fact acc (i + 1) n

let prime_fact n =
  List.fold_left (fun acc i ->
    match acc with
      | [] -> [(i, 1)]
      | (v, cnt) :: xs -> if v = i then (v, cnt + 1) :: xs else (i, 1) :: (v, cnt) :: xs
  ) [] @@ prime_fact [] 2 n

let rec pow n = function
  | 0 -> 1
  | i -> n * pow n (i - 1)

let () = 
  prime_fact p
    |> List.map (fun (i, j) -> pow i (j / n))
    |> List.fold_left ( * ) 1
    |> print_int

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		// 入力
		int a = sc.nextInt();
		int b = sc.nextInt();
		int x = sc.nextInt();

		String ans ="";
		if (a + b >= x && a <= x) {
			ans = "YES";
		} else {
			ans = "NO";
		}

		// 出力
		System.out.println(ans);
	}
}

Measured memory_bytes: 22608
#include <iostream>
#include <tuple>
#include <vector>
#include <algorithm>
using namespace std;

typedef tuple<unsigned long long, unsigned long long> ulltuple;
bool abc131dcompare(const ulltuple& lhs, const ulltuple& rhs) {
  return get<1>(lhs) < get<1>(rhs);
}

int main(int argc, char const *argv[])
{
  int n; cin >> n;
  vector<tuple<unsigned long long, unsigned long long> > c(n);
  unsigned long long a, b;
  for(int i=0;i<n;++i) {
    cin >> a >> b;
    c[i] = tuple<unsigned long long, unsigned long long>(a, b);
  }
  sort(c.begin(), c.end(), abc131dcompare);
  //sort(c.begin(), c.end());

  unsigned long long time=0uLL;
  bool flg = true;
  for(int i=0;i<n;++i) {
    //cout << get<0>(c[i]) << " " << get<1>(c[i]) << " " << time << endl;
    time += get<0>(c[i]);
    if(time>get<1>(c[i])) {
      flg = false;
      break;
    }
  }
  cout << (flg? "Yes": "No") << endl;

  return 0;

}



Measured memory_bytes: 3328
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<queue>
using namespace std;
typedef long long ll;
int main()
{
	ll n,m,ans,sum,tag;
	ll a[100005];
	priority_queue<ll> q;
	scanf("%lld%lld",&n,&m);
	for(ll i=1;i<=n;i++)
	{
		scanf("%lld",&a[i]);
		q.push(a[i]);
	}
	ll flag;
	flag=0;
	sum=0;
	if(n==1)
	{
		while(m)
		{
			a[1]/=2;
			m--;
		}
		printf("%lld\n",a[1]);
	}
	else
	{
		while(!q.empty())
		{
			ans=q.top();
			q.pop();
			while(ans>=q.top())
			{
				ans/=2;
				sum++;
				if(sum==m)
				{
					flag=1;
					q.push(ans);
					break;
				}
			}
			if(flag==0)
			{
				q.push(ans);
			}
			else
			{
				break;
			}
		}
		tag=0;
		while(!q.empty())
		{
			tag+=q.top();	
			q.pop();
		}
		printf("%lld\n",tag);
	}
	return 0;
}

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

int main(){
	int n,k;
	cin>>n>>k;
	if(k>(n-1)*(n-2)/2){
		cout<<"-1\n";
		return 0;
	}
	cout<<(n-1)*n/2-k<<'\n';
	for(int i=1;i<n;i++){
		cout<<i<<' '<<n<<'\n';
	}
	int tmp=(n-1)*(n-2)/2-k;
	for(int i=1;i<n;i++)
    for(int j=i+1;j<n;j++){
		if(tmp){
			cout<<i<<' '<<j<<'\n';
			tmp--;
		}
		else break;
	}
	return 0;
}


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

namespace AtCoder
{

    static class Program
    {
        static void Main()
        {
            Console.SetOut(new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
            //

            var N = GetInt();
            var ans = 1;
            while (ans+1 <= Math.Sqrt(N))
            {
                ans++;
            }
            ans *= ans;

            Console.WriteLine(ans);

            //
            Console.Out.Flush();
            Console.ReadKey();
        }

        static void Solve()
        {

        }


        static public string GetStr() { return Console.ReadLine().Trim(); }
        static public int GetInt() { return int.Parse(Console.ReadLine()); }
        static public long GetLong() { return long.Parse(Console.ReadLine()); }
        static public string[] GetStrArray() { return Console.ReadLine().Split(' '); }
        static public int[] GetIntArray() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
        static public long[] GetLongArray() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
        static public char[] GetCharArray() { return Console.ReadLine().Split(' ').Select(char.Parse).ToArray(); }
        static public List<double> GetDoubleList() { return Console.ReadLine().Split(' ').Select(double.Parse).ToList(); }
        static public void WriteObjects<T>(IEnumerable<T> values) { foreach (var o in values) { Console.Write(o + " "); } }
        static string yesno(this bool b) { return b ? "yes" : "no"; }
        static string YesNo(this bool b) { return b ? "Yes" : "No"; }
        static string YESNO(this bool b) { return b ? "YES" : "NO"; }

        static bool eq<T, U>() => typeof(T).Equals(typeof(U));
        static T ct<T, U>(U a) => (T)Convert.ChangeType(a, typeof(T));
        static T cv<T>(string s) => eq<T, int>() ? ct<T, int>(int.Parse(s))
                           : eq<T, long>() ? ct<T, long>(long.Parse(s))
                           : eq<T, double>() ? ct<T, double>(double.Parse(s))
                           : eq<T, char>() ? ct<T, char>(s[0])
                                             : ct<T, string>(s);
        static void Multi<T>(out T a) => a = cv<T>(GetStr());
        static void Multi<T, U>(out T a, out U b)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]);
        }
        static void Multi<T, U, V>(out T a, out U b, out V c, out V d)
        {
            var ar = GetStrArray(); a = cv<T>(ar[0]); b = cv<U>(ar[1]); c = cv<V>(ar[2]); d = cv<V>(ar[3]);
        }
    }
}

Measured memory_bytes: 13140
#include<bits/stdc++.h>
using namespace std;
int main(){
int a,b,c,d;
  cin>>a>>b>>c>>d;
  if(abs(a-c)<=d||abs(a-b)<=d&&abs(b-c)<=d){
    cout<<"Yes"<<endl;
}
  else{cout<<"No"<<endl;}
}


Measured memory_bytes: 3612