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

using namespace std;
typedef long long int ll;
typedef pair <ll,ll> P;
#define REP(i, n) for(ll i = 0LL; i < (ll)(n); i++)
#define REPR(i, n) for(ll i = n-1; i >= 0LL; i--)
#define FOR(i, n, m) for(ll i = n; i < (ll)(m); i++)
#define PRINT(x) cout << x << endl
#define ALL(v) v.begin(), v.end()
#define INF (ll)1e18
#define INFD 1e18
#define PI 3.14159265358979
#define MOD 1000000007
#define vl vector<ll>

vector<ll> dx = {-1, 1, 0, 0};
vector<ll> dy = {0, 0, 1, -1};

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





typedef vector<vector<ll> > Matrix;

Matrix mat; // グラフの距離を格納した2次元配列（隣接行列）
					// d[u][v]は辺e=(u,v)のコスト（辺が存在しない場合はINF、ただしd[i][i]=0）

void warshall_floyd(ll n) { // nは頂点数
	for (ll i = 0; i < n; i++)      // 経由する頂点
		for (ll j = 0; j < n; j++)    // 開始頂点
			for (ll k = 0; k < n; k++)  // 終端
				mat[j][k] = min(mat[j][k], mat[j][i] + mat[i][k]);
}


int main()
{
	ll N;
	cin >> N;
	if (N == 2) {
		PRINT(2);
		return 0;
	}
	mat = Matrix(N, vector<ll>(N, INF));
	REP(i, N) {
		string s;
		cin >> s;
		REP(j, N) {
			if(s[j] == '1') mat[i][j] = 1;
		}
	}
	auto tmp = mat;
	warshall_floyd(N);
	ll ans = 0;
	P p = P(0, 0);
	REP(i, N) {
		REP(j, N) {
			if (mat[i][j] == INF) continue;
			if (ans < mat[i][j]) {
				ans = mat[i][j];
				p = P(i, j);
			}
			// cout << tmp[i][j] << " ";
		}
		// cout << endl;
	}
	vector<ll> vi(N, false);
	vector<ll> dist(N, 0);
	queue<ll> que;
	que.push(p.first);
	vi[p.first] = true;
	dist[p.first] = 1;
	while(!que.empty()) {
		ll t = que.front();
		que.pop();
		// PRINT(t);
		REP(i, N) {
			if (tmp[t][i] == 1 && !vi[i]) {
				que.push(i);
				vi[i] = true;
				dist[i] = dist[t] + 1;
			}
		}
	}
	// REP(i, N) cout << dist[i] << " ";
	// cout << endl;
	// PRINT(p.first << ":" << p.second);
	REP(i, N) {
		FOR(j, i+1, N) {
			if (tmp[i][j] == 1 && dist[i] == dist[j]) {
				// PRINT(i << " : " << j);
				PRINT(-1);
				return 0;
			}
		}
	}
	if (ans == 0) {
		PRINT(-1);
	} else {
		PRINT(ans+1);
	}
	return 0;
}




Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define pb push_back
const int maxn = 10000;
const int INF32 = 1'050'000'000;
const long long INF64 = 4'000'000'000'000'000'000;
const int MOD7 = 1'000'000'007;
const int MOD9 = 1'000'000'009;
const int mod = MOD7;

void ERROR(int num) { cout << "ERROR" << num << endl; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
int dx[8]={-1,0,1,0,1,1,-1,-1};
int dy[8]={0,-1,0,1,1,-1,1,-1};


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

    ll N;
    cin >> N;
    bool ok = 0;
    if(N<=26) ok = 1;
    string ans = "";
    while(1){
        int res = N % 26;
        N = N / 26;
        if(res!=0) ans += 'a'+res-1;
        else ans += 'z', N--;
        if(N<=0 || ok) break;
    }

    for(int i = ans.length()-1; i >=0; i--)
        cout << ans[i];
    cout << endl;
}

Measured memory_bytes: 3652
//run: g++ -std=c++14 -o run_sol.exe solution.cpp -DLOCAL_JUDGE
#include<bits/stdc++.h>
#define INF 0x7fffffff
#define INFLL 1e17
#define PI 2*acos(0.0)
#define show(x) cout<< #x <<" is "<< x <<"\n"
using namespace std;

#define FS first
#define SC second
#define PB(t) push_back(t)
#define LEN(t) ((int)t.size())
#define ALL(t) t.begin(),t.end()
#define MP(x, y) make_pair((x), (y))
#define Fill(a,c) memset(&a, c, sizeof(a))
#define POPCOUNT __builtin_popcount

typedef long long LL;
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<PII> VPII;

VLL nums;
vector<VLL> memo;

LL solve (int ini, int fin, int player) {
    if (ini + 1 == fin) {
        return nums[ini] * player;
    }
    if (memo[ini][fin] > -1) {
        return memo[ini][fin];
    }
    LL res = 0;
    if (player == 1) {
        res = max(solve(ini + 1, fin, 1 - player) + nums[ini], 
                    solve(ini, fin - 1, 1 - player) + nums[fin - 1]);
    } else {
        res = min(solve(ini + 1, fin, 1 - player), 
                    solve(ini, fin - 1, 1 - player));
    }

    return memo[ini][fin] = res;
}

int main() {
    #ifdef LOCAL_JUDGE
        freopen("../input.txt", "rt", stdin);
        freopen("../output.txt", "wt", stdout);
    #endif

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

    for (int n; cin >> n; ) {
        nums.assign(n, 0);
        memo.assign(n + 1, VLL(n + 1, -1));
        LL sum = 0;
        for (auto& val : nums) {
            cin >> val;
            sum += val;
        }

        cout << 2 * solve(0, n, 1) - sum << "\n";
    }
return 0;
}

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

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

    vector<ll> pows(100);
    pows[0] = 26;
    for(int i=1;i<100;i++)pows[i] = pows[i-1]*26;

    int keta;
    for(int i=0;i<100;i++){
        if(N > pows[i]){
            N -= pows[i];
            continue;
        }
        keta = i+1;
        break;
    }

    N -= 1;
    vector<char> ans(keta);
    for(int i=0;i<keta;i++){
        ans[i] = char(N%26 + int('a'));
        N /= 26;
    }
    for(int i=0;i<keta;i++)cout << ans[keta-i-1];
    cout << endl;
}

