akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

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

int main() {
  ll a, b, k;
  cin >> a >> b >> k;

  if (k <= a) {
    cout << a - k << " " << b << endl;
    return 0;
  }

  if (k <= a + b) {
    cout << "0"
         << " " << b - (k - a) << endl;
    return 0;
  }

  if (k >= a + b) {
    cout << "0"
         << " "
         << "0" << endl;
    return 0;
  }

  return 0;
}


Measured memory_bytes: 768
#include <bits/stdc++.h> //JuniorMonster a.k.a Sho10
#define ll long long int
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#define all(a) (a).begin(), (a).end()
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define sz size
#define f first
#define s second
#define pb push_back
#define er erase
#define in insert
#define mp make_pair
#define pi pair
#define rc(s) return cout<<s,0
#define mod 1000000007
#define PI 3.14159265359
#define CODE_START  ios_base::sync_with_stdio();cin.tie();cout.tie();
using namespace std;
ll n;
double a[1000],s=0;
int32_t main(){
    cout<<fixed;
    cin>>n;
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
        s=s+1/a[i];
    }
    cout<<setprecision(6)<<1/s<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
ll t; t =1;
while(t--){
ll n; cin >> n;
	ll count = 0;
	for(int i = 1; i < n; i++){
		count += (n/i);
		count -= (n%i == 0)?1:0;
		// cout<<count<< " i "<<i<<endl;
	}
	cout<<count;
}
return 0;}

Measured memory_bytes: 3632
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "math.h"
#include "utility"
#include "string"
#include "map"
#include "unordered_map"
#include "iomanip"
#include "random"

using namespace std;
const long long int MOD = 1000000007;

long long int power(long long int x, long long int n, long long int M) {
	long long int tmp = 1;

	if (n > 0) {
		tmp = power(x, n / 2, M);
		if (n % 2 == 0) tmp = (tmp*tmp) % M;
		else tmp = (((tmp*tmp) % M)*x) % M;
	}
	return tmp;
}

long long int N, M, K, Q, W, H, L, R;
long long int ans;

using namespace std;

int main() {
	ios::sync_with_stdio(false);
	cin >> N;
	list<int>edge[100001];
	for (int i = 0; i < N - 1; i++) {
		int a, b;
		cin >> a >> b;
		edge[a].push_back(b);
		edge[b].push_back(a);
	}
	vector<int>dis(N + 1, 1000000);
	dis[1] = 0;
	queue<int>Q;
	Q.push(1);
	while (!Q.empty()) {
		int c = Q.front();
		for (auto i : edge[c]) {
			if (dis[c] + 1 < dis[i]) {
				dis[i] = dis[c] + 1;
				Q.push(i);
			}
		}
		Q.pop();
	}
	vector<int>dist(N + 1, 1000000);
	dist[N] = 0;
	Q.push(N);
	while (!Q.empty()) {
		int c = Q.front();
		for (auto i : edge[c]) {
			if (dist[c] + 1 < dist[i]) {
				dist[i] = dist[c] + 1;
				Q.push(i);
			}
		}
		Q.pop();
	}
	int box = 1;
	int nbox = N;
	for (int i = 2; i < N; i++) {
		if (dis[i] == dis[N] / 2 && dist[i] == (dis[N] + 1) / 2)box = i;
		if (dis[i] == dis[N] / 2 + 1 && dist[i] == (dis[N] - 1) / 2)nbox = i;
	}
	vector<int>bag(N + 1, 1000000);
	bag[1] = 0;
	Q.push(1);
	while (!Q.empty()) {
		ans++;
		int c = Q.front();
		for (auto i : edge[c]) {
			if (i == nbox)continue;
			if (bag[c] + 1 < bag[i]) {
				bag[i] = bag[c] + 1;
				Q.push(i);
			}
		}
		Q.pop();
	}
	if (ans > N - ans) {
		cout << "Fennec\n";
	}
	else cout << "Snuke\n";
	return 0;
}


Measured memory_bytes: 9216
import sys
from collections import defaultdict
sys.setrecursionlimit(10**6)
readline = sys.stdin.readline

n, q = map(int, readline().split())
G = defaultdict(list)
for _ in range(n-1):
    a, b = map(int, readline().split())
    G[a-1].append(b-1)
    G[b-1].append(a-1)
count = [0] * n
for _ in range(q):
    p, x = map(int, readline().split())
    count[p-1] += x


def dfs(root, x):
    ans[root] = count[root] + x
    for i in G[root]:
        if ans[i] == -1:
            dfs(i, ans[root])


ans = [-1] * n
dfs(0, 0)
print(*ans)


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

int n;
string s;

int getx(int mod){
  ll x = 0, two = 1;
  rep(i, n){
    x = (x + two * (int)(s[n - 1 - i] - '0')) % mod;
    two = (two * 2) % mod;
  }

  return x;
}

int popcount(int x){
  int ret = 0;
  while(x > 0){
    ret += x&1;
    x = x>>1;
  }
  return ret;
}

