akhauriyash/Code-Regression huggingface dataset:
#include<vector>
#include<iostream>
#include <algorithm>


std::vector<int> return_sort(std::vector<int> vec){

    std::sort(vec.begin(), vec.end()); //昇順 
    return vec;
}

int main(){

    int N;
    std::vector<int> nums, nums_sorted;
    std::cin >> N;
    for(int num; std::cin >> num;){
        nums.push_back(num);
    }
    nums_sorted = return_sort(nums);
    int x = 0;
    for(int i = 0; i < N; ++i){
            x = nums.at(i);
            if(nums_sorted.at(N-1) - x == 0){
                std::cout << nums_sorted.at(N-2) << std::endl;
            }else{
                std::cout << nums_sorted.at(N-1)<<std::endl;
            }
    }
}

Measured memory_bytes: 4764
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int countbits(long bits)
{
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

void solve() {
    int n;
    cin >> n;
    VI a(n);
    VVI xt(n), xf(n);
    int x,y;
    REP(i,0,n) {
        cin >> a[i];
        REP(j,0,a[i]) {
            cin >> x >> y;
            if (y == 1) xt[i].push_back(x);
            else xf[i].push_back(x);
        }
    }
    int ans = 0;
    REP(p,0,1<<n) {
        bool b = true;
        REP(i,0,n) {
            if (!(p & (1 << i))) continue;
            for (auto &v: xt[i]) {
                if (p & (1<<(v-1))) continue;
                b = false;
                break;
            }
            for (auto &v: xf[i]) {
                if (p & (1<<(v-1))) {
                    b = false;
                    break;
                }
            }
            if (!b) break;
        }
        if (b) {
            ans = max(ans, countbits(p));
            //dump(p);
        }
    }
    cout << ans << endl;
}

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

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

#define pb(s) push_back(s)
#define ALL(v) v.begin(), v.end()
#define ALLA(arr, sz) arr, arr + sz
#define SORT(v) sort(ALL(v))
#define REVERSE(v) reverse(ALL(v))
#define SORTA(arr, sz) sort(ALLA(arr, sz))
#define REVERSEA(arr, sz) reverse(ALLA(arr, sz))
#define PI 3.14159265358979323846264338327950L


typedef long long ll;


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

    int a,b,h,m;
    cin>>a>>b>>h>>m;
    long double rad = PI * 2 * (
                          (long double)h / 12.0 + ((long double)m / 60.0) / 12.0 - (long
                                  double)m / 60.0);
    long double ans= (long double)(a*a+b*b)-(long double)(2*a*b*cosl(rad));
    cout<<fixed<<setprecision(20)<<sqrt(ans)<<endl;
    return 0;
}



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

#define pb         push_back

typedef long long ll;
const ll INF = 1000000000000000000ll;
const ll MOD = 1000000007ll;
const double EPS = 1e-8;

int main(void) {
	//ios_base::sync_with_stdio(false);
	//cin.tie(0);
	string s;
	cin >> s;
	cout << s[0] << s.size() - 2 << s[s.size()-1] << endl;
	
	return 0;
}


Measured memory_bytes: 256
/* You lost the game. */

#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cfloat>
#include <numeric>
#include <cassert>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <vector>

#define fin(i,n) for (int i = 0; i < n; i++)
#define fin2(i,a,b) for (int i = a; i < b; i++)

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define mod 1000000009

#define si(n) scanf("%d", &n)
#define sii(n,m) scanf("%d %d", &n, &m)
#define siii(n,m,k) scanf("%d %d %d", &n, &m, &k)
#define sl(n) scanf("%lld", &n)
#define sll(n,m) scanf("%lld %lld", &n, &m)
#define slll(n,m,k) scanf("%lld %lld %lld", &n, &m, &k)
#define ss(s) scanf("%s", s)
#define sai(t,n) fin(i,n) { scanf("%d", &t[i]); }
#define sal(t,n) fin(i,n) { scanf("%lld", &t[i]); }

#define pi(n) printf("%d\n", n)
#define pc(n) printf("%c\n", n)
#define ps(s) printf("%s\n", s);
#define pii(n,m) printf("%d %d\n", n, m)
#define pl(n) printf("%lld\n", n)
#define pll(n,m) printf("%lld %lld\n", n, m)
#define pai(t,n) fin(i,n) { printf("%d ", t[i]); } printf("\n"); 
#define pal(t,n) fin(i,n) { printf("%lld ", t[i]); } printf("\n"); 

#define L long long int
#define D double
#define PII pair<int, int>
#define VPII vector<PII>
#define VL vector<L>
#define VI vector<int>
#define VVI vector<VI>

using namespace std;

int main() {
    int n, tab[100000];
    si(n);
    sai(tab, n);
    int ni = 0;
    fin(i, n) {
        if (tab[i] % 2 == 1) { ni++; }
    }
    if (ni % 2 == 0) { printf("YES"); }
    else { printf("NO"); }
    return 0;
    
} 

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef set<ii> sii;
typedef set<int> si;
typedef priority_queue<int> pqi;
typedef priority_queue<ii> pqii;
typedef multiset<ll> ssll;

const int INF = 1000000000;
const ll MOD = 1000000007;

int main() {FIN
	
	ll n, t, i, a;
	ssll ns;
	mll df;
	cin >> n >> t;
	vll as(n);
	for (i = 0; i < n; i++) {
		cin >> as[i];
		ns.insert(as[i]);
	}
	for (i = 0; i < n; i++) {
		auto it = ns.find(as[i]);
		ns.erase(it);
		if (!ns.empty()) {
			a = (*ns.rbegin());
			if (a > as[i])
				df[a-as[i]]++;
		}
	}
	
	cout << (df.rbegin())->second << "\n";
	
	return 0;
}


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

