akhauriyash/Code-Regression huggingface dataset:
/*
  Krishnakant Tiwari
  Problem Link:

 */
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")
using namespace std;
typedef long long ll;
#define _cin      ios_base::sync_with_stdio(0);  cin.tie(0);
#define endl "\n"
#define pb push_back
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define repd(i,a,b) for(ll i=a;i>=b;--i)
#define mp make_pair
#define hell 1000000007
#define vvll vector<vector<ll> >
#define vll vector<ll>
#define mll map<ll,ll>
#define sz(x) (ll)x.size()
#define sll set<ll>
#define pll pair<ll,ll>
#define F first
#define S second
#define eb	emplace_back
#define ppb	pop_back
#define pf	push_front
#define ppf	pop_front
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for (auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define precise(x)	cout<<fixed<<setprecision(x)
const ll MAX = 1000004;
const ll INF = 1e18L + 5;
template <class T, class U>
void chmin(T &t, const U &u)
{
    if (t > u) t = u;
}
template <class T, class U>
void chmax(T &t, const U &u)
{
    if (t < u) t = u;
}
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T)
{
    cerr << " " << H;
    debug_out(T...);
}
template <typename Arg1>
void pn(Arg1 &&arg1)
{
    cout << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void pn(Arg1 &&arg1, Args &&... args)
{
    cout << arg1 << "\n";
    pn(args...);
}
template <typename Arg1>
void ps(Arg1 &&arg1)
{
    cout << arg1 << " ";
}
template <typename Arg1, typename... Args>
void ps(Arg1 &&arg1, Args &&... args)
{
    cout << arg1 << " ";
    ps(args...);
}
template <typename Arg1>
void read(Arg1 &&arg1)
{
    cin >> arg1;
}
template <typename Arg1, typename... Args>
void read(Arg1 &&arg1, Args &&... args)
{
    cin >> arg1;
    read(args...);
}
vll arr[MAX];
ll vis[MAX];
ll ch[MAX];
void dfs(ll u)
{
    vis[u] = true;
    ch[u]=1;
    for(auto i : arr[u])
    {
        if(!vis[i])
        {
            dfs(i);
            ch[u]+=ch[i];
 
        }
    }
}
void solve()
{

    ll n, m;
    read(n, m);
    rep(i, 0, m)
    {
        ll u, v;
        u--, v--;
        read(u, v);
        arr[u].pb(v);
        arr[v].pb(u);
    }
    memset(vis, false, sizeof(vis));
     memset(ch, 0, sizeof(ch));
    ll ans = 0;
    rep(i, 0, n)
    {
        if(!vis[i])
        {
            dfs(i);
            chmax(ans, ch[i]);
        }
    }
    pn(ans);

}


int main()
{

    _cin
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
    // ll tc;
    // cin>>tc;
    // while(tc--){
    solve();
    // }

}


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

    def root(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.root(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

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

N, K, L = map(int, input().split())
ufa = UnionFind(N)
ufb = UnionFind(N)

for _ in range(K):
    p,q = map(int,input().split())
    ufa.union(p,q)
for _ in range(L):
    r,s = map(int,input().split())
    ufb.union(r,s)

pairs = {}
for i in range(1,N+1):
    key = (ufa.root(i),ufb.root(i))
    if  key in pairs.keys():
        pairs[key] +=1
    else:
        pairs[key] =1
ans = []
for i in range(1,N+1):
    key = (ufa.root(i),ufb.root(i))
    ans.append(str(pairs[key]))
print(' '.join(ans))


Measured memory_bytes: 64024
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <cctype>
#include <queue>
#include <stdlib.h>
#include <cstdlib>
#include <math.h>
#include <set>
#include"queue"
#include <vector>
#define inf 107374182
#define M 10010001
#define ll long long
#define PII pair<int,int>
using namespace std;
const int N=200110;

int main()
{
	int t;
	scanf("%d",&t);
	if(t==1)
	{
		printf("0\n");
	}
	else
	{
		printf("1\n");
	}
    
}

Measured memory_bytes: 3684
#include <bits/stdc++.h>
using namespace std;
#define REP(i, m, n) for(int i = m; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define dup(x, y) (((x) + (y)-1) / (y))
#define PI 3.14159265359
typedef long long LL;
typedef vector<vector<int>> Graph;
typedef vector<int> Vector;
const LL MOD = 1e9 + 7;
const LL LLINF = 1LL << 60;
const int INF = 1 << 30;
template <class T> inline void chmax(T &a, T b) {
    if(a < b) {
        a = b;
    }
}
template <class T> inline void chmin(T &a, T b) {
    if(a > b) {
        a = b;
    }
}
template <class T> inline T gcd(T x, T y) {
    if(y == 0) {
        return x;
    } else if(x == 0) {
        return y;
    }
    return gcd(y, x % y);
}
template <class T> inline T lcm(T x, T y) { return (x * y) / gcd(x, y); }
template <class T> inline void print_vector(vector<T> vec) {
    for(int i = 0; i < vec.size(); i++) {
        cout << vec[i] << " ";
    }
    cout << endl;
}
template <class T> inline T mpower(T x, T n) {
    if(n == 0) {
        return 1;
    } else if(n % 2 == 0) {
        return mpower(x * x % MOD, n / 2);
    } else {
        return x * mpower(x, n - 1) % MOD;
    }
}
LL mfrac(LL x) {
    LL res = 1;
    for(LL i = x; i >= 1; i--) {
        res *= i;
        res %= MOD;
    }
    return res;
}
LL mcomb(LL n, LL r) {

    if(n == 0 and r == 0) {
        return 1;
    } else if(n < r || n < 0) {
        return 0;
    }

    LL res = mfrac(n) * mpower(mfrac(r), MOD - 2) % MOD;
    res *= mpower(mfrac(n - r), MOD - 2) % MOD;

    return res;
}

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

    vector<LL> A(N);
    rep(i, N) cin >> A[i];

    vector<LL> ruiseki(N);
    ruiseki[0] = A[0];
    for(int i = 1; i < N; i++) {
        ruiseki[i] = ruiseki[i - 1] + A[i];
    }

    LL index =
        upper_bound(ALL(ruiseki), dup(ruiseki[N - 1], 2LL)) - ruiseki.begin();
    if(index == 0) {
        cout << abs(2 * ruiseki[0] - ruiseki[N - 1]) << endl;
    } else {
        cout << min(abs(2*ruiseki[index] - ruiseki[N-1]),abs(2*ruiseki[index-1] - ruiseki[N-1])) << endl;
    }

    return 0;
}


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

const int Maxn = 600015;

int n;
int a[Maxn];
int S[Maxn], slen;
int Z[Maxn];

int main()
{
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
        scanf("%d", &a[i]);
    for (int i = 0; i < n; i++)
        scanf("%d", &S[i]);
    slen = n;
    for (int i = 0; i < n; i++)
        S[slen++] = a[i];
    for (int i = 0; i + 1 < n; i++)
        S[slen++] = a[i];
    int l = -1, r = -1;
    for (int i = 1; i < slen; i++) {
        if (i <= r) Z[i] = min(r - i, Z[i - l]);
        int mask = (S[0] ^ S[i]);
        while (i + Z[i] < slen && (S[Z[i]] ^ S[i + Z[i]]) == mask)
            Z[i]++;
        if (i >= n && Z[i] >= n) printf("%d %d\n", i - n, mask);
        if (i + Z[i] - 1 > r) {
            l = i; r = i + Z[i] - 1;
        }
    }
    return 0;
}


Measured memory_bytes: 9600
#include<bits/stdc++.h>
using namespace std;
#define MAXN 100000
#define ff first
#define ss second
#define ll long long
#define int long long
#define mod 1000000007
#define pii pair<ll,ll>
#define vi vector<ll>
#define mii map<ll,ll>
#define pb push_back
#define mp make_pair
#define ps(x,y) fixed<<setprecision(y)<<x
#define mk(arr,n,type) type *arr=new type[n];
#define w(x) ll x; cin>>x; while(x--)
#define endl '\n'
#define str string
void kehsihba(){
   ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
   freopen("input.txt", "r", stdin);
   freopen("output.txt", "w", stdout);
#endif
}
int32_t main() {
	//kehsihba();
	str s;
	cin>>s;
	int ans[26]={0};
	for(int i=0;i<s.length();i++){
		ans[s[i]-'a']+=1;
	}
	bool a=true;
	for(int i=0;i<26;i++){
		if(ans[i]%2!=0){
			a=false;break;
		}
	}
	if(a){
		cout<<"Yes";
	}
	else{
		cout<<"No";
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    int n, d[100005] = {1};
    cin >> n;
    for (int i = 1; i <= 100000; i++) {
        for (int j = 100; j <= 105; j++) {
            if (j <= i) d[i] |= d[i - j];
        }
    }
    cout << d[n];
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // std::ifstream in("input.txt");
    // std::cin.rdbuf(in.rdbuf());
    ll n, k;
    cin >> n >> k;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    vector<ll> sorted(n);
    rep(i, n) {
        if (i == 0) {
            sorted[i] = 1;
        }
        else {
            if (a[i] > a[i - 1]) sorted[i] = sorted[i - 1] + 1;
            else sorted[i] = 1;
        }
    }
    set<ll> s;
    rep(i, k - 1) s.insert(a[i]);
    bool orig = false;
    ll ans = 0;
    rep(i, n - k + 1) {
        if (sorted[i + k - 1] >= k) {
            if (!orig) {
                ans++;
                orig = true;
            }
        }
        else {
            if (i == 0) {
                ans++;
            }
            else {
                auto it = s.end(); it--;
                ll mav = *it;
                it = s.begin();
                ll miv = *it;
                if ((a[i - 1] > miv) || (a[i + k - 1] < mav)) ans++;
            }
        }
        // printf("[before] "); for(auto x : s) printf("%lld ", x); printf("\n");
        s.erase(a[i]);
        s.insert(a[i + k - 1]);
        // printf("[after] "); for(auto x : s) printf("%lld ", x); printf("\n");
        // printf("i=%lld, ans=%lld\n", i, ans);
    }
    // rep(i, n) printf("%lld%s", sorted[i], (i == (n - 1)) ? "\n" : " ");
    cout << ans << endl;
    return 0;
}


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

int main()
{
	int N, K, num(1), A(0), B(0);
	cin >> N >> K;

	for (int i = 0; i < N; i++)
	{
		if ((num * 2) < (num + K))
		{
			num *= 2;
			A++;
		}
		else
		{
			num += K;
			B++;
		}
	}

	cout << num << endl;

	return 0;
}


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

int main()
{
    string s;
    string result;
    int k;
    cin >> k >> s;

    if(s.size() <= k){
        cout << s << endl;
    }
    else{
        for(int i = 0; i < k; i++){
            result.push_back(s.at(i));
        }
        result.push_back('.');
        result.push_back('.');
        result.push_back('.');
        
        cout << result << endl;
    }
    return 0;
}

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

bool function(int N) {
	int a, b, c, d;
	a = N / 1000;
	N -= a * 1000;
	b = N / 100;
	N -= b * 100;
	c = N / 10;
	N -= c * 10;
	d = N;

	if (b != c)
		return false;
	else if (a == b || c == d)
		return true;
	else
		return false;
}
int main(void) {
	int n;
	cin >> n;

	bool ret = function(n);
	if (ret)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

#define inf (1<<30)-1
#define INF (1LL<<62)-1
#define MOD 1000000007LL
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(),x.end()
#define PI acos(-1)
#define MEM(x,y) memset(x,y,sizeof (x))
#define debug cout<<"A"<<'\n'
#define REP(i,a,b) for (int i=(a); i<=(b); i++)
#define PER(i,a,b) for (int i=(a); i>=(b); i--)
#define REPL(i,a,b) for (LL i=(a); i<=(b); i++)
#define PERL(i,a,b) for (LL i=(a); i>=(b); i--)
#define print(x) cout<<x<<'\n'
#define itrALL(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define UNIQUE(X) X.erase( unique( X.begin(), X.end() ), X.end() )


typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int,int>PII;
typedef pair<LL,LL>PLL;
typedef vector<int> VI;
typedef vector<LL> VL;


// Order Statistic Tree

/* Special functions:

        find_by_order(k) --> returns iterator to the kth largest element counting from 0
        order_of_key(val) --> returns the number of items in a set that are strictly smaller than our item
*/

typedef tree<
PII,
null_type,
less<PII>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

template <class T> inline T bigmod(T p,T e,T M)
{
    T ret = 1;
    for(; e > 0; e >>= 1)
    {
        if(e & 1) ret = (ret * p) % M;
        p = (p * p) % M;
    } return (T)ret;
}

template <class T> inline T gcd(T a,T b){if(b==0)return a;return gcd(b,a%b);}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}
template <class T, class X> inline bool getbit(T a, X i) { T t=1; return ((a&(t<<i))>0);}
template <class T, class X> inline T setbit(T a, X i) { T t=1;return (a|(t<<i)); }
template <class T, class X> inline T resetbit(T a, X i) { T t=1;return (a&(~(t<<i)));}

/*end of header*/

int n,par[100009],level[100009],subsize[100009];
VI graph[100009];

void dfs(int u)
{
    subsize[u]=1;
    REP(i,0,graph[u].size()-1)
    {
        int v=graph[u][i];
        if(v==par[u])continue;
        level[v]=level[u]+1;
        par[v]=u;
        dfs(v);
        subsize[u]+=subsize[v];
    }
}
int main()
{
    //freopen("input_file_name.in","r",stdin);
    //freopen("output_file_name.out","w",stdout);
    scanf("%d",&n);
    int a,b;
    REP(i,1,n-1)
    {
        scanf("%d %d",&a,&b);
        graph[a].PB(b);
        graph[b].PB(a);
    }
    par[1]=-1;
    dfs(1);
    int cnt=(level[n]-1)/2;
    int now=n;
    while(cnt)
    {
        now=par[now];
        cnt--;
    }
    if(subsize[now]<subsize[1]-subsize[now])print("Fennec");
    else print("Snuke");
    return 0;
}



Measured memory_bytes: 13184
n = int(input())
a = []
for i in range(1, 100):
    for j in range(1, 100):
        for k in range(1, 100):
            a.append(i**2 + j**2 + k**2 + i*j + j*k + k*i)
a.sort()
ix = 0
for i in range(1, n+1):
    res = 0
    while(a[ix] == i):
        res+=1
        ix+=1
    print(res)

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

int N, K;
vector< int > g[2000];
bool v[2000];

int dfs(int idx, int limit)
{
  if(limit < 0) return(0);
  int ret = 1;
  for(int to : g[idx]) {
    if(v[to]++) continue;
    ret += dfs(to, limit - 1);
  }
  return(ret);
}

int Solve1()
{
  int ret = 114514;
  for(int i = 0; i < N; i++) {
    memset(v, false, sizeof(v));
    v[i] = true;
    ret = min(ret, N - dfs(i, K / 2));
  }
  return(ret);
}

int Solve2()
{
  int ret = 114514;
  for(int u = 0; u < N; u++) {
    for(int to : g[u]) {
      memset(v, false, sizeof(v));
      v[u] = v[to] = true;
      ret = min(ret, N - dfs(u, K / 2) - dfs(to, K / 2));
    }
  }
  return(ret);
}

int main()
{  
  scanf("%d %d", &N, &K);
  for(int i = 0; i < N - 1; i++) {
    int A, B;
    scanf("%d %d", &A, &B);
    --A, --B;
    g[A].push_back(B);
    g[B].push_back(A);
  }
  if(K % 2 == 0) cout << Solve1() << endl;
  else cout << Solve2() << endl;
}


Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <map>
#include <cmath>
#include <queue>
#include <stack>
#include <list>

using namespace std;

#define EPS (1e-10)

struct Point{
    Point(double _x = 0, double _y = 0){
        x = _x;
        y = _y;
    }
    double x;
    double y;

    Point operator + (Point p){
        return Point(x + p.x, y+ p.y);
    }

    Point operator - (Point p){
        return Point(x - p.x, y - p.y);
    }

    Point operator * (double a){
        return Point(a * x, a * y);
    }

    Point operator / (double a){
        return Point(x / a, y / a);
    }

    double abs(){
        return sqrt(norm());
    }

    double norm(){
        return x * x + y * y;
    }

    bool operator < (const Point &p) const{
        return x!=p.x ? x < p.x : y < p.y;
    }

    bool operator == (const Point &p) const{
        return fabs(x - p.x) && fabs(y - p.y) < EPS;
    }

};

typedef Point Vector;

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

int main() {

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

    for(int i=0;i<q;i++){
        Point p0 = Point(0,0);
        Point p1 = Point(0,0);
        Point p2 = Point();
        Point p3 = Point();

        cin >> p0.x >> p0.y >> p1.x >> p1.y >> p2.x >> p2.y >> p3.x >> p3.y;

        Vector v1 = p1 - p0;
        Vector v2 = p3 - p2;

        //直行判定
        if(fabs((v1.x*v2.x) + (v1.y*v2.y)) < EPS){
            printf("1\n");
        }

        //並行判定
        else if(fabs((v1.x*v2.y) - (v1.y*v2.x)) < EPS){
            printf("2\n");
        }

        else{
            printf("0\n");
        }

    }


    return 0;

}


Measured memory_bytes: 3272
#include <bits/stdc++.h>
using namespace std;
int main(void){
   int n;
   cin >> n;
   vector<int> t;
   vector<string> s;
   for(int i = 0;i < n;i++) {
       int x;
       string y;
       cin >> y >> x;
       t.push_back(x);
       s.push_back(y);
   }
   string ans;
   cin >> ans;
   int flag = 0;
   int count = 0;
   for(int i = 0;i < n;i++) {
       if(flag==1) {
           count+=t[i];
       }
       if(ans==s[i]) {
           flag = 1;
       }
   }
   cout << count << endl;
}


Measured memory_bytes: 256
while True:
    num = int(input())
    if num == 0:
        break
    L = []
    for i in range(num):
        id, m1, s1, m2, s2, m3, s3, m4, s4 = [int(x) for x in input().split()]
        t = (m1 + m2 + m3 + m4) *60 + s1 + s2 + s3 + s4
        L.append([t, id])
    L.sort()
    print(L[0][1])
    print(L[1][1])
    print(L[-2][1])


Measured memory_bytes: 6152
int main(void)
{
    int N, n = 0;
    int temp;
    
    
    scanf("%d", &N);
    
    temp = N;
    
    while(1)
    {
        n += temp%10;
        
        if(temp/10)
            temp /= 10;
        else
            break;
    }
    
    if(N%n == 0)
        printf("Yes\n");
    else
        printf("No\n");

    //system("pause");
    
    return 0;
}

Measured memory_bytes: 128
N,K = map(int,input().split())
X = []; Y = []; info = []
for i in range(N):
    x,y = map(int,input().split())
    X.append(x); Y.append(y); info.append([x,y])
X.sort(); Y.sort()
ans = float('inf')
for i in range(N):
    for j in range(i+1,N):
        for k in range(N):
            for l in range(k+1,N):
                cnt = 0
                for x, y in info:
                    if X[i] <= x <= X[j] and Y[k] <= y <= Y[l]:
                        cnt += 1
                if cnt < K:
                    continue
                S = (Y[l]-Y[k])*(X[j]-X[i])
                if S < ans:
                    ans = S
print(ans)

Measured memory_bytes: 47000
#include <bits/stdc++.h>
using namespace std;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int N,M;
int Q;
string in;
int l,r;
int num[120000];
vector<int> v;

void solve() {
  v.push_back(num[r-1] - num[l-1]);
}

void a() {
  num[0] = 0;
  for(int i = 0; i+1 < in.size(); i++){
    if(in[i] == 'A' && in[i+1] == 'C') num[i+1] = num[i] + 1;
    else num[i+1] = num[i];
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin >> N >> Q;
  cin >> in;
  a();
  for(int i = 0; i < Q; i++) {
    cin >> l >> r;
    solve();
  }

  for(auto i = begin(v); i != end(v); i++) {
    cout << *i << endl;
  }
  return 0;


}


Measured memory_bytes: 1864
/*AOJ 0023*/

#include<iostream>
#include<vector>
#include<math.h>

using namespace std;

class Circle_obj{
public:
	double x,y,r;
};

int isCircleToCircle(Circle_obj a,Circle_obj b){

	double tmpX = a.x - b.x;
	double tmpY = a.y - b.y;

	double R = sqrt(tmpX*tmpX + tmpY*tmpY);

	if(a.r >= b.r){
		if( R + b.r < a.r){
			return 2;
		}
	}
	else{
		if( R + a.r < b.r ){
			return -2;
		}
	}

	if( R <= a.r + b.r){
		return 1;
	}
	else{
		return 0;
	}
}

int main(){

	int n;

	cin>>n;

	Circle_obj a,b;

	vector<int> data;

	for(int i=0;i<n;i++){
		cin>>a.x;
		cin>>a.y;
		cin>>a.r;
		cin>>b.x;
		cin>>b.y;
		cin>>b.r;

		cout<<isCircleToCircle(a,b)<<endl;

		//data.push_back(isCircleToCircle(a,b));
	}
	/*
	for(int i=0;i<n;i++){
		cout<<data.at(i)<<endl;
	}
	*/

	return 0;
}

Measured memory_bytes: 0
import itertools
N=int(input())
P=tuple(map(int,input().split()))
Q=tuple(map(int,input().split()))
l=list(itertools.permutations(range(1,N+1)))
Xp=l.index(P)+1
Xq=l.index(Q)+1
print(abs(Xp-Xq))

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

int main () {
    int a,b,c;
    int a1,b1,c1;
    cin >> a >> b >> c;
    if (a > b) {
        a1 = a;
        b1 = b;

        a = b1;
        b = a1;
    }
    // a < b確定
    if (c < b) {
        if (c < a) {
            // c < a < b
            a1 = a;
            b1 = b;
            c1 = c;

            a = c1;
            b = a1;
            c = b1;
        } else {
            //a < c < b
            b1 = b;
            c1 = c;

            b = c1;
            c = b1;
        }
    }
    cout << a <<" "<< b << " " << c << endl;
}


Measured memory_bytes: 3084
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n)for(int i=0;i<(int)(n);i++)
#define PI 3.141592653589793
//vector < vector<int>>a(0, vector<int>(0));二次元配列宣言


int main()
{
	int a;
	cin >> a;
	string s;
	cin >> s;
	if (a >= 3200)
		cout << s << endl;
	else
		cout << "red" << endl;
}

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

int main() {
  int n;
  string s;
  cin >> n >> s;
  if (n % 2 == 0) {
    string a = s.substr(0, n / 2);
    string b = s.substr(n / 2);
    cout << (a == b ? "Yes" : "No") << '\n';
  } else {
    cout << "No" << '\n';
  }
  return 0;
}

Measured memory_bytes: 256
X,Y,a,b,c = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort()
B.sort()
C.sort()

ans = 0
if X < a:
    A = A[a-X:]
if Y < b:
    B = B[b-Y:]
ans = 0
for i in range(X+Y):
    if len(A) == 0:
        A.append(0)
    if len(B) == 0:
        B.append(0)
    if len(C) == 0:
        C.append(0)
    if max(A[-1],B[-1],C[-1]) == A[-1]:
        ans += A[-1]
        A.pop()
    elif max(A[-1],B[-1],C[-1]) == B[-1]:
        ans += B[-1]
        B.pop()
    else:
        ans += C[-1]
        C.pop()
print(ans)

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

using namespace std;

#define fin cin
#define fout cout
//ifstream fin("x.in"); ofstream fout("x.out");

typedef long long i64;
const int nmax = 1e5;
const int mod = 1e9 + 7;

i64 ans;

vector<pair<int, int>> g[nmax + 1];
int d[nmax + 1], mxfiu[nmax + 1];
bool viz[nmax + 1];

void dfs (int nod, int val) {
    viz[nod] = 1;

    d[nod] = 1;
    for (auto i : g[nod]) {
        if (viz[i.first] == 0) {
            dfs(i.first, i.second);

            d[nod] += d[i.first];
            mxfiu[nod] = max(mxfiu[nod], d[i.first]);
        }
    }

    ans += 2LL * val * d[nod];
}

int main() {
    fin.sync_with_stdio(false); fin.tie(); fout.tie();

    int n;
    fin >> n;

    for (int i = 1; i < n; ++ i) {
        int x, y, z;
        fin >> x >> y >> z;
        g[x].push_back({y, z});
        g[y].push_back({x, z});
    }

    dfs(1, 0);

    int cen = -1;
    for (int i = 1; i <= n; ++ i) {
        if (mxfiu[i] <= n / 2 && n - d[i] <= n / 2) {
            cen = i;
        }
    }

    memset(viz, 0, sizeof(viz));

    ans = 0;
    dfs(cen, 0);

    int mn = 1 << 30;
    int cnt = 0, lst = 0;

    for (auto i : g[cen])
        mn = min(mn, i.second);

    for (auto i : g[cen]) {
        if (2 * d[i.first] == n) {
            ++ cnt;
            lst = i.second;
        }
    }

    if (cnt == 1)
        mn = lst;

    ans -= mn;
    fout << ans << "\n";

    return 0;
}


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

#define MAX_N 3000
int N;
vector<double> P;
vector<vector<double>> memo;

double search(int n, int s) {
  if (n == N) {
    if (s >= (N + 1) / 2) {
      return 1.0;
    } else {
      return 0.0;
    }
  }
  if (memo[n][s] != -1.0) return memo[n][s];
  double ret0 = search(n + 1, s + 1) * P[n];
  double ret1 = search(n + 1, s) * (1 - P[n]);
  memo[n][s] = (ret0 + ret1);
  return memo[n][s];
}

int main(void) {
  ios::sync_with_stdio(false);
  cin >> N;
  P.resize(N);
  rep(i, N) { cin >> P[i]; }
  memo.resize(N, vector<double>(N, -1.0));
  double Ans = search(0, 0);
  cout << setprecision(10) << Ans << endl;
  return 0;
}


Measured memory_bytes: 70912
#include <iostream>
#include <cstdio>
#include <vector>
#include <iomanip>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
using namespace std;

inline long long lpow(long long b, long long p) {
    long long res = 1;

    for (int i = 1; i <= p; ++i) {
        res *= b;
    }

    return res;
}

int main() {
    long long X;
    cin >> X;

    bool found = false;

    for (long long A = -500; A <= 500 && !found; ++A) {
        for (long long B = -500; B < A; ++B) {
            long long res = lpow(A, 5) - lpow(B, 5);

            if (res == X) {
                cout << A << " " << B << endl;
                found = true;
                break;
            }
        }
    }


    return 0;
}

Measured memory_bytes: 3636
def cmb(n, r, mod):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return (fact[n] * factinv[r] * factinv[n-r]) % mod
mod = 10**9 + 7

fact = [1, 1]
factinv = [1, 1]
inv = [0,1]

n , m = map(int,input().split())
for i in range(2,m+1):
    fact.append((fact[-1] * i) % mod)
    inv.append((inv[mod % i] * (mod - (mod // i))) % mod)
    factinv.append((factinv[-1] * inv[-1]) % mod)

ans = 0

for i in range(0,n+1):
    ans += cmb(n,i,mod)*((-1)**i)*fact[m]*factinv[m-i]*(fact[m-i]*factinv[m-n])**2
    ans %= mod
print(ans)

Measured memory_bytes: 192908
#define _GLIBCXX_DEBUG
// header {{{
#include <bits/stdc++.h>
using namespace std;
#define CPP_STR(x) CPP_STR_I(x)
#define CPP_CAT(x,y) CPP_CAT_I(x,y)
#define CPP_STR_I(args...) #args
#define CPP_CAT_I(x,y) x ## y
#define ASSERT(expr...) assert((expr))
using i8  = int8_t;
using u8  = uint8_t;
using i16 = int16_t;
using u16 = uint16_t;
using i32 = int32_t;
using u32 = uint32_t;
using i64 = int64_t;
using u64 = uint64_t;
using f32 = float;
using f64 = double;
using f80 = __float80;
// }}}
constexpr i64 INF = 1'010'000'000'000'000'017LL;
constexpr i64 MOD = 1'000'000'007LL;
constexpr f64 EPS = 1e-12;
constexpr f64 PI = 3.14159265358979323846;
// util {{{
#define FOR(i, start, end) for(i64 i = (start), CPP_CAT(i,xxxx_end)=(end); i < CPP_CAT(i,xxxx_end); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(f,c,...) (([&](decltype((c)) cccc) { return (f)(std::begin(cccc), std::end(cccc), ## __VA_ARGS__); })(c))

template<typename C>
i64 SIZE(const C& c) { return static_cast<i64>(c.size()); }
template<typename T, size_t N>
i64 SIZE(const T (&)[N]) { return static_cast<i64>(N); }
template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) {
        xmax = x;
        return true;
    }
    return false;
}

template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) {
        xmin = x;
        return true;
    }
    return false;
}
// }}}

// init {{{
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;
// }}}

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

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

    vector<int> l(n);

    int mx = 0;
    int sum = 0;

    for(int i=0;i<l.size();i++){
        cin >> l.at(i);
        
        if(l.at(i) > mx){
            mx = l.at(i);
        }
        sum += l.at(i);
    }
    
    if( sum - mx > mx ){
        cout<<"Yes"<<endl;
    } else {
        cout<<"No"<<endl;
    }


    // cout << ans << endl;
    return 0;
}

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

int main(){
  ll N;
  bool f=true;
  cin>>N;
  ll A[N];
  for(int i=0;i<N;i++) cin>>A[i];
  sort(A,A+N);
  for(int i=0;i<N-1;i++){
    if(A[i]==A[i+1]){
      f=false;
      break;
    }
  }
  if(f) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);++(i))
#define all(x) (x).begin(),(x).end()
#define dump(x) cout << #x << " = " << (x) << endl
using namespace std;
using ll = long long;


int main() {
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  rep(i, n) cin >> a[i];

  rep(ki, k) {
    vector<int> b(n+1);
    rep(i, n) {
      int l = max(0, i - a[i]);
      int r = min(n - 1, i + a[i]);

      b[l]++;
      b[r + 1]--;
    }

    rep(i, n) b[i + 1] += b[i];
    b.pop_back();
    if (a == b) break;
    a = b;
  }

  rep(i, n) cout << a[i] << " ";
  cout << endl;
}


Measured memory_bytes: 4820
#include<stdio.h>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<utility>
#include<memory>
#include<cmath>
#include<stack>
#include<tuple>
#include<numeric>
#include<cassert>

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define pb push_back
#define DEBUG false

using namespace std;

using ll = long long;
using P = pair<int,int>;
using Pl = pair<int,ll>;

const int mod=1e9+7,INF=1<<30;
const double EPS=1e-12,PI=3.1415926535897932384626;
const ll LINF=1LL<<60;
const int MAX_K = 100005;
const ll lmod = 1e9+7;

int K;

class edge{
  public:
    ll cost;int to;
  edge(ll cost,int to)
    :cost(cost),to(to){}
};
vector<edge> e[MAX_K];
ll d1[MAX_K];

void dijkstra(int start,vector<edge> graph[],ll d[]){
  priority_queue<Pl,vector<Pl>,greater<Pl>> que;
  fill(d,d+MAX_K,LINF);
  d[start] = 0LL;
  que.push(Pl(0LL,start));
  while(!que.empty()){
    P p=que.top(); que.pop();
    int v=p.second; //行き先
    if(d[v]<p.first)  continue;
    rep(i,graph[v].size()){
      edge e=graph[v][i];
      if(d[v]+e.cost<d[e.to]){
        d[e.to]=d[v]+e.cost;
        que.push(P(d[e.to],e.to));
      }
    }
  }
  return ;
}



int main(){
  cin >> K ;
  rep(i,K){
    e[i].pb(edge(1LL,(i+1)%K));
  }
  REP(i,1,K){
    e[i].pb(edge(0LL,(i*10)%K));
  }
  dijkstra(1,e,d1);
  cout << d1[0] + 1LL << endl;
  return 0;
}


Measured memory_bytes: 9208
import java.util.Scanner;

class Dice {
	private int a[] = new int[6];

	Dice(int face[]){
		for(int i = 0; i < 6; i++) {
			this.a[i] = face[i];
		}
	}

	public void roll(char c) {
		int temp;
		switch(c) {
		case 'E':
			temp = this.a[5];
			this.a[5] = this.a[2];
			this.a[2] = this.a[0];
			this.a[0] = this.a[3];
			this.a[3] = temp;
			break;
		case 'N':
			temp = a[5];
			this.a[5] = this. a[4];
			this.a[4] = this.a[0];
			this.a[0] = this.a[1];
			this.a[1] = temp;
			break;
		case 'S':
			temp = this.a[5];
			this.a[5] = this.a[1];
			this.a[1] = this.a[0];
			this.a[0] = this.a[4];
			this.a[4] = temp;
			break;
		case 'W':
			temp = this.a[5];
			this.a[5] = this.a[3];
			this.a[3] = this.a[0];
			this.a[0] = this.a[2];
			this.a[2] = temp;
			break;
		}
	}

	public int getA(int i) {
		return this.a[i];
	}

}


public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int face[] = new int[6];
		for(int i = 0; i < 6; i++) {
			face[i] = sc.nextInt();
		}
		String command = sc.next();
		char com[] = command.toCharArray();  //コマンドを配列にする

		Dice d1 = new Dice(face);

		for(int i = 0; i < command.length(); i++) {
			//System.out.println(face);
				d1.roll(com[i]);

		}
		System.out.println(d1.getA(0));

	}

}