int main(){

  cin >> n;
  cin >> s;
  int pc = 0;
  rep(i, n){
    if(s[i] == '1') pc++;
  }

  int pc0 = pc + 1, pc1 = pc - 1, x0, x1, two0 = 1, two1 = 1;

  x0 = getx(pc0);
  if(pc1 == 0) x1 = 0;
  else x1 = getx(pc1);

  //cout << x0 << " " << x1 << endl;

  int x[n];
  vector<int> ans(n, 0);

  for(int i = n - 1; i >= 0; i--){
    if(s[i] == '0'){
      //cout << x0 + two0 << endl;
      x[i] = (x0 + two0) % pc0;
      if(x[i] < 0) x[i] += pc0;
    }
    else{
      //cout << x1 - two1 << endl;
      if(pc1 == 0){
        x[i] = 0;
        ans[i] = -1;
      }
      else x[i] = (x1 - two1) % pc1;
      if(x[i] < 0) x[i] += pc1;
    }
    two0 = (two0 * 2) % pc0;
    if(pc1 == 0) two1 = 0;
    else two1 = (two1 * 2) % pc1;
  }


  rep(i, n){
    int t = x[i];
    while(t != 0){
      t %= popcount(t);
      ans[i]++;
    }
    ans[i]++;
  }

  rep(i, n){
    cout << ans[i] << endl;
  }




  return 0;
}


Measured memory_bytes: 5216
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int gcd(int a,int b)
{
	if(a%b==0)
		return  b;
	else
	{
	 	return gcd( b,a%b);
	}
}
int main()
{
	int k;
	cin>>k;
	int sum=0;
	for(int i=1;i<=k;i++)
	{
		for(int j=1;j<=k;j++)
		{
			int s=gcd(i,j);
			for(int h=1;h<=k;h++)
			{
				sum+=gcd(s,h);
			}
		}
	}
	cout<<sum<<endl;
	return 0;
} 

Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define FIND(s, e) ((s).find(e) != (s).end())
#define EB emplace_back

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

void solve(int N) {
    vector<bool> ok(N + 1, true);
    ok[1] = false;
    REP(i, N + 1) {
        if (!(i % 7 == 1 || i % 7 == 6)) {
            ok[i] = false;
        }
    }
    for (int i = 2; i * i <= N; i++) if (ok[i]) {
        for (int j = i * 2; j <= N; j += i) {
            ok[j] = false;
        }
    }
    cout << N << ":";
    FOR(i, 1, N + 1) {
        if (ok[i] && N % i == 0) cout << " " << i;
    }cout << endl;
    return;
}

signed main(void) {
    int n, m, p, a, b, c, x, y, z, q;
    string s;
    bool f = false;
    while (cin >> n, n != 1) {
        solve(n);
        //return 0;
    }
}

Measured memory_bytes: 3136
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
int main(void){
    int n;
    ll a[100000],b[100000],c=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i]>>b[i];
    }
    for(int i=n-1;i>=0;i--){
        c+=(b[i]-((a[i]+c)%b[i]))%b[i];
    }
    cout<<c<<endl;
}


Measured memory_bytes: 1792
def input():
    import sys
    return sys.stdin.readline().rstrip()


def main():
    import math
    import collections
    import itertools

    a, b = map(int, input().split())
    if a <= 9 and b <= 9:
        print(a * b)
    else:
        print(-1)



if __name__ == '__main__':
    main()

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

#define REP(i ,n) for(ll i=0 ;i < n; i++)
#define REPB(i ,n) for(ll i=n; i >= 0; i--)
#define FOR(i ,m ,n) for(ll i=m; i < n; i++)
#define FORB(i, m, n) for(ll i=m; i>= n; i--)
#define ll long long
#define pb push_back
#define popb pop_back
#define debug(i) cout << i << endl
using namespace std;
ll x, y, z, K;
vector<ll> a;
vector<ll> b;
vector<ll> c;
vector<ll> ans1;
vector<ll> ans2;
ll count = 0;

void recall(){
  REP(i,x){
    REP(j, y){
      REP(k,z){
        if(i * j * k > K) break;
        ans2.pb(a[i] + b[j] + c[k]);
       }
    }
  }
    sort(ans2.begin(), ans2.end(), greater<ll>());
  }

int main(){
  ll lt;
  cin >> x >> y >> z >> K;
  REP(i, x){
    cin >> lt;
    a.pb(lt);
        }

    REP(i, y){
        cin >> lt;
        b.pb(lt);
      }

      REP(i, z){
          cin >> lt;
          c.pb(lt);
        }
        
        sort(a.begin(), a.end(), greater<ll>());
        sort(b.begin(), b.end(), greater<ll>());
        sort(c.begin(), c.end(), greater<ll>());
        recall();
        REP(i, K) cout << ans2[i] << endl;
        return 0;
}


Measured memory_bytes: 34928
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<string.h>
#include<algorithm>
#include<climits>
using namespace std;

int main() {
  int ans=0;
  int X = 0;
  int N = 0;
  string s;
  int breakflg=0;
  int cnt = 0;
  int maxcnt = 0;
  int loopcnt = 0;

  cin >> s;

  for(int i = 0; i < s.length(); i++){
    loopcnt = i;
    while(breakflg == 0){
      if(s[loopcnt] == 'A'
         || s[loopcnt] == 'C'
         || s[loopcnt] == 'T'
         || s[loopcnt] == 'G'){
        cnt++;
        loopcnt++;
      }else{
        breakflg++;
      }
    }
    maxcnt = max(maxcnt, cnt);
    breakflg = 0;
    loopcnt = 0;
    cnt = 0;
  }

  cout << maxcnt << endl;
}


