akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#if __cplusplus >= 201103L
#include <chrono>
using namespace std::chrono;
#endif
using namespace std;
#define ll long long
#define ull unsigned long long
#define pii pair<int, int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#ifdef LOCAL
#define prln(x) (cout << #x << ' ' << x << endl)
#define pr(x) (cout << #x << ' ' << x << ' ' )
#define prv(x) (cout << x << ' ')
#else
#define prln(x) 
#define pr(x)
#define prv(x)
#endif
#define clr(x) memset((x), 0, sizeof((x)))
#define clr1(x) memset((x), -1, sizeof((x)))
#define endl "\n"
#define pi acos(-1)
#define rep(i, st, ed) for (int i = (st); i <= (ed); ++i)
#define rep0(i, st, ed) for (int i = (st); i < (ed); ++i)
#define per0(i, st, ed) for (int i = (st); i > ed; --i)
#define per(i, st, ed) for (int i = (st); i >= ed; --i)
#define chmin(a, b) (a = a > b ? b : a)
#define chmax(a, b) (a = a < b ? b : a)
template<class T> void _sf(T &x) {cin >> x;}
void _sf(int &x) {scanf("%d", &x);}
void _sf(ll &x) {scanf("%lld", &x);}
void _sf(double &x) {scanf("%lf", &x);}
void _sf(char &x) {scanf(" %c", &x);}
void _sf(char *x) {scanf("%s", x);}
void sf() {}
template <class T, class...U> void sf(T & head, U&... tail) { _sf(head); sf(tail...);}
template<class T> void _out(const T &x) { cout << x; }
void _out(const int &x) { printf("%d", x); }
void _out(const ll &x) { printf("%lld", x); }
void _out(const double &x) { printf("%.16f", x); }
void _out(const char &x) { putchar(x); }
void _out(const char *x) { printf("%s", x); }
template<class T,class U> void _out(const pair<T,U> &x) {_out(x.F); putchar(' '); _out(x.S);}
template<class T> void _out(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _out(*i++)) if (i != x.cbegin()) putchar(' '); }
void out() {}
template<class T, class... U> void out(const T &head, const U &... tail) { _out(head); putchar(sizeof...(tail) ? ' ' : '\n'); out(tail...); }
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;

int read() {
    int x = 0, f = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9') {
        if (ch == '-') f = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9') {
        x = x * 10 + ch - '0';
        ch = getchar();
    }
    return x * f;
}


int main(){
    #ifdef LOCAL
        freopen("in.txt", "r", stdin);
        freopen("out.txt", "w", stdout);
    #endif
    // string s, t;
    // sf(s, t);
    // cout << t << s << endl;
    ll a, b, k;
    sf(a, b, k);
    if (a >= k) a -= k;
    else if (k >= a + b) a = 0, b = 0;
    else {
        k -= a;
        a = 0;
        b -= k;
    }
    out(a, b);
    return 0;
}

Measured memory_bytes: 256
nn = [0] + list(map(int, list(input())))
dp0, dp1 = 0, 0
for i in range(len(nn)):
	dp0, dp1 = nn[i] + min(dp1, dp0), 9 - nn[i] + min(dp1, dp0 + 2)
print(min(dp0, dp1))

Measured memory_bytes: 21348
#include<stdio.h>

int main(){
	int a[5],b[5];
	
	scanf("%d %d %d %d",&a[0],&a[1],&a[2],&a[3]);
	scanf("%d %d %d %d",&b[0],&b[1],&b[2],&b[3]);
	a[4]=a[0]+a[1]+a[2]+a[3];
	b[4]=b[0]+b[1]+b[2]+b[3];
	if(a[4]>=b[4])printf("%d\n",a[4]);else printf("%d\n",b[4]);
	
	return 0;
} 

Measured memory_bytes: 0
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a)  (a).begin(),(a).end()
#define pb push_back
#define INF (1e9+1)
//#define INF (1LL<<59)

int main(){
	vector<int> v(3);
	rep(i,3)cin>>v[i];
	sort(all(v));
	

	
	if(v[0]==5&&v[1]==5&&v[2]==7)cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
}

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

using namespace std;

int main(){
    int N;
    string S;

    cin >> N >> S;

/*
    for (int i = 0; i < N-2; i++){
        for(int j=i+1;j < N-1 ; j++){
            if(S[i] == S[j])continue;
            for(int k=j+1;k<N; k++){

                //cout << " " << i << " " << j << " " << k << endl;
                if(S[i] == S[k] || S[j] == S[k]) continue;
                if(j-i == k-j) continue;

                res ++;

            }
        }
    }

    */

   //数え上げ
   long long r,g,b;
    r = 0;g = 0;b = 0;

    for(auto& n: S){
        if( n == 'R') r++;
        else if(n == 'G') g++;
        else b++;
    }

    //組み合わせ総数
    long long p = r*b*g;


    //等間隔の組み合わせを数え上げ
    for(int i = 0;i < N-2; i++){
        for(int gap = 1; N > (i + (2*gap)); gap++){
            int j = i + gap;
            int k = j + gap;

            if(S[i] != S[j] && S[i] != S[k] && S[j] != S[k]) p--;
        }
    }


    cout << p << endl;

}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
 
#define int long long
using pii = pair<int, int>;
const int MOD = 1e9 + 7;
const int INF = 1 << 29;
const int N = 1e5 + 10;
 
struct IOsetup{
  IOsetup(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr); 
    cout.tie(nullptr);
    cout << fixed << setprecision(20);
  }
}IO;

int32_t main(){
 int n;
 string s;
 cin >> n >> s;
 string ret = "";
 for (auto it : s){
  int curr = it - 'A';
  int val = curr + n;
  val %= 26;
  ret += (char)('A' + val);
 }
 cout << ret << endl;
}