#define ln '\n'
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, a, b) for(int i = (a); i <= (int)(b); ++i)
#define FORR(i, a, b) for(int i = (a); i >= (int)(b); --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
typedef vector<P> VP;
typedef vector<PL> VPL;
typedef vector<string> VS;


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, k;
    cin >> a >> b >> k;
    FORR(i, min(a, b), 1) {
        if(a % i == 0 and b % i == 0) k--;
        if(k == 0) {
            cout << i << ln;
            break;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,a,rem[4]={},i;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a;
		rem[a%4]++;
	}
	rem[2]%=2;
	if(rem[0]+1>=rem[1]+rem[2]+rem[3])
	{
		cout<<"Yes"<<endl;
	}
	else
	{
		cout<<"No"<<endl;
	}
	return 0;
}

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

using namespace std;

const int N = 110;

int n, m;

int main(){
	scanf("%d%d", &n, &m);
	int res = 0;
	if(n >= 2) res += n * (n - 1) / 2;
	if(m >= 2) res += m * (m - 1) / 2; 
	printf("%d", res);
} 

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

typedef long long int ll;
typedef vector<long long>lve;
typedef vector<pair<ll,ll> > lvp;
typedef vector<vector<int> > ivve;

#define sp         ' '
#define endl       '\n'
#define F          first
#define S          second
#define pb         push_back
#define mp         make_pair 
#define GCD(x,y)   __gcd(x,y)
#define lb         lower_bound
#define up         upper_bound
#define setp       setprecision
#define bs         binary_search
#define all(x)     x.begin(),x.end()
#define LCM(x,y)   ((x*y)/__gcd(x,y))
#define spc(x)     cout<<fixed<<setp(x)

const   long long  inf = 1e18;
const   long long  cs =  200005;
const   long long  mod = 1000000007;
const   double     PI =  2 * acos(0.0);
void solve()
{
    ll t,n,m,a,b,c,d,e,i,j,k,x,y,z,cnt=0,cnt1=0;
    bool flag = false;
    
    cin>>a>>b;
    lve v;
    for(i=a;i<=b;i++)
    {
        x=i;
        while(x>0)
        {
            v.pb(x%10);
            x=x/10;
        }
        lve v1{all(v)};
        reverse(all(v1));
        if(v==v1) cnt++;
        v.clear();
        v1.clear();
    }
    cout<<cnt<<endl;
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);    cout.tie(NULL);

    // freopen ("input.txt","r",stdin);
    // freopen ("output.txt","w",stdout);

    // int32_t tc;
    // cin>>tc;
    // while(tc--)
    solve();

    return 0;
}

Measured memory_bytes: 3588
import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.typecons, std.container;
import std.math, std.numeric, core.bitop;

enum inf = 1_001_001_001;
enum inf6 = 1_001_001_001_001_001_001L;
enum mod = 1_000_000_007L;



void main() {
    int p, q, r;
    scan(p, q, r);
    auto ans = min(p + q, p + r, q + r);
    writeln(ans);
}
















void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}

void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

bool chmin(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x > arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}

bool chmax(T, U...)(ref T x, U args) {
    bool isChanged;

    foreach (arg; args) {
        if (x < arg) {
            x = arg;
            isChanged = true;
        }
    }

    return isChanged;
}


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

template<class T> void chmax(T &a, T b) { a = max(a, b); }
const int cost[] = {0,2,5,5,4,5,6,3,7,6};

int main() {
    lint N, M;
    cin >> N >> M;

    vector<lint> A(M);
    for(auto& elem : A)  cin >> elem;
    sort(A.rbegin(), A.rend());

    vector<lint> dp(N+1, -1e18);
    dp[0] = 0;
    for(auto a : A)
    for(int m=0; m<N; m++) {
        if(m+cost[a]<=N) chmax(dp[m+cost[a]], dp[m]+1);
    }

    auto check = [&](int a, int c) {
        if(N-cost[a]*c < 0) return false;
        bool c1 = (dp[N-cost[a]*c] == dp[N]-c);
        return c1;
    };

    for(auto a : A) {
        int ok = 0;
        int ng = N+1;
        while(ng-ok > 1) {
            int mid = (ok+ng)/2;
            (check(a,mid) ? ok : ng) = mid;
        }
        N -= cost[a]*ok;
        for(int k=0; k<ok; k++) cout << a;
    }
    cout << endl;
}

Measured memory_bytes: 384
import java.util.*;

class Main{
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a[] = new int[1000000];
        int l = 499999;
        int r = 500000;
        for(int i = 0; i < n; i++){
            if(i%2 == n%2) {
                a[r] = sc.nextInt();
                r++;
            }
            else{
                a[l] = sc.nextInt();
                l--;
            }
        }

        for(int i = l+1; i < r; i++){
            if(i == n-1){
                System.out.println(a[i]);
            }else {
                System.out.print(a[i] + " ");
            }
        }
    }
}

Measured memory_bytes: 96072
#include <cstdio>
#include <vector>
#include <queue>
using namespace std;
static const int NIL = -1;

int n, m;
int *color;
vector<int> *v;

void bfs(int r, int c) {
    queue<int> q;
    q.push(r);
    while (!q.empty()) {
        int u = q.front();
        q.pop();
        if (color[u] == NIL) {
            color[u] = c;
        }
        for (vector<int>::iterator it = v[u].begin(); it != v[u].end(); it++) {
            if (color[*it] == NIL) {
                q.push(*it);
            }
        }
    }
}