Measured memory_bytes: 3608
#ifndef LOCAL
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#else
#include <iostream>
#include <iomanip> 
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; } sim > auto dud(c* x) -> decltype(cerr << *x, 0); sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; } eni(!=) cerr << boolalpha << i; ris; } eni(==) ris << range(begin(i), end(i)); } sim, class b dor(pair < b, c > d) { ris << "(" << d.first << ", " << d.second << ")"; } sim dor(rge<c> d) { *this << "["; for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it; ris << "]"; }
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds; 
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

template<typename T> void setmax(T& x, T y) {x = max(x, y);}
template<typename T> void setmin(T& x, T y) {x = min(x, y);}
#define fix(a) fixed << setprecision(a)
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define all(V) V.begin(), V.end()
#define rall(V) V.rbegin(), V.rend()
#define len(V) (int)V.size()
#define ll long long
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define endl '\n'


void solve(){
  int n;
  cin >> n;
  int a = 0;
  int b = 0;
  int p = 0;
  forn(i,n){
    int t, x, y;
    cin >> t >> x >> y;
    int d = abs(x-a)+abs(y-b);
    int dd = t - p;
    if (d > dd or dd%2!=d%2) {
      cout << "No";
      return;
    }
    a = x;
    b = y;
    p = t;
  }
  cout << "Yes";
}

int main() {
  ios::sync_with_stdio(false);
  // cin.tie(0); cout.tie(0);
  int t = 1;
  // cin >> t;
  forn(i, t){
    solve();
  }
}

/* 



*/

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, n) for (int i = (int)(n); i >= 0; i--)
#define REP(i, m, n) for (int i = (int)(m); i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
typedef long long ll;

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

const long long INF = 1LL << 60;

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

  set<int> st;
  int cnt = 0;
  rep(i, n){
    int a; cin >> a;
    if(a >= 3200) cnt++;
    else st.insert(a/400);
  }

  if(st.size() == 0) cout << 1 << " ";
  else cout << st.size() << " ";

  cout << st.size() + cnt << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;(i)--)
#define rrep1(i,n) for(int i=((int)(n));i>0;(i)--)
#define sz(c) ((int)(c).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> P;
typedef pair<int, pair<int, int> > PP;
//const int MAX=;

int main(){
	int n;
	cin>>n;
	int p[20];
	rep(i,n)cin>>p[i];
	int ans=0;
	rep1(i,n-2){
		if(p[i-1]<p[i] && p[i]<p[i+1])ans++;
		if(p[i-1]>p[i] && p[i]>p[i+1])ans++;
	}
	cout<<ans<<endl;
	
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
int main() {
    int n, k;
    cin >> n >> k;
    vector<double> p(n);
    for(int i = 0; i < n; i++) {
        cin >> p[i];
        p[i] = (p[i] + 1) / 2.0;
    }
    vector<double> rui(n + 1, 0);
    for(int i = 0; i < n; i++) {
        rui[i + 1] = rui[i] + p[i];
    }
    double ans = 0.0;
    for(int i = k; i < n + 1; i++) {
        ans = max(ans, rui[i] - rui[i - k]);
    }
    cout << fixed << setprecision(15) << ans << endl;
}

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

#define datatype lli
#define lli long long int

//比較関数
int compare(datatype a, datatype b){
	if(a < b){
		return -1;
	}
	else if(a > b){
		return 1;
	}
	else{
		return 0;
	}
}

//昇順
lli inv_num_sub(datatype *origin, int left, int right, datatype *tmp){
	lli ans = 0;
	if(right - left > 1){
		int i, j, k, half = (left + right) / 2;
		ans += inv_num_sub(origin, left, half, tmp);
		ans += inv_num_sub(origin, half, right, tmp);
		for(i = left; i < right; i++){
			tmp[i] = origin[i];
		}
		for(i = left, j = left, k = half; i < right; i++){
			if((compare(tmp[j], tmp[k]) <= 0 && j < half) || k == right){
				origin[i] = tmp[j];
				j++;
			}
			else{
				origin[i] = tmp[k];
				ans += (lli)(k - i);
				k++;
			}
		}
	}
	return ans;
}

//i < j && a[i] > a[j] となる組(i, j)の数
//effect: sortされる
lli inv_num(datatype *origin, int N){
	datatype *tmp = (datatype *)malloc(sizeof(datatype) * N);
	return inv_num_sub(origin, 0, N, tmp);
}

int main(){
	lli N, K, i;
	scanf("%lld%lld", &N, &K);
	lli *sum = (lli *)malloc(sizeof(lli) * (N + 1));
	sum[0] = 0;
	for(i = 1; i <= N; i++){
		scanf("%lld", &sum[i]);
		sum[i] += sum[i - 1] - K;
	}
	printf("%lld\n", N * (N + 1) / 2 - inv_num(sum, (int)(N + 1)));
	return 0;
}

Measured memory_bytes: 3328
n = int(input())
t, a = map(int, input().split())
h = list(map(int, input().split()))
ans_l = []

def elev(t, n):
    high = t - n * 0.006
    return abs(a - high)

for i in range(n):
    ans = elev(t, h[i])
    ans_l.append(ans)

num = min(ans_l)
print(ans_l.index(num) + 1)

Measured memory_bytes: 3064
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        sc.nextLine();
        List<Integer> tmp = Arrays.stream(sc.nextLine().split(" ")).map(e -> Integer.valueOf(e)).collect(Collectors.toList());
        int available = 0;
        int preMax = -1;

        for (int tar : tmp) {
            if (preMax <= tar) {
                preMax = tar;
                available++;
            }
        }

        System.out.println(available);
    }
}