Measured memory_bytes: 256
#ifdef MY_LOCAL
#define MY_NAMESPACE(ns) namespace ns {
#define MY_NAMESPACE_    }
#define MY_DEBUG(s)      s
#else
#define MY_NAMESPACE(ns) 
#define MY_NAMESPACE_    
#define MY_DEBUG(s)      
#endif

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>

using namespace std;

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

#define EPS (1e-7)


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

	int sum = 0;
	int num_to_take = k;
	int num_a = min(num_to_take, a);
	sum += num_a;
	num_to_take -= num_a;

	int num_b = min(num_to_take, b);
	num_to_take -= num_b;

	int num_c = min(num_to_take, c);
	sum -= num_c;
	num_to_take -= num_c;

	cout << sum << "\n";
	return 0;
}
MY_NAMESPACE_

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  int ans = 0;
  for(int i = a; i <= b; i++){
    if(c%i == 0){
      ans++;
    }
  }
  cout << ans << endl;
}



Measured memory_bytes: 3096
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;



int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);

    long long n, m;
    cin >> n >> m;
    vector<pair<long long, long long>> P;
    for (int i = 0; i < n; ++i) {
        int a, b;
        cin >> a >> b;
        P.emplace_back(a, b);
    }
    sort(P.begin(), P.end());


    long long res = 0;
    for (int i = 0; i < n; ++i) {
        long long a = P[i].first;
        long long cnt = P[i].second;
        cnt = min(cnt, m);
        m -= cnt;
        res += cnt * a;
    }

    cout << res << "\n";

    return 0;
}

Measured memory_bytes: 2420
//be name khoda

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

#define pii pair<int, int>
#define mp make_pair
#define REP(i, n) for(int i = 0; i < (int)(n); i++)

typedef long long ll;

const int N = 1;

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll n;
	cin >> n;
	for(ll i = 1; i <= 3500; i++)
		for(ll j = 1; j <= 3500; j++)
		{
			ll a = n * i * j;
			ll b = 4 * i * j - n * i - n * j;
			if(b > 0 && a > 0 && a % b == 0)
				return cout << i << ' ' << j << ' ' << a / b << endl, 0;
		}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <utility>
#include <cmath>
#include <random>
#include <vector>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <algorithm>
using namespace std;

#define rep(i,n) for(int i = 0; i<n; ++i)
#define REP(i,n) for(int i = 1; i<=n; ++i)
#define all(x) begin(x),end(x)
#define show(obj) {for(auto x:obj)cout<<x<<' ';cout<<endl;}
#define line "----------"
typedef long long ll;
typedef pair<int,int> P;
const int inf = 1001001000;
const ll INF = 1LL<<60;
const ll MOD = 1e9 + 7;

int main(){
	int N,K; cin>>N>>K;
	vector<int> A(N);
	rep(i,N)cin>> A[i];
	for(int i = K; i<N; ++i){
		if(A[i] > A[i-K])cout << "Yes"<< endl;
		else cout << "No"<< endl;
	}
	return 0;
}

Measured memory_bytes: 3992
from sys import stdin
import sys
import math
from functools import reduce
import functools
import itertools
from collections import deque,Counter
from operator import mul
import copy
# ! /usr/bin/env python
# -*- coding: utf-8 -*-
import heapq

N, W = list(map(int, input().split()))
INF = 10**10

dp = [[0]*(W+1) for i in range(N+1)]

for i in range(1,N+1):
    w, v = list(map(int, input().split()))
    for j in range(1,W+1):
        if j-w < 0:
            p = -INF
        else:
            p = dp[i-1][j - w]

        dp[i][j] = max(p + v, dp[i-1][j])

print(dp[N][W])


Measured memory_bytes: 147864
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); i++)
typedef long long ll;
int main()
{
 int N; 
 ll ans=0;
 cin >> N;
 map<string, int>nums;
 rep(i, N){
   string s;
   cin >> s;
   sort(s.begin(), s.end());
   nums[s]++;}
 for(auto p: nums){
   int a = p.second;
   ans += (ll)a*(a-1)/2;
      
 }
  cout << ans << endl; 
   
 }


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

int main() {
	int x, n;
	cin >> x >> n;
	map<int, bool> mp;
	for (int i = 0, y; i < n; ++i) {
		cin >> y;
		mp[y] = true;
	}
	
	int ans = 150;
	
	for (int i = 101; i >= -1; --i) {
		if (!mp[i] && abs(x-i) <= abs(x-ans)) {
			ans = i;
		}
	}
	
	cout << ans << "\n";
}



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

int check( long long maxcarry, int w[],int w_size, int t ){
	int i=0;
	for( int j=0; j<t; j++ ){
		long long s=0;
		while( s + w[i] <=maxcarry ){
			s +=w[i];
			i++;
			if( i == w_size ) {
				return w_size;
			}
		}
	}
	return i;
}

long long solve( int w[], int w_size, int t ){

	long long front =0, back =100000*10000, center;
	while( back - front > 1 ){
		center= (front+back) /2;
		int v= check(center, w, w_size, t);
		if( v >= w_size ) {
			back= center;
		}else{
			front=center;
		}
	}
	return back;
}


int main()
{
	int w_size, t;
	cin>>w_size>>t;
	int *w=new int[w_size];
	for( int i=0; i<w_size; i++ ) cin>>w[i];

	cout<<solve(w, w_size, t)<<endl;
}

Measured memory_bytes: 1564
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

#define lengthof(array) (sizeof(array) / sizeof(*array))
#define dump(a) (cerr << (#a) << " = " << (a) << endl)
#define FOR(it,c) for(__typeof((c).begin())it=(c).begin(); it!=(c).end();++it)
#define RFOR(it,c) for(__typeof((c).rbegin())it=(c).rbegin(); it!=(c).rend();++it)

template<class T> inline void chmax(T& a, const T& b) { if(b > a) a = b; }
template<class T> inline void chmin(T& a, const T& b) { if(b < a) a = b; }

template<typename T, typename U> ostream& operator<<(ostream& os, const pair<T, U>& p) {
	os << '(' << p.first << ", " << p.second << ')';
	return os;
}