void assignColor() {
    color = new int[n];
    int id = 0;
    for (int i = 0; i < n; i++) {
        color[i] = NIL;
    }
    for (int u = 0; u < n; u++) {
        if (color[u] == NIL) {
            bfs(u, id++);
        }
    }
}

int main() {
    scanf("%d %d", &n, &m);
    v = new vector<int>[n];

    for (int i = 0; i < m; i++) {
        int s, t;
        scanf("%d %d", &s, &t);
        v[s].push_back(t);
        v[t].push_back(s);
    }

    assignColor();

    int q;
    scanf("%d", &q);

    for (int i = 0; i < q; i++) {
        int s, t;
        scanf("%d %d", &s, &t);
        printf("%s\n", color[s] == color[t] ? "yes" : "no");
    }

    return 0;
}


Measured memory_bytes: 8572
N = int(input())
A = list(int(i) for i in input().split())
B = list(int(i) for i in input().split())
C = list(int(i) for i in input().split())
fill = 0
for i in range(N):
  fill += B[A[i]-1]
  if i > 0:
    if A[i] == A[i-1]+1:
      fill += C[A[i-1]-1]
print(fill)


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

template<class T>
void merge(vector<T>& a,int left,int right){
  vector<T> tmp(right-left);
  int mid= (left+right)/2;
  int tl = left;
  int tr = mid;
  for(int idx=0;idx<(right-left);++idx){
    if(tl>=mid)tmp[idx]=a[tr++];
    else if(tr>=right)tmp[idx]=a[tl++];
    else tmp[idx] = (a[tl]<a[tr]?a[tl++]:a[tr++]);
  }
  for(int i=0;i<(right-left);++i){
    a[left+i] = tmp[i];
  }
}

template<class T>
void split(vector<T>& a,int left,int right){
  if(right-left>1){
    split(a,left,(left+right)/2);
    split(a,(left+right)/2,right);
  }
  merge(a,left,right);
}

template<class T>
void merge_sort(vector<T>& a){
  split(a,0,a.size());
}

template<class T>
class segtree {
private:
  ll n=1;
  T unit;
  std::vector<T> dat;
  std::function<T(T,T)> func;
public:
  segtree(){}
  segtree(std::vector<T>& a,T v,std::function<T(T,T)> f){
    build(a,v,f);
  }
  void build(std::vector<T>& a,T v,std::function<T(T,T)> f){
    ll sz=a.size();
    unit=v;
    func=f;
    while(n<sz)n<<=1LL;
    dat.resize(2*n-1,unit);
    for(int i=0;i<sz;++i)dat[i+n-1]=a[i];
    for(int i=n-2;i>=0;--i){
      dat[i]=func(dat[i*2+1],dat[i*2+2]);
    }
  }
  void update(ll idx,T val){
    idx+=n-1;
    dat[idx]=val;
    while(idx){
      idx--;idx>>=1LL;
      dat[idx]=func(dat[idx*2+1],dat[idx*2+2]);
    }
  }
  T query(ll a,ll b,ll k=0,ll l=0,ll r=-1){
    if(r<0)r=n;
    if( b<=l || r<=a )return unit;
    if( a<=l && r<=b )return dat[k];
    else{
      auto left=query(a,b,2*k+1,l,(l+r)/2);
      auto right=query(a,b,2*k+2,(l+r)/2,r);
      return func(left,right);
    }
  }
};


int main(){

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

  merge_sort(a);

  auto gcd = [](auto a,auto b){
    while(1){
      swap(a,b);
      if(b==0)return a;
      a%=b;
    }
  };

  segtree<ll> seg(a,0,gcd);

  ll ans = 1;
  rep(i,n){
    seg.update(i,0);
    ans = max(ans,seg.query(0,n));
    seg.update(i,a[i]);
  }
  cout<<(ans)<<endl;
  
}

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

#define vvi             vector<vector<int>>
#define ld              long double
#define mod             1000000007
#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vpii            vector<pair<int,int>>
#define fr(i,a,b)       for(int i = a; i < b; i += 1)
#define all(x)          x.begin(),x.end()
#define sz(a)           (int)(a.size())
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define pw(b,p)         pow(b,p) + 0.1
#define input(a)        for(auto it = a.begin(); it != a.end(); it++) { int value; cin >> value; *it = value;}
//#define print(a)        for(auto it = a.begin() ; it != a.end() ; it++){ cout << *it << " " ;}cout << '\n';
#define SS                      stringstream
#define db(...)                 __f(#__VA_ARGS__, __VA_ARGS__)

template <typename Arg1>
void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 <<'\n'; }
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...);
}

const int dirx[4] = {0, 0, -1, 1};
const int diry[4] = {-1, 1, 0, 0};

// 0 -> l, 1 - > r, 2 -> u , 3 -> down
void FASTIO()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

int power(int x, int y, int p) 
{ 
    int res = 1;      // Initialize result 
 
    x = x % p;  // Update x if it is more than or 
                // equal to p 
 
    while (y > 0) 
    { 
        // If y is odd, multiply x with result 
        if (y & 1) 
            res = (res*x) % p; 
 
        // y must be even now 
        y = y>>1; // y = y/2 
        x = (x*x) % p; 
    } 
    return res; 
} 
 
// Returns n^(-1) mod p 
int modInverse(int n, int p) 
{ 
    return power(n, p-2, p); 
} 

const int mxN = 1e6 + 10;
int a[mxN];
int t[mxN], y[mxN], z[mxN];
int ans;
int n, m;
vi v;

void test_case()
{
	cin >> n;
	n ^= 1;
	cout << n;

}   


int32_t main()
{
    FASTIO();

    int t;
    t = 1;
    //cin >> t;

    for(int i = 1; i <= t; i++)
    {
        //cout << "Case #" << i << ": ";
        test_case();
    }
    return 0;
} 


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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    ans=((N)*(N-1))//2
    
    print(ans)

