akhauriyash/Code-Regression huggingface dataset:
//DUEL
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define x first
#define y second
#define pii pair<int,int>
#define pb push_back
#define eb emplace_back
#pragma GCC optimize("unroll-loops")
#define shandom_ruffle(a, b) shuffle(a, b, rng)
#define vi vector<int>
#define vl vector<ll>
#define popcnt __builtin_popcount
#define popcntll __builtin_popcountll

using namespace std;
using namespace __gnu_pbds;

using ll=long long;
using ull=unsigned long long;
using ld=long double;
int MOD=1000000007;
int MOD2=998244353;
vector<int> bases;
const ll LLINF=1ll<<60;
const char en='\n';

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void yes() {cout<<"YES"<<en; exit(0);}
void no() {cout<<"NO"<<en; exit(0);}
inline int rund() {int x576363482791fuweh=rng();return abs(x576363482791fuweh)%RAND_MAX;}
template<class T>
void prVec(vector<T> w,bool fl=false)
{
	cout<<w.size()<<en;
	for (int i=0;i<int(w.size())-1;++i) cout<<w[i]<<' ';
	if (w.size()) cout<<w[w.size()-1]<<en;
	if (fl) cout<<flush;
}

void M998()
{
	swap(MOD,MOD2);
}

ll raand()
{
	ll a=rund();
	a*=RAND_MAX;
	a+=rund();
    return a;
}

#define rand raand

ll raaand()
{
	return raand()*(MOD-7)+raand();
}

string to_upper(string a)
{
	for (int i=0;i<(int)a.size();++i) if (a[i]>='a' && a[i]<='z') a[i]-='a'-'A';
	return a;
}

string to_lower(string a)
{
	for (int i=0;i<(int)a.size();++i) if (a[i]>='A' && a[i]<='Z') a[i]+='a'-'A';
	return a;
}

ll sti(string a,int base=10)
{
	ll k=0;
	for (int i=0;i<(int)a.size();++i)
	{
		k*=base;
		k+=a[i]-'0';
	}
	return k;
}

template<class T>
void eras(vector<T>& a,T b)
{
	a.erase(find(a.begin(),a.end(),b));
}

string its(ll k,int base=10)
{
	if (k==0) return "0";
	string a;
	while (k)
	{
		a.push_back((k%base)+'0');
		k/=base;
	}
	reverse(a.begin(),a.end());
	return a;
}

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

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

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

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

ll gcd(ll a,ll b)
{
	if (b==0) return a;
	return gcd(b,a%b);
}

ll lcm(ll a,ll b)
{
	return a/gcd(a,b)*b;
}

template<class T,class K>
pair<T,K> mp(T a,K b)
{
	return make_pair(a,b);
}

inline int mult(ll a,ll b)
{
	return (a*b)%MOD;
}

inline int pot(int n,int k)
{
	if (k==0) return 1;
	ll a=pot(n,k/2);
	a=mult(a,a);
	if (k%2) return mult(a,n);
	else return a;
}

int divide(int a,int b)
{
	return mult(a,pot(b,MOD-2));
}

inline int sub(int a,int b)
{
	if (a-b>=0) return a-b;
	return a-b+MOD;
}

inline int add(int a,int b)
{
	if (a+b>=MOD) return a+b-MOD;
	return a+b;
}

bool prime(ll a)
{
	if (a==1) return 0;
	for (int i=2;i<=round(sqrt(a));++i)
	{
		if (a%i==0) return 0;
	}
	return 1;
}

const int N=300010;
int n;
string a[N];
int b[N];

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	for (int i=0;i<10;++i) bases.push_back(rand()%(MOD-13893829*2)+13893829);
	cin>>n;
	int s=0;
	for (int i=0;i<n;++i) cin>>a[i]>>b[i],s+=b[i];
	string x;
	cin>>x;
	for (int i=0;i<n;++i)
	{
		s-=b[i];
		if (x==a[i]) break;
	}
	cout<<s;
}





Measured memory_bytes: 3196
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111; 
using namespace std;
typedef long long lint;


lint powmod(lint a, lint n, lint mod = MOD) {
	lint res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

class Combi {
private:
	vector<lint> fac, inv, finv;

	void init(int N) {
		fac[0] = fac[1] = 1; inv[1] = 1; finv[0] = finv[1] = 1;

		for (int i = 2; i < N; i++) {
			fac[i] = fac[i - 1] * i % MOD;
			inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
			finv[i] = finv[i - 1] * inv[i] % MOD;
		}
	}

public:
	Combi(int N = 100000) : fac(N + 1), inv(N + 1), finv(N + 1) { init(N + 1); }

	lint Cmod(int n, int k) {
		if (n < k) return 0;
		if (n < 0 || k < 0) return 0;
		return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
	}

	lint Pmod(int n, int k) {
		if (n < k) return 0;
		if (n < 0 || k < 0) return 0;
		return fac[n] * finv[n - k] % MOD;
	}
};

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int N, A, B, C;
	cin >> N >> A >> B >> C;
	Combi Combi(N * 2);

	lint tmp = 0;
	for (int i = 0; i < N; i++) {

		tmp += (N + i) * powmod(A, N) % MOD * powmod(B, i) % MOD * powmod(powmod(100 - C, N + i), MOD - 2) % MOD * Combi.Cmod(N + i - 1, i) % MOD;
		tmp %= MOD;
		tmp += (N + i) * powmod(B, N) % MOD * powmod(A, i) % MOD * powmod(powmod(100 - C, N + i), MOD - 2) % MOD * Combi.Cmod(N + i - 1, i) % MOD;
		tmp %= MOD;	

	}

	lint ans = 0;
	ans += 100 * powmod(100 - C, MOD - 2) % MOD * tmp % MOD;
	ans %= MOD;

	cout << ans << "\n";

	return 0;
}

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

using ll = long long;
using namespace std;

int n;
const int MAXN = 1e3 + 1;
const int MAXV = 1e6 + 1;
int id[MAXN][MAXN];
vector<int> to[MAXV];