Measured memory_bytes: 28884
import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

from heapq import heappop, heappush

def main(): 
    N, M = LI()
    B = [[] for i in range(10**5+1)]
    for _ in range(N):
        a, b = LI()
        B[a].append(b)
    
    hq = []
    ans = 0
    for day in range(1, M+1):
        for b in B[day]:
            heappush(hq, -b)
        if not hq:
            continue
        ans += (-heappop(hq))

    print(ans)



main()

Measured memory_bytes: 69280
A, B, C, X, Y = gets.split.map(&:to_i)

min = Float::INFINITY
([X, Y].max*2+1).times do |i|
    price = i * C
    a = [X - i/2, 0].max
    b = [Y - i/2, 0].max
    price += a * A
    price += b * B
    min = price if min > price
end

puts min

Measured memory_bytes: 1788
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;
#define ll long long
#define ld long double
#define mp make_pair

void print(auto &a)
{
    for (auto s: a) cout<<s<<' ';
    cout<<endl;
}

void get(vector<auto> &a)
{
    for (int i = 0; i<a.size(); i++) cin>>a[i];
}

const int p = 998244353;


int mul(int a, int b) {
    return (1LL * a%p * b%p) % p;
}

int add(int a, int b) {
    ll s = (a+b);
    s = s%p;
    if (s<0) s+=p; 
    return s;
}

int po(int a, int deg)
{
    if (deg==0) return 1;
    if (deg%2==1) return mul(a, po(a, deg-1));
    int t = po(a, deg/2);
    return mul(t, t);
}

int inv(int n)
{
    return po(n, p-2);
}

vector<int> Z(string s)
{
int n = s.length();
vector<int> z(n);
int L = 0, R = 0;
for (int i = 1; i < n; i++) {
  if (i > R) {
    L = R = i;
    while (R < n && s[R-L] == s[R]) R++;
    z[i] = R-L; R--;
  } else {
    int k = i-L;
    if (z[k] < R-i+1) z[i] = z[k];
    else {
      L = i;
      while (R < n && s[R-L] == s[R]) R++;
      z[i] = R-L; R--;
    }
  }
}
return z;
}

set<int> answer;

bool check(vector<int> a, int q)
{
    int n = a.size();
    //print(a);
    //cout<<q<<' '<<n<<endl;
    for (int i = 0; i+q<n; i++) {a[i+q-1] = (a[i+q-1]+a[i])%q; a[i]=0;}
    //print(a);
    for (int i = 0; i<n; i++) if (a[i]%q!=0) return 0;
    return 1;
    
}

vector<int> primes;
vector<bool> kek(1e6);

void init()
{
    for (int i = 2; i<1e6; i++) if (!kek[i])
    {
        primes.push_back(i);
        for (int j = 2*i; j<1e6; j+=i) kek[j] = 1;
    }
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    
    init();
    
    int n;
    cin>>n;

    vector<int> a(n+1);
    get(a);
    int gcd = abs(a[n]);
    for (int i = 0; i<=n; i++) gcd = __gcd(gcd, abs(a[i]));
    for (int i = 0; i<=n; i++) a[i]/=gcd;
    for (auto it: primes)
    {
        if (gcd%it==0) answer.insert(it);
        while(gcd%it==0) gcd/=it;
    }
    if (gcd!=1) answer.insert(gcd);
    

    
    for (auto it: primes) if (it<=n+1&&check(a, it)) answer.insert(it);
    for (auto it: answer) cout<<it<<endl;

    
}

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

const int MAX_N = 1e5+10;
int N;
int a[MAX_N];

void solve()
{
	vector<pair<int,int>> ans;
	for(int i=1;i<=N;++i){
		ans.emplace_back(a[i],i);
	}
	sort(ans.begin(), ans.end());
	for(int i=0;i<N;++i){
		cout << ans[i].second << " ";
	}
	cout << "\n";
	return;
}

int main()
{
	ios::sync_with_stdio(false);
	cin >> N;
	for(int i=1;i<=N;++i){
		cin >> a[i];
	}		
	solve();
	return 0;
}

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

int main()
{
  string s;
  cin >> s;
  if (s=="ABC") cout << "ARC" << endl;
  else cout << "ABC" << endl;

  return 0;
}


Measured memory_bytes: 3624
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<map>
using namespace std;

int main() {
  int N;
  cin >> N;
  map<string, int> S;
  for (int i = 0; i < N; i++) {
    string word;
    cin >> word;
    S[word] += 1;
  }

  int max_poll = 0;
  for (auto iter = S.begin(); iter != S.end(); iter++) {
    int poll = iter->second;
    if (poll > max_poll) max_poll = poll;
  }

  for (auto iter = S.begin(); iter != S.end(); iter++) {
    if (iter->second == max_poll) {
      cout << iter->first << endl;
    }
  }
}


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