Measured memory_bytes: 256
// エイシングプログラミングコンテスト2020-B
#include <bits/stdc++.h>
#define endl "\n"
#define rep(i,n) for(int i=0;i<int(n);i++)
#define e_b emplace_back
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> ipair;
typedef pair<ll,ll> lpair;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v) //vectorの中身を見る
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}
void map_p(map<int,int>& d){cout<<"map: ";for(auto a : d){cout<<"{"<<a.first<<":"<<a.second<<"}";}cout<<endl;} //mapの中身を見る
void set_p(set<int>& d){cout<<"set: ";for(int a : d){cout<<a<<" ";}cout<<endl;} //setの中身を見る


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(12);

    int n,ans=0;
    cin>>n;
    for(int i=1;i<=n;i++){
        int now;
        cin>>now;
        if(i%2==1 && now%2==1) ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3652
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
#include <random>
#include <string.h>
#include <cmath>
#include <unordered_map>
#include <cstdio>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long ll;

ll gcd(ll x, ll y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}
ll kai(ll x, ll y, ll m) {
	ll res = 1;
	for (ll i = x - y + 1; i <= x; i++) {
		res *= i; res %= m;
	}
	return res;
}
ll mod_pow(ll x, ll y, ll m) {
	ll res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

ll comb(ll x, ll y, ll m) {
	if (y > x)return 0;
	return kai(x, y, m) * mod_pow(kai(y, y, m), m - 2, m) % m;
}

int n, a[100010];
vector<int> vec[100010];
map<pair<int, int>, ll> cum, cum2;
ll ans;

signed main() {
	std::random_device rnd;
	std::mt19937_64 mt(rnd());
	cin >> n;
	for (int i = 0; i < n; i++)cin >> a[i];
	for (int i = 1; i <= n; i++) {
		for (int j = i; j < n; j += i)cum[make_pair(i, j)] = cum[make_pair(i, j - i)] + a[j];
		for (int j = n - 1; j >= 0; j -= i)cum2[make_pair(i, j)] = cum2[make_pair(i, j + i)] + a[j];
	}
	for (int i = 1; i <= n; i++)for (int j = i; j <= n; j += i)vec[j].push_back(i);
	for (int i = 1; i < n; i++) {
		int k = n - 1 - i;
		for (int j = 0; j < (int)vec[k].size(); j++) {
			if (i <= vec[k][j] || (i <= k && (k - i) % vec[k][j] == 0))continue;
			ans = max(ans, cum[make_pair(vec[k][j], k)] + cum2[make_pair(vec[k][j], i)]);
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 178960
import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline

in_n = lambda: int(readline())
in_nn = lambda: map(int, readline().split())
in_s = lambda: readline().rstrip().decode('utf-8')


def main():

    N = in_n()
    A = sorted(list(in_nn()))

    maxA = max(A)
    ans = [True] * (maxA + 1)
    d = set()

    for i in range(N):
        if A[i] in d:
            ans[A[i]] = False
        for j in range(A[i] * 2, maxA + 1, A[i]):
            if not j:
                break
            else:
                ans[j] = False
        d |= {A[i]}

    count = 0
    for i in range(N):
        count += ans[A[i]]

    print(count)


if __name__ == '__main__':
    main()


Measured memory_bytes: 40056
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
#include<stdio.h>
#include<cmath>
#include<limits>
#include<iomanip>

using namespace std;

template <class T> using V = vector<T>;

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

const long long INF = 1LL << 60;

using ll = long long;
using db = long double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
using graph = V<V<int>>;
using pq = priority_queue<ll>;



#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>=(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define pb(a) push_back(a);



ll Sum(ll n) {
ll m=0;
  while(n){
    m+=n%10;
    n/=10;
  }
  return m;
}



const int MAX = 510000;
const int MOD = 1000000007;
 
long long fac[MAX], finv[MAX], inv[MAX];
 
void Comuse() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}


#define comuse Comuse()

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

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


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


vll div(ll n){
  vll ret;
  for(ll i=1;i*i<=n;i++){
    if(n%i==0){
      ret.push_back(i);
      if(i*i!=n){
        ret.push_back(n/i);
      }
    }
  }
  SORT(ret);
  return (ret);
}

ll modpow(ll a,ll n,ll mod){
  ll ans=1;
  while(n>0){
    if(n&1){
      ans=ans*a%mod;
    }

    a=a*a%mod;
    
    n>>=1;
  }

  return ans;
}

void Solve();


const int MAX_N = 131072;
//segment tree 
int NN;
int seg[MAX_N*2-1];
void seguse(){
  for(int i=0;i<2*NN-1;i++){
    seg[i]=INT_MAX;
  }
}

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<setprecision(20)<<fixed;
  Solve();
}


/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
//segtreeの葉の先頭の添え字はn-1
void Solve(){
  ll n;
    cin>>n;
  st s;
    cin>>s;
  ll m=s.sz;
  FOR(i,0,m){
    ll a=s[i]-'A';
    a+=n;
    a%=26;
    s[i]=a+'A';
  }

  cout<<s<<endl;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
typedef long long ll;
#include <bits/stdc++.h>

using namespace std;

ll mod = 1000000007;

template<class Type> inline bool chmax(Type& a, Type b) { if (a < b) { a = b; return 1; } return 0; }
template<class Type> inline bool chmin(Type& a, Type b) { if (a > b) { a = b; return 1; } return 0; }

template<class Type>
Type modpow(Type a, Type n, Type mod)
{
	Type res = 1;
	while (0 < n)
	{
		if (n & 1)
		{
			res = res * a % mod;
		}
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

template<class Type>
Type gcd(Type x, Type y)
{
	Type r;
	if (x < y)
	{
		swap(x, y);
	}

	while (0 < y)
	{
		r = x % y;
		x = y;
		y = r;
	}
	return x;
}

template<class Type>
bool isPrime(Type x)
{
	if (x == 2) return true;
	if (x < 2 || x % 2 == 0) return false;

	for (Type i = 3; i <= sqrt(x); i += 2)
	{
		if (x % i == 0) return false;
	}
	return true;
}

template<class Type>
vector<bool> eratos(Type n)
{
	vector<bool> isPrime(n + 1, true);
	isPrime[0] = isPrime[1] = false;
	for (Type i = 2; i <= n; i++)
	{
		if (isPrime[i])
		{
			Type j = i + i;
			while (j <= n)
			{
				isPrime[j] = false;
				j = j + i;
			}
		}
	}
	return isPrime;
}

bool binarySearchJudge(vector<int> a, int index, int key)
{
	if (key <= a[index]) return true;
	else return false;
}

int binarySearch(vector<int> a, int key)
{
	int ng = -1;
	int ok = a.size();
	while (1 < abs(ng - ok))
	{
		int mid = (ng + ok) / 2;
		if (binarySearchJudge(a, mid, key)) ok = mid;
		else ng = mid;
	}
	return a[ok] == key;
}

int main()
{
	int n, m;
	cin >> n >> m;
	vector<ll> caseNum(n + 1, 1);
	caseNum[0] = 1;
	caseNum[1] = 1;

	vector<int> a(m);
	for (int i = 0; i < m; i++)
	{
		cin >> a[i];
		caseNum[a[i]] = 0;
	}
	
	for (int i = 2; i <= n; i++)
	{
		if (caseNum[i] != 0)
		{
			caseNum[i] = (caseNum[i - 2] + caseNum[i - 1]) % mod;
		}
	}
	cout << caseNum[n] << endl;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pr;
typedef vector<ll> vc;
#define pb push_back
#define rep(i,a,b) for(ll i=a;i<=b;i++)
#define repr(i,a,b) for(ll i=a;i>=b;i--)
#define reps(i,v) for(ll i=0;i<v.size();i++)

int main() {
    // your code goes here
    double r;
    cin >> r;
    cout << setprecision(13) << 2.0*r*3.1415926536 << endl;
    return 0;
}

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

int main() {
  int a , b , c , d  ;
  cin >> a >> b >> c >> d ;
  
  int e , f ;
  
  e = a + b ;
  f = c + d ;
  
  if(e < f) {
    cout << "Right" << endl;
  }
  
  if(e == f) {
    cout << "Balanced" << endl;
  }
  
  if(e > f) {
    cout << "Left" << endl;
  }
  
}

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

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define repr(i,a,b) for(int i=(a); i>=(b); i--)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef pair<int,int> P;
const int INF=1<<29;

ll N,X;

ll solve(int N,ll X){
    if(X==0)return 0;
    if(N==0)return 1;
    
    if(X>=(1LL<<(N+1))-1){
        return (1LL<<N) + solve(N-1,X+1-(1LL<<(N+1)));
    }
    return solve(N-1,X-1);
}

int main(){
    
    cin>>N>>X;
    
    cout<<solve(N,X)<<endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  char input;
  
  cin >> input;
  
  if(input == 'a' || input == 'i' || 
    input == 'u' || input == 'e' || input == 'o'){
  	cout << "vowel" << endl;
  }else{
  	cout << "consonant" << endl;
  }
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
#define ll long long
#define LL long long
#define MOD 1000000007
#define INF 2000000000000
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
ll N, M, K, H, W, L, R, l, r, u, sum, X;
LL ans=0;
LL no;

string s, t;



int main() {
	cin >> N >> M>>X;
	ans = INF;
	vector<LL> C(N), B(M),Z(M,0);
	vector<vector<LL>> A(N,vector<LL>(M));
	for (int i = 0; i < N; i++) {
		cin >> C[i];
		for (int j = 0; j < M; j++){
			cin >> A[i][j];
	}
}
	for (int bit = 0; bit < (1 << N); bit++) {
		B = Z;
		sum = 0;
		for (int i = 0; i < N; i++) {
			if (bit&(1 << i)) {
				sum += C[i];
				for (int j = 0; j < M; j++) {
					B[j] += A[i][j];
				}
			}
		}
		sort(B.begin(), B.end());
		if (B[0] >= X)ans = min(ans, sum);
	}
	if (ans == INF)ans = -1;
	cout << ans<<endl;
	return 0;
}



Measured memory_bytes: 3604
from sys import exit, stdin

class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n)]
        self.rank = [0]*n
        self.size = [1]*n

    def find_root(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find_root(self.par[x])
            return self.par[x]
    
    def merge(self, x, y):
        x, y = self.find_root(x), self.find_root(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
            self.size[y] += self.size[x]
        else:
            self.par[y] = x
            self.size[x] += self.size[y]
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    def issame(self, x, y):
        return self.find_root(x) == self.find_root(y)

    def get_size(self, x):
        x = self.find_root(x)
        return self.size[x]

N, M = [int(_) for _ in stdin.readline().rstrip().split()]

uf = UnionFind(N)
AB = [list(map(int, stdin.readline().rstrip().split())) for _ in range(M)]
AB = AB[::-1]

for i in range(M):
    AB[i] = (AB[i][0]-1, AB[i][1]-1)

ans = []
for i in range(M):
    fi = uf.find_root(AB[i][0])
    se = uf.find_root(AB[i][1])
    if fi == se:
        ans.append(0)
    else:
        ans.append(uf.get_size(fi)*uf.get_size(se))
        uf.merge(fi, se)

score = 0
for i in range(M):
    score += ans[M-1-i]
    print(score)

Measured memory_bytes: 34220
#include <iostream>
using namespace std;
int main()
{
    int t=0;
    while(1){
        int a,b,count=0;
        cin>>a>>b;
        if(a==0&&b==0)return 0;
        if(t!=0)cout<<endl;
        for(;a<=b;++a){
            if(a%4==0){
                if(a%100==0){
                    if(a%400==0){
                        cout<<a<<endl;++count;continue;
                        }
                        continue;
                }
                cout<<a<<endl;
                ++count;
            }
        }
        if(count==0)cout<<"NA"<<endl;
        t++;
    }
}

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

using i64 = long long;
using P = pair<i64, i64>;

#define overload3(_1, _2, _3, name, ...) name
#define rep1(i, n) for(i64 i = 0LL; i < (n); ++i)
#define rep2(i, a, b) for(i64 i = (a); i < (b); ++i)
#define rep(...) overload3(__VA_ARGS__, rep2, rep1)(__VA_ARGS__)
#define all(v) v.begin(), v.end()


void solve(long long A, long long B, long long C, long long D, long long E, long long F){
    vector<bool> w(31), s(3010);
    w[0] = s[0] = true;
    rep(i, 1, 31){
        if(i - A >= 0) w[i] = w[i] || w[i - A];
        if(i - B >= 0) w[i] = w[i] || w[i - B];
    }
    rep(i, 1, 3010){
        if(i - C >= 0) s[i] = s[i] || s[i - C];
        if(i - D >= 0) s[i] = s[i] || s[i - D];
    }
    i64 water = 100 * A, sugar = 0;
    double p = 0;
    rep(i, 1, 31){
        if(!w[i]) continue;
        i64 ww = 100 * i;
        i64 r = min(F - ww, i * E);
        for(i64 j = r; j >= 0; --j){
            if(s[j]){
                if(p < (double)(100 * j) / (double)(ww + j)){
                    p = (double)(100 * j) / (double)(ww + j);
                    water = ww; sugar = j;
                    break;
                }
            }
        }
    }
    cout << water + sugar << " " << sugar << endl;
}

struct IoSetup {
    IoSetup() {
        // cin.tie(nullptr);
        // ios::sync_with_stdio(false);
        cout << fixed << setprecision(10);
        cerr << fixed << setprecision(10);
    }
} iosetup;

int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long C;
    scanf("%lld",&C);
    long long D;
    scanf("%lld",&D);
    long long E;
    scanf("%lld",&E);
    long long F;
    scanf("%lld",&F);
    solve(A, B, C, D, E, F);
    return 0;
}


Measured memory_bytes: 256
use proconio::input;

fn main() {
	input!(n: usize);
	input!(m: usize);

//	let mut tn = n;
	let mut tm = m;
	
	if m < 2 {
		println!("0");
		return;	
	} 
	if n >= m / 2 {
		println!("{}", m / 2);
		return;
	}
	let d: usize = ((m+1)/2)-n;
//	tn += d/2;
	tm -= d;
	println!("{}", tm / 2);
}



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

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

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

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

//struct edge {int from, to, cost;};

constexpr double EPS = 1e-10;
constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;

template<class T> inline T sqr(T x) {return x*x;}

void solve() {
   int h,w,d;
   cin >> h >> w >> d;
   VVI a(h, VI(w));
   int n = h * w;
   VP pos(n+1);
   REP(i,0,h) REP(j,0,w) {
       cin >> a[i][j];
       pos[a[i][j]] = MP(i, j);
   }
   VI ru(n+1);
   REP(i,d+1,n+1) {
       ru[i] = ru[i-d] + abs(pos[i].first - pos[i-d].first) + abs(pos[i].second - pos[i-d].second);
   }
   int q;
   cin >> q;
   int l, r;
   REP(i,0,q) {
       cin >> l >> r;
       cout << ru[r] - ru[l] << endl;
   }
}

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


Measured memory_bytes: 2560
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cmath>
#include <iomanip>
#include <bitset>
#include <string>
#include <stdlib.h>
using namespace std;
//cout <<  << endl;
typedef long long int ll;
typedef long double ld;
typedef vector<ll> vl;
int main() {
    ll  a,b,c;
    cin >> a >> b >> c;
    if (a==b && b==c){
        cout << "Yes" << endl;
        return 0;
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
//----------------------------おまじない
#pragma GCC optimize ("O3")
#pragma GCC target ("tune=native")
#pragma GCC target ("avx")
//----------------------------
#define FOR(i,j,n) for (int i=(j);i<(n);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define REPN(i,n) for (int i=(n);i>0;i--)
#define I(n) scanf("%d", &(n))
#define LL(n) scanf("%lld", &(n))
#define pb(n) push_back((n))
#define mp(i,j) make_pair((i),(j))
#define eb(i,j) emplace_back((i),(j))
#include <bits/stdc++.h>
using namespace std;
//------------------------------typedef集
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
typedef vector<vi> vvi;
typedef vector<vpi> vvpi;
typedef vector<vvi> vvvi;
typedef long long ll;
const int mod = 1000000009;

int n;
string s;
int q;
int k[100];

vi di,mi,ci;

struct SegmentTree {
private:
    int n;
    vi node;

public:
    SegmentTree(vi v) {
        int sz = v.size();
        n = 1; while(n < sz) n *= 2;
        node.resize(2*n-1, INT_MAX);
        REP(i,sz) node[i+n-1] = v[i];
        REPN(i,n-2) node[i] = (node[2*i+1] + node[2*i+2]);
    }
    void update(int k, int x){
        k += n-1;
        node[k] = x;
        while(k){
            k = (k-1)/2;
            node[k] = (node[2*k+1] + node[2*k+2]);
        }
    }
    int getmin(int a, int b, int k=0, int l=0, int r=-1){
        if(r<0) r=n;
        if(r<=a || b<=l) return 0;
        if(a<=l && r<=b) return node[k];
        return ( getmin(a,b,2*k+1,l,(l+r)/2) + getmin(a,b,2*k+2,(l+r)/2,r) );
    }
};

int main(){
    cin >> n;
    cin >> s;
    cin >> q;
    REP(i,q) {
        cin >> k[i];
        vector<ll> imos( n*2 );
        vector<ll> jmos(n*2);
        vector<ll> mmos( n*2 );
        REP(j,n) {
            if (s[j] == 'D'){
                imos[j] ++;
                imos[j + k[i]] --;
            }
            if (s[j] == 'M'){
                mmos[max(0,j-k[i]+1)] ++;
                mmos[j] --;
            }
        
        }
        ll ret = 0;
        //vector<ll> jmos(n*2);
        REP(j,n){
            mmos[j+1] += mmos[j];

            // if(imos[j+1] < 0){
            if(j+1 >= k[i] && s[j-k[i]+1] == 'D'){
                jmos[j+1] -= mmos[j - k[i] + 1];
            }
            imos[j+1] += imos[j];

            if (s[j] == 'M'){
                jmos[j] += imos[j];
            }
            jmos[j+1] += jmos[j];

            if (s[j] == 'C'){
                ret += jmos[j];
            }
        }

        //REP(j,n) cerr << jmos[j];


        cout << ret << endl;
    }
}

Measured memory_bytes: 50128
sp = input()
t = input()


def is_valid(start):
    for i in range(len(t)):
        c = sp[start+i]
        if c != '?' and c != t[i]:
            return False
    return True


def minstr(start):
    end = start + len(t)
    sa = []
    for i, c in enumerate(sp):
        if i >= start and i < end:
            sa.append(t[i - start])
            continue
        if c == '?':
            sa.append('a')
        else:
            sa.append(c)
    return ''.join(sa)


def solve():
    if len(t) > len(sp):
        return False
    start = len(sp) - len(t)
    while start >= 0:
        if is_valid(start):
            print(minstr(start))
            return True
        start -= 1
    return False


if not solve():
    print('UNRESTORABLE')


Measured memory_bytes: 38256
#include<bits/stdc++.h>
 
#define hell                         1000000007
#define hell2                        998244353
#define lcm(a,b)                     (a*b)/__gcd(a,b)
#define ll                           int
#define vll                          vector<ll>
#define pll                          vector< pair<ll,ll> >
#define pb                           push_back
#define all(v)                       v.begin(),v.end()
#define F                            first
#define S                            second
#define rep(i,a,b)                   for(ll i=a;i<b;i++)
#define ret(x)                       return cout<<x,0;
#define endl                           '\n'
 
const ll MAX=300005;
const ll SQN=330;
const ll LG=22;
const double PI=atan(1)*4;
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);

    ll n;
    long long k;
    cin >> n >> k;
    ll a[n];
    rep(i,0,n) {
    	cin >> a[i];
    	a[i]--;
    }

    ll moves=min(k,1LL*MAX);
    k-=moves;
    ll cur=0;
    while(moves>0) {
    	cur=a[cur];
    	moves--;
    }

    ll csz=1;
    ll st=cur;
    moves=min(k,1LL*MAX);
    while(moves>0) {
    	cur=a[cur];
    	moves--;
    	if(cur==st) break;
    	csz++;
    }

    k%=csz;
    cur=st;
    while(k>0) {
    	cur=a[cur];
    	k--;
    }
    ret(cur+1);
}


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

bool is_prime(int n){
  if(n==1) return false;

  int m = sqrt(n);
  for (int i = 2; i <= m; i++)
  {
    if(n%i==0) return false;
  }
  return true;
}

int main(){
  int n = 100000;
  vector<int> p(n,0);
  vector<int> ruiseki(n);
  for (int i = 0; i < n; i++)
  {
    if (is_prime(i)) p[i]++;
  }

  ruiseki[0]=0;
  for (int i = 1; i < n; i++)
  {
    if(p[i]&&p[(i+1)/2]) ruiseki[i]=ruiseki[i-1]+1;
    else ruiseki[i]=ruiseki[i-1];
  }

  int q;
  cin >> q;
  for (int i = 0; i < q; i++)
  {
    int l,r;
    cin >> l >> r;
    cout << ruiseki[r]-ruiseki[l-1] << endl;
  }
}

Measured memory_bytes: 1408
#include <stdio.h>          // printf(), fgets()
#include <stdlib.h>         // qsort()
#include <string.h>         // strlen(), strncpy(), strncmp()
#include <ctype.h>          // isalpha()

#define L_LINE 1000
#define L_WORD 32
#define N_WORD 31

static const char NUL = '\0';

typedef struct word_tbl
{
	char word[L_WORD + 1];
	int freq;
} word_t;

int
cmp_func(const void *l_, const void *r_)
{
	const word_t* l = (const word_t*) l_;
	const word_t* r = (const word_t*) r_;
	if (l->freq > r->freq)
		return -1;

	if (l->freq < r->freq)
		return 1;

	return 0;
}

int
main(int argc, char** argv)
{
	char line[L_LINE + 1];
	word_t words[N_WORD];
	char lword[L_WORD + 1];
	int n_word;
	const char *s, *t;
	int i;

	n_word = 0;
	fgets(line, sizeof(line), stdin);
	for (s = line; *s != '\n' && *s != NUL;)
	{
		if (!isalpha(*s))
		{
			s++;
			continue;
		}

		t = s + 1;
		while (*t != ' ' && *t != '\n' && *t != NUL)
			t++;

		int l = t - s;
		if (l > strlen(lword))
		{
			strncpy(lword, s, l);
			lword[l] = NUL;
		}

		for (i = 0; i < n_word; ++i)
		{
			if (strncmp(s, words[i].word, l) == 0 && words[i].word[l] == NUL)
				break;
		}

		if (i < n_word)
			words[i].freq++;

		else
		{
			strncpy(words[n_word].word, s, l);
			words[n_word].word[l] = NUL;
			words[n_word].freq = 1;
			n_word++;
		}

		s = t;
	}

	qsort(words, n_word, sizeof(word_t), cmp_func);
	printf("%s %s\n", words[0].word, lword);

	return 0;
}

Measured memory_bytes: 556
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
#include <iomanip>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str(); }
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX / 2;
const int MOD = 1000000007;

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

	char c;
	set<char> H;
	REP(i, N) {
		cin >> c;
		H.insert(c);
	}

	if(H.size() == 3) {
		cout << "Three" << endl;
	}
	else {
		cout << "Four" << endl;
	}
	return 0;
}

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

using namespace std;

int main(int argc, const char *argv[])
{
  // IDカード，ゲート
  int n, m;
  cin >> n >> m;

  int min_l = -1, max_r = -1;
  for (int i = 0; i < m; i++) {
    int l, r;
    cin >> l >> r;
    min_l = min_l < 0 ? l : max(l, min_l);
    max_r = max_r < 0 ? r : min(r, max_r);
  }

  if (max_r >= min_l) {
    cout << max_r - min_l + 1 << "\n";
  } else {
    cout << "0\n";
  }
  return 0;
}

Measured memory_bytes: 256
//#include <bits/stdint.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <bitset>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef long long LL;

typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
const LL MOD = 1e9+7; 
int main(){
    int n;
    cin >> n;
    map<int,LL> s;
    REP(i,n){
      int a;
      cin >> a;
      s[a]++;
    }
    int cnt=0;
    for(auto x: s){
      if(x.second%2==1){
        cnt++;
      }
    }
    cout << cnt << endl;


}

Measured memory_bytes: 9660
[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

[<EntryPoint>]
let main _ =
    let n = read int
    let ps = reads int
    List.windowed 3 ps
    |> List.filter (fun xs -> (List.sort xs).[1] = xs.[1])
    |> List.length
    |> printfn "%i"
    0

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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

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 ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

/* Some Libraries */

//-------------------------------------------------

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int t; cin>>t;
    while(t--){
        int N; cin>>N;
        vll a(N);
        rep(i,N) cin>>a[i];
        string S; cin>>S;
        vll Base;

        auto update = [&](ll x){
            Base.pb(x);
            int M = Base.size();
            int k=0;
            rep(i,60){
                bool find=false;
                FOR(j,k,M-1)if(Base[j]>>i&1){
                    swap(Base[k],Base[j]);
                    find=true;
                    break;
                }
                if (!find) continue;
                rep(j,M)if(j!=k && Base[j]>>i&1){
                    Base[j]^=Base[k];
                }
                k++;
            }
            if (Base.back()==0){
                Base.pop_back();
                return true;
            }
            return false;
        };

        int ans=0;
        RFOR(i,N-1,0){
            if (!update(a[i]) && S[i]=='1'){
                ans=1;
                break;
            }
        }
        cout<<ans<<"\n";
    }
    return 0;
}


Measured memory_bytes: 3608
import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.IntStream;

public class Main {
    static final int MODULUS = 1_000_000_007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int N = sc.nextInt();
        int[] A = new int[N];
        for (int i = 0; i < A.length; ++i) {
            A[i] = sc.nextInt();
        }

        System.out.println(solve(A));

        sc.close();
    }

    static int solve(int[] A) {
        A = Arrays.stream(A).boxed().sorted().mapToInt(x -> x).toArray();

        int[] A_ = A;
        return IntStream.range(0, A.length).allMatch(i -> A_[i] == (i + A_.length % 2) / 2 * 2 + (1 - A_.length % 2))
                ? IntStream.range(0, A.length / 2).map(i -> 2).reduce(1, Main::multiplyMod)
                : 0;
    }

    static int multiplyMod(int x, int y) {
        return (int) ((long) x * y % MODULUS);
    }
}

Measured memory_bytes: 51848
n, k = gets.split.map(&:to_i)
x = gets.split.map(&:to_i)

puts (0..(n - k)).flat_map{|i|
  j = i + k - 1
  [x[i].abs + (x[i] - x[j]).abs, x[j].abs + (x[j] - x[i]).abs]
}.min


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

double EPS = 1e-9;
typedef complex<double> P;

struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
};
double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}
int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}

P projection(const L &l, const P &p) {
  double t = dot(p-l[0], l[0]-l[1]) / norm(l[0]-l[1]);
  return l[0] + t*(l[0]-l[1]);
}
bool intersectSS(const L &s, const L &t) {
  return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) <= 0 &&
         ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) <= 0;
}
bool intersectSP(const L &s, const P &p) {
  return abs(s[0]-p)+abs(s[1]-p)-abs(s[1]-s[0]) < EPS; // triangle inequality
}
double distanceSP(const L &s, const P &p) {
  const P r = projection(s, p);
  if (intersectSP(s, r)) return abs(r - p);
  return min(abs(s[0] - p), abs(s[1] - p));
}