main()


Measured memory_bytes: 61852
#include <stdio.h>
#include <stdlib.h>

//メイン関数
int main(void){
  int a, b;
  char op;
  while(1){
    scanf("%d %c %d", &a, &op, &b);
    if     (op == '+') printf("%d\n", a+b);
    else if(op == '-') printf("%d\n", a-b);
    else if(op == '*') printf("%d\n", a*b);
    else if(op == '/') printf("%d\n", a/b);
    else break;
  }
  return 0;
}



Measured memory_bytes: 2140
#include<cstdio>
int main(){
    int n,a1,a2,sign=0,ans=1;
    scanf("%d%d",&n,&a1);
    for(int i=1;i<n;i++){
        scanf("%d",&a2);
        if(sign==0){
            if(a1<a2)sign=1;
            else if(a1>a2)sign=-1;
        }else if(sign*(a2-a1)<0){
            sign=0;
            ans++;
        }
        a1=a2;
    }
    printf("%d",ans);
    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
#define endl '\n'
#define fsp(x) cout << fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = M_PI;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
  string s;
  cin >> s;
  ll n = s.size();

  for (ll i = 0; i < n; i++) {
    for (ll j = i; j < n; j++) {
      string t = s;
      t.erase(t.begin() + i, t.begin() + j);
      if (t == "keyence") {
        YES();
        return 0;
      }
    }
  }
  NO();
}

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

const int MAXN = 101;

int cn[26];

string s[MAXN];
string ans[MAXN];;

void y() {
    cout << "Yes\n";
    exit(0);
}


int main() {
#ifdef PAUNSVOKNO
    freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false); cout.setf(ios::fixed); cout.precision(20);
    string s;
    cin >> s;
    if (s.length() >= 4 && s.substr(0, 4) == "YAKI")
        y();

    cout << "No\n";
}

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

using namespace std;

int main(){
  long long X,Y;
  cin >> X >> Y;
  long long ans = 1;
  long long prev = X;
  for(int i = 1; prev * 2 <= Y ;i++){
    prev = prev * 2;
    ans ++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys


def solve(A: int, B: int):
    print(max(0,A-2*B))
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)

if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#include <queue>
#include <cstdio>
#include <iostream>
#include <math.h>

using namespace std;

const int MAX_N = 100010;

//入力
int Q;
int l[MAX_N], r[MAX_N];

bool IsPrime(int num)
{
	if (num < 2) return false;
	else if (num == 2) return true;
	else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			// 素数ではない
			return false;
		}
	}

	// 素数である
	return true;
}

void solve()
{
	int a[MAX_N] = {};	//0で初期化 ある数字が相似が判定
	int b[MAX_N] = {};	//同上 累積和保存

	cin >> Q;
	for (int i = 0; i < Q; i++)
	{
		cin >> l[i] >> r[i];
	}

	//入力完了


	for (int i = 0; i <= 100000; i++)//素数かもとめるループ
	{
		//a[i]に素数か否か保存
		a[i] = IsPrime(i) && IsPrime((i + 1) / 2);
		//累積和を計算
		b[i + 1] = b[i] + a[i];
	}

	int ans;

	for (int i = 0; i < Q; i++)//全クエリのループ
	{
		ans = 0;
		//クエリ毎のl~rのループ
//		for (int j = l[i]; j <= r[i]; j++)
//		{
//			if (a[j] == true &&
//				a[(j + 1) / 2] == true)
//			{
//				ans++;
//			}
//		}
      ans = b[r[i] + 1] - b[l[i]];

		cout << ans << endl;
	}
}

int main()
{
	solve();
}

Measured memory_bytes: 1792
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#define mkp make_pair
#define fi first
#define se second
#define pr(num) cout << num << "\n"
#define max(a, b) ((a)>(b) ? (a):(b))
#define min(a, b) ((a)<(b) ? (a):(b))
#define chmax(a, b) (a<b ? a=b : 0)
#define chmin(a, b) (a>b ? a=b : 0)
#define INF 1000000000000000000
#define MOD 1000000007LL
#define MAX 100010
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef map<ll, ll> Map;

ll mfa[1010101];
ll mrfa[1010101];

ll mPow(ll x, ll n) {
    ll res=1;
    while(n>0) {
        if(n&1) res=res*x%MOD;
        x=x*x%MOD;
        n>>=1;
    }
    return res;
}

ll fa(ll x) {
    if(x==0) return 1;
    if(mfa[x]!=-1) return mfa[x];
    return mfa[x]=x*fa(x-1)%MOD;
}

ll rfa(ll x) {
    if(x==0) return 1;
    if(mrfa[x]!=-1) return mrfa[x];
    rfa(x-1);
    return mrfa[x]=mPow(fa(x), MOD-2)%MOD;
}

ll C(ll n, ll k) {
    if(n<k) return 0;
    return fa(n)*rfa(k)%MOD*rfa(n-k)%MOD;
}

ll N, M;
ll a[1010], b[1010];
ll mx[1010][1010];

int main(void) {
    ll i;
    cin >> N >> M;
    Map ma, mb;
    Map mp;
    
    for(i=0; i<N; i++)
        cin >> a[i];
    sort(a, a+N);
    reverse(a, a+N);
    
    for(i=0; i<M; i++)
        cin >> b[i];
    sort(b, b+M);
    reverse(b, b+M);
    
    ll ans=1;
    ll h=0, w=0;
    for(i=N*M; i>=1; i--) {
        if(a[h]==i && b[w]==i) {
            h++; w++;
        }else if(a[h]==i) {
            ans=(ans*w)%MOD;
            h++;
        }else if(b[w]==i) {
            ans=(ans*h)%MOD;
            w++;
        }else {
            ans=(ans*(h*w-N*M+i))%MOD;
        }
        
    }
    
    pr(ans);
}













