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

using namespace std;

int main(void) {
	int N,W,H;
	cin >> N >> W >> H;
	vector< pair<int,int> > w(N),h(N);
	int x,y,r;
	for (int i = 0; i < N; ++i) {
		cin >> x >> y >> r;
		w[i].first = x - r;
		w[i].second = x + r;
		h[i].first = y - r;
		h[i].second = y + r;
	}
	sort(w.begin(),w.end());
	sort(h.begin(),h.end());

	bool comp,wcomp,hcomp;
	comp = wcomp = hcomp = true;
	if (w[0].first > 0 && h[0].first > 0) {
		comp = false;
	}
	else if (w[0].first > 0) {
		wcomp = false;
	}
	else if (h[0].first > 0) {
		hcomp = false;
	}

	int wm = w[0].second;
	int hm = h[0].second;
	for (int i = 1; comp && i < N; ++i) {
		if (wcomp) {
			if (wm < w[i].first) {
				wcomp = false;
			}
		}
		if (hcomp) {
			if (hm < h[i].first) {
				hcomp = false;
			}
		}
		if (!wcomp && !hcomp) {
			comp = false;
		}
		wm = max(wm,w[i].second);
		hm = max(hm,h[i].second);
	}

	if (comp) {
		if (wcomp) {
			if (wm < W) {
				wcomp = false;
			}
		}
		if (hcomp) {
			if (hm < H) {
				hcomp = false;
			}
		}
		if (!wcomp && !hcomp) {
			comp = false;
		}
	}

	if (comp) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 4416
#include <bits/stdc++.h>
#define int long long
#define pb push_back
#define mp make_pair
using namespace std;
const int inf = 1e18 + 7;
const int N = 1e6 + 7;
const int md = 1e9 + 7;
void sol() {
  int cnt = 0;
  string s;
  cin >> s;
  int n = s.length();
  for(int i=0, j=n-1; i<n/2; i++, j--) {
    if(s[i] != s[j]) {
      cnt++;
    }
  }
  cout << cnt;
}

int32_t main() 
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int T = 1;
  //cin >> T; while(T--) 
  sol();
  return 0;
}


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

using namespace std;

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

    int i=0;

    while(true){
        if(c-b*i<=0){
            cout<<"Yes"<<endl;
            return 0;
        }
        if(a-d*i<=0){
            cout<<"No"<<endl;
            return 0;
        }
        i++;
    }
}

Measured memory_bytes: 3568
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;

public class Main {
    public static void main(String args[]){
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try{
            String line;
            int[][] map = new int[10][10];
            
            while((line=br.readLine())!=null){
                if(line.equals(""))break;
                String[] splited = line.split(" ");
                int month = Integer.parseInt(splited[0]);
                int day = Integer.parseInt(splited[1]);
                if(month==0)break;
                int[] days = new int[]{31,29,31,30,   31,30,31,31,    30,31,30,31};
                int passday =0;
                for(int i=0;i<month-1;i++){
                    passday+=days[i];
                }
                passday+=day;
                passday%=7;
                String weekday[] = new String[]{"Wednesday","Thursday",
                    "Friday","Saturday","Sunday","Monday","Tuesday"};
                System.out.println(weekday[passday]);

            }
        }catch(Exception e){e.printStackTrace();}
    }
}

Measured memory_bytes: 16924
#include<deque>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<cstring>
using namespace std;
map<string,vector<pair<string,int> > > b;
map<string,int> c;
int fn(string s,int p){
  int i;
  if(c.count(s)){
    if(c[s]!=p)
      return 1;
    else
      return 0;
  }else{
    c[s]=p;
    for(i=0;i<(int)b[s].size();i++){
      if(fn(b[s][i].first,p+b[s][i].second))
	return 1;
    }
    return 0;
  }
}
int main(){
  int i;
  int n;
  while(cin>>n,n){
    set<string> a;
    b.clear();
    for(i=0;i<n;i++){
      string s,t;
      char c;
      int p;
      cin>>s>>s>>c>>c>>c>>c>>p>>t;
      a.insert(s);
      a.insert(t);
      b[s].push_back(make_pair(t,-p));
      b[t].push_back(make_pair(s,p));
    }
    set<string>::iterator it;
    for(it=a.begin();it!=a.end();it++){
      c.clear();
      if(fn(*it,0))
	break;
    }
    if(it!=a.end())
      cout<<"No"<<endl;
    else
      cout<<"Yes"<<endl;
  }
  return 0;
}