template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	copy(v.begin(), v.end(), ostream_iterator<T>(os, " "));
	return os;
}

const int MAX_N = 8;
int n, m, p, a, b;
int t[MAX_N];

struct state {
	int city, used;
	double dist;
	state(int c, int t, double d):city(c), used(t), dist(d){}
	bool operator>(const state& s) const {
		return dist > s.dist;
	}
};

struct edge {
	int to, cost;
	edge(int t, int c):to(t), cost(c){}
};

vector<vector<edge> > es;


double dijkstra() {
	vector<vector<double> > dist(m, vector<double>(1 << n, INT_MAX));
	priority_queue<state, vector<state>, greater<state> > que;
	dist[a][0] = 0;
	que.push(state(a, 0, 0));

	while(!que.empty()) {
		const state s = que.top();
		que.pop();

		if(dist[s.city][s.used] < s.dist)
			continue;

		if(s.city == b)
			return s.dist;

		for(int i = 0; i < (int)es[s.city].size(); ++i) {
			const edge& e = es[s.city][i];
			for(int j = 0; j < n; ++j) {
				if(s.used & (1 << j))
					continue;

				const double d = s.dist + ((double)e.cost / t[j]);
				const int next_used = (s.used | (1 << j));
				if(dist[e.to][next_used] > d) {
					dist[e.to][next_used] = d;
					que.push(state(e.to, next_used, d));
				}
			}
		}
	}

	return -1;
}

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

	while(cin >> n >> m >> p >> a >> b, n) {
		--a;
		--b;

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

		es.clear();
		es.resize(m);

		for(int i = 0; i < p; ++i) {
			int x, y, z;
			cin >> x >> y >> z;
			--x;
			--y;
			es[x].push_back(edge(y, z));
			es[y].push_back(edge(x, z));
		}

		double ans = dijkstra();
		if(ans < 0)
			cout << "Impossible" << endl;
		else
			cout << ans << endl;
	}

	return EXIT_SUCCESS;
}

Measured memory_bytes: 2728
#include <bits/stdc++.h>
#define ll long long int
#define K 1000000007
using namespace std;

ll a[200001];

int main() {
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int n;
    cin>>n;
    ll sum=0;
    for(int i=0;i<n;i++)cin>>a[i], sum=(sum+a[i])%K;
    
    ll ans=0;
    for(int i=0;i<n;i++)
        sum=(sum-a[i]+K)%K , ans=(ans+ (a[i]*sum)%K)%K;
    
    cout<<ans<<endl;
    
    
    
	return 0;
}


Measured memory_bytes: 5176
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<functional>
#include<queue>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>

#define DBG cerr << '!' << endl;
#define REP(i,n) for(int (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(int (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(int (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int i = 0;i < (n);i++)cerr << v[i] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()

using namespace std;

typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;

#define INF 10000000

int dp[2][401][401];

int main()
{
	REP(k,2)REP(i,401)REP(j,401)dp[k][i][j] = INF;
	dp[0][0][0] = dp[1][0][0] = 0;
	
	int n,ma,mb;
	cin >> n >> ma >> mb;
	
	REP(v,n)
	{
		int a,b,c;
		cin >> a >> b >> c;
		REP(i,401-a)REP(j,401-b)
		{
			if(dp[v%2][i][j] != INF)
			{
				dp[(v+1)%2][i][j] = min(dp[v%2][i][j],dp[(v+1)%2][i][j]);
				dp[(v+1)%2][i+a][j+b] = min(dp[(v+1)%2][i+a][j+b],min(dp[v%2][i+a][j+b],dp[v%2][i][j] + c));
			}
		}
		
	}
	int ans = INF;
		
	rep(i,1,401)rep(j,1,401)
	{
		if(ma*j == mb*i)
			ans = min(ans,min(dp[0][i][j],dp[1][i][j]));
	}
	
	if(ans != INF)
	{
		cout << ans << endl;
	}
	else
	{
		cout << -1 << endl;
	}
	
	
	return 0;
}

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

#define MAXN 100005
#define INF 0x3f3f3f3f3f3f3f3f

typedef long long lint;


using namespace std;

int n, t, e;
lint f[MAXN], d[MAXN], v[MAXN];
deque<int> p, q;

int read() {
    char c = getchar();
    int x = 0;
    while (!isdigit(c))
        c = getchar();
    while (isdigit(c)) {
        x = (x << 3) + (x << 1) + c - '0';
        c = getchar();
    }
    return x;
}

void pushp(int x) {
    while (!p.empty() && f[x] + v[x + 1] - d[x + 1] < f[p.back()] + v[p.back() + 1] - d[p.back() + 1])
        p.pop_back();
    p.push_back(x);
}

void pushq(int x) {
    while (!q.empty() && f[x] + v[x + 1] - d[x + 1] * 3 < f[q.back()] + v[q.back() + 1] - d[q.back() + 1] * 3)
        q.pop_back();
    q.push_back(x);
}

int main() {
    n = read();
    e = read();
    t = read();
    for (int i = 1; i <= n; ++i) {
        d[i] = read();
        v[i] = d[i] - d[i - 1];
    }
    p.push_back(0);
    for (int i = 1, j; i <= n; ++i) {
        while (!p.empty() && (d[i] - d[p.front() + 1]) * 2 > t) {
            pushq(p.front());
            p.pop_front();
        }
        f[i] = INF;
        if (!p.empty()) {
            j = p.front();
            f[i] = min(f[i], f[j] + v[j + 1] - d[j + 1] + d[i] + t);
        }
        if (!q.empty()) {
            j = q.front();
            f[i] = min(f[i], f[j] + v[j + 1] - d[j + 1] * 3 + d[i] * 3);
        }
        pushp(i);
    }
    printf("%lld\n", f[n] + abs(e - d[n]));
}


Measured memory_bytes: 2816
/**
 *    Coded by : lucky_21
 *               --------Lokesh Singh
**/

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