Measured memory_bytes: 2304
#include <cstdio>

int main() {
    int W,H,x,y,r;
    std::scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);

    if(W >= x + r&&H >= y + r&&x - r >= 0&&y - r >= 0){
        std::printf("Yes\n");
    }
    
    else {
        std::printf("No\n");
    }
 
return 0;
}


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

using lint = long long;
using namespace std;

bool solve() {
    int N;
    cin >> N;
    if (N == 0) return false;

    vector<lint> ok(31, 0);
    for (int i = 0; i < N; ++i) {
        int f;
        cin >> f;
        for (int j = 0; j < f; ++j) {
            int d;
            cin >> d;
            ok[d] |= (1LL << i);
        }
    }

    for (int D = 1; D <= 30; ++D) {
        lint bit = ok[D];
        for (int d = D - 1; d > 0; --d) {
            if (bit & ok[d]) {
                bit |= ok[d];
            }
        }

        if (__builtin_popcountll(bit) == N) {
            cout << D << endl;
            return true;
        }
    }

    cout << -1 << endl;
    return true;
}

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


Measured memory_bytes: 3096
package main

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

// github.com/EndlessCheng/codeforces-go
func run(_r io.Reader, _w io.Writer) {
	in := bufio.NewReader(_r)
	out := bufio.NewWriter(_w)
	defer out.Flush()

	var n, m, v, w int
	Fscan(in, &n, &m)
	g := make([][]int, n+1)
	for ; m > 0; m-- {
		Fscan(in, &v, &w)
		g[v] = append(g[v], w)
		g[w] = append(g[w], v)
	}
	vis := make([]bool, n+1)
	ans := make([]int, n+1)
	q := []int{1}
	vis[1] = true
	cnt := 1
	for len(q) > 0 {
		v, q = q[0], q[1:]
		for _, w := range g[v] {
			if !vis[w] {
				vis[w] = true
				cnt++
				ans[w] = v
				q = append(q, w)
			}
		}
	}
	if cnt < n {
		Fprint(out, "No")
		return
	}
	Fprintln(out, "Yes")
	for _, v := range ans[2:] {
		Fprintln(out, v)
	}
}

func main() { run(os.Stdin, os.Stdout) }


Measured memory_bytes: 17816
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <set>
#include <math.h>
using namespace std;
int f[105][11],n,p[105][11],s[105];
int dfs(int a,int b){
    if(a==10){
        if(b==0)return -1000000000;
        int res=0;
        for(int i=0;i<n;i++){
            res+=p[i][s[i]];
        }
        return res;
    }
    int x=dfs(a+1,b);
    for(int i=0;i<n;i++){
        if(f[i][a])s[i]++;
    }
    int y=dfs(a+1,1);
    for(int i=0;i<n;i++){
        if(f[i][a])s[i]--;
    }
    return max(x,y);
}
int main(void){
    cin>>n;
    for(int i=0;i<n;i++){
        for(int j=0;j<10;j++){
                cin>>f[i][j];
        }
    }
    for(int i=0;i<n;i++)for(int j=0;j<11;j++)cin>>p[i][j];
    cout<<dfs(0,0)<<endl;
}


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

template<typename T>
T gcd(T a, T b){
    T n = min(a,b);
    T m = max(a,b);
    if(n == 0){ return m;}
    else {
        return gcd(n, m % n);
    }
}

template<typename T>
T gcdAll(std::vector<T> & vals){
    int size = vals.size();
    T gcdVal = vals[0];
    for(int i = 1 ; i < size; i++){
        gcdVal = gcd(std::max(vals[i], gcdVal), std::min(vals[i], gcdVal));
    }
    return gcdVal;
}

int main(void)
{
    int N;
    cin >> N;
    vector<ll> T(N);
    for (int i = 0; i < N; i++)
    {
        cin >> T[i];        
    }

    ll lcmVal = T[0];
    for(int i = 1; i < N; i++){
        ll gcdVal = gcd(T[i] ,lcmVal);
        lcmVal = (T[i] / gcdVal) * lcmVal;
    }

    cout << lcmVal << endl;
    
    return 0;
}


Measured memory_bytes: 3592
#include <iostream>

using namespace std;

struct Item
{
	int v;
	int w;
};

int N;
int W;

int nap[110][10100] = {};
Item goods[110];

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

	for (int i = 0; i < N; i++)
	{
		int v, w;
		cin >> v >> w;
		goods[i + 1] = { v, w };
	}

	// i = 使ってよいgoods
	for (int i = 1; i <= N; i++)
	{
		// weight = 許容される重さの範囲
		for (int weight = 0; weight <= W; weight++)
		{
			if (weight - goods[i].w < 0)
			{
				nap[i][weight] = nap[i - 1][weight];
				continue;
			}

			// 入れた時と入れなかったときの比較
			int in = nap[i - 1][weight - goods[i].w] + goods[i].v;

			nap[i][weight] = in > nap[i - 1][weight] ? in : nap[i - 1][weight];
		}
	}

	cout << nap[N][W] << endl;
	
	return 0;
}