int main()
{
    int n;
      
    cin >> n;
    while (n--) {
        int s, g;
        vector<int> v;
          
        cin >> s >> g;
        if (s < g) {
            for (int i = s; i <= g; i++) {
                v.push_back(i);
            }
        } else if (s > g) {
            if (s > 5) {
                for (int i = s; i <= 9; i++) {
                    v.push_back(i);
                }                   
                if (g > 5) {
                    for (int i = 5; i >= 0; i--) {
                        v.push_back(i);
                    }
                    for (int i = 1; i <= g; i++) {
                        v.push_back(i);
                    }
                } else {
                    for (int i = 5; i >= g; i--) {
                        v.push_back(i);
                    }
                }
            } else if (s <= 5) {
                for (int i = s; i >= g; i--) {
                    v.push_back(i);
                }
            }
        }        
        for (int i = 0; i < (int)v.size(); i++) {
            if (i > 0) cout << " ";
            cout << v[i];
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 3080
import java.util.*;
import java.io.*;
public class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); 
        PrintWriter pw=new PrintWriter(System.out);
        double max=-1;
        int dim=Integer.parseInt(br.readLine());
        //if(dim==1)
        //pw.println("0.037026");
        //else if(dim==2)
    //    pw.println("0.296274");
     //   else
      //  {
            /*for(int i=1;i<=1000;i++)
            {
                for(int j=1;j<=1000;j++)
                {
                    for(int k=1;k<=1000;k++)
                    {
                        if(i+j+k==dim)
                        {
                            max=Math.max(max,(double)i*j*k);
                        }
                    }
                }
            }*/
            pw.println(Math.pow((double)dim/3,3));
        //}
        //System.out.println(max);
        pw.flush();
        pw.close();
    }
}

Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N= 100000000;
  int num;
  int sum = 0;
  cin >> num;
  
  for( int i = 8; i > 0;i--) {
    int digit;
    
    digit = ( num % N )  / ( N / 10 );
    sum += digit;
    N /= 10;
  }
  if ( num % sum == 0 ) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
N = int(input())
AB = [tuple(map(int,input().split())) for i in range(N)]
A = []
B = []
for a,b in AB:
    A.append(a)
    B.append(b)
A.sort()
B.sort()

if N%2==0:
    m = N//2
    b = B[m] + B[m-1]
    a = A[m] + A[m-1]
    print(b - a + 1)
else:
    m = N//2
    print(B[m] - A[m] + 1)

Measured memory_bytes: 39676
package main

import (
	"fmt"
)

func main(){
	var a, b int
	for{
		fmt.Scan(&a, &b)
		if a == 0 || b == 0{
			break
		}
		for i:=0; i<a; i++{
			for j:=0; j<b; j++{
				if i == 0 || i == a-1 || j == 0 || j == b-1 {
					fmt.Print("#")
				}else{
					fmt.Print(".")
				}
			}
			fmt.Print("\n")
		}
		fmt.Print("\n")
	}
}


Measured memory_bytes: 1096
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
typedef unsigned int ui;
#define stop char nyaa;cin>>nyaa;
struct labcol { double x; double y; double z; };
double dis(labcol s, labcol t) {
	return pow(s.x-t.x,2) + pow(s.y-t.y,2) + pow(s.z-t.z,2);
}
int main() {
    int n, m;
    labcol c[20];
	cin >> n >> m;
	double l, a, b;
	for (int i = 0; i < n; i++) {
		cin >> l >> a >> b; c[i] = { l,a,b };
	}
    double ma = 0;
	for (int i = 0; i < 1 << n; i++) {
		vector<labcol> v;
		for (int j = 0; j < n; j++) {
			if (i&(1 << j)) {
				v.push_back(c[j]);
			}
		}
		if (v.size() != m)continue;
		double sum = 0;
		for (int j = 0; j < m; j++) {
			for (int k = j + 1; k < m; k++) {
				sum += dis(v[j], v[k]);
			}
		}
		ma = max(ma, sum);
	}
	cout << fixed<<setprecision(6)<<ma << endl;
	return 0;
}


Measured memory_bytes: 3264
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <math.h>
using namespace std;

typedef long long ll;
const int MAXN = 1e5 + 10;
int N;
ll A[MAXN], B[MAXN];
ll s;

int main() {
	register int i;
	scanf("%d", &N);
	for(i = 1; i <= N; ++i)
		scanf("%lld%lld", A + i, B + i);
	for(i = N; i; --i)
		A[i] += s, s += (-A[i] % B[i] + B[i]) % B[i];
	printf("%lld\n", s);
	return 0;
}

Measured memory_bytes: 1664
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;

public class Main {

	public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner(System.in);
		final int n = sc.nextInt();
		final long c = sc.nextLong();
		long [] x = new long[n];
		long [] v = new long[n];
		for(int i=0; i<n; i++) {
			x[i] = sc.nextLong();
			v[i] = sc.nextLong();
		}
		// sub
		long [] imosv = new long[n];
		imosv[0] = v[0];
		for(int i=1; i<n; i++) {
			imosv[i] = imosv[i-1]+v[i];
		}
		long[] g = new long[n];
		g[0] = Math.max(0, v[0]-x[0]);
		for(int i=1; i<n; i++) {
			g[i] = Math.max(g[i-1], imosv[i]-x[i]);
		}
		long[] g2 = new long[n];
		g2[0] = Math.max(0, v[0]-2*x[0]);
		for(int i=1; i<n; i++) {
			g2[i] = Math.max(g2[i-1], imosv[i]-2*x[i]);
		}
		// main
		long ans = 0;
		// 1
		for(int m=1; m<n; m++) {
			ans = Math.max(ans, (imosv[n-1]-imosv[m-1])-(c-x[m])+g2[m-1]);
			ans = Math.max(ans, (imosv[n-1]-imosv[m-1])-2*(c-x[m])+g[m-1]);
		}
		// 2
		for(int m=0; m<n; m++) {
			ans = Math.max(ans, imosv[m]-x[m]);
		}
		// 3
		for(int k=0; k<n; k++) {
			if(k!=0) {
				ans = Math.max(ans, imosv[n-1]-imosv[k-1]-(c-x[k]));	
			} else {
				ans = Math.max(ans, imosv[n-1]-(c-x[k]));	
			}
			
		}
		System.out.println(ans);
	}

	static class MyScanner
	{
		BufferedReader br;
		StringTokenizer st;
		public MyScanner(InputStream s)
		{
			br=new BufferedReader(new InputStreamReader(s));
		}
		public String nextLine() throws IOException
		{
			return br.readLine();
		}
		public String next() throws IOException
		{
			while(st==null || !st.hasMoreTokens())
				st=new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int nextInt() throws IOException
		{
			return Integer.parseInt(next());
			
		}
		public double nextDouble() throws IOException
		{
			return Double.parseDouble(next());
		}
		public boolean ready() throws IOException
		{
			return br.ready();
		}
		public long nextLong() throws IOException
		{
			return Long.parseLong(next());
		}
	}
}