#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
template<class T> using oset=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

#define     F           first
#define     S           second
#define     pb          push_back
#define     lb          lower_bound
#define     ub          upper_bound
#define     pii         pair<int,int>
#define     all(x)      x.begin(),x.end()
#define     fix         fixed<<setprecision(10)
#define     rep(i,a,b)  for(int i=int(a);i<=int(b);i++)
#define     repb(i,b,a) for(int i=int(b);i>=int(a);i--)
#define     FastIO      ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)

typedef double db;
typedef long long ll;

const int N=2e5+5;
const int mod=1e9+7;

int n,a[200];
signed main(){
    FastIO;
    cin>>n;
    rep(i,1,n) cin>>a[i];
    vector<pii>v;
    rep(i,1,n){
        int d=a[i];
        while(a[i+1]>=a[i]) i++;
        if(d!=a[i]) v.pb({d,a[i]});
    }
    ll ans=1000;
    for(pii p:v){
        ans=ans%p.F+1ll*ans/p.F*p.S;
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 3652
#pragma GCC optimize("O3")
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;

using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;

template <class T> inline T chmax(T &a, const T b) {return a = (a < b) ? b : a;}
template <class T> inline T chmin(T &a, const T b) {return a = (a > b) ? b : a;}

constexpr int MOD = 1e9 + 7;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
constexpr double pi = acos(-1);
constexpr double EPS = 1e-10;

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

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

    int a, b; cin>>a>>b;
    cout << max(0, a - b * 2) << endl;

    return 0;
}

Measured memory_bytes: 256
//Author: A_S_M_M@sud_P@rvez
#include<bits/stdc++.h>
using namespace std;
#define    MP ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define    for0(i,n) for(int i=0;i<n;i++)
#define    forn(i,n) for(int i=1;i<=n;i++)
#define    fors(i,s) for(int i=0;i<s.size();i++)
#define    gcd(a, b) __gcd(a , b)
#define    lcm(a,b) (a*(b/__gcd(a,b)))
#define    nl     "\n"
#define    End    return 0
#define    gt     greater<int>()
#define    ll     long long int
#define    mp     make_pair
#define    pb     push_back
#define    vi     vector<int>
#define    vl     vector<ll>
#define    mod    1000000007
#define    sp(n)  fixed<<setprecision(n)
#define    pi     acos(-1)

int main()
{
MP;

int n,m;
cin>>n>>m;
float x=(float)m/n;
if(x>4||m%2!=0||m/2<n){
    cout<<"No";
}
else {
    cout<<"Yes";
}

End;   
}


Measured memory_bytes: 3644
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>

using namespace std;
using int64 = unsigned long long;

int main() {
    int n;
    cin >> n;
    vector<int64> a(n);
    for (int i=0; i<n; i++)
        cin >> a[i];
    sort(a.begin(), a.end());
    if (a[0] == 0) {
        cout << 0 << endl;
        return 0;
    }

    int64 ans = 1;
    for (int i=0; i<n; i++) {
        if (ans > 1000000000000000000/a[i]) {
            cout << -1 << endl;
            return 0;
        }
        ans *= a[i];
    }

    cout << ans << endl;
}


Measured memory_bytes: 3612
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;


int main(){
  ll S; cin >> S;
  ll x2, x3, y2, y3;
  x2 = 1e9;
  y3 = (S-1)/(ll)pow(10, 9) + 1;
  x3 = 1;
  y2 = ((ll)pow(10,9) - S%(ll)pow(10, 9))%(ll)pow(10, 9);
  cout << 0 << " " << 0 << " " << x2 << " " << y2 << " " << x3 << " " << y3 << endl;
}
      

Measured memory_bytes: 256
for i in range(10000):
        a, op, b = input().split()
        if op == '?':
            break
        else:
            if op == '+':
                print(int(a) + int(b))
            elif op == '-':
                print(int(a) - int(b))
            elif op == '*':
                print(int(a) * int(b))
            else:
                print(int(int(a) / int(b)))


Measured memory_bytes: 5600
#include <bits/stdc++.h>
#include <string>
#define ft first
#define sc second
#define pt(sth) cout << sth << "\n"
#define chmax(a, b) (a)=max(a, b)
#define chmin(a, b) (a)=min(a, b)
#define moC(a, s, b) (a)=((a)s(b)+MOD)%MOD
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
static const ll INF=1e18;
static const ll MAX=101010;
static const ll MOD=1e9+7;

/*
 for(i=0; i<N; i++)
   cin >> a[i];
*/

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

ll dfs(vector<ll> v, ll n) {
  ll i;
  
  if(n==N) {
    ll t=0;
    for(i=0; i<Q; i++) if(v[b[i]]-v[a[i]]==c[i]) t+=d[i];
    return t;
  }
  
  ll res=0;
  for(i=(n==0) ? 1:v[n-1]; i<=M; i++) {;
    v[n]=i;
    chmax(res, dfs(v, n+1));
  }
  
  return res;
}

int main(void) {
  ll i, j, k;
  
  cin >> N >> M >> Q;
  for(i=0; i<Q; i++) {
    cin >> a[i] >> b[i] >> c[i] >> d[i];
    a[i]--; b[i]--;
  }
  
  vector<ll> v(N);
  pt(dfs(v, 0));
}
 
 


Measured memory_bytes: 3580
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#include <iterator>     
#include <iomanip>
#include <sstream>
#include <numeric>
#include <cassert>
#define INF 2000000
#define MOD 1000000007
#define sym cout<<"---------"<<endl;
#define ll long long
#define mk make_pair
#define en endl
#define RE return 0
//#define int ll
#define P pair<int,int>
using namespace std;
int dx[5]={1,0,-1,0,0},dy[5]={0,1,0,-1,0};
int gcd(int a,int b){if(a%b==0){return b;}else return gcd(b,a%b);}
int lcm(int a,int b){if(a==0){return b;} return a/gcd(a,b)*b;}    

int temp[10005];
vector<P> G[10005];  // to, dis
map<P,bool> mp;
#define pp pair<int, P>
int an[10005][405];

signed main(){
	int n,m,x; cin>>n>>m>>x;
	
	for(int i=1; i<=n; i++){
		cin>>temp[i];
		if(temp[i]==0) temp[i]=0;
		else if(temp[i]==1) temp[i]=x;
		else temp[i]=2*x;
	}
	for(int i=0; i<m; i++){
		int a,b,c; cin>>a>>b>>c;
		G[a].push_back(mk(b,c));
		G[b].push_back(mk(a,c));
	}
	
	priority_queue<pp, vector<pp>, greater<pp> > que; // dis now temp
	que.push(mk(0,mk(1,temp[1])));
	
	for(int i=0; i<10001; i++) for(int j=0; j<=401; j++) an[i][j]=INF;
	an[1][temp[1]]=0;
	while(!que.empty()){
		int d=que.top().first, now=que.top().second.first, tem=que.top().second.second; que.pop();
		if(now==n){
			cout<<d<<en;
			RE;
		}
		if(an[now][tem]<d) continue;
		for(int i=0; i<G[now].size(); i++){
			int to=G[now][i].first, dis=G[now][i].second;
			int t=temp[to];
			int j;
			if(t==0 || t==2*x){
				if(abs(t-tem)<=x+dis) j=t;
				else continue;
			}else{
				if(tem==x) j=x;
				else if(tem<x) j=(tem+dis>x) ? x:tem+dis;
				else j=(tem-dis<x) ? x:tem-dis; 
			}
			if(an[to][j]<=d+dis) continue;
			else an[to][j]=d+dis;
			que.push(mk(d+dis, mk(to, j)));
		}
	}
}





Measured memory_bytes: 19900
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
ll poww(ll a, ll n)
{
    long long ans = 1;
    while(n){
        if(n&1){
            ans = (ans * a) % mod;
        }
        a = (a * a) % mod;
        n >>= 1;
    }
    return ans;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll n;
    cin >> n;
    if(n == 1)
    {
        cout << "0\n";
        return 0;
    }
    ll sum = poww(10, n);
    sum -= poww(9,n);
    sum -= poww(9,n);
    sum += poww(8,n);
    sum = sum + mod;
    sum = sum + mod;
    sum = sum + mod;
    sum = sum % mod;
    cout << sum << "\n";
    return 0;
}


Measured memory_bytes: 3660
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn=2e5+5;
const int mod=2019;
map<int,int>mp;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin>>s;
    int n=s.size();
    mp[0]=1;
    int cnt=1;
    int x=0;
    ll ans=0;
    for(int i=n-1;i>=0;i--)
    {
        x=(s[i]-'0')*cnt+x;
        x%=mod;
        ans+=mp[x];
        mp[x]++;
        cnt=cnt*10%mod;
    }
    cout<<ans<<'\n';
    //两个数同余  x=2019*a+b,y=2019*c+b 两个数相减一定是2019的整数倍
    //https://blog.csdn.net/weixin_43872728/article/details/105779079
}