Measured memory_bytes: 7044
#include<iostream>
#include<algorithm>
using namespace std;
int n,m,tmp,ans;
int x[200],y[200],dp[200];
int check(int a,int b){
  return (x[a]>x[b]&&y[a]>y[b]);
}
int main(){
  while(cin>>n&&n){
    for(int i=0;i<n;i++)cin>>x[i]>>y[i];
    cin>>m;
    for(int i=0;i<m;i++)cin>>x[n+i]>>y[n+i];
    for(int i=n+m-1;i>0;i--){
      for(int j=0;j<i;j++){
	if(x[j]*y[j]>x[j+1]*y[j+1]){
	  swap(x[j],x[j+1]);//tmp=x[j];x[j]=x[j+1];x[j+1]=tmp;
	  swap(y[j],y[j+1]);//tmp=y[j];y[j]=y[j+1];y[j+1]=tmp;
	}
      }
    }
    ans=1;
    for(int i=0;i<n+m;i++)dp[i]=1;
    for(int i=1;i<n+m;i++){
      for(int j=0;j<i;j++){
	if(check(i,j))dp[i]=max(dp[i],dp[j]+1);
      }
      ans=max(ans,dp[i]);
    }
    cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_set>
#include <queue>
#include <deque>
#include <string>
#include <sstream>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <stack>
#include <cstdio>
#include <climits>
#include <tuple>
#include <ctime>
#include <cstring>
#include <numeric>
#define FOR(i,a,n) for (int i = a; i < n; i++)
#define IFOR(i,n,a) for (int i = n; i >= a; i--)
#define mp make_pair
#define full(a) a.begin(), a.end()
#define sz(x) ((int)(x).size())
#define pii pair<int, int>
#define trav(a,x) for (auto& a : x)
using ull = unsigned long long;
using ll = long long;
using ld = long double;
using namespace std;
const ll mod = 1e9 + 7;
const int N = 2e5 + 5;



void solve()
{
    int n; cin >> n;
    cout << (n + 1) / 2;
}


int main()
{
    ios::sync_with_stdio(false); cin.tie(NULL); //cout.tie(NULL);
    /*int tc; cin >> tc;
    while (tc--)*/
        solve();

    return 0;
}

Measured memory_bytes: 3140
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int d = sc.nextInt();
        int width = 1+ 2*d;
        System.out.println((int)Math.ceil((double) n/width));
    }
}

Measured memory_bytes: 23636
#include <bits/stdc++.h>
using namespace std;
const int md = 1e9 + 7;
inline void add(int &a, int b) {
  a += b;
  if (a >= md) a -= md;
}
int main() {
  int n;
  cin >> n;
  vector<int> c(n + 1);
  c[0] = -1;
  for (int i = 1; i <= n; i++) {
    cin >> c[i];
    c[i]--;
  }
  vector<int> dp(n + 1, 0), ep(2e5, 0);
  dp[0] = 1;
  for (int i = 1; i <= n; i++) {
    int prv = c[i - 1];
    int crr = c[i];
    if (prv != crr) add(ep[crr], dp[i - 1]);
    dp[i] = ep[crr];
  }
  cout << dp[n] << '\n';
  return 0;
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
#define ll long long int
#define mod 1000000007
 
using namespace std;
 
ll powr(ll base, ll power, ll m=mod){
  ll ans = 1;
  base%=m;
  
  while(power){
    if(power&1){
      ans=(ans*base)%m;
    }
    base=(base*base)%m;
    power>>=1;
  }
  return ans;
}
int main(){
  ll n;
  cin>>n;
  ll ans = powr(10,n)%mod;
  ans -=(2LL * powr(9,n))%mod;
  ans +=(powr(8,n));
  ans%=mod;
  if(ans<0)ans+=mod;
  ans%=mod;
  cout<<ans<<"\n";
  return 0;
}

Measured memory_bytes: 3592
N = int(input())
S = [[int(i) for i in input().split()] for j in range(N)]
SS = sorted(S,key=lambda x: x[2], reverse=True)

#(x, y)を(0,0)から(100,100)まで試す
def firstlook(si, kohod): 
    for x in range(0, 100+1):
        for y in range(0, 100+1):
            h = si[2]+abs(si[0]-x)+abs(si[1]-y)
            kohod[(x,y)] = h
    return kohod

def lastlook(si, kohod):
    for (x, y) in list(kohod.keys()):
        h = max(kohod[(x,y)]-abs(si[0]-x)-abs(si[1]-y),0)
        if si[2] != h:
            del kohod[(x,y)]
    return kohod

ans = firstlook(SS[0], dict())
for Si in SS[1:]:
    ans = lastlook(Si, ans)

[xy] = list(ans.keys())
print(str(xy[0]) + " " + str(xy[1]) + " "+ str(ans[xy]))

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

int binary_search(const vector<int>& ls, int v, int first, int last) {
  auto value = v - 0.5;
  int f = first;
  int l = last;
  while(l - f > 1) {
    int mid = (f + l) / 2;
    int vm = ls[mid];
    if(vm > value) {
      l = mid;
    } else {
      f = mid;
    }
  }
  return f;
}

int main() {
  int N;
  vector<int> Ls;
  cin >> N;
  int tmp;
  for(int i = 0; i < N; ++i) {
    cin >> tmp;
    Ls.push_back(tmp);
  }
  sort(Ls.begin(), Ls.end());

  int total = 0;
  for(int i = 0; i < Ls.size(); ++i) {
    for(int j = i + 1; j < Ls.size(); ++j) {
      if(j + 1 >= Ls.size())
        continue;

      int v = Ls[i] + Ls[j];
      if(v <= Ls[j + 1]) {
        continue;
      }

      if(Ls.back() < v) {
        // cout << Ls[i] << " - " << Ls[j] << " - " << Ls.back() << endl;
        total += (Ls.size() - 1 - j);
        continue;
      }

      int ib = binary_search(Ls, v, j + 1, Ls.size() - 1);
      // cout << Ls[i] << " - " << Ls[j] << " - " << Ls[ib] << endl;
      total += max(0, ib - j);
    }
  }
  cout << total << endl;

  return 0;
}

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


int main(){

    int n;
    cin >> n;
    int A[n];
    for (int i = 0; i < n; i++)
    {
        cin >> A[i];
    }
    
    for (int i = 0; i < n; i++)
    {
        int v = A[i];
        int j = i-1;
        while(j >= 0 && A[j] > v){
            A[j+1]  = A[j];
            j--;
        }
        A[j+1] = v;

        for (int i = 0; i < n; i++)
        {
        cout  << A[i];
            if(i != n-1){
                cout << " ";
            }
        }

        cout << "" << endl;
    }
        
}





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

int main() {
  int N,W;
  cin >> N >> W;
  long long w[N+1],v[N+1],dp[N+1][W+1];
  for(int i=1;i<=N;i++) cin >> w[i] >> v[i];
  for(int i=0;i<=N;i++) dp[i][0]=0;
  for(int i=0;i<=W;i++) dp[0][i]=0;
  
  for(int i=1;i<=N;i++){
    for(int j=1;j<=W;j++){
      if(j-w[i]<0) dp[i][j]=dp[i-1][j];
      else dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i]]+v[i]);
    }
  }
  
  cout << dp[N][W] << endl;
  return 0;
}