Measured memory_bytes: 48696
import java.util.Arrays;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
	    int n = scan.nextInt();
	    int a[]=new int[n];
	    for(int i=0;i<n;i++) {
	    	a[i]=scan.nextInt();
	    }
	    scan.close();
	    Arrays.sort(a);
	    int Acnt=0,Bcnt=0;
	    for(int i=n-1,j=0;i>=0;i--,j++) {
	    	if(j%2==0)Acnt+=a[i];
	    	else Bcnt+=a[i];
	    }
	    System.out.println(Acnt-Bcnt);
	}

}

Measured memory_bytes: 24020
fun main() {
    val (N, K) = nextIntList()
    val A = nextIntList()
    (K until N).forEach{
        println(if (A[it - K] >= A[it]) "No" else "Yes")
    }
}

// # Utils
// ## Input
fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ")
fun nextIntList() = next().split(" ").map(String::toInt)
fun nextLongList() = next().split(" ").map(String::toLong)
fun nextDoubleList() = next().split(" ").map(String::toDouble)

// ## Array
inline fun <reified T> sizedArray(size: Int, default: T) = Array(size) { default }

// ## mod^-1
//    [NOTE] CANNOT use this for 0, mod, 2mod, 3mod ...(return wrong value)
fun modinv(num: Long, mod: Long): Long {
    var a = num
    var b = mod
    var u = 1L
    var v = 0L
    while (b > 0) {
        val t = a.div(b)
        a -= t * b
        a = b.also { b = a } // swap a and b
        u -= t * v
        u = v.also { v = u } // swap u and v
    }
    u %= mod
    if (u < 0) u += mod
    return u
}

Measured memory_bytes: 69296
n = int(input())
v = list(map(int, input().split()))

v.sort()
ans = 0
for i in range(n):
    if i != 0:
        ans += v[i] / (2 ** (n - i))
    else:
        ans += v[i] / (2 ** (n - 1))

print(ans)


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

using namespace std;

const int N = 100005;

int n, m;
int par[N];
int sz[N];
int from[N], to[N];
long long ans[N];
long long now;

int anc(int u) {
	if (par[u] == u) {
		return u;
	} else {
		return par[u] = anc(par[u]);
	}
}

void join(int u,int v) {
	u = anc(u), v = anc(v);
	if (u == v) {
		return;
	}
	now -= (long long) sz[u] * sz[v];
	sz[u] += sz[v];
	par[v] = u;
}

int main() {
	scanf("%d %d", &n, &m);
	
	for (int i = 1; i <= n; ++i) {
		par[i] = i;
		sz[i] = 1;
	}
	
	for (int i = 1; i <= m; ++i) {
		scanf("%d %d", from + i, to + i);
	}
	
	now = (long long) n * (n - 1) / 2;
	
	for (int i = m; i > 0; --i) {
		ans[i] = now;
		join(from[i], to[i]);
	}
	
	for (int i = 1; i <= m; ++i) {
		printf("%lld\n", ans[i]);
	} 
	
}


Measured memory_bytes: 3712
#include <stdio.h>

int main(void) {
	int p=0, q=0, r=0;
	int sum[3];

	scanf("%d", &p);
	scanf("%d", &q);
	scanf("%d", &r);

	sum[0] = p + q;
	sum[1] = p + r;
	sum[2] = q + r;
	 
	int min = sum[0];

	for (int i = 0; i < 3; i++) {
		if (min > sum[i]) {
			min = sum[i];
		}
	}

	printf("%d", min);
}

Measured memory_bytes: 128
n,w=map(int,input().split())
weight,value=[0]*110,[0]*110
dp = [[0 for _ in range(100100)] for _ in range(110)]
for i in range(n):
    weight[i],value[i] = map(int,input().split())
for i in range(n):
    for  sum_w in range(w+1):
        #i番目の品物を選ぶ
        if(sum_w - weight[i] >=0):
            dp[i+1][sum_w] =max(dp[i+1][sum_w], dp[i][sum_w - weight[i]]+ value[i])
        #選ばない場合
        dp[i + 1][sum_w] = max(dp[i + 1][sum_w], dp[i][sum_w])
print(dp[n][w])

Measured memory_bytes: 181512
import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static long gcd(long a, long b){
		if(a < b){
			long tmp = a;
			a = b;
			b = tmp;
		}
		while(b > 0){
			long r = a % b;
			a = b;
			b = r;
		}
		return a;
	}

	public static long lcm(long a, long b, long g){
		long v = a / g;
		long w = b / g;
		long l = v * w * g;
		return l;
	}

	public static void main(String[] args){

		while(scan.hasNext()){
			long a = scan.nextLong();
			long b = scan.nextLong();
			long g = gcd(a, b);
			long l = lcm(a, b, g);
			System.out.printf("%d %d\n", g, l);
		}
	}
}

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

#define ll long long
#define ld long double
#define db double
#define pb push_back
#define nl '\n'
#define X first
#define Y second
#define nimble ios::sync_with_stdio(0);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define mod(x,m) ((((x)%(m))+(m))%(m))
#define _sz(x) (int)x.size()
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repv(v) for(int i=0;i<_sz(v);i++)
#define rep1(i,b,a) for(int i=b;i>=a;i--)
#define preci(x) fixed<<setprecision(x)
#define tc int tt=1;cin>>tt;rep(tcs,1,tt+1)

#define TRACE
#ifdef TRACE
#define see(...) __f(#__VA_ARGS__,__VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr<<name<<" : "<<arg1<<nl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma=strchr(names+1,',');cerr.write(names,comma-names)<<" : "<<arg1<<" | ";__f(comma+1, args...);
}
#else
#endif