double distanceSS(const L &s, const L &t) {
  if (intersectSS(s, t)) return 0;
  return min(min(distanceSP(s, t[0]), distanceSP(s, t[1])),
             min(distanceSP(t, s[0]), distanceSP(t, s[1])));
}

P A[100],B[100];
double H[100];
P s,e;
P in(){
	double x,y;
	cin >> x >> y;
	return P(x,y);
}

int N;

bool f(double R){
	for(int i = 0 ; i < N ; i++){
		double h = min(R,H[i]);
		P a = A[i];
		P b = P(B[i].real(),A[i].imag());
		P c = B[i];
		P d = P(A[i].real(),B[i].imag());
		L l[] = {L(a,b),L(b,c),L(c,d),L(d,a)};
		for(int j = 0 ; j < 4 ; j++){
			double rd = sqrt(R*R-(h-R)*(h-R));
			if( distanceSS(L(s,e),l[j]) < rd ){
				return 0;
			}
		}
	}
	return 1;
}
int main(){
	while( cin >> N and N > 0 ){
		
		s = in();
		e = in();
		bool ff = 0;
		for(int i = 0 ; i < N ; i++){
			A[i] = in();
			B[i] = in();
			cin >> H[i];
			if( A[i].real() <= s.real() and s.real() <= B[i].real()
				and  A[i].imag() <= s.imag() and s.imag() <= B[i].imag() 
			or A[i].real() <= e.real() and e.real() <= B[i].real()
				and  A[i].imag() <= e.imag() and e.imag() <= B[i].imag() ){
				ff = 1;
			}
		}
		
		if(ff){
			cout << 0 << endl;
			continue;
		}
		
		double l = 0, r = 100000;
		for(int i = 0 ; i < 128 ; i++){
			double m = (l+r) / 2;
			if( f(m) ){
				l = m;
			}else{
				r = m;
			}
		}
		printf("%.10lf\n",l);
		
	}
}

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

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