Measured memory_bytes: 3776
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		
		char[] ss = s.toCharArray();
		char[] tt = new char[s.length()];
		
		int i = 0;
		for(char c : ss) {
			if(c != 'B') {
				tt[i] = c;
				i++;
			} else if(i != 0){
				i--;
			}			
		}
		
		for(int j = 0; j < i; j++) {
			System.out.print(tt[j]);
		}
		System.out.println();

	}

}


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

int main()
{


    int n;
    cin>>n;

    int odd_cnt=0,even_cnt=0;
    for(int i=0;i<n;i++){
        int a;
        cin>>a;

        if(a%2==0)
            even_cnt++;
        else
            odd_cnt++;
    }

    
    if(odd_cnt%2==1)
        cout<<"NO"<<endl;
    else
        cout<<"YES"<<endl;

    return 0;
}


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

int main(){
    int n,k; cin >> n >> k;
    ll ans = 0;
    for(int b = k+1; b <= n; ++b){
        ans += (b-k)*(n/b);
        ans += max(0, (n%b) - k + 1);
        if(k == 0) ans--;
    }
    cout << ans;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<vector>
#include<queue>
#include<map>
#include<string>
#include <math.h>
#include<algorithm>
#include<functional>
#define ll long long
#define inf  999999999
#define pa pair<int,int>
#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b))<EPS)

using namespace std;

class Point{
	public:
	double x,y;
	Point(double x=0,double y=0):x(x),y(y) {}
	Point operator + (Point p) {return Point(x+p.x,y+p.y);}
	Point operator - (Point p) {return Point(x-p.x,y-p.y);}
	Point operator * (double a) {return Point(x*a,y*a);}
	Point operator / (double a) {return Point(x/a,y/a);}
	double abs() {return sqrt(norm());}
	double norm() {return x*x+y*y;}
	bool operator < (const Point &p) const{
		return x != p.x ? x<p.x: y<p.y;
	}
	bool operator == (const Point &p) const{
		return fabs(x-p.x)<EPS && fabs(y-p.y)<EPS;
	}
};
typedef Point Vector;

double dot(Vector a,Vector b){
	return a.x*b.x+a.y*b.y;
}
double cross(Vector a,Vector b){
	return a.x*b.y-a.y*b.x;
}

//----------------kokomade temple------------


int main(){
int n;
cin>>n;
double a1,a2,a3,a4,a5,a6,a7,a8;
Vector p,q;
for(int i=0;i<n;i++){
cin>>a1>>a2>>a3>>a4>>a5>>a6>>a7>>a8;
p.x=a3-a1;
p.y=a4-a2;
q.x=a7-a5;
q.y=a8-a6;

if(equals(dot(p,q),0.0)) cout<<"1"<<endl;
else if(equals(cross(p,q),0.0)) cout<<"2"<<endl;
else cout<<"0"<<endl;

}



return 0;
}

Measured memory_bytes: 1224
#include <iostream>
#include <cstdio>
#include <cmath>
#include <map>
#include <set>
#include <queue> 
using namespace std;
char a[200005],b[200005];
int main()
{
	string a;
	cin>>a;
	int l=a.length();
	int k=0;
	for(int i=0;i<l;)
	{
		if((a[i]==a[i+1])&&((i+1)!=l-1))
		{
			k=k+2;
			i=i+3;
		}
		else if(a[i]!=a[i+1])
		{
			i++;
			k++;
		}
		else 
		{
			k++;
			i=i+2;
		}
	}
	cout<<k;
    return 0;
}
//aa a c ca c a b aa b a b c
//a ab b aa 

Measured memory_bytes: 640
from copy import deepcopy


def gen_2017_like(limit):
    p = [1 for _ in range(limit+1)]
    p[0] = p[1] = 0

    # prime?
    for i in range(2, len(p)):
        if not p[i]: continue
        else:
           for j in range(i*2, limit+1, i):
               p[j] = 0

    a = deepcopy(p)

    # like 2017?
    for i in range(len(a)):
        target = int((i+1)/2)
        if p[i] and p[target]:
            continue
        else:
            a[i] = 0
    return a



N = int(input())
R = []
L = []

for i in range(N):
    l, r = map(int, input().split())
    R.append(r)
    L.append(l)

limit = max(R)
sum_list = gen_2017_like(limit)
S = [0]*len(sum_list)
for i, e in enumerate(sum_list[1:]):
    S[i+1] = S[i] + e

for l, r in zip(L, R):
    ans = S[r] - S[l-1]
    print(ans)


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

int main()
{
    int N, A, B, C, D;
    cin >> N >> A >> B >> C >> D;
    string S;
    cin >> S;
    int mxCD = max(C, D);
    for (int i = A; i < mxCD - 1; i++)
    {
        if (S[i] == '#' && S[i + 1] == '#')
        {
            cout << "No" << endl;
            return 0;
        }
    }
    if (C > D)
    {
        for (int i = B - 2; i < D - 1; i++)
        {
            if (S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.')
            {
                cout << "Yes" << endl;
                return 0;
            }
        }
        cout << "No" << endl;
    }
    else
    {
        cout << "Yes" << endl;
    }
}

Measured memory_bytes: 640
#define _USE_MATH_DEFINES
#define INF 10000000
#include <iostream>
#include <sstream>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>

using namespace std;

typedef long long ll;
typedef pair<int,string> P;

static const double eps = 1e-8;

int main(){
	int L;
	while(~scanf("%d",&L)){
		if(L==0) break;
		int sum=0;
		int res=INF;
		for(int i=0;i<12;i++){
			int M,N;
			scanf("%d %d",&M,&N);
			sum += M-N;
			if(sum >= L){
				res = min(i+1,res);
			}
		}

		if(res==INF) printf("NA\n");
		else printf("%d\n",res);
	}
}

Measured memory_bytes: 0
#include <stdio.h>

class Dice{
public:
	Dice(){
		number = new int[6];
		work = new int[6];
	};
	~Dice(){
		delete[] number;
		delete[] work;
	};

	void setLabel(int index,int num){
		number[index] = num;
	};

	void roll(char dst){
		for(int i = 0; i < 6; i++) work[i] = number[i];
		switch(dst){
		case 'E':
			setNumber(work[3],work[1],work[0],work[5],work[4],work[2]);
			break;
		case 'N':
			setNumber(work[1],work[5],work[2],work[3],work[0],work[4]);
			break;
		case 'S':
			setNumber(work[4],work[0],work[2],work[3],work[5],work[1]);
			break;
		case 'W':
			setNumber(work[2],work[1],work[5],work[0],work[4],work[3]);
			break;
		}
	};

	int returnPeek(){
		return number[0];
	}

private:
	void setNumber(int n0,int n1,int n2,int n3,int n4,int n5){
		number[0] = n0;
		number[1] = n1;
		number[2] = n2;
		number[3] = n3;
		number[4] = n4;
		number[5] = n5;
	}

private:
	int* number;
	int* work;
};

int main(){
	Dice dice;
	int label;
	char ch;
	for(int i = 0; i < 6; i++){
		scanf("%d",&label);
		dice.setLabel(i,label);
	}
	getchar(); 
	while((ch = getchar()) != '\n'){
		dice.roll(ch);
	}
	printf("%d\n",dice.returnPeek());
}


Measured memory_bytes: 2680
K = gets.to_i
array = ["1", "2", "3", "4", "5", "6", "7", "8", "9"]
index = -1
while(array.size <= K) do
    index += 1 
    s = array[index][-1] # -1はarray[index]の最後の文字を指す
    if s == "0" 
        array.push(array[index] + "0")
        array.push(array[index] + "1")
    elsif s == "9"
        array.push(array[index] + "8")
        array.push(array[index] + "9")
    else
        array.push(array[index] + (s.to_i - 1).to_s)
        array.push(array[index] + (s.to_i).to_s)
        array.push(array[index] + (s.to_i + 1).to_s)
    end
end
puts array[K - 1]

Measured memory_bytes: 9340
import Control.Monad ( replicateM )
import Data.Bits ( xor )

f  2 = (\a b -> [a, b]) <$> [0, 1] <*> [0, 1]
f  3 = (\a b c -> [a, b, c]) <$> [0, 1] <*> [0, 1] <*> [0, 1]
f  4 = (\a b c d -> [a, b, c, d]) <$> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1]
f  5 = (\a b c d e -> [a, b, c, d, e]) <$> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1]
f  6 = (\a b c d e f -> [a, b, c, d, e, f]) <$> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1]
f  7 = (\a b c d e f g -> [a, b, c, d, e, f, g]) <$> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1]
f  8 = (\a b c d e f g h -> [a, b, c, d, e, f, g, h]) <$> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1]
f  9 = (\a b c d e f g h i -> [a, b, c, d, e, f, g, h, i]) <$> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1]
f 10 = (\a b c d e f g h i j -> [a, b, c, d, e, f, g, h, i, j]) <$> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1] <*> [0, 1]