Measured memory_bytes: 26208
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws NumberFormatException, IOException {
		// TODO ?????????????????????????????????????????????
		// TODO ?????????????????????????????????????????????
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(br.readLine());

		String[] strArray = br.readLine().split(" ");
		Card[] cards1 = new Card[n];
		Card[] cards2 = new Card[n];
		
		for(int i = 0; i < n; i++){
			cards1[i] = new Card(strArray[i]);
			cards2[i] = new Card(strArray[i]);
		}
		
		bubbleSor(cards1, n);
		printArray(cards1);
		isStable(cards1);
		
		selectionSort(cards2, n);
		printArray(cards2);
		isStable(cards2);
	}

	static int bubbleSor(Card[] array, int n){
		int flag = 1;
		int count = 0;
		while(flag == 1){
			flag = 0;
			for(int j = n - 1; j >= 1; j--){
				if(array[j].number < array[j - 1].number){
					Card tmp = array[j];
					array[j]  = array[j - 1];
					array[j - 1] = tmp;
					flag = 1;
					count++;
				}
			}
		}

		return count;
	}

	static int selectionSort(Card[] array, int n){
		int count = 0;
		for(int i = 0; i < n; i++){
			int minJ = i;
			for(int j = i; j < n; j++){
				if(array[j].number < array[minJ].number){
					minJ = j;
				}
			}
			Card tmp = array[i];
			array[i]  = array[minJ];
			array[minJ] = tmp;
			if(i != minJ){
				count++;
			}
		}

		return count;
	}
	
	static void isStable(Card[] array){
		//int number = array[0].number;
		boolean result = true;
		for(int i = 1 ; i < array.length ; i++){
			if(array[i - 1].number == array[i].number && array[i - 1].getID() > array[i].getID()){
				result =  false;
			}
		}
		
		if(result){
			System.out.println("Stable");
		}
		else{
			System.out.println("Not stable");
		}
	}

	static void printArray(Card[] array){
		for(int i = 0; i < array.length ;i++){
			System.out.print(array[i].toString());
			if(i != array.length - 1){
				System.out.print(" ");
			}
		}
		System.out.println();
	}

}