int inf=0x3f3f3f3f;
ll infl=0x3f3f3f3f3f3f3f3fLL;
ld infd=1.0/0.0;
const ll MOD=1e9+7;// 998244353 // = (119<<23)+1
const ld pi=2*acos(0.0);

int main(){
    nimble
    int n;
    int d;
    int cnt=0;
    cin>>n>>d;
    for(int i=0;i<n;i++){
        ld x,y;
        cin>>x>>y;
        ld as=1.0*sqrt(x*x+y*y);
        if(as<=d)cnt++;
    }
    cout<<cnt<<nl;
    return 0;
}


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

int main() {
    int n; cin >> n;
    vector<int> a(n);
    for(int i = 0; i < n; ++i) cin >> a[i];
    
    // a[0] が正の場合
    long long res1 = 0;
    int sum1 = 0;
    for(int i = 0; i < n; ++i) {
        sum1 += a[i];
        if(i % 2 == 0 && sum1 <= 0) {
            res1 += (1 - sum1), sum1 = 1;
        }
        if(i % 2 != 0 && sum1 >= 0) {
            res1 += (sum1 + 1), sum1 = -1;
        }
    }
    // a[0] が負の場合
    long long res2 = 0;
    int sum2 = 0;
    for(int i = 0; i < n; ++i) {
        sum2 += a[i];
        if(i % 2 == 0 && sum2 >= 0) {
            res2 += (sum2 + 1), sum2 = -1;
        }
        if(i % 2 != 0 && sum2 <= 0) {
            res2 += (1 - sum2), sum2 = 1;
        }
    }
    
    cout << min(res1, res2) << endl;
}


Measured memory_bytes: 768
#include <iostream>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

int main(){
  int n;
  cin >> n;
  bool flag = false;
  rep(i, 10){
    rep(j, 10){
      if (i * j == n){
        flag = true;
        break;
      }
    }
    if (flag) break;
  }
  if (flag) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  return 0;
}

Measured memory_bytes: 3584
#!/usr/bin/env python

n = int(input())

def sumdigits(n):
    ret = 0 
    s = list(str(n))
    for i in range(len(s)):
        ret += int(s[i])
    return ret 

a = 1 
ans = 1000000
while n-a > 0:
    tmp = sumdigits(a) + sumdigits(n-a)
    if ans >= tmp:
        ans = tmp 
    a += 1

print(ans)


Measured memory_bytes: 9128
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less_equal<int>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
#define ll long long
#define pb push_back
#define F first
#define S second
#define all(c)  c.begin(), c.end()
#define llv vector< ll >
#define mp make_pair
#define endl "\n"
const int N = (int)1e5+10 ;
const int M = (int)1000000007;
ll ans=0 , n  ;
ll a[N] , b[N] , c[N] ;
ll cache[N][2][2][2]  ;

ll calc(ll idx , bool a1 , bool a2 , bool a3){
    if(idx==n) return 0 ;
    if(cache[idx][a1][a2][a3]!=0){
        return cache[idx][a1][a2][a3] ;
    }
    if(a1 && a2 && a3){
        return cache[idx][a1][a2][a3] = max(a[idx] + calc(idx+1 , 0 , 1 , 1) , max(b[idx] + calc(idx+1 , 1 , 0 , 1) , c[idx] + calc(idx+1 , 1 , 1 , 0) ) ) ;
    }else if(a1 && a2){
        return cache[idx][a1][a2][a3] = max(a[idx] + calc(idx+1 , 0 , 1 , 1) , b[idx] + calc(idx+1 , 1 , 0 , 1) ) ;
    }else if(a2 && a3){
        return cache[idx][a1][a2][a3] = max(b[idx] + calc(idx+1 , 1 , 0 , 1) , c[idx] + calc(idx+1 , 1 , 1 , 0) ) ;
    }else if(a1 && a3){
        return cache[idx][a1][a2][a3] = max(a[idx] + calc(idx+1 , 0 , 1 , 1) , c[idx] + calc(idx+1 , 1 , 1 , 0) ) ;
    }
}

int main(){
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    // #endif
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    
    ll  i ;
    cin >> n ;
    //ll a[n] , b[n] , c[n] ;
    for(i=0 ; i<n ; i++){
        cin >> a[i] >> b[i] >> c[i] ;
    }
     //cout << n << endl ;
    cout << calc(0 , 1 , 1 ,1 )  ;
    //cout << cache[0][1][1][1] ;
    return 0 ;
}

Measured memory_bytes: 16640
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define req(i,n) for(long long i=n-1; i>=0; i--)
#define range(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define onBoard(y,x) (y>=0 && y<h && x>=0 && x<w)
#define vint vector<int>
#define pri_que priority_queue
#define vvint vector<vector<int>>
#define vstr vector<string>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a/gcd(a,b)*b;}
const long long dx[8]={1,0,-1,0,1,-1,-1,1};
const long long dy[8]={0,1,0,-1,1,1,-1,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(15);

    int n; cin >> n;
    vint a(n),s(n+1,0);
    rep(i,n){
        cin >> a[i];
        s[i+1]=s[i]+a[i];
    }
    int res=INF;
    range(i,1,n){
        chmin(res,abs(s[i]-(s[n]-s[i])));
    }
    cout<<res<<endl;
}