Measured memory_bytes: 1004
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;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(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main()
{
    int h,w;
    cin>>h>>w;
    char buf[105];
    for(int i=0; i<h; i++)
    {
        cin>>buf;
        cout<<buf<<endl;
        cout<<buf<<endl;
    }
}

Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

public class Test
{
    public static void Main()
    {
        int K = int.Parse(Console.ReadLine());
        int gcd = 0;
        int a,b,c;
        long sum = 0;

        for (a = 1; a <= K; a++)
        {
            for (b = 1; b <= K; b++)
            {
                for (c = 1; c <= K; c++)
                {
                    int dummy = creategcd(a,b);
                    gcd = creategcd(dummy, c);
                    sum += gcd;
                }
            }
        }

        System.Console.WriteLine(sum);        

        }
    public static int creategcd(int a, int b)
    {
        var x = 0;

        while (true)
        {
            // 割り切れたら
            if (a % b == 0)
            {
                return b;
            }
            else
            {
                x = a % b;
                a = b;
                b = x;

            }
        }

    }

}



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

int main() {
  int k;
  cin >> k;
  
  if(k % 2 == 0){
    cout << k * k / 4;
  }
  else{
    cout << (k / 2) * (k / 2 + 1) << endl;
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int MOD = 1000000000 + 7;
const int N = 100005;
int fac[N], ifac[N];
int pwr(int b, int e)
{
	int ans = 1;
	while (e)
	{
		if (e & 1)
			ans = (1LL * ans * b) % MOD;
		b = (1LL * b * b) % MOD;
		e >>= 1;
	}
	return ans;
}
void pre()
{
	fac[0] = ifac[0] = 1;
	for (int i = 1; i < N; ++i)
	{
		fac[i] = (1LL * i * fac[i - 1]) % MOD;
		ifac[i] = (1LL * pwr(i, MOD - 2) * ifac[i - 1]) % MOD;
	}
}
int ncr(int n, int r)
{
	if (r > n || r < 0)
		return 0;
	int ans = fac[n];
	ans = (1LL * ans * ifac[r]) % MOD;
	ans = (1LL * ans * ifac[n - r]) % MOD;
	return ans;
}
int main(int argc, char const *argv[])
{
	pre();
	int n, k, ans = 0;
	scanf("%d%d", &n, &k);
	vector<int> a(n);
	for (int i = 0; i < n; ++i)
	{
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	for (int i = 0; i < n; ++i)
	{
		a[i] = (1LL * a[i] + MOD) % MOD;
	}
	for (int i = 0; i <= n - k; ++i)
	{
		ans = (1LL * ans + (1LL * ncr(n - i - 1, k - 1) * a[i]) % MOD) % MOD;  
	}
	ans = (MOD - ans) % MOD;
	for (int i = k - 1; i < n; ++i)
	{
		ans = (1LL * ans + (1LL * ncr(i, k - 1) * a[i]) % MOD + MOD) % MOD;  
	}
	printf("%d", ans);
	return 0;
}

Measured memory_bytes: 1408
#include <stdio.h>
#include <limits.h>
#include <algorithm>
 
using namespace std;
 
int cmp_count = 0;
 
 
void merge(int A[],int left,int mid, int right){
    int n1 = mid - left;
    int n2 = right - mid;
    int L[n1+1],R[n2+1];
    for(int i = 0; i < n1; i++) L[i] = A[left + i];
    for(int i = 0; i < n2; i++) R[i] = A[mid + i];
    L[n1] = R[n2] =  INT_MAX;
 
    int i = 0, j = 0;
    for(int k = left;k < right; k++){
        if(L[i] <= R[j]){
            A[k] = L[i++];
            cmp_count++;
        }else{
            A[k] = R[j++];
            cmp_count++;
        }
    }
}
 
void mergeSort(int A[],int left,int right){
    if(left+1 < right){
        int mid = (left+right)/2;
        mergeSort(A,left,mid);
        mergeSort(A,mid,right);
        merge(A,left,mid,right);
    }
}


 
int main(){
    int n;
    scanf("%d",&n);
    int S[n];
    for(int i = 0; i < n; i++) scanf("%d",&S[i]);
 
    mergeSort(S,0,n);
 
    for(int i = 0; i < n-1; i++) printf("%d ",S[i]);
    printf("%d\n",S[n-1]);
    printf("%d\n",cmp_count);
 
}


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

int main() {
  int N, K; cin >> N >> K;
  vector<int> A(N);
  for (int i = 0; i < N; i++) cin >> A.at(i);
  for (int i = 0; i < K; i++) {
    vector<int> B(N+1, 0);
    for (int j = 0; j < N; j++) {
      int left = max(0, j - A.at(j));
      int right = min(N, j + A.at(j) + 1);
      B.at(left)++; B.at(right)--;
    }
    for (int j = 0; j < N; j++) B.at(j+1) += B.at(j);
    B.pop_back();
    if (A == B) break;
    A = B;
  }
  for (int i = 0; i < N; i++) {
    if (i) cout << " ";
    cout << A.at(i);
  }
  cout << endl;
}

Measured memory_bytes: 4816
n = int(input())
s = input()

su = s.count('1')
sun = int(s,2)

sun_plus = sun % (su + 1)
sun_minus = 0 if su - 1 == 0 else sun % (su - 1)


table = [0]*200001
table[1] = 1
for i in range(2,200001):
    table[i] = 1 + table[i % bin(i).count('1')]

def pow(n,e,mod):
    ret=1
    b=n
    while e > 0:
        if e % 2 == 1:
            ret = ret * b % mod
        b = b * b % mod
        e = e//2
    return ret

for i in range(n):
    if s[i] == '0':
        print(1+table[(sun_plus+pow(2,n-1-i,su+1))%(su+1)])
    else:
        if su-1 == 0:
            print(0)
        else:
            print(1+table[(sun_minus-pow(2,n-1-i,su-1)+su-1)%(su-1)])


Measured memory_bytes: 79508
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
// head

int n;
char s[1010];
vector<PII> ans,c,trash;
vector<PII> build(VI w) {
	if (SZ(w)==1) return vector<PII>{{w[0],0}};
	vector<PII> z{{w[0],0},{w[1],0},{w[0],1},{w[1],1}};
	rep(i,2,SZ(w)) {
		vector<PII> nz=z; 
		z.pb({w[i],0});
		reverse(all(nz));
		for (auto p:nz) z.pb({p.fi,p.se^1});
		z.pb({w[i],1});
	}
	return z;
}
int zz;
int main() {
	scanf("%d",&n);
	scanf("%s",s);
	//rep(i,0,(1<<n)) s[i]=(__builtin_popcount(i)<5)+'0';
	rep(i,0,(1<<n)) rep(j,0,(1<<n)) if ((j&i)==i&&s[i]=='0'&&s[j]=='1') {
		puts("Impossible");
		return 0;
	}
	rep(i,0,(1<<n)) if (s[i]=='0') {
		bool cc=0;
		rep(j,0,(1<<n)) if ((i&j)==j&&i!=j&&s[j]=='0') cc=1;
		if (cc) continue;
		VI w;
		fprintf(stderr,"%d\n",i);
		rep(j,0,n) if (i&(1<<j)) w.pb(j);
		auto x=build(w);
		for (auto p:x) ans.pb(p);
		zz++;
		//rep(i,0,n) ans.pb(mp(i,0)),trash.pb(mp(i,0));
		rep(i,0,100) {
			int x=rnd(n);
			ans.pb(mp(x,(SZ(w)>=2))),trash.pb(mp(x,(SZ(w)>=2)));
		}
	}
	//fprintf(stderr,"%d\n",zz);
	reverse(all(trash));
	for (auto p:trash) ans.pb(mp(p.fi,p.se^1));
 // rep(i,0,zz) per(j,0,n) ans.pb(mp(j,-1));
	rep(i,0,(1<<n)) {
		stack<PII> s;
		for (auto x:ans) {
			if (!(i&(1<<x.fi))) continue;
			if (!s.empty()&&s.top().fi==x.fi&&s.top().se==(x.se^1)) s.pop();
			else s.push(x);
		}

		if (s.empty()!=(::s[i]=='1')) {
			assert(0);
			puts("Impossible");
			return 0;
		}
	}
	puts("Possible");
	int pos=0;
	c.pb(mp(0,0));
	for (auto p:ans) {
		//printf("pp %d %d\n",p.fi,p.se);
		if (p.se==0) {
			while (pos<p.fi) {
				pos+=1;
				c.pb(mp(pos,0));
			}
			while (pos>p.fi) {
				pos-=1;
				c.pb(mp(pos,0));
			}
			c.pb(mp(pos,1));
			c.pb(mp(pos+1,1));
			c.pb(mp(pos+1,0));
			pos+=1;
		} else {
			while (pos<p.fi+1) {
				pos+=1;
				c.pb(mp(pos,0));
			}
			while (pos>p.fi+1) {
				pos-=1;
				c.pb(mp(pos,0));
			}
			c.pb(mp(pos,1));
			c.pb(mp(pos-1,1));
			c.pb(mp(pos-1,0));
			pos-=1;
		}
	}
	while (pos>0) {
		pos--;
		c.pb(mp(pos,0));
	}
	assert(SZ(c)<=250000);
	printf("%d\n",SZ(c)-1);
	for (auto x:c) printf("%d %d\n",x.fi,x.se);
}

Measured memory_bytes: 1724
#include <iostream>
#include <utility>
using namespace std;
const int MAX_W = 30;
int main()
{
    int w,n;
	int num[MAX_W+1]={};
	char c;
	cin>>w>>n;
	for(int i=0;i<w;i++){
		num[i]=i+1;
	}
	int a,b;
	for(int i=0;i<n;i++){
		cin>>a>>c>>b;
		swap(num[a-1],num[b-1]);
	}
	for(int i=0;i<w;i++){
		cout<<num[i]<<endl;
	}
    return 0;
}

Measured memory_bytes: 1160
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <cstring>
#include <queue>
#include <functional>
#include <set>
#include <map>
#define SIZE 105

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

char A[3][SIZE];
int cnt[SIZE];

int main()
{
	int n;
	scanf("%d",&n);
	for(int i=0;i<3;i++) scanf("%s",&A[i]);
	int ret=0;
	for(int i=0;i<n;i++)
	{
		memset(cnt,0,sizeof(cnt));
		for(int j=0;j<3;j++) cnt[A[j][i]-'a']++;
		int mx=0;
		for(int j=0;j<SIZE;j++) mx=max(mx,cnt[j]);
		ret+=3-mx;
	}
	printf("%d\n",ret);
	return 0;
}


Measured memory_bytes: 128
#include <iostream>

//#include REP(i,n) for(int i=0,i<(n);i++)
using namespace std;
int main(void){
    int A,B,C;
    cin >> A >> B >> C;
    if(2*B==A+C){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
using namespace std;

typedef istringstream ISS;
typedef ostringstream OSS;
typedef vector<string> VS;
typedef int INT;
typedef vector<INT> VI;
typedef vector<VI> VVI;
typedef pair <INT, INT> II;
typedef vector <II> VII;

template<class T> ostream& operator << ( ostream& os, vector<T> v ) {
    for ( typename vector<T>::iterator it_i = v.begin(); it_i != v.end(); ++it_i ) {
        os << *it_i << ", ";
    }
    return os;
}


int n, m;
VII R;

int solve() {
    int res = 0;
    sort( R.rbegin(), R.rend() );
    for ( int i = 0; i < n; ++ i ) {
        int d = R[i].second, p = R[i].first;
        if ( m >= d ) {
            m -= d;
            d = 0;
        } else {
            d -= m;
            m = 0;
        }
        res += d * p;
    }
    return res;
}

int main() {
    while ( cin >> n >> m && n ) {
        R = VII(n);
        for ( int i = 0; i < n; ++ i ) {
            cin >> R[i].second >> R[i].first;
        }
        cout << solve() << endl;
    }
    return 0;
}

Measured memory_bytes: 1160
#include<stdio.h>
int main()
{
	int a[100]={0},i,x;
	scanf("%d",&i);
	for(x=0;x<=i-1;x++)
	{
		scanf("%d",&a[x]);
	}
	for(x=i-1;x>=1;x--)
	{
		printf("%d ",a[x]);
	}
	printf("%d",a[0]);
	printf("\n");
	return 0;
}

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

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<60)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

ull cnt[100];

int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    ull N, K;
    cin >> N >> K;
    vector<ull> V(N);
    REP(i, N) {
        cin >> V[i];
        REP(j, 64) {
            if (V[i] & (1ULL << j)) {
                cnt[j]++;
            }
        }
    }
    // ull k = 0;
    // bool flag = false;
    int idx = 62;
    while (idx >= 0) {
        if (K & (1ULL << idx)) {
            break;
        }
        idx--;
    }
    if (K == 0) {
        ull sum = 0;
        ull k = 0;
        REP(i, N) {
            sum += k ^ V[i];
        }
        cout << sum << endl;
        return 0;
    }
    ull ans = 0;
    FORD(i, idx, 0) {
        ull k = 0;
        FORD(j, idx, 0) {
            if (j < i && (K & (1ULL << i))) {
                if (cnt[j] <= N / 2) {
                    k |= (1ULL << j);
                }
            } else if (j < i) {
                if (K & (1ULL << j)) {
                    if (cnt[j] <= N / 2) {
                        k |= (1ULL << j);
                    }
                }
            } else if (j > i || i == 0) {
                if (K & (1ULL << j)) {
                    if (cnt[j] <= N / 2) {
                        k |= (1ULL << j);
                    }
                }
            }
        }
        ull sum = 0;
        REP(j, N) {
            sum += k ^ V[j];
        }
        // debug(k, sum);
        ans = max(ans, sum);
    }
    cout << ans << endl;

}

Measured memory_bytes: 1024
// #pragma GCC optimize("no-stack-protector")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma GCC diagnostic ignored "-W"

#include<cassert>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<iostream>
#include<iomanip>
#include<sstream>
#include<deque>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<vector>
#include<utility>
#include<functional>
#include<complex>
#include<climits>
#include<random>
#include<thread>

#if __cplusplus >= 201103L
#include<unordered_map>
#include<unordered_set>
#include<tuple>
#endif

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

using namespace std;
// using namespace __gnu_pbds;

#define ll long long
#define ld long double
#define X first
#define Y second
#define pb push_back
#define eb emplace_back
#define pii pair<int,int>
#define vint vector<int>
#define vpii vector<pair<int,int>>
#define SS stringstream
#define PQ priority_queue
#define MS(x,v) memset((x),(v),sizeof(x))
#define RZUNI(x) sort(x.begin(),x.end()), x.resize(unique(x.begin(),x.end())-x.begin())
#define FLH fflush(stdout)
#define CPPinput ios_base::sync_with_stdio(0); cin.tie(0)
#define FIN(fname) freopen(fname,"r",stdin)
#define FOUT(fname) freopen(fname,"w",stdout)

#define tm Ovuvuevuevue
#define y1 Enyetuenwuevue
#define left Ugbemugbem
#define ws Osas
#define dec tetteterette
#define expl explexplexpl

#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl

#ifdef WEAK
#include"/home/edison/Coding/cpp/template/debug.cpp"
#define DEB(...) printf(__VA_ARGS__),fflush(stdout)
#define WHR() printf("%s: Line %d",__PRETTY_FUNCTION__,__LINE__),fflush(stdout)
#define LOG(...) printf("%s: Line %d ",__PRETTY_FUNCTION__,__LINE__),printf(__VA_ARGS__),fflush(stdout)
#define DEBUG 1
#define exit(x) cout<<"exit code "<<x<<endl, exit(0)
#else
#define PDE(...) ;
#define DEB(...) ;
#define WHR() ;
#define LOG(...) ;
#define DEBUG 0
#endif

#define lowbit(x) ((x)&(-(x)))

void JIZZ(string output=""){cout<<output; exit(0);}

const ld PI=3.14159265358979323846264338327950288;
const ld eps=1e-10;
const ll mod=1e9+7;


int a[2525];
int main(){
    CPPinput;
    int n,sum=0; cin>>n;
    for(int i=1;i<=n;++i)cin>>a[i],sum+=a[i];
    bitset<2000*2000+1> v;
    v[0]=1;
    for(int i=1;i<=n;++i)v|=(v<<a[i]);
    int half=(sum+1)>>1;
    cout<<v._Find_next(half-1)<<endl;

}


Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#include<map>
#include<set>
#include<vector>
using namespace std;
#define INF (1 << 30)
typedef pair<int, int> P;



int C = ~(1<<31), M = (1<<16)-1;
int m, n, a, b, x, y, z;
int r() {
  a = 36969 * (a & M) + (a >> 16);
  b = 18000 * (b & M) + (b >> 16);
  return (C & ((a << 16) + b)) % 1000000;
}

template <typename T>
T next(T a){
	return ++a;
}

template <typename T>
T before(T a){
	return --a;
}

vector<P> points[1080000];
set<P> dp[324000];

int main(){
	while(cin >> m >> n >> a >> b, m | n | a | b){
		for(int i = 0;i < m;i++){
			cin >> x >> y >> z;
			points[x].push_back(P(-y, z));
		}
		for(int i = 0;i < n;i++){
			x = r();
			y = r();
			z = r();
			points[x].push_back(P(-y, z));
		}
		n += m;
		for(int i = 0;i < 324000;i++){
			while(!dp[i].empty())dp[i].erase(dp[i].begin());
		}
		dp[0].insert(P(-INF, -INF));
        int res = 0;
		for(int i = 0;i < 1080000;i++){
			sort(points[i].begin(), points[i].end());
			for(int j = 0;j < points[i].size();j++){
				y = -points[i][j].first;
				z = points[i][j].second;
				int bottom = 0, top = 324000;
				while(top - bottom > 1){
					int mid = (top + bottom) / 2;
					if(dp[mid].empty()){
						top = mid;
						continue;
					}
					set<P>::iterator it = dp[mid].lower_bound(P(y, -INF));					
					if(it == dp[mid].begin()){
						top = mid;
						continue;
					}
					it--;
					if(it->second < z)bottom = mid;
					else top = mid;
				}
				bottom++;
				res = max(res, bottom);
				dp[bottom].insert(P(y, z));
				set<P>::iterator it = dp[bottom].find(P(y, z));

				if(it != dp[bottom].begin() && before(it)->second <= z){
					dp[bottom].erase(it);
					continue;
				}
				it++;
				while(it != dp[bottom].end() && it->second >= z){
					dp[bottom].erase(it++);
				}			
			}
			points[i].clear();
		}
		cout << res << endl;
	}	
	return 0;
}

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

int main(){
  string S; cin >> S;
  bool check = true;
  if (S[0] != 'A') check = false;
  int count = 0;
  for (int i=2; i<=S.length()-2; i++){
    if (S[i] == 'C') count++;
  }
  if (count != 1) check = false;
  count = 0;
  for (char i: S){
    if (i < 'a' || i > 'z') count ++;
  }
  if (count != 2) check = false;
  if (check) cout << "AC" << endl;
  else cout << "WA" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>
#include <limits.h>
#include <stdbool.h>

int main(){
	int rate;
	scanf("%d",&rate);
	if(rate<1200){
		puts("ABC");
	}else{
		puts("ARC");
	}
	
    return 0;
}


Measured memory_bytes: 128
// but in the end its me & I

#include <bits/stdc++.h>
#include <vector>

#define s second
#define f first
#define pb push_back
//#define int ll

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

const long long MAX=2e6,INF=1e9+1,mod=998244353;

int n,m,a[MAX],dp[MAX];
string s;
vector <int> v;
bool mark[MAX];

main()
{
    ios_base::sync_with_stdio(0);
    cin >> n >> a[0] >> a[1];
    dp[1]=abs(a[1]-a[0]);
    for(int i=2;i<n;i++)
    {
        cin >> a[i];
        int x = a[i];
        dp[i]=min(dp[i-1]+abs(x-a[i-1]),dp[i-2]+abs(x-a[i-2]));
    }
    cout << dp[n-1];return -0;
}


Measured memory_bytes: 4480
/***********************************************************
 *This code By @1353055672(Ligen)                          *
 *[Warning]You're not excepted to understand this code!    *
 *CSP-S 2019 RP++                                          *
 ***********************************************************/
// #pragma GCC optimize(3)
#define ADD_STACK int size = 512 << 20;\
	char *pp = (char*)malloc(size) + size;  \
	__asm__("movl %0, %%esp\n" :: "r"(pp))
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<string>
#include<fstream>
#include<queue>
#include<map>
#include<stack>
#include<set>
#include<bitset>
#include<ctime>
#include<vector>
#define ll long long
#define ull unsigned long long
#define mn 200020
#define Max(x,y) (((x)>(y))?(x):(y))
#define Min(x,y) (((x)<(y))?(x):(y))
#define Abs(x) (((x)<(0))?(-(x)):(x))
#define infll (ll)(1e18)
#define infint (1<<30)
#define mod (int)(1e9+7)
#define FOR(a,b,c) for (register int a=b;a<=c;++a)
#define FORD(a,b,c) for (register int a=b;a>=c;--a)
using namespace std;
// char buf[1<<20],*p1=buf,*p2=buf;
// #define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<20,stdin),p1==p2)?EOF:*p1++)
inline ll read(){
	ll x=0,f=1;char c;
	for(c=getchar();c<'0'||c>'9';f=((c=='-')?-1:f),c=getchar());
	for(;c>='0'&&c<='9';x=x*10+c-'0',c=getchar());
	return x*f;
}
template<typename T>
inline void write(T a){
	if(a==0){putchar('0');return;}if(a<0)putchar('-'),a=-a;char c1[120];int h=0;
	while(a)c1[++h]=a%10+'0',a/=10;FORD(i,h,1)putchar(c1[i]);
}
inline void write_(){return;}
template<typename T,typename... Args>
inline void write_(T a,Args... b){write(a);putchar(' ');write_(b...);}
inline void writeln(){putchar('\n');return;}
template<typename T,typename... Args>
inline void writeln(T a,Args... b){write(a);putchar(' ');writeln(b...);}
//need c++11

//inline void write(ll a){
//    if(a==0){putchar('0');return;}if(a<0)putchar('-'),a=-a;char c1[120];int h=0;
//    while(a)c1[++h]=a%10+'0',a/=10;FORD(i,h,1)putchar(c1[i]);
//}
//inline void write_(ll a){write(a);putchar(' ');}
//inline void writeln(ll a){write(a);putchar('\n');}
inline ll gcd(ll a,ll b){return a==0?b:gcd(b%a,a);}
inline ll lcm(ll a,ll b){return 1ll*a/gcd(a,b)*b;}
inline ll Pow(ll n,ll a){ll b=1;while(a){if(a&1)b=1ll*b*n%mod;n=1ll*n*n%mod;a>>=1;}return b;}
//---------------------Head Files--------------------------//
int n,m,a[120];
bool v[100020],vv;
signed main(){
#ifdef LOCAL_LIGEN
	// freopen("0.in","r",stdin);
	// freopen("0.out","w",stdout);
	double be=clock();
#endif
	n=read(),m=read();
	FOR(i,1,n)a[i]=read(),v[a[i]]=1;
	FOR(i,1,m)if(!v[i]){
		vv=1;
		FOR(j,1,n)if(i-a[j]>=0)vv&=v[i-a[j]];
		if(!vv)v[i]=1;
	}
	// FOR(i,0,m)writeln(i,v[i]);
	if(v[m])puts("First");else puts("Second");
#ifdef LOCAL_LIGEN
	double en=clock();
	printf("Time: %.0lfms\n",en-be);
	fclose(stdin);fclose(stdout);
#endif
	return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin>>n;
  if(n==1){cout<<"Hello World";}
  else{
    int A,B;
    cin>>A>>B;
    cout<<A+B<<endl;}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__",", __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 1120000000
#define long long long // for codeforces

class UnionFind {
public:
  vector<int> par, rank; // parent(negative := its root and abs-value is its size), depth
  UnionFind(int sz) : par(sz, -1), rank(sz, 0){}
  int find(int x){
    if(par[x]<0) return x;
    else return par[x] = find(par[x]);
  }
  void unite(int x, int y){
    x=find(x); y=find(y);
    if(x==y) return;  // already belong to same tree
    if(rank[x] < rank[y]){  // y becomes parent node
      par[y] += par[x];
      par[x] = y;
    } else {  // x becomes parent node
      par[x] += par[y];
      par[y] = x;
      if(rank[x]==rank[y]) rank[x]++;
    }
  }
  bool same(int x, int y){ return find(x) == find(y); }
  int size(int x){ return -par[find(x)]; }
};


int main(){
  int n;
  cin>>n;
  vector<pair<pair<int,int>,int>> vec(n);
  rep(i,n) cin>>vec[i].fi.fi>>vec[i].fi.se;
  rep(i,n) vec[i].se=i;

  vector<pair<int,pair<int,int>>> vv;

  sort(all(vec));
  rep(i,n-1){ vv.pb(mp(vec[i+1].fi.fi-vec[i].fi.fi, mp(vec[i].se,vec[i+1].se))); }

  rep(i,n) swap(vec[i].fi.fi, vec[i].fi.se);
  sort(all(vec));
  rep(i,n-1){ vv.pb(mp(vec[i+1].fi.fi-vec[i].fi.fi, mp(vec[i].se,vec[i+1].se))); }

  sort(all(vv));

  UnionFind uf(n);

  long ans = 0;
  for(auto pp : vv){
    int x =pp.se.fi, y =pp.se.se;
    if(!uf.same(x,y)){
      uf.unite(x,y);
      ans += pp.fi;
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 6132
#include <bits/stdc++.h>
//#define lop(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
int main() {
#ifndef ONLINE_JUDGE
	freopen("input1.txt", "r", stdin);
	freopen("output1.txt", "w", stdout);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0);

	char c;
	cin >> c;
	char r = c + 1;
	cout << r << endl;
}

Measured memory_bytes: 3652
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<unordered_map>
#include<array>
#include<map>
#include<iomanip>
//<< setprecision(5)
using namespace std;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
#define dme cout<<-1<<endl;return 0
const int mod=1000000007;
const llint big=1e9+10;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-7;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){return a/gcd(a,b)*b;}
int main(void){
	int al[256]={0};
	int h,w,i,j;cin>>h>>w;
	for(i=0;i<h;i++){
		string str;cin>>str;
		for(j=0;j<w;j++){
			al[str[j]]++;
		}
	}
	int on=0,to=0;
	for(i=0;i<256;i++){
		al[i]%=4;
		if(al[i]==1||al[i]==3){on++;}
		if(al[i]==2||al[i]==3){to++;}
	}
	if(h%2==1){swap(h,w);}//0,1にする
	to*=2;
	if(h%2==0&&w%2==0){
		if(on>0||to>0){cout<<"No"<<endl;return 0;}
	}else if(h%2==1&&w%2==1){
		if(on>1||to>(h+w-2)){cout<<"No"<<endl;return 0;}
	}else{
		if(on>0||to>h){cout<<"No"<<endl;return 0;}
	}
	cout<<"Yes"<<endl;
	return 0;
}

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

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


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

#define int long long

const int mod = 1e9+7;

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

int modpow(int a,int b)
{
	int res = 1;
	while(b)
	{
		if(b&1)
		{
			res = (res*a)%mod;
		}
		a = (a*a)%mod;
		b >>= 1;
	}
	return res%mod;
}

int sti(string s)
{
	int res = 0;
	for(int i = 0;i < (int)s.length();++i)
	{
		res*=10;
		res += (s[i] - '0');
	}
	return res;
}
signed main()
{
	ios_base::sync_with_stdio(false);
	int r;
	cin >> r;
	cout << (int)(3*pow(r,2));
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//ifstream cin("lineup.in");
//ofstream cout("lineup.out");
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#define IOS ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
int main(){
    int n;
    cin>>n;
    int a[n];
    int l=1;
    //int ans=0;
    for(int i=0;i<n;i++){
	cin>>a[i];
	if(a[i]==l){
	    l++;
	}
    }
    if(n-l+1==n){
	cout<<-1<<endl;
	return 0;
    }
    cout<<n-l+1<<endl;
}


Measured memory_bytes: 1152
# Aizu Problem 0081: Symmetric Point
#
import sys, math, os

# read input:
PYDEV = os.environ.get('PYDEV')
if PYDEV=="True":
    sys.stdin = open("sample-input.txt", "rt")


def symmetric_point(x1, y1, x2, y2, xq, yq):
    rx = x2 - x1
    ry = y2 - y1
    det = -rx**2 - ry**2
    det_s = rx * (yq - y1) - ry * (xq - x1)
    s = det_s / det
    xr = xq - 2 * s * ry
    yr = yq + 2 * s * rx
    return xr, yr


for line in sys.stdin:
    x1, y1, x2, y2, xq, yq = [float(_) for _ in line.split(',')]
    xr, yr = symmetric_point(x1, y1, x2, y2, xq, yq)
    print("%.6f %.6f" % (xr, yr))

Measured memory_bytes: 7572
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
using namespace std;

int main(){

	int p,q,pre_limit,limit;
	scanf("%d %d",&p,&q);

	pre_limit = sqrt(q);

	for(int i = 2; i <= pre_limit; i++){
		while(p%i == 0 && q %i == 0){
			p /= i;
			q /= i;
		}
	}

	if(q % p == 0)q /= p;

	limit = sqrt(q);

	int ans = 1;

	for(int i = 2; i <= limit; i++){
		if(q%i == 0){
			ans *= i;
			while(q % i == 0)q /= i;
		}
	}

	ans *= q;

	printf("%d\n",ans);

	return 0;
}

Measured memory_bytes: 2748
#include <stdio.h>;

int main() {
	int rate1=0,rate2=0,rate3=0,rate4=0,rate5=0,rate6=0,rate7=0,rate8=0,all=0,N,a[100],i,resmin,resmax;
	scanf("%d",&N);
	for(i=0;i<N;i++){
		scanf("%d",&a[i]);
	}
	for(i=0;i<N;i++){
		if((1<=a[i])&&(a[i]<=399)){
			rate1=1;
		}
		else if((400<=a[i])&&(a[i]<=799)){
					rate2=1;
				}
		else if((800<=a[i])&&(a[i]<=1199)){
					rate3=1;
				}
		else if((1200<=a[i])&&(a[i]<=1599)){
					rate4=1;
				}
		else if((1600<=a[i])&&(a[i]<=1999)){
					rate5=1;
				}
		else if((2000<=a[i])&&(a[i]<=2399)){
					rate6=1;
				}
		else if((2400<=a[i])&&(a[i]<=2799)){
					rate7=1;
				}
		else if((2800<=a[i])&&(a[i]<=3199)){
					rate8=1;
				}
		else if(3200<=a[i]){
			all++;
		}
	}
	resmin = rate1+rate2+rate3+rate4+rate5+rate6+rate7+rate8;
	if(resmin==0){
		resmin = 1;
	}
	resmax = rate1+rate2+rate3+rate4+rate5+rate6+rate7+rate8+all;

	printf("%d %d",resmin,resmax);
	return 0;
}


Measured memory_bytes: 128
i = 0
date = {}
while i < 50:
	try:
		s, w, h = list(map(float,input().split(",")))
	except:
		break
	date.update({int(s):w/h/h})
	i += 1
li = [i for i in date if date[i] >= 25]
for i in range(len(li)): print(li[i])


Measured memory_bytes: 5588
n, a, b = map(int, input().split())
x = list(map(int, input().split()))

hp = 0
good = min(a, b)
bad = max(a, b)

if good == a:
  for i in range(n):
    if i+1 == n:
      break
    if bad >= abs(x[i+1] - x[i])*good:
      hp += abs(x[i+1] - x[i]) * good
    else:
      hp += bad

else:
  for i in range(n):
    if i+1 == n:
      break
    if good >= abs(x[i+1] - x[i])*bad:
      hp += abs(x[i+1] - x[i]) * bad
    else:
      hp += good
print(hp)

Measured memory_bytes: 14484
let f = function 'r' -> 'p' | 's' -> 'r' | _ -> 's'
let ans, n, k, t, g = Scanf.(scanf "%d %d %d %d %d" @@ fun n k r s p -> ref 0, n, k, Array.init n (fun _ -> scanf " %c" @@ fun c -> c), (function 'r' -> r | 's' -> s | _ -> p))
let _ = Array.iteri (fun i c -> if i < k || t.(i - k) <> c then ans := !ans + g (f c) else if i + k < n && c = t.(i + k) then t.(i) <- f c) t; Printf.printf "%d\n" !ans

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

void solve(int n, int m, bool d){

  if(n == m){
    cout << n << endl;
    return;
  }
  cout << n << " ";
  if(n == 9) solve(5, m, false);
  else if(!n) solve(n+1, m, true);
  else if(d) solve(n+1, m, true);
  else solve(n-1, m, false);
}

int main(){

  int l;
  int n,m;

  cin >> l;

  while(l--){
    cin >> n >> m;
    if(n == 9) solve(n, m, false);
    else if(n < 6 && n > m) solve(n, m, false);
    else solve(n, m, true);
  }

}

Measured memory_bytes: 1160
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };
bool sosuub[50000];
vector<int> sosuu;
int max(int a, int b){
	int ans=1;
	int ac=a;
	int bc=b;
	vector<int> va;
	vector<int> vb;
	for (int i = 0; ac >= sosuu[i];){
		if (ac%sosuu[i] == 0){
			ac /= sosuu[i];
			va.push_back(sosuu[i]);
		}
		else i++;
	}
	for (int i = 0; bc >= sosuu[i];){
		if (bc%sosuu[i] == 0){
			bc /= sosuu[i];
			vb.push_back(sosuu[i]);
		}
		else i++;
	}
	while (!va.empty() && !vb.empty()){
		if (va.back() == vb.back()){
			ans *= va.back();
			va.pop_back();
			vb.pop_back();
		}else{
			if (va.back() > vb.back())va.pop_back();
			else if (va.back() < vb.back())vb.pop_back();
		}
	}
	return ans;
}
int min(int a, int b){
	int ans=-1;

	return ans;
}

int main() {
	int a, b;
	for (int i = 2; i < 50000; i++){
		if (!sosuub[i]){
			sosuu.push_back(i);
			for (int j = i * 2; j < 50000; j += i){
				sosuub[j] = true;
			}
		}
	}
	while (cin >> a >> b){
		int ma = max(a, b);
		int mi = a / ma*b;
		cout << ma<< " " << mi << endl;
	}
}

Measured memory_bytes: 1324
a,v = map(int,input().split())
b,w = map(int,input().split())
t = int(input())

if v == w:
    print("NO")
else:
    if w > v:
        print("NO")
    else:
        if abs(b-a) / (v-w) <= t:    
            print("YES")
        else:
            print("NO")

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

using namespace std;

int main()
{
    int N;
    while(cin >> N, N)
    {
        int num[1000], p[1000], q[1000], r[1000];
        for(int i = 0; i < N; i++) cin >> num[i] >> p[i] >> q[i] >> r[i];
        int P, Q, R, C;
        cin >> P >> Q >> R >> C;
        bool NA = true;
        for(int i = 0; i < N; i++)
        {
            if(p[i] > P || q[i] > Q || r[i] > R || p[i] * 4 + q[i] * 9 + r[i] * 4 > C)
                continue;
            NA = false;
            printf("%d\n", num[i]);
        }
        if(NA) puts("NA");
    }
}

Measured memory_bytes: 1164
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

#define MAX 1000000

int main(){
	bool p[MAX+1];
	int num,answer;
	p[0] = false;
	p[1] = false;
	for(int i=2 ; i<=MAX ; i++){
		p[i] = true;
	}
	for(int i=2 ; i<=sqrt(MAX)+1 ; i++){
		if(p[i]==1){
			for(int j=i*2; j<=MAX; j=j+i){
				p[j] = false;
			}
		}
	}
		
	while( scanf("%d" , &num) != EOF ){	
		answer = 0;	

		for(int i=0; i<=num; i++){
			if(p[i]){
				answer++;
			}
		}
		printf("%d\n", answer);
	}
}

Measured memory_bytes: 0
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
using namespace std;

typedef long long ll;


int main() {
	int n; cin >> n;
	vector<int> a(n + 2);
	for (int i = 0; i < n; i++) cin >> a[i];
	int curl = 0, curr = 0, left = 0;
	ll ans = 0;
	for (int i = 0; i < n; i++) {
		curl ^= a[i];
		curr += a[i];
		while (curl != curr) {
			curl ^= a[left];
			curr -= a[left];
			left++;
		}
		ans += i - left + 1;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define MAXN 500005
#define INF 1000000000
#define MOD 1000000007
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int n;
P a[MAXN];
P pre[MAXN],suf[MAXN];
P intersect(P x,P y)
{
    if(x.F>y.S||y.F>x.S) return P(1,0);
    return P(max(x.F,y.F),min(x.S,y.S));
}
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%d%d",&a[i].F,&a[i].S);
    sort(a+1,a+n+1);
    pre[0]=suf[n+1]=P(1,INF);
    for(int i=1;i<=n;i++) pre[i]=intersect(pre[i-1],a[i]);
    for(int i=n;i>=1;i--) suf[i]=intersect(suf[i+1],a[i]);
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        P p=intersect(pre[i-1],suf[i+1]);
        ans=max(ans,a[i].S-a[i].F+1+p.S-p.F+1);
    }
    for(int i=1;i<=n-1;i++) ans=max(ans,pre[i].S-pre[i].F+1+suf[i+1].S-suf[i+1].F+1);
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 9216
blue = []
red = []
count=countb=countr=x=maxi=0
nblue = int(input())
for c in range(1, nblue+1):
  blue+=[input()]
nred = int(input())
for c in range(1, nred + 1):
  red+=[input()]
for c in range (0, len(blue)): 
  countb=blue.count(blue[c])
  countr=red.count(blue[c])
  if countr>=1:
    countr=red.count(blue[c])
    countb-=countr
  if countb>maxi:
    maxi=countb
    x=c
print(maxi)

Measured memory_bytes: 3064
#include <algorithm>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

typedef long long ll;

#define rep(i, n) for (ll i = 0; i < (ll)n; ++i)
#define INF 10e12
#define MAX 51000
#define all(x) (x).begin(), (x).end()
#define MX(x) *max_element(all(x))
#define MN(x) *min_element(all(x))

using namespace std;

const long long MOD = 1e9 + 7;

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

    ll n, m;
    cin >> n >> m;
    vector<vector<ll>> vec(m);
    rep(i, m)
    {
        ll tmp;
        cin >> tmp;
        rep(j, tmp)
        {
            ll a;
            cin >> a;
            vec[i].push_back(a - 1);
        }
    }
    vector<ll> kirikae(m);
    rep(i, m) cin >> kirikae[i];
    ll ans = 0;
    for (ll i = 0; i < (1 << n); ++i)
    {
        vector<ll> tmp;
        rep(j, n) if (i & (1 << j)) tmp.push_back(j);
        ll counta = 0;
        rep(j, m)
        {
            ll kazu = 0;
            rep(k, vec[j].size()) //個々のライトに対して
            {
                if (find(tmp.begin(), tmp.end(), vec[j][k]) != tmp.end())
                    kazu++;
            }
            if (kazu % 2 == kirikae[j])
                counta++;
        }
        if (counta == m)
            ans++;
    }
    cout << ans << endl;
}


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

		int counter = 0;
		for(int i = 1; i<=9; i++)
		{
			if(a%i == 0)
			{
				counter++;
				if(a/i > 9)
					counter--;
			}
		}
		if(a == 100)
			System.out.println("No");
		else if(counter >= 2 || Math.sqrt(a)%1 == 0)
		{
			System.out.println("Yes");
		}
		else
			System.out.println("No");
	}
}

Measured memory_bytes: 22740
#include <iostream>
#include <queue>
#include <algorithm>
const int MAX = 2e5 + 10;
using namespace std;

bool cmp(pair<int,int> l ,pair<int,int> r) {
	return l.first < r.first;
}

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

	pair<int,int> p[MAX];

	for(int i=0;i<n;i++) {
		cin>>p[i].first>>p[i].second;
	}

	sort(p,p+n,cmp);

	priority_queue<int> q;

	int i=0;
	long long ans = 0;
	for(int d=1;d<=m;d++) {
		while(i < n and p[i].first <= d) {q.push(p[i].second); i++;}

		if(!q.empty()) {
			ans += q.top(); q.pop();
		}
	}

	cout << ans;
}

Measured memory_bytes: 2428
package main

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

func main() {
	rdr := NewReader(10)
	l1 := ReadInts(rdr)
	l2 := ReadInts(rdr)
	l3 := ReadInts(rdr)

	x := l2[0] - l1[0]
	y := l2[1] - l1[1]
	z := l2[2] - l1[2]

	if !(x == y && y == z) {
		fmt.Println("No")
		return
	}

	x = l3[0] - l1[0]
	y = l3[1] - l1[1]
	z = l3[2] - l1[2]

	if !(x == y && y == z) {
		fmt.Println("No")
		return
	}

	fmt.Println("Yes")
}

type Reader struct {
	rdr  *bufio.Reader
	size int
}

func NewReader(size int) *Reader {
	return &Reader{
		bufio.NewReaderSize(os.Stdin, size),
		size,
	}
}

func ReadLine(r *Reader) string {
	buf := make([]byte, 0, r.size)
	for {
		line, isPrefix, err := r.rdr.ReadLine()
		if err != nil {
			panic(err)
		}
		buf = append(buf, line...)
		if !isPrefix {
			break
		}
	}
	return string(buf)
}

func ReadStrs(r *Reader) []string {
	return strings.Split(ReadLine(r), " ")
}

func ReadInts(r *Reader) []int {
	a := ReadStrs(r)
	n := make([]int, 0)
	for _, v := range a {
		if i, e := strconv.Atoi(v); e == nil {
			n = append(n, i)
		}
	}
	return n
}


Measured memory_bytes: 640
#include<stdio.h>
#define NIL -1
typedef struct{
  int p,l,r;
}node;

void preParse(node *u,int n){
  if(n == NIL) return;
  printf(" %d",n);
  preParse(u,u[n].l);
  preParse(u,u[n].r);
}

void inParse(node *u,int n){
  if(n == NIL) return;
  inParse(u,u[n].l);
  printf(" %d",n);
  inParse(u,u[n].r);
}

void postParse(node *u,int n){
  if(n == NIL) return;
  postParse(u,u[n].l);
  postParse(u,u[n].r);
  printf(" %d",n);
}

int main(){
  node u[30];
  int n,id,l,r;
  int i;
  
  scanf("%d",&n);
  for(i=0;i<n;i++) u[i].p = u[i].l = u[i].r = NIL;
  for(i=0;i<n;i++){
    scanf("%d%d%d",&id,&l,&r);
    u[id].l = l;
    u[id].r = r;
    u[l].p = u[r].p = id;
  }
  id = 0;
  while(u[id].p != NIL) id = u[id].p;
  printf("Preorder\n");
  preParse(u,id);
  printf("\n");
  printf("Inorder\n");
  inParse(u,id);
  printf("\n");
  printf("Postorder\n");
  postParse(u,id);
  printf("\n");
  
return 0;
}



Measured memory_bytes: 2092
#include <iostream>

using namespace std;
typedef long long int ll;
ll dp[100010];
ll arr[100010];

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

    for(ll i = 1; i <= n; i++){
        scanf("%lld",arr+i);
    }

    for(ll i = 2; i <= n; i++){
        dp[i] = 10000000000000;
        if(i-1 >= 1){
            dp[i] = dp[i-1] + llabs(arr[i]-arr[i-1]);
        }
        if(i-2 >= 1){
            dp[i] = min(dp[i],dp[i-2] + llabs(arr[i]-arr[i-2]));
        }
    }
    printf("%lld\n",dp[n]);
}


Measured memory_bytes: 1792
#include <iostream>

int main(){
  while(1){
    int n;
    std::cin>>n;
    if(n==0)break;
    int maxs=-1,mins=1001;
    int sum=0;
    for(int i=0;i<n;++i){
      int s;
      std::cin>>s;
      if(maxs<s) maxs=s;
      if(mins>s) mins=s;
      sum += s;
    }
    std::cout<<(sum-mins-maxs)/(n-2)<<std::endl;
  }
  return 0;
}

Measured memory_bytes: 3100