class Card {
	private static int idSeed = 0;
	private int id;
	char mark;
	int number;

	public Card(char mark, int number) {
		// TODO ?????????????????????????????????????????????????????????
		this.mark = mark;
		this.number = number;
		this.id = idSeed;
		this.idSeed++;
	}

	public Card(String str){
		if(str.length() != 2){
			this.mark = 0;
			this.number = -1;
		}

		else{
			this.mark = str.charAt(0);
			this.number = Character.digit(str.charAt(1), 10);
		}
		this.id = idSeed;
		this.idSeed++;
	}

	public String toString(){
		return mark + "" + number;
	}
	
	public int getID(){
		return id;
	}
}

Measured memory_bytes: 24488
#include <iostream>
using namespace std;
using ll = long long;
int main() {
    int n,m;
    cin >> n >> m;
    ll ans = 1;
    for (int i = 0; i < n; i++) {
        ans *= (m - i);
        ans %= 1000000007;
    }
    ll p = 1;
    ll q = 0;
    for (int i = 0; i < n; i++) {
        ll pp = p;
        ll qq = q;
        p *= (m - n);
        p += qq * (m - n + 1);
        q = (qq+pp) * (n - i - 1);
        p %= 1000000007;
        q %= 1000000007;
    }
    cout << ans*p%1000000007 << endl;
}