vector<int> reached_loop(MAXV, -1);
bool looped(int v) {
    if (reached_loop[v] >= 0) {
        return reached_loop[v] > 0;
    }
    reached_loop[v] = 1;
    int ret = 0;
    for (int next: to[v]) {
        if (looped(next)) {
            ret = 1;
            break;
        }
    }
    reached_loop[v] = ret;
    return ret > 0;
}

vector<bool> reached(MAXV, false);
vector<int> dp(MAXV, 0);
int dfs(int v) {
    if (reached[v]) {
        return dp[v];
    }
    reached[v] = true;
    dp[v] = 1;
    for (int e: to[v]) {
        dp[v] = max(dp[v], dfs(e) + 1);
    }
    return dp[v];
}

int main() {
    cin >> n;
    vector<vector<int>> a(n, vector<int>(n - 1));
    for (int i = 0; i < n; i++) {
        for (int k = 0; k < n - 1; k++) {
            cin >> a[i][k];
            a[i][k]--;
        }
    }
    int v = 0;
    for (int i = 0; i < n - 1; i++) {
        for (int k = 1; k < n; k++) {
            id[i][k] = v;
            v++;
        }
    }
    for (int i = 0; i < n; i++) {
        for (int k = 1; k < n - 1; k++) {
            to[id[min(i, a[i][k - 1])][max(i, a[i][k - 1])]].emplace_back(id[min(i, a[i][k])][max(i, a[i][k])]);
        }
    }
    int ans = 0;
    for (int i = 0; i < v; i++) {
        if (looped(i)) {
            cout << -1 << endl;
            return 0;
        }
        ans = max(ans, dfs(i));
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 55168
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <numeric>
#include <queue>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

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

void Main() {
  int n, d;
  cin >> n >> d;

  vector<vector<int>> x(n, vector<int>(d));

  rep(i, n) {
    rep(j, d) { cin >> x[i][j]; }
  }
  int ans = 0;

  rep(i, n) rep(j, i) {
    int sq = 0;
    rep(k, d) {
      int s = x[i][k] - x[j][k];
      sq += s * s;
    }
    int s = sqrt(sq) + 0.5;
    if (s * s == sq)
      ++ans;
  }
  cout << ans << endl;
}

int main() {
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}


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

int main() {
  int N;
  cin>>N;
  vector<int> p(N);
for (int i = 0; i < N; i++) {
  cin >> p.at(i);
}
sort(p.begin(), p.end());
reverse(p.begin(), p.end());
  int Z=0;
  for (int i = 0; i < N; i++) {
  if(i%2==0){
    Z+=p.at(i);
  }
    else{
      Z-=p.at(i);
    }
  }
  cout<<Z<<endl;
}


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

#define all(c) (c).begin(), (c).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb(e) push_back(e)
#define mp(a, b) make_pair(a, b)
#define fr first
#define sc second

const int INF=100000000;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
using namespace std;
typedef pair<int ,int > P;
typedef long long ll;
int n;
bool is_prime[10005];

void init() {
    rep(i,10005) is_prime[i] = true;
    is_prime[0] = is_prime[1] = false;

    rep(i,10005) if(is_prime[i]) for(int j=i+i;j<10005;j+=i) is_prime[j]=false;
}

void solve() {
    int ans = 0;
    rep(i,n+1) {
        if(is_prime[i]&&is_prime[n-i+1]) ans++;

    }
    cout<<ans<<endl;

}

int main() {
    init();
    while(cin>>n) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 1168
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <cmath>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>

typedef  long long ll;
#define mop 1000000007
using namespace std;

int main() {
    
    ll x,y;
    cin >> x >> y;
    ll ans = 0;
    if(x == 1) ans += 300000;
    if(x == 2) ans += 200000;
    if(x == 3) ans += 100000;
    if(y == 1) ans += 300000;
    if(y == 2) ans += 200000;
    if(y == 3) ans += 100000;
    if(x == 1 and y == 1) ans += 400000;
    cout << ans << endl;

}

Measured memory_bytes: 256
import java.util.Scanner;
  
class Node {
    static Node root;
  
    int key;
    Node left;
    Node right;
  
    Node(int key) {
        this.key = key;
    }
  
    void insert() {
        Node y = null;
        Node x = root;
        while(x != null) {
            y = x;
            if(key < x.key) x = x.left;
            else x = x.right;
        }
  
        if(y == null) root = this;
        else if(key < y.key) y.left = this;
        else y.right = this;
    }
  
    static boolean find(int key) {
        Node x = root;
        while(x != null) {
            if(key < x.key) x = x.left;
            else if(x.key < key) x = x.right;
            else return true;
        }
        return false;
    }
  
    static String inorder(Node x) {
        String str = "";
        if(x == null) return str;
  
        if(x.left != null) str += inorder(x.left);
        str += " " + x.key;
        if(x.right != null)str += inorder(x.right);
  
        return str;
    }
  
    static String preorder(Node x) {
        String str = "";
        if(x == null) return str;
  
        str += " " + x.key;
        if(x.left != null) str += preorder(x.left);
        if(x.right != null) str += preorder(x.right);
  
        return str;
    }
}
  
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
   
        Node.root = null;
        int m = sc.nextInt();
        for(int i = 0; i < m; i++) {
            String cmd = sc.next();
            if(cmd.equals("insert")) {
                new Node(sc.nextInt()).insert();
            }else if(cmd.equals("find")) {
                System.out.println(Node.find(sc.nextInt())? "yes" : "no");
            }else {
                System.out.println(Node.inorder(Node.root));
                System.out.println(Node.preorder(Node.root));
            }
        }
  
        sc.close();
    }
}



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

typedef long long int ll;
typedef long double ld;

//****************************************************                
#define lp(var,start,end) for (ll var = start; var <end ; ++var)
#define rlp(var,start,end) for(ll var = start; var>=end ; var--)
#define pb push_back
#define mp make_pair
#define pf push_front
#define ff first
#define ss second
#define vll vector<ll>
#define pll pair<ll,ll> 
#define vpll vector<pll>
#define all(X) X.begin(),X.end()
#define endl "\n" //comment it for interactive questions
#define trace1(a) cerr << #a << ": " << a << endl;
#define trace2(a,b) cerr << #a << ": " << a << " " << #b << ": " << b << endl;
#define trace3(a,b,c) cerr << #a << ": " << a << " " << #b << ": " << b << " " << #c << ": " << c << endl;
#define trace4(a,b,c,d) cerr << #a << ": " << a << " " << #b << ": " << b << " " << #c << ": " << c << #d << ": " << d << endl;
#define OC freopen("input.txt" , "r", stdin); freopen("output.txt" , "w", stdout) 
#define MOD (ll)1e9+7; //change it for other mods
#define FAST_IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
        //*******************************************************
//Some Functions

ll powmod(ll a,ll b)
{
   ll res = 1;
   while(b > 0) {
      if(b & 1) res = (res * a) % MOD;
      a = (a*a)%MOD;
      b = b >> 1; 
  }
  return res % MOD;
}

ll cal(ll x) 
{
	if(x == 1) {
		return 1;
	} else {
		return 1 + 2*cal(x/2);
	}
}
void solve()
{
    ll h;
    cin >> h;
    cout << cal(h);

}

int main()
{
    FAST_IO;
    // #ifndef ONLINE_JUDGE 
    //   OC;
    // #endif
    ll t = 1;
    // cin >> t;
    while(t--){
        solve();
    }
}

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

using namespace std;

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

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

    sort(v.begin(), v.end());
    int mid = (n - 1) / 2;
    cout << v[mid + 1] - v[mid] << '\n';
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const int RMAX = (1 << 12) + 5;
/* global variables */
vector<int> dp(RMAX, INF);
vector<int> cost(RMAX);
vector<bitset<12> > open(RMAX);
int N, M;
int upper;
/* function */
void initDPTable() {
    upper = 1 << N;
    dp[0] = 0;
}
void calcDPTable() {
    for (int c = 1; c <= M; c++) {
        for (int r = 0; r < upper; r++) {
            bitset<12> pb(r);
            bitset<12> nb = pb | open[c - 1];
            int pi = pb.to_ulong();
            int ni = nb.to_ulong();
            int nextCost = dp[pi] + cost[c - 1];
            dp[ni] = min(dp[ni], nextCost);
        }
    }
}
int calcAns() {
    if (dp[upper-1] == INF) return -1;
    else return dp[upper-1];
}
/* main */
int main(){
    cin >> N >> M;
    int m;
    for (int i = 0; i < M; i++) {
        cin >> cost[i] >> m;
        int k;
        bitset<12> bs(0);
        for (int j = 0; j < m; j++) {
            cin >> k;
            bs.set(k - 1);
        }
        open[i] = bs;
    }
    initDPTable();
    calcDPTable();
    cout << calcAns() << '\n';
}


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

int main(){
	int a, saizu;
	int num[100] = {0}, num2[100] = {0};
	vector<int> array;
	while(cin >> a){
		array.push_back(a);
	}
	saizu = array.size();
	for(int i = 0; i < saizu; i++){
		num2[array[i]-1]++;
		num[array[i]-1]++;
	}
	sort(num,num+saizu);
	for(int i = 0; i < 100; i++){
		if(num2[i] == num[saizu-1]){
			cout << i+1 << endl;
		}
	}
}

Measured memory_bytes: 1220
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <climits>
using namespace std;

#define MOD1097 1000000007

#define ll long long
#define pint pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define mpair make_pair
#define pm(first, second) pb(mpair(first, second))
#define SPACE " "
#define fpf first.first
#define fps first.second
#define spf second.first
#define sps second.second

#define all(X) (X).begin(), (X).end()
#define reall(X) (X).rbegin(), (X).rend()
#define divcel(a, b) (((a) + ((b) - 1)) / (b))

int main(){

	ll N;
	cin >> N;
	cout << (N-1)/2 << endl;

	return 0;
}


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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

int n;
vl a;

ll sadsum(int b){
    ll sum=0;
    REP(i,n) {
        sum += abs(a[i]-b);
    }

    return sum;
}

int main() {

    cin>>n;
    a.resize(n);
    REP(i,n) cin>>a[i];

    ll ans=0;
    REP(i,n) {
        a[i] = a[i]-(i+1);
    }

    sort(a.begin(), a.end());
    //DEBUG_VEC(a);
    ll b=0;
    ll cen = 0;
    if(n%2==0){
        cen = a[n/2]+a[(n/2)-1];
        if(cen!=0) cen /=2;
    }
    else
        cen=a[n/2];

    ans=sadsum(cen);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 12 00:55:57 2020

@author: Kanaru Sato
"""

n,k = list(map(int, input().split()))
h = list(map(int, input().split()))

count = 0

for i in range(n):
    if h[i] >= k:
        count += 1

print(count)

Measured memory_bytes: 11908
using Yorukatsu028.Questions;
using Yorukatsu028.Extensions;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace Yorukatsu028.Questions
{
    /// <summary>
    /// ARC073 C
    /// </summary>
    public class QuestionB : AtCoderQuestionBase
    {
        public override IEnumerable<object> Solve(TextReader inputStream)
        {
            var nt = inputStream.ReadIntArray();
            var n = nt[0];
            var duration = nt[1];
            var times = inputStream.ReadIntArray();

            long totalTime = 0;

            totalTime += duration;
            for (int i = 1; i < times.Length; i++)
            {
                var last = times[i] - times[i - 1];
                if (last < duration)
                {
                    totalTime += last;
                }
                else
                {
                    totalTime += duration;
                }
            }

            yield return totalTime;
        }
    }
}


namespace Yorukatsu028
{
    class Program
    {
        static void Main(string[] args)
        {
            IAtCoderQuestion question = new QuestionB();    // 問題に合わせて書き換え
            var answers = question.Solve(Console.In);
            foreach (var answer in answers)
            {
                Console.WriteLine(answer);
            }
        }
    }
}

#region Base Classes

namespace Yorukatsu028.Questions
{

    public interface IAtCoderQuestion
    {
        IEnumerable<object> Solve(string input);
        IEnumerable<object> Solve(TextReader inputStream);
    }

    public abstract class AtCoderQuestionBase : IAtCoderQuestion
    {
        public IEnumerable<object> Solve(string input)
        {
            var stream = new MemoryStream(Encoding.Unicode.GetBytes(input));
            var reader = new StreamReader(stream, Encoding.Unicode);

            return Solve(reader);
        }

        public abstract IEnumerable<object> Solve(TextReader inputStream);
    }

}

#endregion

#region Extensions

namespace Yorukatsu028.Extensions
{
    internal static class TextReaderExtensions
    {
        internal static int ReadInt(this TextReader reader) => int.Parse(ReadString(reader));
        internal static long ReadLong(this TextReader reader) => long.Parse(ReadString(reader));
        internal static double ReadDouble(this TextReader reader) => double.Parse(ReadString(reader));
        internal static string ReadString(this TextReader reader) => reader.ReadLine();

        internal static int[] ReadIntArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(int.Parse).ToArray();
        internal static long[] ReadLongArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(long.Parse).ToArray();
        internal static double[] ReadDoubleArray(this TextReader reader, char separator = ' ') => ReadStringArray(reader, separator).Select(double.Parse).ToArray();
        internal static string[] ReadStringArray(this TextReader reader, char separator = ' ') => reader.ReadLine().Split(separator);
    }
}

#endregion

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

  ll a = n % k;
  ll b = abs(k - a);
  cout << min(a, b) << endl;

  return 0;
}


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

int main() {
    int k, x;
    cin >> k >> x;

    if (k*500 >= x) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define F first
#define S second
#define pub push_back
#define pob pop_back
#define M 1000000007
#define pii pair<ll,ll>
#define mp make_pair
using namespace std;
vector<ll>p,q,ans;
int main()
{
    ios_base::sync_with_stdio(false);
    ll n,i,u,x;

    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>u;
        p.pub(u);
    }
    while(p.size()>0)
    {
        for(i=0;i<p.size();i++)
        {
            if(p[i]>i+1){cout<<-1;return 0;}
            else if(p[i]==i+1){x=i;}
        }
        //cout<<x<<" !!\n";
        ans.pub(x+1);
        q=p;p.clear();
        for(i=0;i<q.size();i++)
        {
            if(i!=x)p.pub(q[i]);
        }
        q.clear();
    }
    for(i=n-1;i>=0;i--)cout<<ans[i]<<endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
class Main{
    public static void main(String[]args){
        Scanner sc=new Scanner(System.in);
        while(true){
        	int a=sc.nextInt();
            String op=sc.next();
        	int b=sc.nextInt();

        	if(op.equals("+")){
                System.out.println(a+b);
        	}else if(op.equals("-")){
                System.out.println(a-b);
            }else if(op.equals("*")){
                System.out.println(a*b);
            }else if(op.equals("/")){
                System.out.println(a/b);
            }else{
                break;
            }
        }
    }
}


Measured memory_bytes: 26268
#include <stdio.h>

int main(void)
{

  int a,b,s,i;
  scanf("%d%d",&a,&b);
  s=0;
  if(a<b){
        s=s+b;
        b=b-1;
        if(a<b) s=s+b;
        else if(a>b) s=s+a;
        else s=s+a;
  }
  else if(a>b){
        s=s+a;
        a=a-1;
        if(a<b) s=s+b;
        else if(a>b) s=s+a;
        else s=s+b;
  }
  else
        s=a+b;
  printf("%d\n",s);
  return 0;
}



Measured memory_bytes: 128
#include <iostream>
using namespace std;
int main(){
        int n;
        cin >> n;
        int t=n,c=0;
        while(t!=0){
                c+=t%10;
                t/=10;
        }
        if(n%c==0)
                cout <<"Yes"<<endl;
        else
                cout <<"No"<<endl;
        return 0;
}

Measured memory_bytes: 256
#define LOCAL
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rrep(i, n) for(int i=(n-1); i>=0; --i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define memr(dp, val) memset(dp, val, sizeof(dp))
using namespace std;
typedef long long ll;
static const int INTINF = (INT_MAX >> 1); // 10^9 + 10^7
static const ll LLINF = (LLONG_MAX >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> inline bool int_ceil(T a, T b) { T res = a / b; if(a % b != 0) res++; return res; }
template<typename T>
using min_priority_queue = priority_queue<T, vector<T>, greater<T> >;
string to_string(string s) { return '"' + s + '"'; }
string to_string(bool b) { return b ? "true" : "false"; }
template <size_t N> string to_string(bitset<N> bs) {
  string res;
  for (size_t i = 0; i < N; ++i) res += '0' + bs[i];
  return res;
}
string to_string(vector<bool> v) {
  string res = "{";
  for (bool e : v) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p);
template <class C> string to_string(C c) {
  string res = "{";
  for (auto e : c) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug() { cerr << '\n'; }
template <class Head, class... Tail> void debug(Head head, Tail... tail) {
  cerr << '\t' << to_string(head), debug(tail...);
}
#ifdef LOCAL
#define print(...) cerr << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
#else
#define print(...)
#endif

int main(int argc, const char * argv[]) {
	std::cout << std::fixed << std::setprecision(15);

	ll N; cin >> N;
	ll tmp = N / 1000LL;
	if(N % 1000LL != 0) tmp++;

	cout << tmp * 1000LL - N << endl;

	return 0;
}


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

#include <math.h>
#include <stdlib.h>


#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

template<class T> inline bool chmin(T &a, T b) { if(a > b){ a = b; return true; } return false; }
template<class T> inline bool chmax(T &a, T b) { if(a < b){ a = b; return true; } return false; }

//INT_MAX	2,147,483,647 = 2*1.0e9

const ll mod = 1000000007;

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

    ll dp[100010][2][2][2];
    for(int i = 0; i < 100010; i++) for(int j = 0; j < 2; j++) for(int k = 0; k < 2; k++) for(int l = 0; l < 2; l++) dp[i][j][k][l] = 0;
    dp[0][0][0][0] = 1;
    
    for(int i = 0; i < S.length(); i++){
        if(S[i] == 'A' || S[i] == '?'){
            for(int k = 0; k < 2; k++){
                for(int l = 0; l < 2; l++){
                    dp[i+1][0][k][l] += dp[i][0][k][l];
                    dp[i+1][0][k][l] %= mod;
                    dp[i+1][1][k][l] += dp[i][0][k][l];
                    dp[i+1][1][k][l] %= mod;
                    dp[i+1][1][k][l] += dp[i][1][k][l];
                    dp[i+1][1][k][l] %= mod;
                }
            }
        }

        if(S[i] == 'B' || S[i] == '?'){
            for(int l = 0; l < 2; l++){
                for(int k = 0; k < 2; k++){
                    dp[i+1][0][k][l] += dp[i][0][k][l];
                    dp[i+1][0][k][l] %= mod;
                }
                dp[i+1][1][0][l] += dp[i][1][0][l];
                dp[i+1][1][0][l] %= mod;
                dp[i+1][1][1][l] += dp[i][1][0][l];
                dp[i+1][1][1][l] %= mod;
                dp[i+1][1][1][l] += dp[i][1][1][l];
                dp[i+1][1][1][l] %= mod;
            }
        }

        if(S[i] == 'C' || S[i] == '?'){
            for(int l = 0; l < 2; l++){
                for(int k = 0; k < 2; k++){
                    dp[i+1][0][k][l] += dp[i][0][k][l];
                    dp[i+1][0][k][l] %= mod;
                }
                dp[i+1][1][0][l] += dp[i][1][0][l];
                dp[i+1][1][0][l] %= mod;
            }
            dp[i+1][1][1][0] += dp[i][1][1][0];
            dp[i+1][1][1][0] %= mod;
            dp[i+1][1][1][1] += dp[i][1][1][0];
            dp[i+1][1][1][1] %= mod;
            dp[i+1][1][1][1] += dp[i][1][1][1];
            dp[i+1][1][1][1] %= mod;
        }
    }

    cout << dp[S.length()][1][1][1] << endl;

    return 0;
}


Measured memory_bytes: 6784
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int count=0;
		long temp=0;

		for(int i=0;i<n;i++) {
			temp=sc.nextLong();
			if(temp==2||temp%2!=0) {
				count += sosu(temp);
			}
		}
		System.out.println(count);

	}

	public static int sosu(long num) {
		int res=1;
		for(int i=2;i<=Math.sqrt(num);i++) {
			if(num%i==0) {
				res=0;
				break;
			}
		}
		return res;
	}
}



Measured memory_bytes: 43924
#include <iostream>
#include <cstring>
#include <vector>
#include <iomanip>
using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n;
	cin >> n;
	//i tosses, then tails = i-heads
	vector<double> dp(n+1);
	dp[0]=1;
	for(int coin=0; coin < n; ++coin) {
		double p_heads;
		cin >> p_heads;
		for(int i=coin+1; i>=0; --i) {
			dp[i] = (i==0 ?0:dp[i-1]*p_heads) + dp[i]*(1 -p_heads);
		}
	}

	double ans = 0.0;
	for(int heads=(n+1)/2; heads<=n; ++heads) {
		ans+=dp[heads];
	}
	// printf("%0.10lf\n",ans);
	cout <<setprecision(10) << ans << "\n";
	return 0;
}


Measured memory_bytes: 256
public class Main {
	public static void main(String[] args) {
		java.util.Scanner s = new java.util.Scanner(System.in);
		int n = s.nextInt();
		int k= s.nextInt();
		Integer array[] = new Integer[n];
		for(int i=0;i<array.length;i++) {
			array[i]=s.nextInt();
		}
		s.close();
		System.out.println(Main.calc(n,k,array));
	}

	private static int calc(int n,int k,Integer[] array) {
		java.util.Arrays.sort(array, java.util.Collections.reverseOrder());
		int sum=0;
		for(int i=0;i<k;i++) {
			sum+=array[i];
		}
		return sum;
	}
}

Measured memory_bytes: 21716
const main = (X,A) => {
    if (X >= A) {
        return 10
    }else{
        return 0
    }

}

const input = require('fs').readFileSync('/dev/stdin','utf8').split("\n")[0]
const xa = input.split(" ").map(i => Number(i))
console.log(main(xa[0],xa[1]))

Measured memory_bytes: 7372
#include <iostream>
#include <string.h>

using namespace std;
bool IsPrime[50001];

void calc()
{
	memset(IsPrime, 1, sizeof(IsPrime));
	IsPrime[0] = false;
	IsPrime[1] = false;
	for(int i = 2; i < 50001; ++i)
	{
		if(IsPrime[i])
		{
			for(int j = 2 * i; j < 50001; j += i)
			{
				IsPrime[j] = false;
			}
		}
	}
}

void solve()
{
	calc();
	int n;
	while(cin >> n, n)
	{
		int count = 0;
		int temp = n / 2;
		for(int i = 0; i <= temp; ++i)
		{
			if(IsPrime[i] == true && IsPrime[n - i] == true)
			{
				count++;
			}
		}
		cout << count << endl;
	}
}

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

Measured memory_bytes: 912
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef pair<string, int> SP;
typedef pair<string, string> SS;

const int maxn = 100550;
const int inf = 0x3f3f3f3f;
const int mod = 998244353;
const ll linf = 2e18;
#define debug(x) cout << #x << " " << x << "\n";

int main()
{
    ios::sync_with_stdio(0);
    int a;
    cin >> a;
    cout << a + a * a + a * a * a << endl;
    return 0;
}

Measured memory_bytes: 3608
// 2020-06-29 22:09:40
#include<bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = long long;
using ld = long double;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }

void answer() {
  string s;
  cin >> s;
  int ans = 0, cur = 0;
  rep(i, s.size()) {
    if(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T') {
      cur++;
      chmax(ans, cur);
    } else cur = 0;
  }
  cout << ans << "\n";
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
#define mp make_pair
// GCD inbuilt func: __gcd(a,b)
// LCM formula: (a*b)/__gcd(a,b)

int main(){
	ios::sync_with_stdio(false);
    cin.tie(NULL);
	// CODE goes here
	string s;
	cin >> s;
	ll ans=0;
	for(int i=0;i<s.size();i++) ans+=(s[i]-'0');
	if(ans%9) cout << "No";
	else cout << "Yes";
	return 0;
}


Measured memory_bytes: 3764
package main

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

func Rotate(a []int, b, m, e int) []int {
	tmp := make([]int, m-b)
	copy(tmp, a[b:m])

	aa := append(a[:b], a[m:e]...)
	aa = append(aa, tmp...)
	aa = append(aa, a[e:]...)
	return aa
}

func NextInt(sc *bufio.Scanner) (int, error) {
	sc.Scan()
	return strconv.Atoi(sc.Text())
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	n, _ := NextInt(sc)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i], _ = NextInt(sc)
	}

	q, _ := NextInt(sc)
	for i := 0; i < q; i++ {
		b, _ := NextInt(sc)
		m, _ := NextInt(sc)
		e, _ := NextInt(sc)
		a = Rotate(a, b, m, e)
	}

	fmt.Println(strings.Trim(fmt.Sprint(a), "[]"))
}



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

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

    int N, M;
    cin >> N >> M;
    bool R[N][N] = {};
    for(int i = 0; i < M; i++){
        int a, b;
        cin >> a >> b;
        a--; b--;
        R[a][b] = true;
        R[b][a] = true;
    }

    vector<int> V(N - 1);
    for(int i = 0; i < N - 1; i++){
        V[i] = i + 1;
    }

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

    int ans = 0;
    do{
        int tmp = 0;
        bool f = true;
        for(int i = 0; i < N - 1; i++){
            if(R[tmp][V[i]]);
            else{
                f = false;
                break;
            }
            tmp = V[i];
        }
        ans += f;
    }while(next_permutation(V.begin(), V.end()));

    cout << ans << endl;

    return 0;
}

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

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	string s;
	cin >> s;
	const int n = s.size();
	if(n < 26){
		vector<int> h(26);
		for(int i = 0; i < n; ++i){ ++h[s[i] - 'a']; }
		for(int c = 0; c < 26; ++c){
			if(h[c] == 0){
				s += static_cast<char>(c + 'a');
				break;
			}
		}
	}else{
		vector<int> h(26, 1);
		bool valid = false;
		for(int i = n - 1; i >= 0; --i){
			const int c = s[i] - 'a';
			--h[c];
			for(int j = c + 1; j < 26; ++j){
				if(h[j] == 0){
					s[i] = j + 'a';
					valid = true;
					break;
				}
			}
			if(valid){
				s.resize(i + 1);
				break;
			}
		}
		if(!valid){ s = "-1"; }
	}
	cout << s << endl;
	return 0;
}



Measured memory_bytes: 256
#include<stdio.h>

int main()
{
    //UG02-53-20-014
	int x,i,j;
	scanf("%d",&x);
	int ans=0;
	
	for(i=1;i<=9;i++)
	
	{for(j=1;j<=9;j++)
	
	{if(i*j==x)
	
	{ans=1;}	}	}
	
	if(ans==0)
		printf("No");
	else
		printf("Yes");
	return 0;
}
		


Measured memory_bytes: 128
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <set>
#include <functional>
#include <map>
#include <cmath>
#include <deque>
#include <string>
#define SIZE 5005

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

int pos[SIZE],X[SIZE];
int cnt[SIZE][SIZE];
ll dp[SIZE][SIZE];
int n;
ll A,B;

ll solve(int i,int j)
{
	if(i==n||j==n) return 0;
	if(dp[i][j]!=-1) return dp[i][j];
	if(pos[i]<j) return solve(i+1,j);
	return dp[i][j]=min(B+solve(i+1,j),A*(ll) cnt[i][j]+solve(i+1,pos[i]));
}
int main()
{
	scanf("%d",&n);
	scanf("%lld %lld",&A,&B);
	for(int i=0;i<n;i++)
	{
		int x;
		scanf("%d",&x);x--;
		pos[x]=i;
		X[i]=x;
	}
	memset(dp,-1,sizeof(dp));
	for(int i=0;i<n;i++)
	{
		for(int j=pos[i];j>=0;j--)
		{
			cnt[i][j]=cnt[i][j+1]+(X[j]>i?1:0);
		}
	}
	printf("%lld\n",solve(0,0));
	return 0;
}


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

using namespace std;

const int maxN = 2e5+10, base = 1e9+7;
typedef pair<int, int> ii;
int N, M, A[maxN], vt[maxN], odd[8*maxN], even[8*maxN];
ii G[maxN];
vector <int> E[maxN];

struct cmp
{
    bool operator() (int a, int b)
    {
        return G[a].first < G[b].first;
    }
};
set <int, cmp> seta;

void Update(int k, int l, int r, int i, int x)
{
    if (l > i || r < i) return;
    if (l == r)
    {
        if (i%2) odd[k] = x;
        else even[k] = x;
        return;
    }
    int mid = (l+r)/2;
    Update(k*2, l, mid, i, x);
    Update(k*2+1, mid+1, r, i, x);
    odd[k] = min(odd[k*2], odd[k*2+1]);
    even[k] = min(even[k*2], even[k*2+1]);
}

int getodd(int k, int l, int r, int u, int v)
{
    if (l > v || r < u) return base;
    if (l >= u && r <= v) return odd[k];
    int mid = (l+r)/2;
    int res1 = getodd(k*2, l, mid, u, v);
    int res2 = getodd(k*2+1, mid+1, r, u, v);
    return min(res1, res2);
}

int geteven(int k, int l, int r, int u, int v)
{
    if (l > v || r < u) return base;
    if (l >= u && r <= v) return even[k];
    int mid = (l+r)/2;
    int res1 = geteven(k*2, l, mid, u, v);
    int res2 = geteven(k*2+1, mid+1, r, u, v);
    return min(res1, res2);
}

void solve(int par, int l, int r)
{
    int x, y;
    if (l%2)
    {
        x = getodd(1,1,N,l,r);
        y = geteven(1,1,N,vt[x]+1,r);
    }
    else
    {
        x = geteven(1,1,N,l,r);
        y = getodd(1,1,N,vt[x]+1,r);
    }
    M++; G[M] = ii(x,y);
    E[par].push_back(M);
    int tmp = M;
    if (l < vt[x]) solve(par, l, vt[x]-1);
    if (vt[x]+1 < vt[y]) solve(tmp, vt[x]+1, vt[y]-1);
    if (vt[y] < r) solve(par, vt[y]+1, r);
}

void BFS(int x)
{
    for (int i=0; i < E[x].size(); i++) seta.insert(E[x][i]);
    while (!seta.empty())
    {
        int cur = *seta.begin();
        seta.erase(seta.begin());
        cout << G[cur].first << " " << G[cur].second << " ";
        for (int i=0; i < E[cur].size(); i++) seta.insert(E[cur][i]);
    }
}

int main()
{
    cin >> N;
    for (int i=1; i <= 4*N; i++) odd[i] = even[i] = base;
    for (int i=1; i <= N; i++)
    {
        cin >> A[i];
        vt[A[i]] = i;
        Update(1,1,N,i,A[i]);
    }
    solve(0, 1, N);
    BFS(0);
}


Measured memory_bytes: 30328
import java.util.Scanner;

class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int a = scan.nextInt();
		int b = scan.nextInt();
		int c = scan.nextInt();

		if(a<b&&b<c){
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}


	}

}

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

int main() {
    int n;
    while (cin >> n) {
        int t = (n+38) % 39 + 1;
        cout << "3C" << (t < 10 ? "0" : "") << t << endl;
    }
    return 0;
}

Measured memory_bytes: 1164
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
 
typedef unsigned long long int ll;
 
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;
 
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<pll> vpll;

#define  ff          first
#define  ss          second
#define  pb          push_back
#define  IOS         ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define  lb          lower_bound
#define  ub          upper_bound
#define  D2(x)       { cerr << "[" << #x << ": "; for(auto it:x) cerr << it << " "; cerr << "]\n"; }
#define  all(x)      (x).begin(), (x).end()
#define  mem(a)      memset(a , 0 ,sizeof a)
#define  deb(x)      cout << #x << " - " << x << "\n";
#define  ps(x,y)     fixed<<setprecision(y)<<x
#define  setbit(x)  __builtin_popcountll(x)
#define  deb2(x,y)   cerr<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n"
#define  rep(i,a,b)  for(int i=a ; i<b ; ++i)
#define  repr(i,a,b)  for(int i=a ; i>=b ; --i)
 
#define PI 3.141592653589793
const ll p = 5;
const ll INF = 1000000000;
const ll MAX_N = 1e5 + 2;

void solve(){
    int n,k,num; cin >> n >> k;
    priority_queue<int>pq;
    rep(i,0,n){
        cin >> num;
        pq.push(num);
    }
    while(k){
        int top = pq.top();
        pq.pop();
        pq.push(top/2);
        k--;
    }
    
    ll sum = 0;
    while(!pq.empty()){
        sum += pq.top();
        pq.pop();
    }
    
    cout << sum;
}

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

Measured memory_bytes: 3856
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int X;
  cin >> X;
  if(X<600){
    cout << 8 << endl;
  }
  else if(600<=X && X<800){
    cout << 7 << endl;
  }
  else if(800<=X && X<1000){
    cout << 6 << endl;
  }
  else if(1000<=X && X<1200){
    cout << 5 << endl;
  }
  else if(1200<=X && X<1400){
    cout << 4 << endl;
  }
  else if(1400<=X && X<1600){
    cout << 3 << endl;
  }
  else if(1600<=X && X<1800){
    cout << 2 << endl;
  }
  else if(1800<=X && X<2000){
    cout << 1 << endl;
  }
}




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

int main() {
	int W, H, x, y, r;
	cin >> W >> H >> x >> y >> r;
	if (W - r >= x && H - r >= y && x >= r && y >= r) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}


Measured memory_bytes: 3100
import java.util.ArrayList;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}
	ArrayList<ArrayList<Integer>> g = new ArrayList<ArrayList<Integer>>();
	boolean used[];
	int n;
	int ans;
	public void run() {
		Scanner sc = new Scanner(System.in);
		n=sc.nextInt();
		int m=sc.nextInt();
		used = new boolean[n+1];
		for(int i=0; i<n+1; i++) g.add(new ArrayList<Integer>());
		for(int i=0; i<m; i++) {
			int a=sc.nextInt();
			int b=sc.nextInt();
			g.get(a).add(b);
			g.get(b).add(a);
		}
		used[1]=true;
		dfs(1);
		System.out.println(ans);
		sc.close();
	}

	private boolean dfs(int s) {
		used[s]=true;
		for(Integer t : g.get(s)) {
			if(used[t]) {
				continue;
			}
			boolean ok = dfs(t);
			if(ok) {
				ans++;
			}
		}
		boolean ok=true;
		for(int i=1; i<=n; i++) {
			if(!used[i]) {
				ok=false;
				break;
			}
		}
		used[s]=false;
		return ok;
	}
}


Measured memory_bytes: 21988
# -*- coding: utf-8 -*-
"""
Created on Mon May  4 20:56:04 2020
"""

import sys
#import numpy as np

sys.setrecursionlimit(10 ** 9)
#def input():
#    return sys.stdin.readline()[:-1]
mod = 10**9+7

#N = int(input())
N, M = map(int,input().split())
A = [list(map(int,input().split())) for i in range(N)]

foods = [0 for _ in range(M)]
for i in range(N):
    for j in range(1,len(A[i])):
        foods[A[i][j]-1] += 1
#        print(i,j,A[i][j])

ans = 0
for f in foods:
    if f == N:
        ans += 1
print(ans)


Measured memory_bytes: 3064
N = int(input())
ans = ''
for i in range(1, 99):
    if N <= 26 ** i:
        N -= 1
        for j in range(i):
            ans += chr(ord('a') + N % 26)
            N //= 26
        break
    else:
        N -= 26 ** i
print(ans[::-1])


Measured memory_bytes: 9176
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func nextStr() string {
	sc.Scan()
	s := sc.Text()
	return s
}

func getRuneAt(s string, i int) rune {
	rs := []rune(s)
	return rs[i]
}

func main() {
	sc.Split(bufio.ScanWords)
	n := nextInt()
	var moutains []int
	moutains = make([]int, 40)

	var count = 1
	for index := 0; index < n; index++ {
		moutains[index] = nextInt()
		if index >= 1 {
			if Count(moutains[index], moutains[0:index]) {
				count++
			}
		}
	}

	fmt.Print(count)
}

func Count(hi int, mountains []int) bool {
	for i := 0; i < len(mountains); i++ {
		if hi < mountains[i] {
			return false
		}
      
	}
	return true
}

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

int n;

int main() {
  cin >> n;
  vector<int> ans;
  int sum = 0;
  for(int i = 1; sum + i <= n; ++i) {
    sum += i;
    ans.push_back(i);
  }
  sum = n - sum;
  for(int i = (int)ans.size()-1; i >= 0; --i) {
    cout << ans[i] + (sum > 0) << endl;
    --sum;
  }
  return 0;
}

Measured memory_bytes: 384
#include <math.h>
#include <assert.h>

#include <vector>
#include <numeric>
#include <iostream>
#include <algorithm>
#include <functional>

template <typename T1, typename T2>
std::istream& operator>>(std::istream& is, std::pair<T1, T2>& v) {
    return is >> v.first >> v.second;
}

template <typename T>
std::istream& operator>>(std::istream& is, std::vector<T>& v) {
    for (T& i: v) is >> i;
    return is;
}

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

template <typename T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& v) {
    int n = (int) v.size();
    for (int i = 0; i < n; ++i) os << v[i] << (i == n - 1 ? "" : " ");
    return os;
}

template <typename T>
void in(T& x) {
    std::cin >> x;
}

template <typename T>
void out(const T H) {
    std::cout << (H);
}

template <typename T1, typename... T2>
void out(const T1 H, const T2... T) {
    std::cout << (H) << " "; out(T...);
}

template <typename T>
void eout(const char *s, const T H) {
    std::cerr << s << "=" << H << "\n";
}

template <typename T1, typename... T2>
void eout(const char *s, const T1 H, const T2... T) {
    while (*s != ',') std::cerr << *s++;
    std::cerr << "=" << H << " | "; eout(++s, T...);
}

#define nl                std::cout << "\n"
#define err(args...)      eout(#args, args)

#define rep(i, n)         for (int i =  0 ; i < (n); ++i)
#define per(i, n)         for (int i = (n) - 1; i > -1; --i)
#define repr(i, l, r)     for (int i = (l); i < (r); ++i)

#define sz(v)             ((int) v.size())
#define all(v)            (v).begin(), (v).end()
#define lla(v)            (v).rbegin(), (v).rend()

#define no                std::cout << "NO\n"
#define yes               std::cout << "YES\n"

const int INF           = 2147483647;
const long long int LNF = 9223372036854775807LL;

using ll  = long long int;
using vi  = std::vector<int>;
using vb  = std::vector<bool>;
using ii  = std::pair<int, int>;
using iii = std::pair< ii, int>;
using vii = std::vector<ii>;

const int N  = 505050;
const int MD = 1000*1000*1000 + 7;

int solve();
int main() {
    std::ios_base::sync_with_stdio(0); std::cin.tie(0);
    //std::cout.tie(0);

    //int t; in(t); repr(tc, 1, t + 1)
    solve();

    return 0;
}

int solve() {
    std::string s, t; in(s); in(t);
    int a = 0; rep(i, 3) a += (s[i] == t[i]);
    out(a);
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

fib(n){
  int i, a=1, b=1, c;
  for(i=2; i<= n; i++){
    c = a + b;
    a = b;
    b = c;
  }
  
  return c;
}

int main(){

  int n;

  scanf("%d", &n);

  if(n==0 || n==1){
    printf("1\n");
  }

  else{
    printf("%d\n", fib(n));
  }
  
  return 0;
}



Measured memory_bytes: 2104
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6+100;
const int mod = 1e9+7;
typedef long long ll;
const int INF = 0x3f3f3f3f;
const ll llINF = 0x3f3f3f3f3f3f3f3f;
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define fep(i,a,b) for(int i=(a);i>=(b);i--)
inline bool read(ll &num) {
  char in;bool IsN=false;
  in=getchar();
  if(in==EOF) return false;
  while(in!='-'&&(in<'0'||in>'9')) in=getchar();
  if(in=='-'){ IsN=true;num=0;}
  else num=in-'0';
  while(in=getchar(),in>='0'&&in<='9'){
      num*=10,num+=in-'0';
  } 
  if(IsN) num=-num;
  return true;
}
int main(){
  string s;
  cin>>s;
  string t=s;
  reverse(t.begin(),t.end());
  int n=(int)t.length();
  int ans=0;
  for(int i=0;i<n/2;i++){
    ans+=(s[i]!=t[i]);
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
  int a,b,c,t,res;
  cin >> a >> b >> c;
  t=max({a,b,c});
  res=3*t-a-b-c;
  if(res%2==0)
    res/=2;
  else
    res=(res+3)/2;
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 256