int main(){

  ios_base::sync_with_stdio (false);
  cin.tie(NULL);
  ll X; cin >> X;
  if(X >= 30){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }

}


Measured memory_bytes: 3636
#include <iostream>
using namespace std;
int main(void){
    int a;
    int b;
    
 std::cin >>a; cin >>b;
 
 if(a<b){
     cout << "a < b" << endl;
 }else if(a>b){
     cout << "a > b" << endl;
 }else{
     cout << "a == b" << endl;
 }

}

Measured memory_bytes: 3004
n = gets.chomp.to_i

n.times do
  line = gets
  numbers = line.split(nil).map(&:to_i)
  if (numbers[0]**2 + numbers[1]**2 == numbers[2]**2)||(numbers[1]**2 + numbers[2]**2 == numbers[0]**2)||(numbers[2]**2 + numbers[0]**2 == numbers[1]**2)
    puts "YES"
  else
    puts "NO"
  end
end


Measured memory_bytes: 8748
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
#include<cstring>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int CM = 1 << 17, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
	tmp = tmp << dig & ma1;
	tmp = tmp * 10 + (tmp >> 8) & ma2;
	tmp = tmp * 100 + (tmp >> 16) & ma3;
	tmp = tmp * 10000 + (tmp >> 32) & ma4;
	ci += 72 - dig >> 3;
	return tmp;
}
const int dm = 1 << 17;
char *dn = cn, * di = dn, * owad = dn + dm - 20;
inline void putint(int X) {
	if (owad < di) {
		fwrite(dn, 1, di - dn, stdout);
		di = dn;
	}
	int dig = 1;
	if (X >= 10000) {
		if (X >= 100000) dig = 6;
		else dig = 5;
	}
	else {
		if (X >= 1000) dig = 4;
		else if (X >= 100) dig = 3;
		else if (X >= 10) dig = 2;
	}
	rep1(i, dig) {
		di[dig - i] = '0' + X % 10;
		X /= 10;
	}
	di[dig] = '\n';
	di += dig + 1;
}
const int bm = 500001;
int BIT[bm];
void add(int A) {
	while (A > 0) {
		BIT[A]++;
		A -= A & -A;
	}
}
int query(int A) {
	int ret = 0;
	while (A < bm) {
		ret += BIT[A];
		A += A & -A;
	}
	return ret;
}
int L[500001], R[500001], C[500001], ne[500001];
int are[500001];
int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);


	int N = getint(), Q = getint();
	rep1(i, N) C[i] = getint();
	rep1(i, Q) {
		L[i] = getint();
		int r = getint();
		ne[i] = R[r];
		R[r] = i;
	}
	rep1(i, N) {
		if (are[C[i]]) add(are[C[i]]);
		are[C[i]] = i;
		
		for (int r = R[i]; r; r = ne[r]) {
			L[r] = i - L[r] - query(L[r]) + 1;
		}
	}

	rep1(i, Q) putint(L[i]);
	fwrite(dn, 1, di - dn, stdout);


	Would you please return 0;
}

Measured memory_bytes: 15092