Measured memory_bytes: 3584
import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
 
   int N = sc.nextInt();
   int[] m = new int[N];
   int[] ans = new int[N]; 
   for(int i=0;i<N;i++) 
   {
     m[i] = sc.nextInt();
   } 
 
   if(N%2==0)
   {
     for(int i =0;i<N/2;i++) ans[i] = m[N-1-2*i];
     for(int i =0;i<N/2;i++) ans[i+N/2]= m[2*i];
   }
   else
   {
     for(int i= 0;i<(N+1)/2;i++) ans[i] = m[N-1-2*i];
     for(int i= 0;i<(N-1)/2;i++) ans[i+(N+1)/2] = m[1+2*i];
   }
   for(int i=0;i<N;i++)System.out.print(ans[i]+" ");
 }
}

Measured memory_bytes: 95356
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(long long i=0;i<x;i++)
#define repn(i,x) for(long long i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())
vector<pair<string,P> >vec;


int main(){	
	long long M;
	long long N;
	scanf("%lld",&N);
	scanf("%lld",&M);
	vector<vector<ll> > g(N);
	for(int i = 0 ; i <= M-1 ; i++){
		ll a, b;
		scanf("%lld",&a);
		scanf("%lld",&b);
		a--;
		b--;
		g[a].push_back(b);
		g[b].push_back(a);
	}
	if (M%2 == 1) {
		cout << "-1" << endl;
		return 0;
	}

	vector<pair<ll,ll> > res;
	vector<ll> deg(N, 0);
	vector<ll> depth(N, -1);

	function<void(ll, ll)> dfs = [&](ll v, ll pr) {
		for (ll u : g[v]) {
			if (depth[u] == -1) {
				depth[u] = depth[v] + 1;
				dfs(u,v);
			} else {
				if (depth[u] > depth[v]) {
					res.emplace_back(v, u);
					++deg[v];
				}
			}
		}
		if (deg[v] % 2 == 1) {
			res.emplace_back(v, pr);
			++deg[v];
		} else {
			if (pr != -1) {
				res.emplace_back(pr, v);
				++deg[pr];
			}
		}
	};
	depth[0] = 0;
	dfs(0, -1);

	for (auto& p : res) {
		cout << p.first + 1 << " " << p.second + 1 << endl;
	}
	return 0;
}