Measured memory_bytes: 6336
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define repr(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
const ll mod = 1e9 + 7;

int main() {
  int a, b;
  cin >> a >> b;
  rep(i, max(a, b)) cout << min(a, b);
  cout << endl;
  return 0;
}


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

string rep(string s, int n) {
    string ret = "";
    for (int i=0; i<n; ++i) {
        ret += s;
    }
    return ret;
}

int main() {
    vector<int> dis(6, 0);
    int n;
    cin >> n;
    double h;
    for (int i=0; i<n; ++i) {
        cin >> h;
        if (h < 165) {
            dis[0] ++;
        } else if (h < 170) {
            dis[1] ++;
        } else if (h < 175) {
            dis[2] ++;
        } else if (h < 180) {
            dis[3] ++;
        } else if (h < 185) {
            dis[4] ++;
        } else {
            dis[5] ++;
        }
    }
    for (int i=0; i<(int)dis.size(); ++i) {
        cout << (i+1) << ":" << rep("*", dis[i]) << endl;
    }
    return 0;
}

Measured memory_bytes: 1248
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>

#define REP(n) for(int i = 0;i < n;i++)
#define LLREP(n) for(long long int  i = 0;i < n;i++)
typedef long long int ll;
using namespace std;
#define MAX_A 1000000007

int main(){

    int h,w;
    cin >> h >> w;
    vector<string> s(h);

    for(int i = 0;i < h;i++){
        cin >> s[i];
    }

    for(int i = 0;i < h;i++){
        cout << s[i] << endl;
        cout << s[i] << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using lint = long long int;
using ulint = unsigned long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T, class U> void assign(V<T>& v, int n, const U& a) { v.assign(n, a); }
template<class T, class... Args> void assign(V<T>& v, int n, const Args&... args) { v.resize(n); for (auto&& e : v) assign(e, args...); }


int main() {
  cin.tie(nullptr); ios_base::sync_with_stdio(false);
  for (int i = 1; i <= 9; ++i) for (int j = 1; j <= 9; ++j) {
    cout << i << 'x' << j << '=' << i * j << '\n';
  }
}


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

int main()
{
  ll L,R;
  cin >> L >> R;
  R = min(R,L + 2019 *2);
  int ans = 2019;
  for(ll i=L;i < R;i++){
    for(ll j=i+1;j <= R;j++){
      int r = i * j % 2019;
      ans = min(ans,r);
    }
  }
  cout << ans << endl;

}

Measured memory_bytes: 256
n,k = map(int, input().split())
d = 0
A_lis = []
ans = [0] * n
for i in range(k):
    d = int(input())
    A = list(map(int, input().split()))
    A_lis.append(A)
for lis in A_lis:
    for value in lis:
        ans[value-1] += 1
print(ans.count(0))

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

int main(){

    int A, B, C, K;
    cin >> A >> B >> C >> K;

    int cnt = 0;
    while (A >= B){
        B *= 2;
        cnt++;
    }
    while (B >= C){
        C *= 2;
        cnt++;
    }
    if (cnt <= K) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define rep(i,a,n) for(int (i) = (a);(i) < (n);(i)++)
typedef long long ll;

using namespace std;

int main(){
	unsigned long long n,memo = 1;
	
	cin >> n;
	
	rep(i,0,n){
		memo = (memo*(i+1)) % (unsigned long long)(pow(10,9)+7);

	}
	
	cout << memo << endl;
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath> 
#include<iostream>
#define it register int
#define il inline
using namespace std;
const int N=1000005;
char s1[N],s2[N];
int n1,n2;
il bool cmp(char p,char q){
	return p>q;
}
int main(){
	cin>>(s1+1)>>(s2+1);
	it n1=strlen(s1+1),n2=strlen(s2+1);
	sort(s1+1,s1+1+n1),sort(s2+1,s2+1+n2,cmp);
	it minn=n1<n2?n1:n2;
	for(it i=1;i<=minn;++i){
		if(s1[i]>s2[i]) return puts("No"),0;
		if(s1[i]<s2[i]) return puts("Yes"),0;
	}
	n1<n2?puts("Yes"):puts("No");
	return 0;
}


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

int main(){
	int n;
	cin>>n;
	vector<pair<int, int>> pr(n);
	for(int i=0; i<n; i++){
		int a;
		cin>>a;
		pr[i]=make_pair(a,i+1);
	}
	sort(pr.begin(), pr.end());
	for(int i=0;i<n; i++){
		int a,b;
		tie(a,b)=pr[i];
		cout << b << " ";
	}

}

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

int main(){
    int n, m;
    int a[100][100], b[100], ans[100];
    
    cin >> n >> m;
    for(int i = 0;i < n;i++){
        for(int j = 0;j < m;j++){
            cin >> a[i][j];
        }
    }
    for(int i = 0;i < m;i++){
        cin >> b[i];
    }
    
    for(int i = 0;i < n;i++){
        for(int j = 0;j < m;j++){
            ans[i] += (a[i][j] * b[j]);
        }
    }
    
    for(int i = 0; i < n;i++){
        cout << ans[i] << endl;
    }
    
    return 0;
}


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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
//#define int ll
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<vvc> vvvc;
typedef pair<int, int> pii;
typedef pair<pii, pii> piii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector< vi > vvi;
typedef vector< vvi > vvvi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<string> vst;
typedef vector<vst> vvst;
typedef pair<ld, ld> pld;

#define inmin(a, b) a = min(a, (b))
#define inmax(a, b) a = max(a, (b))
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define sqr(x) ((x) * (x))
#define fori(i, n) for(int i = 0; i < int(n); ++i)
#define SZ(a) ((int)((a).size()))
#define triple(T) tuple<T, T, T>
#define quad(T) tuple<T, T, T, T>
#define watch(x) cerr << (#x) << " = " << (x) << endl;

#ifdef RUS_HOME
#define cerr cout
#else
#define cerr if (false) cerr
#endif

const double PI = 2 * acos(0.0);
#define rand shittttty_shit
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng_64(chrono::steady_clock::now().time_since_epoch().count());

const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";


template <class T0, class T1>
inline ostream & operator << (ostream &out, pair<T0, T1> &a) {
    return out << "{" << a.first << ", " << a.second << "}";
}

template <class T0, class T1>
inline istream & operator >> (istream &in, pair<T0, T1> &a) {
    return in >> a.first >> a.second;
}

template <class T0, class T1, class T2>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << "}";
}

template <class T0, class T1, class T2, class T3>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2, T3> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << ", " <<  get<3>(a) << "}";
}

template<class T>
inline ostream & operator << (ostream &out, vector<T> &a) {
    out << "[";
    fori (i, a.size())
        out << a[i] << vector<string>{", ", "]  "}[i + 1 == a.size()];
    return out;
}


void smain();



signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
#ifdef RUS_HOME
    freopen("input", "r", stdin);
    //freopen("output.txt", "w", stdout);
    clock_t start = clock();
#endif
    cout << setprecision(12) << fixed;
    smain();
#ifdef RUS_HOME
    cout << "\n\n\n\nTOTAL EXECUTION TIME: " << float( clock () - start ) /  CLOCKS_PER_SEC << endl;
#endif
    return 0;
}

const int N=5e4,M=110;



void smain() {

    int a,b,c;
    cin>>a>>b>>c;
    if(a==b&&a==c){
        cout<<"Yes";
    }else{
        cout<<"No";
    }


}

Measured memory_bytes: 3644
import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int solve (int n, int k, bool [] a)
{
	bool cur = false;
	int num = 0;
	int [] d;
	d ~= 0;
	foreach (ref c; a)
	{
		if (cur != c)
		{
			d ~= num;
			num = 0;
			cur = c;
		}
		num += 1;
	}
	d ~= num;
	d ~= 0;
	debug {writeln (d);}

	int [] s;
	s ~= 0;
	foreach (ref c; d)
	{
		s ~= s.back + c;
	}
	debug {writeln (s);}

	int res = -1;
	int delta = k * 2 + 1;
	for (int i = delta; i < s.length; i += 2)
	{
		debug {writeln (s[i], " ", s[i - delta]);}
		res = max (res, s[i] - s[i - delta]);
	}
	if (res == -1)
	{
		res = n;
	}
	return res;
}

void main ()
{
	int n;
	int k;
	while (readf (" %s %s", &n, &k) > 0)
	{
		readln;
		auto a = readln.strip.map !(q{a == '1'}).array;
		writeln (solve (n, k, a));
	}
}


Measured memory_bytes: 3196
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[200];
int main(void){
	int n; cin>>n;
	ll ans=1;
    string s; cin>>s;
    for(int i=0;i<n;i++){
		int k=s[i];
		//cout<<k<<endl;
		a[k]++;
	}
	for(int i=97;i<=123;i++){
		if(a[i]>0){
			ans=ans*(1+a[i])%1000000007;
		}
	}
    cout<<ans-1<<endl;
    
}


Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <set>
#include <map>
#define rep(i, n)   for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main(){
    int x,y,a,b,c;  cin >> x >> y >> a >> b >> c;
    vector<ll>p(a); rep(i, a)   cin >> p[i];
    vector<ll>q(b); rep(i, b)   cin >> q[i];
    vector<ll>r(c); rep(i, c)   cin >> r[i];
    sort(p.rbegin(), p.rend());
    sort(q.rbegin(), q.rend());
    rep(i, x)   r.push_back(p[i]);
    rep(i, y)   r.push_back(q[i]);
    sort(r.rbegin(), r.rend());
    ll ans = 0;
    rep(i, x+y) ans += r[i];
    cout << ans << endl;
}


Measured memory_bytes: 7868
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;

int main() {
    int n, k, q;
    cin >> n >> k >> q;

    int x[n+1];
    rep(i, n+1) {
        x[i] = 0;
    }

    rep(i, q) {
        int a;
        cin >> a;
        x[a]++;
    }

   for(int i = 1; i <= n; i++) {
       if(q-k >= x[i]) {
           cout << "No";
       }
       else {
           cout << "Yes";
       }
       cout << "\n";
   }

    return 0;
}

Measured memory_bytes: 1024
#include<string.h>
#include<stdio.h>
int main()
{
  char *s1,*s2,*s3;
  char x[100];

  scanf("%s",&x);

  s1="Sunny";
  s2="Cloudy";
  s3="Rainy";

  if(strcmp(x,s1)==0){
    printf("Cloudy\n");
  }

  else if(strcmp(x,s2)==0){
    printf("Rainy\n");
  }

  else if(strcmp(x,s3)==0){
    printf("Sunny\n");
      }
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rp(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

void solve(){
    int n;
    cin >> n;
    Vi a(n),b(n);
    rp(i,n) cin >> a.at(i);
    rp(i,n) cin >> b.at(i);
    Vi suma(n),sumb(n);
    repi(i,1,n){
        suma[i]=suma[i-1]+a[n-i];
        sumb[i]=sumb[i-1]+b[i-1];
    }
    ll sub=100000000;
    rp(i,n){
        chmin(sub,suma[i]+sumb[n-i-1]);
    }
    print(suma[n-1]+a[0]+sumb[n-1]+b[n-1]-sub);
    return;
}
int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    solve();
    return 0;
}

Measured memory_bytes: 3672
def left(num):
    return int(num*2)

def right(num):
    return int(num*2)+1

def maxHeapify(i, H):
    l = left(i)
    r = right(i)
    if l <= H and A[l] > A[i]:
        largest = l
    else:
        largest = i
    if r <= H and A[r] > A[largest]:
        largest = r
    
    if largest != i:
        A[i], A[largest] = A[largest], A[i]
        maxHeapify(largest, H)

def buildMaxHeap(H):
    for i in range(int(H/2), 0, -1):
        maxHeapify(i, H)

if __name__ == "__main__":
    H = int(input())
    A = [-1] + list(map(int, input().split()))
    buildMaxHeap(H)
    print(' ' + ' '.join(map(str, A[1:])))



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

int main() {

  int k,x; cin >> k >> x ;
   
  for ( int i = -200 ; i < 200 ; i++ ){
  	 if (  (x - k +1) <= i  && i <= ( x+k-1) ) 
    cout << i << ' ' ;
  }
	cout << endl ;
  

}

Measured memory_bytes: 256