Measured memory_bytes: 79104
import sys
input = sys.stdin.readline
from fractions import gcd


def read():
    N, M = map(int, input().strip().split())
    AB = list()
    for i in range(N):
        a, b = map(int, input().strip().split())
        AB.append((a, b))
    CD = list()
    for i in range(M):
        c, d = map(int, input().strip().split())
        CD.append((c, d))
    return N, M, AB, CD


def distance(x1, y1, x2, y2):
    return abs(x1 - x2) + abs(y1 - y2)


def solve(N, M, AB, CD):
    checkpoints = list()
    for a, b in AB:
        min_checkpoint = 0
        min_d = 10**9
        for j, (c, d) in enumerate(CD):
            d = distance(a, b, c, d)
            if d < min_d:
                min_d = d
                min_checkpoint = j + 1
        checkpoints.append(min_checkpoint)
    for c in checkpoints:
        print(c)


if __name__ == '__main__':
    inputs = read()
    solve(*inputs)


Measured memory_bytes: 5588
def getlist():
	return list(map(int, input().split()))

S = input()
N = len(S)
judge = "Yes"
for i in range(N):
	if i % 2 == 0:
		if S[i] == "L":
			judge = "No"
	else:
		if S[i] == "R":
			judge = "No"

print(judge)

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

int main() {
  double W;
  double H;
  double x;
  double y;
  cin >> W;
  cin >> H;
  cin >> x;
  cin >> y;

  cout << W * H / 2 << endl;
  if (2 * x == W && 2 * y == H) {
    cout << 1 << endl;
  }
  else {
    cout << 0 << endl;
  }
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
   int a, b, c, k, x;

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

   if(a>k)
      x=k;
   else if(a+b>=k)
      x=a;
   else
      x=2*a-k+b;

   printf("%d\n",x);
   return 0;
}

Measured memory_bytes: 1732
from collections import Counter
n,m = map(int, input().split())
c = Counter(map(int, input().split()))
r = [0]*m
s = [0]*m
for key, value in c.items():
    i = key%m
    r[i] += value
    s[i] += value//2
# 0
ans = r[0]//2
for i in range(1, m):
    j = m-i
    if i < j:
        if r[i] < r[j]:
            i,j = j,i
        ans += r[j]
        ans += min((r[i]-r[j])//2, s[i])
    elif i == j:
        ans += r[i] //2
    else:
        break
print(ans)

Measured memory_bytes: 22628
#!/usr/bin/env python3
# Generated by https://github.com/kyuridenamida/atcoder-tools
from typing import *
import collections
import functools
import itertools
import math
import sys

INF = float('inf')


def solve(N: int, S: str, T: str):
    return "".join(s+t for s, t in zip(S, T))


def main():

    sys.setrecursionlimit(10 ** 6)

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    T = next(tokens)  # type: str
    print(f'{solve(N, S, T)}')


if __name__ == '__main__':
    main()


Measured memory_bytes: 75164
#include <iostream>

using namespace std;

int main(void)
{
  string s;
  cin >> s;
  bool isin[26];
  for (int i = 0; i < 26; ++i) {
    isin[i] = false;
  }
  for (int i = 0; i < s.size(); ++i) {
    if (isin[s[i]-'a']) {
      cout << "no" << endl;
      return 0;
    }
    isin[s[i]-'a'] = true;
  }
  cout << "yes" << endl;
  return 0;
}


Measured memory_bytes: 256
from scipy.sparse.csgraph import floyd_warshall

N, M, L = map(int, input().split())
INF = 10**9 + 1
dist = [[0 if i == j else INF for i in range(N+1)] for j in range(N+1)]
for i in range(M):
  a, b, c = map(int, input().split())
  dist[a][b] = c
  dist[b][a] = c

dist = floyd_warshall(dist)

dist_2 = [[INF for i in range(N+1)] for j in range(N+1)]
for i in range(1, N+1):
  for j in range(i+1, N+1):
    if dist[i][j] <= L:
      dist_2[i][j] = 1
      dist_2[j][i] = 1

dist_2 = floyd_warshall(dist_2)

Q = int(input())
for i in range(Q):
  s, t = map(int, input().split())
  print(-1 if dist_2[s][t] == INF else int(dist_2[s][t]-1))


Measured memory_bytes: 27996
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop
import math
import collections
MOD = 10**9+7


w,h,n = map(int,input().split())
whiteXmin = 0
whiteXmax = w
whiteYmin = 0
whiteYmax = h
for i in range(n):
    x,y,a = map(int,input().split())
    if a == 1:
        whiteXmin = max(x,whiteXmin)
    if a == 2:
        whiteXmax = min(x,whiteXmax)
    if a == 3:
        whiteYmin= max(y,whiteYmin)
    if a == 4:
        whiteYmax = min(y,whiteYmax)

if whiteXmax - whiteXmin < 0 or whiteYmax-whiteYmin < 0:
    print(0)
    sys.exit()
print((whiteXmax-whiteXmin)*(whiteYmax-whiteYmin))

Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    int mn = 1050;
    int mx = -1;
    for(int i = 1; i <= n; i++)
    {
        int x;
        cin >> x;
        mn = min(mn, x);
        mx = max(mx, x);
    }
    cout << mx - mn << endl;
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>

using namespace std;

int a[200'009];

int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  int ans = 0;
  int cur = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
    ++a[i];
    cur += a[i];
    if (i + 1 > k) {
      cur -= a[i - k];
    }
    ans = max(ans, cur);
  }
  printf("%.15f\n", ans / 2.0);
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 1e5 + 10;
ll h,n;
ll v[N];
int main() {
	cin>>h>>n;
	ll sm = 0;
	for(int i = 0; i < n; ++i) {
		cin>>v[i];
		sm += v[i];
	}
	if(sm >= h) puts("Yes");
	else puts("No");
	return 0;
}


Measured memory_bytes: 1024
<?php

	$data = explode(" ", trim(fgets(STDIN)));
	$n = $data[0];
	$x = 0;
	
	for($i=0; $i<strlen($n); $i++){
	    $x += (int)$n[$i];
	}
	$y = 9 * strlen($n) + (int)$n[0] - 10;
	
	echo max($x, $y);
?>

Measured memory_bytes: 4732
#include <bits/stdc++.h>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
template<class T> inline T sqr(T x) {return x*x;}
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) sort((c).rbegin(),(c).rend())
#define UNIQUE(c) SORT(c); (c).erase(unique((c).begin(), (c).end()), (c).end());
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
const double INF = 1e7;
const double EPS = 1e-10;
const double PI  = acos(-1.0);
#define CLR(a) memset((a), 0 ,sizeof(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;