Measured memory_bytes: 17904
#include<iostream>
#define val 1000000000
#define for2(x) for(x = 0; x <= 9; x++)
using namespace std;
int n, i, b1, b2, b3, b4, c1, c2, c3, c4;
long long x, y, r, sol;
int a[12][12][12][12];
double curr;
long long cmmdc(long long a, long long b){
    long long r;
    while(b != 0){
        r = a % b;
        a = b;
        b = r;
    }
    return a;
}
int main(){
    cin>> n;
    for(i = 1; i <= n; i++){
        cin>> curr;
        curr += 0.0000000001;
        x = curr * val;
        y = val;
        r = cmmdc(x, y);
        x /= r;
        y /= r;
        b1 = b2 = b3 = b4 = 0;
        if(y == 1){
            sol--;
        }
        while(x % 2 == 0){
            b1++;
            x /= 2;
        }
        while(x % 5 == 0){
            b2++;
            x /= 5;
        }
        while(y % 2 == 0){
            b3++;
            y /= 2;
        }
        while(y % 5 == 0){
            b4++;
            y /= 5;
        }
        b1 = min(b1, 9);
        b2 = min(b2, 9);
        a[b1][b2][b3][b4]++;
    }
    for2(b1){
        for2(b2){
            for2(b3){
                for2(b4){
                    if(a[b1][b2][b3][b4] == 0){
                        continue;
                    }
                    for2(c1){
                        for2(c2){
                            for2(c3){
                                for2(c4){
                                    if(b1 >= c3 && b2 >= c4 && c1 >= b3 && c2 >= b4){
                                        sol += a[b1][b2][b3][b4] * 1LL * a[c1][c2][c3][c4];
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    sol /= 2;
    cout<< sol;
}


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

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint long long
#define ulint unsigned long long
#define ldou long double
#define fi first
#define se second
#define setpre(x) std::cout << fixed << setprecision(x)
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define out(x) cout << (x) << endl
#define outs(x) cout << (x) << " "
#define yn(x) cout << ((x)?("Yes"):("No")) << endl
#define YN(x) cout << ((x)?("YES"):("NO")) << endl
#define bit_c(x) __builtin_popcountll(x)

inline void logger(){ std::cout << " [LOGGER] " << endl; }
template<typename A, typename... B>
void logger(const A& a, const B&... b){
    cout << a << " , ";
    logger(b...);
}

typedef pair<lint, lint> P;
const lint MOD = 1000000007;
const lint MOD9 = 998244353;
const lint INF = MOD * MOD;
const int MAX = 200005;

/* ...o(^-^)o... */


int main(){
    int n; cin >> n;
    vector<int> ans(n); rep(i, n) ans[i] = 0;
    rep(i, n-1){
        int a; cin >> a;
        ans[a-1] ++;
    }
    rep(i, n) out(ans[i]);
}

Measured memory_bytes: 4052
#include <stdio.h>

int main(){int N,a,b,c;
           scanf("%d",&N);
     
           if(N==1){printf("Hello World");}
             else if(N==2){
               scanf("%d%d",&a,&b);
               c=a+b;
               if(c<10){printf("%1d",c);}
               else{printf("%2d",c);}}
           return 0;}
           


Measured memory_bytes: 128
#include<iostream>
#include<queue>
#include<algorithm>
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> T;

class uft {//union-find tree
public:
    int parent[101];
    int size[101];
    int root(int x);
    bool same(int x,int y);
    void unite(int x,int y);
};
int uft::root(int x){
    if(parent[x]==x){
        return x;
    }
    return parent[x] = root(parent[x]);
}
bool uft::same(int x,int y){
    if(root(x)==root(y)){
        return true;
    }else{
        return false;
    }
}
void uft::unite(int x,int y){
    x=root(x);
    y=root(y);
    if(x == y) return;
    parent[x] = y;
    size[y] = size[y]+size[x];
}

int solv(priority_queue<T, vector<T>, greater<T> > q,int N){
    uft u;
    for(int i=0;i<N;i++){
        u.parent[i]=i;
        u.size[i]=1;
    }
    int ret=0;
    while(u.size[u.root(0)] != N && !q.empty()){
        T edge = q.top(); q.pop();
        if(u.root((edge.second).first) != u.root((edge.second).second)){
            u.unite((edge.second).first,(edge.second).second);
            ret += edge.first;
        }
    }
    return ret;
}

int main(){
    int N;
    priority_queue<T, vector<T>, greater<T> > q;
    cin>>N;
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            int a;
            cin>>a;
            if(a!=-1 && i<j){
                T d = T(a,P(i,j));
                q.push(d);
            }
        }
    }
    int ans=solv(q,N);
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3168
package main

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

func main() {
	a, b := readInt(), readInt()

	if (b-1)%(a-1) == 0 {
		fmt.Println((b - 1) / (a - 1))
	} else {
		fmt.Println((b-1)/(a-1) + 1)
	}
}

// sort ------------------------------------------------------------

type xxx struct {
	x int
}

type sortArray []xxx

func (s sortArray) Len() int           { return len(s) }
func (s sortArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }

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

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcd(m, n int) int {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcm(m, n int) int {
	return m / gcd(m, n) * n
}


Measured memory_bytes: 640
#include<iostream>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int main(){
	int n;
	while(1){
		cin>>n;
		if(!n)break;
		int a,b;
		int apoint=0,bpoint=0;
		rep(i,n){
			cin>>a>>b;
			if(a>b)apoint+=(a+b);
			else if(a<b)bpoint+=(a+b);
			else{
				apoint+=a;
				bpoint+=b;
			}
		}
		cout<<apoint<<" "<<bpoint<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
# AOJ 0125 Day Count
# Python3 2018.6.18 bal4u

def ut2jd(year, month, day):
	if month <= 2:
		year -= 1
		month += 12
	s = 3 + year//4 - year//100 + year//400
	s += 1720994 + year*365 + (month+1)*30 + (month+1)*3//5 + day;
	return s

while True:
	y1, m1, d1, y2, m2, d2 = list(map(int, input().split()))
	if y1 < 0 or m1 < 0 or d1 < 0 or y2 < 0 or m2 < 0 or d2 < 0: break
	print(ut2jd(y2, m2, d2)-ut2jd(y1, m1, d1))


Measured memory_bytes: 5600
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vs = vector<string>;
using msi = map<string, int>;
using mii = map<int, int>;
using psi = pair<string, int>;
using pii = pair<int, int>;
using vlai = valarray<int>;
#define rep(i,n) for(int i=0;i<n;i++)
#define range(i,s,n) for(int i=s;i<n;i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fs first
#define sc second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define INF 1E9
#define EPS 1E-9
#define MOD (ll)(1E9+7)
#define PI 3.1415926535897932384

template <class T>ostream &operator<<(std::ostream &o, const vector<T> &v)
{
	rep(i, v.size()) {
		o << (i > 0 ? " " : "") << v[i];
	}
	return o;
}

int ToInt(string str) {
	int num=0,flag=2;
	for (int j = 0; j < str.size(); j++) {
		if ('1' <= str[j] && str[j] <= '9') {
			flag = 1;
			switch (str[j + 1]) {
				case 'm':
					num += (str[j] - '0') * 1000;
					break;
				case 'c':
					num += (str[j] - '0') * 100;
					break;
				case 'x':
					num += (str[j] - '0') * 10;
					break;
				case 'i':
					num += (str[j] - '0') ;
					break;
			}
		}
		else if (flag == 1) {
			flag = 0;
		}
		else {
			switch (str[j]) {
				case 'm':
					num +=1000;
					break;
				case 'c':
					num +=100;
					break;
				case 'x':
					num +=10;
					break;
				case 'i':
					num +=1;
					break;
			}
			flag = 0;
		}
	}
	return num;
}

void ToMCXI(int num) {
	string ans;
	if (num / 1000 > 1) {
		cout << num / 1000;
		cout << 'm';
	}
	else if (num / 1000 == 1) {
		cout << 'm';
	}
	if ((num / 100) % 10 > 1) {
		cout << (num / 100) % 10;
		cout << 'c';
	}
	else if ((num / 100) % 10 == 1) {
		cout << 'c';
	}
	if ((num / 10) % 10 > 1) {
		cout << (num / 10) % 10;
		cout << 'x';
	}
	else if ((num / 10) % 10 == 1) {
		cout << 'x';
	}
	if (num % 10 > 1) {
		cout << num % 10;
		cout << 'i';
	}
	else if (num % 10 == 1) {
		cout << 'i';
	}
	cout << endl;
}

int main() {
	int n;
	cin >> n;
	rep(i, n) {
		string num1, num2;
		cin >> num1 >> num2;
		//cout << ToInt(num1) <<" "<< ToInt(num2) << endl;
		int ans = ToInt(num1) + ToInt(num2);
		ToMCXI(ans);
	}
}



Measured memory_bytes: 3084