check :: [Int] -> Int -> [Int] -> Bool
check switches p ks = p == foldl1 xor (map (switches !!) ks)

checkAll :: [Int] -> [Int] -> [[Int]] -> Bool
checkAll switches ps kss = all (uncurry (check switches)) (zip ps kss)

main = do
    [n, m] <- map read . words <$> getLine
    kss <- replicateM m $ map read . words <$> getLine
    ps <- map read . words <$> getLine
    let switchess = f n

    print $ length $ filter (\switches -> checkAll switches ps (map (tail . map pred) kss)) switchess


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

using namespace std;

int main(){
    int T = 1;
    //cin >> T;
    while (T--){
        string n;
        cin >> n;
        if (n[n.size()-1] == '3'){
            cout << "bon" << endl;
        } else if (n[n.size()-1] == '0' or n[n.size()-1] == '1' or n[n.size()-1] == '6' or n[n.size()-1] == '8'){
            cout << "pon" << endl;
        } else {
            cout << "hon" << endl;
        }
    }
}

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

using namespace std;

int main() {

    int N; cin >> N;
    vector<int> a(N);
    for (int i = 0; i < N; ++i) cin >> a[i];

    vector<int> left(N+1, 0), right(N+1, 0);

    for(int i = 0; i < N; i++)      left[i+1] = __gcd(a[i], left[i]);
    for(int i = N - 1; i >= 0; i--) right[i]  = __gcd(a[i], right[i+1]);


    // for (int i = 0; i < N; ++i) cout << left[i] << endl;
    // cout << endl;
    // for (int i = 0; i < N; ++i) cout << right[i] << endl;
    // cout << endl;

    int res = 0;
    for (int i = 0; i < N; ++i) {
        int l = left[i];
        int r = right[i+1];

        res = max(__gcd(l,r), res);
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 4568
//状态:
//题号:
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <ctime>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <map>
#include <iomanip>
#include <cassert>
#include <complex>
#include <functional>
#include <list>
#include <cmath>
using namespace std;
double a,b,c;
int main(){
	cin>>a>>b>>c;
	double s1=a-c,s2=b-1,s3=a*a;
	if(c==0)printf("%.10f",(b-1)/a);
	else printf("%.10f",(s1*s2*2)/s3);
	return 0;
}


Measured memory_bytes: 256
class Node
  attr_accessor :index, :list, :double

  def initialize(num_list)
    @list = num_list.dup
    @index = 0
    @double = false
  end

  def check
    @list.all?(&:zero?) && @double
  end

  def initialize_copy(orig)
    @list = orig.list.dup
    @double = orig.double
    @index = orig.index
  end

  def is_valid?
    !@list.find{|e| e > 4 }
  end
end

class Solver
  def initialize

    loop do
      number = gets

      break if number.nil?

      answer = []

      1.upto(9) do |num|
        if solver(number.chomp, num)
          answer << num
        end
      end

      puts answer.empty? ? 0 : answer.join(' ')
    end
  end

  def queue(list)
    res = Array.new(9, 0)

    list.each do |num|
      res[num-1] += 1
    end

    res
  end

  def solver(number, num)
    list = number.chars.map(&:to_i) + [num]

    num_list = queue(list)

    que = [Node.new(num_list)]

    while !que.empty?
      node = que.shift

      next unless node.is_valid?

      index = node.index

      return true if node.check
      next if index >= 9 || node.list[index] < 0

      if node.list[index] >= 3
        n = node.dup
        n.list[index] -= 3

        n.index += 1 if n.list[index].zero?
        que.push(n)
      end

      if node.list[index] >= 2 && !node.double
        n = node.dup
        n.list[index] -= 2
        n.double = true

        n.index += 1 if n.list[index].zero?
        que.push(n)
      end

      if node.list[index] >= 1 && node.index < 7
        n = node.dup
        n.list[index] -= 1
        n.list[index+1] -= 1
        n.list[index+2] -= 1

        n.index += 1 if n.list[index].zero?
        que.push(n)
      end

      if node.list[index].zero?
        n = node.dup
        n.index += 1
        que.push(n)
      end
    end

    false
  end
end

Solver.new

Measured memory_bytes: 6144
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-6;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
pair<int,int> v[210000];
int p[210000];
int q[210000];
int x[210000];
int sz;
int solve(int a,int b){
	if(a>=b)return 1;
//	printf("%d %d\n",a,b);
	int t=x[a];
	int A=a;
	int B=b;
	if(A>B)B+=sz;
	if(!(A<=t&&t<B)&&!(A<=t+sz&&t+sz<B))return 0;
	if(solve(a+1,t)&&solve(t+1,b))return 1;
	return 0;
}
int main(){
	int a,b,c;scanf("%d%d%d",&a,&b,&c);
	for(int i=0;i<c;i++){
		int X1,Y1,X2,Y2;
		scanf("%d%d%d%d",&X1,&Y1,&X2,&Y2);
		bool ok=true;
		if(X1!=0&&X1!=a&&Y1!=0&&Y1!=b)ok=false;
		if(X2!=0&&X2!=a&&Y2!=0&&Y2!=b)ok=false;
		if(ok){
			int t1=0;
			if(X1==0)t1=Y1;
			else if(Y1==b)t1=b+X1;
			else if(X1==a)t1=a+b+(b-Y1);
			else t1=a+b+b+a-X1;
			int t2=0;
			if(X2==0)t2=Y2;
			else if(Y2==b)t2=b+X2;
			else if(X2==a)t2=a+b+(b-Y2);
			else t2=a+b+b+a-X2;
			v[sz++]=make_pair(t1,i);
			v[sz++]=make_pair(t2,i);
		//	printf("%d %d %d\n",i,t1,t2);
		}
	}
	for(int i=0;i<210000;i++)p[i]=q[i]=-1;
	std::sort(v,v+sz);
	for(int i=0;i<sz;i++){
		if(p[v[i].second]==-1){
			p[v[i].second]=i;
		}else q[v[i].second]=i;
	}
	for(int i=0;i<sz;i++){
		int f=v[i].second;
		if(p[f]==i)x[i]=q[f];
		else x[i]=p[f];
//		printf("%d\n",x[i]);
	}
	int ret=solve(0,sz);
	if(ret)printf("YES\n");
	else printf("NO\n");
}

Measured memory_bytes: 6144
def bos(a, b)
	if (a > b)
		return "a > b"
	elsif (a < b)
		return "a < b"
	else
		return "a == b"
	end
end

input = gets.to_s
a, b = input.split(' ').map(&:to_i)
puts bos(a, b)

Measured memory_bytes: 8576
#include<iostream>
#include<string>
#include<vector>
#include<math.h>
#include<map>
#include<algorithm>
#include<set>
#include <stdexcept>
#include<queue>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
typedef long long ll;
typedef pair<int,int> P;
int ceil(int a,int b){// a以上でbの倍数の最小値を出力//
     return (a+b-1)/b*b;
}
int stoii(string s){//stoi関数の代用 文字列を数値として読み取りint型に変換//
    return atoi(s.c_str());
}
int L,p,N;
int A[10010],B[10010];
int main(){
    int n=0;
    int sum=0;
    for(int i=1;i<=999;i++){
        if(i%3==0) sum+=200;
        else sum+=195;
    }
    sum++;
    cin>>n;
    int y,m,d;
    for(int i=0;i<n;i++){
        int sum2=0;
        cin>>y>>m>>d;
        for(int j=1;j<=y-1;j++){
            if(j%3==0) sum2+=200;
            else sum2+=195;
        }
        if(y%3!=0){
            for(int k=1;k<=m-1;k++){
                if(k%2==0) sum2+=19;
                else sum2+=20;
            }
        }
        else{
            sum2+=(m-1)*20;        
        }
        sum2+=d;
        cout<<sum-sum2<<endl;
    }
    return 0;
}




Measured memory_bytes: 3080
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (n); ++i)
int main(){
  int n;
  std::cin >> n;
  bool flag=true;
  rep(i,n){
    int temp;
    std::cin >> temp;
    if(temp%2==0){
      if(temp%3==0);
      else if(temp%5==0);
      else flag=false;

    }
  }
  if(flag==true)std::cout << "APPROVED" << '\n';
  else std::cout << "DENIED" << '\n';
  return 0;


}


Measured memory_bytes: 256
from math import gcd

n = int(input())
ab = [map(int, input().split()) for _ in range(n)]
mod = 1000000007

pair = []
d = {}
d[0] = {}
d[0][0] = 0

for a, b in ab:
   x = gcd(a, b)
   if x != 0:
      a //= x
      b //= x
   pair.append((a, b))

   d.setdefault(a, {})
   d[a].setdefault(b, 0)
   d[a][b] += 1
used = set()
ans = 1
for a, b in pair:
   if (a, b) in used:
      continue
   used.add((a, b))

   if a == 0 and b == 0:
      continue

   i = d[a][b]
   j, k, l = 0, 0, 0
   if -a in d and -b in d[-a]:
      j = d[-a][-b]
      used.add((-a, -b))
   if -b in d and a in d[-b]:
      k = d[-b][a]
      used.add((-b, a))
   if b in d and -a in d[b]:
      l = d[b][-a]
      used.add((b, -a))

   ans *= pow(2, i+j, mod) + pow(2, k+l, mod) - 1
   ans %= mod

ans += d[0][0] - 1
ans %= mod
print(ans)


Measured memory_bytes: 151332
n, m = map(int, input().split())

class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

uf = UnionFind(n)
for _ in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    uf.union(a, b)
print(uf.group_count() - 1)


Measured memory_bytes: 74972
#include<bits/stdc++.h>
using namespace std;
int main()
{ 
  int n,sum = 0;
  cin>>n;
  int a[n];
  for(int i = 0;i<n;i++)
  {
    cin>>a[i];
  }
  sort(a,a+n);
  
  for(int i = 0;i<n-1;i++)
  {
    sum = sum + a[i];
  }
  
  if(a[n-1]<sum)
  cout<<"Yes"<<endl;
  else if(a[n-1]>=sum)
  cout<<"No"<<endl;
}


Measured memory_bytes: 3640
#include "bits/stdc++.h"

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i,n) for(ll i=1;i<=(ll)(n);i++)
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define rrep1(i,n) for(ll i=(ll)(n);i>0;i--)
#define REP(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
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 (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = 2e18;
const ll MOD = 1000000007;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0, -1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);

vl a;

bool cmp(int i, int j) {
  return a[i] > a[j];
}

int main () {
  int n;
  cin >> n;
  a.resize(1 << n);
  rep (i, 1 << n) {
    cin >> a[i];
  }

  a.push_back(-1);
  vll ma(2, vl(1 << n, 1 << n));
  rep (i, 1 << n) {
    ma[0][i] = i;
  }

  rep (i, n) {
    rep (j, 1 << n) {
      if (j & (1 << i)) {
        //DEBUG(j);
        vi idx(4);
        idx[0] = ma[0][j];
        idx[1] = ma[1][j];
        idx[2] = ma[0][j ^ (1 << i)];
        idx[3] = ma[1][j ^ (1 << i)];
        sort(all(idx), cmp);
        //DEBUG_VEC(idx);
        ma[0][j] = idx[0];
        ma[1][j] = idx[1];
      }
    }
  }
  ll ans = 0;
  rep1 (i, (1 << n) - 1) {
    chmax(ans, a[ma[0][i]] + a[ma[1][i]]);
    cout << ans << endl;
  }
}


Measured memory_bytes: 13180