void solve(LL N){
	string s = toString(N);
	if (max(max(s[0], s[1]), s[2]) == s[0]) {
		cout << s[0] << s[0] << s[0] << endl;
	} else {
		char x = s[0] + 1;
		cout << x  << x << x << endl;
	}
}


int main(){	
	LL N;
	scanf("%lld",&N);
	solve(N);
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s,c,c1,a,b,d;
    int n,l,k;
    cin>>s;
    d=s;
    l=s.length();
    c=s.substr(0,(l-1)/2);
    a=s.substr((l+3)/2-1,l);
    c1=c;
    b=a;
    reverse(c.begin(),c.end());
    reverse(a.begin(),a.end());
    reverse(s.begin(),s.end());
   // cout<<s<<" "<<c1<<" "<<b<<endl;
    if(s==d&&c1==c&&a==b)
        cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repbtw(i, a, b) for (int i = a; i <= (int)(b); i++)
#define all(v) v.begin(), v.end()
#define pr(x) cout << x << endl


int main()
{
    int64_t n;
    cin >> n;
    int64_t a;
    vector<pair<int64_t,int64_t>> ends(n, pair<int64_t, int64_t>(0,0));
    rep(i, n){
        cin >> a;
        int64_t l = i-a;
        if(l >= 0) ends.at(l).second++;
        int64_t r = i+a;
        if(r < n) ends.at(r).first++;
    }

    int64_t cnt = 0;
    rep(i,n){
        cnt += ends.at(i).first * ends.at(i).second;
    }

    pr(cnt);
    return 0;
}



Measured memory_bytes: 6428
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<vector>
#include<queue>
#include<cmath>

#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n-1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(a, n) sort(a, a+n)
#define VSORT(v) sort(v.begin(), v.end())

using namespace std;

int main()
{
    int n, k;

    cin >> n >> k;

    int h[n];

    REP(i, n) {
        cin >> h[i];
    }

    int cost[n];
    cost[0] = 0;
    int nowcost, min;

    FOR(i, 1, n) {
        min = 1000000000;
        FOR(j, 1, k+1) {
            if(i-j >= 0) {
                nowcost = cost[i-j] + abs(h[i] - h[i-j]);
                if(nowcost < min) { min = nowcost; }
            }
        }
        cost[i] = min;
    }

    cout << cost[n-1] << endl;

    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int a[110];
    rep(i, N) cin >> a[i];
    int ans = INF;
    REP(b, -100, 100) {
        int sum = 0;
        rep(i, N) {
            int d = a[i] - b;
            sum += d * d;
        }
        ans = min(ans, sum);
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string.h>
#include<ctype.h>
#include<string>
#include<math.h>
#define pi 3.141592653589
#include<iomanip>
using namespace std;
 


int main(){
     
    int h,w;
    char c[100][100][2];
    
    cin>>h>>w;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            cin>>c[i][j][0];
        }
    }
    for(int i=0;i<2*h;i++){
        for(int j=0;j<w;j++){
            cout<<c[i/2][j][0];
        }
        cout<<endl;
    }
            
    
     
    return 0;
}
 

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

int main(){
 
  long long N,a,t,res;
  cin >> N;

  res = 0;
  cin >> t;
  for(int i=1;i<N;i++){
    cin >> a;
    if (a < t)
      res += t-a;
    else if (a > t)
      t = a;
  }
  
  cout << res << "\n";

  return 0;
}

Measured memory_bytes: 3624