akhauriyash/Code-Regression huggingface dataset:
// #define DEBUGGING
#include <bits/stdc++.h>
#define endl '\n'
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()
using ll = std::int64_t;
using ull = std::uint64_t;
using PLL = std::pair<ll, ll>;
using TLL = std::tuple<ll, ll, ll>;
template <typename T> using V = std::vector<T>;
template <typename T> using VV = V<V<T>>;
template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename T, typename... Tail> const T& var_min(const T &t, const Tail&... tail) { return std::min(t, var_min(tail...)); }
template <typename T, typename... Tail> const T& var_max(const T &t, const Tail&... tail) { return std::max(t, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
template <typename T> const T& clamp(const T &t, const T &low, const T &high) { return std::max(low, std::min(high, t)); }
template <typename T> void chclamp(T &t, const T &low, const T &high) { return t = clamp(t, low, high); }
namespace init__ { struct InitIO { InitIO() { std::cin.tie(nullptr); std::ios_base::sync_with_stdio(false); std::cout << std::fixed << std::setprecision(30); } } init_io; }
#define mv_rec make_v(init, tail...)
template <typename T> T make_v(T init) { return init; }
template <typename T, typename... Tail> auto make_v(T init, size_t s, Tail... tail) { return V<decltype(mv_rec)>(s, mv_rec); }
#undef mv_rec
using namespace std;

#ifdef DEBUGGING
#include "../../debug/debug.cpp"
#else
#define DEBUG(...) 0
#define DEBUG_SEPARATOR_LINE 0
#endif

const ll inf = 5e15;

int main() {
    ll N;
    cin >> N;
    V<PLL> rbt(N);
    for (auto &&e : rbt) {
        ll a, b;
        cin >> a >> b;
        e = PLL(a, b);
    }

    auto get_s = [](PLL a) {
        ll x, l;
        tie(x, l) = a;
        return x + l;
    };

    sort(ALL(rbt), [&](PLL p, PLL q) { return get_s(p) < get_s(q); });

    ll ans = 0;
    ll cur = -inf;
    for (auto &&e : rbt) {
        ll x, l;
        tie(x, l) = e;
        if (cur <= x - l) {
            cur = x + l;
            ans++;
        }
    }

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


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

signed main(){
  int N;
  cin >> N;
  map<int,int> a;
  int A[200020];
  rep(i,N){
    cin >> A[i];
    a[A[i]]++;
  }
  int sum = 0;
  for(auto i : a){
    sum += i.second * (i.second-1) / 2;
  }
  rep(i,N){
    cout << sum - a[A[i]] + 1 << endl;
  }
}



Measured memory_bytes: 13028
import java.util.Scanner

object Main {
  def main(args: Array[String]): Unit = {
    val sc: Scanner = new Scanner(System.in)
    val n: Int = sc.nextInt
    val prices = List.fill(n)(sc.nextInt).sorted.reverse

    println(prices.head / 2 + prices.slice(1, prices.length).sum)
  }

}


Measured memory_bytes: 27328
#include <bits/stdc++.h>
using namespace std;
#define rep(i, from, to) for (int i = from; i < (to); ++i)
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<pair<int, int>> vii;

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

    int q;
    cin >> q;
    rep(i,0,q) {
        ll a, b, c, d;
        cin >> a >> b >> c >> d;
        ll t = 1ll + (max(a,b)-1ll)/(min(a,b)+1ll);
        // calc x, y, k, j
        // a = t*x+y+k
        if (t == 1) {
            if (a >= b) {
                for (ll ix = c; ix < d+1; ix++) {
                    if (ix % 2 == 0) {
                        cout << "B";
                    } else {
                        cout << "A";
                    }
                }
            } else {
                for (ll ix = c; ix < d+1; ix++) {
                    if (ix % 2 == 0) {
                        cout << "A";
                    } else {
                        cout << "B";
                    }
                }
            }
            cout << endl;
            continue;
        }
        //cout << "t:" << t << endl;
        ll mm = t*t-1ll;
        ll l = (t*b-a+((a/mm + 1ll)*mm)) % mm;
        if (l == 0) l = mm;
        ll j = ((l-1ll) / t + 1ll)%t;
        ll k = (t*j-l+mm)%mm;
        ll y = (t*b-t*j+k-a)/mm;
        ll x = b - t*y-j;
        ll bk1 = x*(t+1ll);
        ll bk2 = bk1 + k + j + 1ll;
        //cout << "x:" << x << "y:" << y << endl;
        //cout << "k:" << k << "j:" << j << endl;
        //cout << "bk1 " << bk1 << "bk2 " << bk2 << endl;
        for (ll ix = c; ix < d+1; ix++) {
            if (ix <= bk1) {
                if (ix % (t+1ll) == 0) {
                    cout << "B";
                } else {
                    cout << "A";
                }
            } else if (ix >= bk2) {
                ll rx = ix-bk2;
                if (rx % (t+1ll) == 0) {
                    cout << "A";
                } else {
                    cout << "B";
                }
            } else {
                if (ix <= bk1 + k) {
                    cout << "A";
                } else {
                    cout << "B";
                }
            }
        }
        cout << endl;
    }




    return 0;
}


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

#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n; i >= 0; i--)

#define INF 2e9
#define ALL(v) v.begin(), v.end()



int main(int argc, char const *argv[]) {
  int a,b,c,x;
  cin>>a>>b>>c>>x;
  int res=0;
  rep(i,a+1){
    rep(j,b+1){
      rep(k,c+1){
        int total=500*i+100*j+50*k;
        if(total==x)res++;
      }
    }
  }
  cout<<res<<endl;
  return 0;
}


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

using namespace std;

#define debug(x) cerr << #x << " = " << x << endl;

using ll = long long;

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

int L ;


int main() {

  cin >> L;
  int bit;
  for(int i = 20; i >= 0; --i)
  if(L>>i&1){
    bit = i;  break;
  }

  cout << bit + 1 << ' ' << 2 * (bit) + __builtin_popcount(L) - 1 << '\n';

  for(int i = 1; i <= bit; i++){
    cout << i << ' ' << i + 1 << ' ' << (1 << (i-1)) << '\n';
    cout << i << ' ' << i + 1 << ' ' << 0 << '\n';
  }
  int cur = 1<<bit;
  for(int i = bit-1; i >= 0; i--)if(L>>i&1){
    cout << i+1 << ' ' << bit+1 << ' ' << cur << '\n';
    cur |= ( 1 << i );
  }


  return 0;
}


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

int main(){
  	int N, Alice=0, Bob=0;
  	cin >> N;
  	vector<int> a(N);
  	for(int i=0; i<N; i++) cin >> a[i]; 
  	sort(a.begin(), a.end());
  	reverse(a.begin(), a.end());
  	for(int i=0; i<N; i++){
      if(i%2==0) Alice+=a[i];
      else Bob+=a[i];
    }
  	cout << Alice - Bob << endl;
  	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <cassert>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
#include <unordered_set>
#include <iomanip>
//#pragma GCC optimize("Ofast")  //デバッグ時にoptimized-outされて邪魔だった
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define irep(it, stl) for(auto it = stl.begin(); it != stl.end(); it++)
#define drep(i,n) for(int i = (n) - 1; i >= 0; --i)
#define fin(ans) cout << (ans) << '\n'
#define mp(p,q) make_pair(p, q)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define floatprec(dig) fixed << setprecision(dig)
#define Sort(a) sort(a.begin(), a.end())
#define Rort(a) sort(a.rbegin(), a.rend())
#define MATHPI acos(-1)
#define itn int;
#define invar(typ, var) typ var; cin >> var;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
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;}
struct io{io(){ios::sync_with_stdio(false);cin.tie(0);}};
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;
const ll MOD = 1000000007;
const double EPS = 1e-9;

signed main(void) {
  cin.tie(0); ios::sync_with_stdio(false);
  
  invar(ll, L);
  
  cout << fixed << setprecision(7) << (long double)(L * L * L) / 27.0 << endl;
}


Measured memory_bytes: 256
h, w = map(int, input().split())
if (h * w) % 3 == 0:
    print(0)
    exit()

hw = h * w
ans = min(h, w)
lower = (hw - ans * 2) / 3
upper = (hw + ans * 2) / 3
h_min = int((lower + w - 1) // w)
h_max = int(upper // w)
if w % 2 == 0:
    w_flg = True
else:
    w_flg = False
for hh in range(h_min - 1, h_max + 2):
    if hh < 0 or hh > h:
        continue
    s = [hh * w]
    h2 = h - hh
    if w_flg:
        s.append(h2 * (w // 2))
    else:
        s.append(h2 * (w // 2))
        s.append(h2 * ((w + 1) // 2))
    ans_sub = max(s) - min(s)
    ans = min(ans, ans_sub)

h, w = w, h    
h_min = int((lower + w - 1) // w)
h_max = int(upper // w)
if w % 2 == 0:
    w_flg = True
else:
    w_flg = False
for hh in range(h_min - 1, h_max + 2):
    if hh < 0 or hh > h:
        continue
    s = [hh * w]
    h2 = h - hh
    if w_flg:
        s.append(h2 * (w // 2))
    else:
        s.append(h2 * (w // 2))
        s.append(h2 * ((w + 1) // 2))
    ans_sub = max(s) - min(s)
    ans = min(ans, ans_sub)
print(ans)

Measured memory_bytes: 62160
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>

#define MIN(a, b) (a < b ? a : b)
#define MAX(a, b) (a > b ? a : b)
#define ABSS(a, b) (a > b ? a - b : b - a)

int main(void) {
	uint32_t S[3];
	uint32_t len5Count = 0;
	uint32_t len7Count = 0;

	scanf("%"PRIu32" %"PRIu32" %"PRIu32, &S[0], &S[1], &S[2]);
	for (uint32_t idx = 0; idx < 3; idx++) {
		if (S[idx] == 5) {
			len5Count++;
		}
		else if (S[idx] == 7) {
			len7Count++;
		}
	}

	printf("%s", (len5Count == 2 && len7Count == 1 ? "YES" : "NO"));

	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <sstream>
#include <cstdio>
#include <stdlib.h>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int ary[2000];
int n,tmp;
bool s[2000];
vector <int> comary;

void rec(int i){
  tmp=0;
  if(i==n){
    for(int j=0;j<n;j++){
      if(s[j])tmp+=ary[j];
	}
    comary.push_back(tmp);
    return;
  }
  rec(i+1);
  s[i]=1;
  rec(i+1);
  s[i]=0;
}


void makecombination(){
  rec(0);

}
bool solve(int cmpva){
  for(int i=0;i<(int)comary.size();i++){
    if(comary[i]==cmpva)return 1;
  }
  return 0;
}

int main(){
  int q,cmpva;
  cin>>n;
  for(int i=0;i<n;i++)cin>>ary[i];
  makecombination();
  /*for(int i=0;i<(int)comary.size();i++)
    cout<<comary[i]<<endl;*/
  cin>>q;
  stable_sort(comary.begin(),comary.end());
  for(int i=0;i<q;i++){
    cin>>cmpva;
    if(solve(cmpva))cout<<"yes"<<endl;
    else cout<<"no"<<endl;
  }
  return 0;
}



Measured memory_bytes: 8976
/*input
7 8
1 2
2 3
3 4
4 5
5 6
6 7
3 5
2 6
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#ifdef leowang
#define debug(...) do{\
	fprintf(stderr,"%s - %d : (%s) = ",__PRETTY_FUNCTION__,__LINE__,#__VA_ARGS__);\
	_DO(__VA_ARGS__);\
}while(0)
template<typename I> void _DO(I&&x){cerr<<x<<endl;}
template<typename I,typename...T> void _DO(I&&x,T&&...tail){cerr<<x<<", ";_DO(tail...);}
#else
#define debug(...)
#endif
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}
//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		b>>=1;
	}
	return res;
}
vector<int> child[maxn];
bool vis[maxn];
vector<int> q;
void dfs(int u){
	q.pb(u);
	vis[u]=1;
	for(int v:child[u]) if(!vis[v]){
		dfs(v);
		return;
	}
}

int main()
{
	//IOS;
	int n,m;
	cin>>n>>m;
	REP(i,m){
		int u,v;
		cin>>u>>v;
		u--;v--;
		child[u].pb(v);
		child[v].pb(u);
	}
	dfs(0);
	reverse(ALL(q));
	int tmp=q.back();
	q.pop_back();
	dfs(tmp);
	cout<<SZ(q)<<'\n';
	for(int i:q) cout<<i+1<<' ';
	return 0;
}


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

int n;
long long a[100007];

long long solve()
{
  long long res = 0;
  long long sum = 0;

  for(int i=0;i<n;i++)
  {
    if(i%2 == 0)
    {
      if(sum+a[i] <= 0)
      {
        res += llabs(sum+a[i]-1);
        sum = 1;
      }
      else sum += a[i];
    }
    else
    {
      if(sum+a[i] >= 0)
      {
        res += llabs(sum+a[i]+1);
        sum = -1;
      }
      else sum += a[i];
    }
  }
  return res;
}

int main()
{
  cin >> n;
  for(int i=0;i<n;i++) cin >> a[i];
  long long ans = solve();
  for(int i=0;i<n;i++) a[i] *= -1;
  ans = min(ans,solve());
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1024
#include<iostream>
    #include<algorithm>
    #include<functional>
    #include<cmath>
    #include<string>
    #include<vector>
    #include<stack>
    #include<queue>
    #include<map>
    #include<set>
    #include<deque>
    using namespace std;
    #define ll long long
    const int mod = 1000000007;
    const ll INF = 1000000000000000000;
     
    struct UnionFind {
    	vector<int> par;
    	UnionFind(int x) : par(x, -1) {}
    	void init(int x) { par.assign(x, -1); }
    	int root(int x) {
    		if (par[x] <= -1) return x;
    		else return root(par[x]);
    	}
    	bool issame(int x, int y) {
    		return root(x) == root(y);
    	}
    	bool merge(int x, int y) {
    		x = root(x); y = root(y);
    		if (x == y) return false;
    		if (par[x] > par[y]) swap(x, y);
    		par[x] += par[y];
    		par[y] = x;
    		return true;
    	}
    	int size(int x) {
    		return -par[root(x)];
    	}
    };
     
    int p[100010];
    int main()
    {
    	int N, M;
    	cin >> N >> M;
    	for (int i = 0; i < N; i++) {
    		cin >> p[i];
    		p[i]--;
    	}
    	UnionFind uf(N);
    	for (int i = 0; i < M; i++) {
    		int a, b;
    		cin >> a >> b;
    		a--; b--;
    		uf.merge(a, b);
    	}
    	int ans = 0;
    	for (int i = 0; i < N; i++) {
    		if (uf.issame(i, p[i])) ans++;
    	}
    	cout << ans << endl;
    }

Measured memory_bytes: 4044
#include<iostream>
#include<cstring>
using namespace std;
const long long M=1e9+7;
int main()
{
	int n;
	while(cin>>n)
	{
		int flag=1;
		int a[100005],b[100005];
		memset(b,0,sizeof(b));
		for(int i=0;i<n;i++)
		{
			cin>>a[i];
		}
		if(n%2==1)
		{	
		    for(int i=0;i<n;i++)
			{
				b[a[i]]++;
			}
			for(int i=2;i<n;i=i+2)
			{
				if(b[0]!=1)
				{
				    flag=0;
				    break;
			    }
				else if(b[i]==2)
				continue;
				else
				{
					flag=0;
					break;
				}
			} 
		}
		if(n%2==0)
		{
			for(int i=0;i<n;i++)
			{
				b[a[i]]++;
			}
			for(int i=1;i<n;i=i+2)
			{
				if(b[i]==2)
				continue;
				else
				{
					flag=0;
					break;
				}
			}
	    }
	    long long sum=1;
		if(flag==1)
		{
			for(int i=0;i<n/2;i++)
			{
				sum*=2;
				sum%=M;
			}
			cout<<sum<<endl;
		}
		else
		cout<<"0"<<endl;
	}
	return 0;
} 

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

using namespace std;

string s;

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

    if (s[0] == s[s.length() - 1]) cout << ((int)s.length() % 2 == 1 ? "Second" : "First");
    else cout << ((int)s.length() % 2 == 1 ? "First" : "Second");
    return 0;
}


Measured memory_bytes: 512
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

class MainClass
{
    static long[] h;
    static long A, B;
    static void Main()
    {
        var NAB = ReadLine().Split().Select(int.Parse).ToArray();
        int N = NAB[0];
        A = NAB[1];
        B = NAB[2];

        h = new long[N];
        for (int i = 0; i < N; i++)
        {
            h[i] = long.Parse(ReadLine());
        }
        Array.Sort(h);
        long lb = 0, ub = h[N-1];
        while (ub - lb > 1)
        {
            var mid = (lb + ub) / 2;
            if (comp(mid)) lb = mid;
            else ub = mid;
        }
        WriteLine(ub);
    }
    static bool comp(long mid)
    {
        var nh = new long[h.Length];
        for (int i = 0; i < h.Length; i++)
        {
            nh[i] = Max(0, h[i] - B * mid);
        }
        long ans = 0;
        for (int i = 0; i < h.Length; i++)
        {
            ans += nh[i] / (A - B);
            if (nh[i] % (A - B) != 0) ans++;
        }
        return ans > mid;
    }
}


Measured memory_bytes: 37012
#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define popcount __builtin_popcount
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;

// #pragma GCC target("avx2")
// #pragma GCC optimize("O3")
// #pragma GCC optimize("unroll-loops")
template <class T>
inline bool chmin(T &a, T b)
{
	if (a > b)
	{
		a = b;
		return true;
	}
	return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
	if (a < b)
	{
		a = b;
		return true;
	}
	return false;
}

ll gcd(ll n, ll m)
{
	ll tmp;
	while (m != 0)
	{
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m)
{
	return abs(n) / gcd(n, m) * abs(m); //gl=xy
}

using namespace std;
using namespace atcoder;

void solve(){
	string s;
	cin>>s;
	int n=s.size();
	auto sa=suffix_array(s);
	auto v=lcp_array(s,sa);
	ll ans=0;
	rep(i,v.size()){
		ans+=(n-sa[i+1])-v[i];
	}
	ans+=(n-sa[0]);
	cout<<ans<<"\n";
}


int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}


Measured memory_bytes: 15636
// Original: https://github.com/tanakh/competitive-rs
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

mod util {
    #[allow(dead_code)]
    pub fn chmin<T>(x: &mut T, y: T) -> bool
    where
        T: PartialOrd + Copy,
    {
        *x > y && {
            *x = y;
            true
        }
    }

    #[allow(dead_code)]
    pub fn chmax<T>(x: &mut T, y: T) -> bool
    where
        T: PartialOrd + Copy,
    {
        *x < y && {
            *x = y;
            true
        }
    }

    /// 整数除算切り上げ
    #[allow(dead_code)]
    pub fn roundup(a: i64, b: i64) -> i64 {
        (a + b - 1) / b
    }

    #[allow(dead_code)]
    pub fn ctoi(c: char) -> i64 {
        c as i64 - 48
    }
}

#[allow(unused_imports)]
use util::*;

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, VecDeque};

fn main() {
    input! {
        r:i64
    }
    println!("{}", r * r);
}


Measured memory_bytes: 4352
A,V = map(int,input().split())
B,W = map(int,input().split())
T = int(input())

if abs(V-W) == 0:
  print("NO")
else:  
  ans = abs(B-A)/(V-W)
  if ans < 0:
    print("NO")
  else:
    if ans <= T:
      print("YES")
    else:
      print("NO")

Measured memory_bytes: 9188
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define INF 999999999
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

using llong = long long;
using namespace std;

// long long gcd(long long a, long long b){
//     if (a < b){
//         a ^= b;
//         b ^= a;
//         a ^= b;
//     }
//     return b ? gcd(b, a % b) : a;
// }

// long long lcm(long long a, long long b){
//     return a * b / gcd(a, b);
// }

int yakusuu(int x){
    int count=0;
    for(int i=1;i<=x;i++){
        if(x%i == 0){
            count++;
        }
    }
    return count;
}

int main(){
    int x;
    cin >> x;
    for(int i=x;i<INF;i++){
        if(yakusuu(i) == 2){
            cout << i << endl;
            return 0;
        }
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//*******************
// Mahmoud Magdy    *
//*******************
#define ll long long
#define endl "\n"

void fast()
{
    ios_base :: sync_with_stdio( 0 ) ;
    cin.tie( 0 ) ;
    cout.tie( 0 ) ;
}
inline int D()
{
    int m ;
    cin>>m;
    return m ;
}
inline ll lD()
{
    ll m ;
    cin>>m;
    return m ;
}
inline double dD()
{
    double m ;
    cin>>m;
    return m ;
}
string s1[55],s2[55];
int main()
{
  fast();
  ll n=D(),m=D();
  for(int i=0;i<n;++i)
   cin>>s1[i];
  for(int i=0;i<m;++i)
   cin>>s2[i];
      for(int c1=0;c1<n-m+1;++c1){
       for(int c2=0;c2<n-m+1;++c2){
        bool f=true;
         for(int i=0;i<m;++i){
          for(int j=0;j<m;++j){
              if(s1[i+c1][j+c2]!=s2[i][j]){
                f=false;
                break;
              }
          if(f==false)
                break;
         }
      }
      if(f){
        cout<<"Yes"<<endl;
        return 0;
      }
      }
    }
      cout<<"No"<<endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int     long long
#define F       first
#define S       second
#define _READ   freopen("input.txt","r", stdin);
#define _FAST   ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
void solve()
{
    int k;
    cin>>k;
    string s;
    cin>>s;
    string t=s;
    s=s.substr(0,k);
    if(t.size()>k)
        s=s+"...";
    cout<<s;
}
int32_t main()
{
    clock_t tStart = clock();
    #ifndef ONLINE_JUDGE
    _READ
    #endif
    
    int t;
    t=1;
    while(t--)
        solve();
    
    #ifndef ONLINE_JUDGE
    cout<<fixed<<setprecision(5)<<"\nTime taken: "<<(double)(clock() - tStart)/CLOCKS_PER_SEC;
    #endif
    
    return 0;
}
/*
===FOR N-Dimensional Vector===
https://codeforces.com/blog/entry/76149
g++ -std=c++17 -Wshadow -Wall -g -fsanitize=address -fsanitize=undefined a.cpp -o a -D_GLIBCXX_DEBUG
*/

Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001
#define mod 1000000007
#define pi acos(-1)
typedef vector<int> vi;
typedef vector<ll> vl;
#define all(v) v.begin(),v.end()
ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    ll g=gcd(a,b);
    return a/g*b;
}
ll rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t=rep_jijo(n,x/2);
        return t*t%mod;
    }
    return n*rep_jijo(n,x-1)%mod;
}
ll com(ll n,ll r){
    ll x=1,y=1;
    ll tmp=n;
    while(tmp>=n-r+1){
        x=x*tmp%mod;
        tmp--;
    }
    while(r>0){
        y=y*r%mod;
        r--;
    }
    return x*rep_jijo(y,mod-2)%mod;
}


int main(){
    int n;
    int ans=0;
    cin >> n;
    vector<int>a(n);
    map<int,int>mp;
    rep(i,n) {
        int x;
        cin >> x;
        a[i] = x;
        mp[x]++;
    }
    vector<bool>sosu(1000010,false);
    sort(all(a));
    rep(i,n){
        sosu[a[i]] = true;
    }
    for(int i = 1; i <=1000000; i++){
        if(sosu[i]){
            for(int j = 2;i*j <=1000000;j++){
                sosu[i*j] =false;
            }
        }
    }
    //sosu[a[0]] = false;
    for(auto p:mp){
        if(p.second>1){
            sosu[p.first]=false;
        }
    }
    rep(i,n){
        if(sosu[a[i]]) ans++;
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 13504
#include "bits/stdc++.h"
using namespace std;
int main(){
    int W, a, b;
    cin >> W >> a >> b;
    if(a < b){
        if(b <= a + W)
        cout << "0" << endl;
        else 
        cout << b - (a + W) << endl;
    }
    else if(a <= b + W)
    cout << "0" << endl;
    else 
    cout << a - (b + W) << endl;
    return 0; 
}

Measured memory_bytes: 256
N,K = map(int, input().split())
A = list(map(int, input().split()))

accum = [0] * N
for i in range(N):
    if i == 0:
        accum[i] = A[i]
    else:
        accum[i] = accum[i-1] + A[i]



B = []
for l in range(N):
    for r in range(l, N):
        if l == 0:
            B.append(accum[r])
        else:
            B.append(accum[r] - accum[l-1])




ans = 0
for i in range(50, -1, -1):
    
    cnt = 0
    nxt_B = []
    for b in B:
        if b & (1 << i):
            cnt += 1
            nxt_B.append(b)

    if cnt >= K:
        ans += 2**i
        B = nxt_B

print(ans)

Measured memory_bytes: 23852
#include <bits/stdc++.h>
 
// headers {{{
using namespace std;
// using namespace rel_ops;
 
typedef long long int64;
typedef unsigned long long uint64;
const double pi=acos(-1.0);
const double eps=1e-11;
const int INF=0x7FFFFFFF;
template<class T> inline bool checkmin(T &a,T b){return b<a?a=b,1:0;}
template<class T> inline bool checkmax(T &a,T b){return b>a?a=b,1:0;}
template<class T> inline T sqr(T x){return x*x;}
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
#define MP(A,B) make_pair(A,B)
#define PB(X) push_back(X)
#define mem(a,b) memset(a, b, sizeof(a))
#define clr(a) memset(a, 0, sizeof(a))
#define rep(i,n) for(int i=0; i<(int)n; i++)
#define ff first
#define ss second
#ifdef LOCAL
#define dbg(args...) printf(args); //##__VA_ARGS__
#define dout cout
#define out(x) (cout<<#x<<": "<<x<<endl)
template<class T>void show(T a, int n){for(int i=0; i<n; ++i) cout<<a[i]<<' '; cout<<endl;}
template<class T>void show(T a, int r, int l){for(int i=0; i<r; ++i)show(a[i],l);cout<<endl;}
#else
#define dbg(...)
#define dout if(true);else cout
#define out(...)
#define show(...)
#endif
// }}}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL); 
    int N;
    while (cin >> N) {
        VI a(N), b(N);
        rep(i, N) cin >> a[i] >> b[i];
        sort(a.begin(), a.end());
        sort(b.begin(), b.end());
        int64 x = a[N/2], y = b[N/2];
        if (N%2 == 0) {
            x += a[N/2-1], y += b[N/2-1];
        }
        cout << y - x + 1 << endl;
    }
    return 0;
}



Measured memory_bytes: 4780
# list(map(int, input().split()))
# int(input())
l = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = int(input())
print(l[k-1])

Measured memory_bytes: 38384
#include<bits/stdc++.h>;
using namespace std;
//#define LOCAL
typedef long long ll;
#define fastIO ios::sync_with_stdio(0), cin.tie(0)
#define endl '\n'

int main(){
#ifdef LOCAL
     freopen("in.txt", "r", stdin);
     //freopen("out.txt", "w", stdout);
#else
 fastIO;
#endif
//***************************//**************************//******************************

string s,ans;
cin>>s;
for(auto &x:s){
    if(x=='B' && !ans.empty()){
        ans.pop_back();
    }else if(x=='1' || x=='0'){
        ans.push_back(x);
    }
}
cout<<ans;
}



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

int main(){
	ll a, b, c;
	cin >> a >> b >> c;
	ll ans = (1ll << 62);
	if(a % 2) ans = min(ans, b * c);
	else ans = 0;
	if(b % 2) ans = min(ans, a * c);
	else ans = 0;
	if(c % 2) ans = min(ans, a * b);
	else ans = 0;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
//https://onlinejudge.u-aizu.ac.jp/courses/library/3/DSL/all/DSL_2_B
//Range Sum Query
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
template<class T>bool chmax(T &a, const T &b) {if (a<b) { a=b; return 1; } return 0;}
template<class T>bool chmin(T &a, const T &b) {if (b<a) { a=b; return 1; } return 0;}

template <class T>
struct fenwick_tree {
    int n;
    std::vector<T> x;
    fenwick_tree(int n_ = 0) : n(n_), x(n + 1, 0) {}
    int size() const { return n; }
    T sum(int r) const {
        T S = 0;
        for (r = r - 1; r >= 0; r = (r & (r + 1)) - 1) S += x[r];
        return S;
    }
    T sum(int l, int r) const { return sum(r) - sum(l); }
    void add(int k, const T &a) {
        for (; k < n; k |= k + 1) x[k] += a;
    }
    void set(int k, const T &a) { add(k, a - sum(k, k + 1)); }
};

int main() {
    ll n,q; cin>>n>>q;
    fenwick_tree<ll> t(n);
    REP(i,q){
        int c,x,y;
        cin >> c >> x >> y;
        x--;
        if(c == 0) t.add(x,y);
        else cout << t.sum(x,y) << endl;
    }

    return 0;
}


Measured memory_bytes: 3544
#include <iostream>

using namespace std;

int main() {
    char arr[4];
    bool a=false;
    bool b=false;
    bool c=false;
    for (int i=0;i<3;i++) {
        cin >> arr[i] ;
    }
    //cin>>ws;
    for (int i=0;i<3;i++) {
        if (arr[i]=='a')a=true;
        if (arr[i]=='b')b=true;
        if (arr[i]=='c')c=true;
    }
    if (a==true && b==true && c==true) {cout << "Yes";}
    else{
        cout << "No";
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void){
  int i,n,q,mid,left,right;
  int cnt = 0;
  long long int S[100001],T[50001];

  scanf("%d",&n);
  for( i = 0 ; i < n ; i++ ) scanf("%lld",&S[i]);
  scanf("%d",&q);
  for( i = 0 ; i < q ; i++ ) scanf("%lld",&T[i]);

  for( i = 0 ; i < q ; i++ ){
    right = n;
    left = 0;
    while( left < right ){
      mid = (left + right)/2;
      if( T[i] == S[mid] ){
        cnt++;
        break;
      }
      else if( T[i] < S[mid] ){
        right = mid;
      }
      else left = mid + 1;
    }
  }

  printf("%d\n",cnt);
  return 0;
}

Measured memory_bytes: 1488
#include<bits/stdc++.h>
#include <boost/range/irange.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using boost::irange;
using boost::multiprecision::cpp_int;

typedef long long ll;
ll max(ll a, ll b){ 
	if(a >= b) return a;
	else if(a < b) return b;
}

int main(){
    cpp_int a, b, ans; cin >> a >> b;
    cout <<  ((a > b)? "GREATER":((a == b)? "EQUAL": "LESS") )<< endl;
    
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;
using ll = long long;
using vpii = vector<pair<int, int>>;
using vpll = vector<pair<ll, ll>>;

int		main(void)
{
	int N;

	cin >> N;
	cout << N * N * N << endl;
}



Measured memory_bytes: 384
//بِسْمِ ٱللَّٰهِ ٱلرَّحْمَٰنِ ٱلرَّحِيمِ
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef double db;

#define endl "\n"

const int MOD = 1000000007;


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

    char x;
	cin >> x;
	printf("%c\n",x + 1);

	return 0;
}


Measured memory_bytes: 3796
package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d", &n)
	a := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Scanf("%d", &a[i])
	}
	answer := reconstructOrder(a)
	for i, v := range answer {
		if i < len(answer)-1 {
			fmt.Printf("%d ", v)
		} else {
			fmt.Println(v)
		}

	}

}

func reconstructOrder(a []int) []int {
	order := make([]int, len(a))
	for i := 0; i < len(a); i++ {
		order[a[i]-1] = i + 1
	}
	return order
}


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

int main(void)
{
    int inputN;
    long int *inputH, moveCount = 0, maxMoveCount = 0;
    scanf("%d", &inputN);
    inputH = (long int *)malloc(sizeof(long int) * inputN);
    for (int count = 0; count < inputN; count++)
    {
        scanf("%ld", &inputH[count]);
    }
    for (int count = 0; count < inputN - 1; count++)
    {
        if (inputH[count] >= inputH[count + 1])
        {
            moveCount++;
        }
        else
        {
            if (moveCount > maxMoveCount)
            {
                maxMoveCount = moveCount;
            }
            moveCount = 0;
        }
    }
    if (moveCount > maxMoveCount)
    {
        maxMoveCount = moveCount;
    }
    printf("%ld", maxMoveCount);

    free(inputH);

    return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<vector<int> > data(4, vector<int>(13, 0));
  for (int i=0; i<N; i++) {
    string a;
    int b;
    cin >> a >> b;
    if (a == "S") data.at(0).at(b-1) = 1;
    if (a == "H") data.at(1).at(b-1) = 1;
    if (a == "C") data.at(2).at(b-1) = 1;
    if (a == "D") data.at(3).at(b-1) = 1;
  }
  
  for (int i=0; i<4; i++) {
    for (int j=0; j<13; j++) {
      if (data.at(i).at(j) == 0) {
        if (i == 0) cout << "S " << j+1 << endl;
        if (i == 1) cout << "H " << j+1 << endl;
        if (i == 2) cout << "C " << j+1 << endl;
        if (i == 3) cout << "D " << j+1 << endl;
      }
    }
  }
  return 0;
}


Measured memory_bytes: 3188
#include<stdio.h>

int main()
{
  char s1,s2,s3;
  int ans=0;
  scanf("%c%c%c",&s1,&s2,&s3);
  if(s1=='1')ans++;
  if(s2=='1')ans++;
  if(s3=='1')ans++;

  printf("%d",ans);

  return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
#define MAX 100005
#define NIL -1

struct Node{int p,l,r;};

struct Node T[MAX];
int n, D[MAX];

void print(int u){
  int i,c;
  printf("node %d: ",u);
  printf("parent = %d, ",T[u].p);
  printf("depth = %d, ",D[u]);

  if(T[u].p==NIL) printf("root, ");
  else if(T[u].l==NIL) printf("leaf, ");
  else printf("internal node, ");

  printf("[");

  for(i=0,c=T[u].l;c!=NIL;i++, c=T[c].r){
    if(i) printf(", ");
    printf("%d",c);
  }
  printf("]\n");
}

int rec(int u, int p){
  D[u]=p;
  if(T[u].r != NIL) rec(T[u].r,p);
  if(T[u].l!=NIL) rec(T[u].l,p+1);
}

int main(){
  int i,j,d,v,c,l,r;
  scanf("%d",&n);
  for(i=0;i<n;i++) T[i].p=T[i].l=T[i].r=NIL;

  for(i=0;i<n;i++){
    scanf("%d%d",&v,&d);
    for(j=0;j<d;j++){
      scanf("%d",&c);
      if(j==0) T[v].l=c;
      else T[l].r=c;
      l=c;
      T[c].p=v;
    }
  }
  for(i=0;i<n;i++){
    if(T[i].p==NIL) r=i;
  }

  rec(r,0);

  for(i=0;i<n;i++) print(i);

  return 0;
}

Measured memory_bytes: 5300
#include <stdio.h>
int main(){
  int n;//食べた回数
  int x,y;//x:払った金額 y:もらった金額
  scanf("%d",&n);
  
  for(int i=1;i<=n;i++){
    x+=800;
    if(i%15==0) y+=200;
  }
  printf("%d",x-y);
}

Measured memory_bytes: 1736
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
using namespace std;
int main(){
  int N,M,X;
  cin>>N>>M>>X;
  int C[12];
  int A[12][12];
  int n=1;
  for(int i=0;i<N;i++){
    n=n*2;
    cin>>C[i];
    for(int j=0;j<M;j++){
      cin>>A[i][j];
    }
  }
  int m[12];
  int answer=99999999;
  for(int i=0;i<n;i++){
    int cost=0;
    for(int j=0;j<M;j++){
    m[j]=0;
  }
    int k=0;
    for(int l=1;l<n;l=l*2){
      k++;
      if((i/l)%2==0){
        cost+=C[k-1];
        for(int j=0;j<M;j++){
          m[j]+=A[k-1][j];
        }
      }
    }
    int judge=0;
    for(int j=0;j<M;j++){
      if(m[j]<X) judge++;
    }
    if(judge==0) answer=min(cost,answer);
  }
  if(answer!=99999999) cout<<answer<<endl;
  else cout<<-1<<endl;
  
  /*long long A,B,C,K;
  cin>>A>>B>>C>>K;
  if(K<=A+B) cout<<A<<endl;
  else cout<<A-(K-(A+B))<<endl;*/
  
  return 0;
}

Measured memory_bytes: 3584
import sys, math, re
from functools import lru_cache
from collections import defaultdict
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]


def main():
    N, X, T = mi()
    print(math.ceil(N/X)*T)

if __name__ == '__main__':
    main()

Measured memory_bytes: 9812
import Control.Monad

main = do
    [n,h,w] <- map read . words <$> getLine
    ms <- map (map read . words) <$> replicateM n getLine :: IO [[Int]]
    print $ sum [ isOk h w m | m <- ms]

isOk :: Int -> Int -> [Int] -> Int
isOk h w m = 
    let
        a = m !! 0
        b = m !! 1 
    in if h <= a && w <= b then 1 else 0


Measured memory_bytes: 2044
import java.io.*;
import java.util.*;

public class Main {
	public static void main(String[] args) {
		FastScanner fs = new FastScanner();
		int k = fs.nextInt();
		int n = fs.nextInt();
		int len1, len2;
		int flen, llen;
		int maxlen = 0;
		flen = fs.nextInt();
		len1 = flen;
		for (int i = 1; i < n; i++) {
			len2 = fs.nextInt();
			int len = len2 - len1;
			if (len > maxlen)
				maxlen = len;
			len1 = len2;
		}
		llen = k - len1 + flen;
		if (llen > maxlen)
			maxlen = llen;
		System.out.println(k - maxlen);
	}
}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}

Measured memory_bytes: 23636
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int N;
    int i, ans;

    cin >> N;

    vector<int>V(N);
 
    for (i = 0; i < N; i++){
      cin >> V[i];
    }
    sort(V.begin(), V.end());

    ans = V[V.size() / 2] - V[V.size() / 2 - 1];

    cout << ans << endl;
}

Measured memory_bytes: 640
//  Created by liszt on 2019/08/04.
#include<bits/stdc++.h>
using namespace std;

int main(){
    int sx,sy,tx,ty;
    cin >>sx >>sy >>tx >>ty;
    const int dx=tx-sx, dy=ty-sy;
    
    cout<<string(dy,'U')<<string(dx,'R');
    
    cout<<string(dy,'D')<<string(dx,'L');
    
    cout<<'L'<<string(dy+1,'U')<<string(dx+1,'R')<<'D';
    
    cout<<'R'<<string(dy+1,'D')<<string(dx+1,'L')<<'U';
    
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
  int N,M,X,i,a,b,c;
  b=0,c=0;
  scanf("%d%d%d",&N,&M,&X);
  for(i=0;i<M;i++){
    scanf("%d",&a);
    if(a<X){
      b++;
    }else{c++;
    }
  }
  if(b<=c){
    printf("%d\n",b);
  }else {
    printf("%d\n",c);
  }return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
string S,T;
void input()
{
  cin>>S>>T;
}
void solve() 
{
  T.pop_back();
  if(S==T)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}
int main() 
{
  input();
  solve();
  return 0;
}

Measured memory_bytes: 3644
#define _USE_MATH_DEFINES
#include <iostream>
#include <vector>
#include <algorithm>
#include <ctime>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <random>
#include <unordered_set>
#include <unordered_map>
#include <string>
#include <cstring>
#include <iomanip>
using namespace std;

#define double long double
#define int long long
#define mp make_pair
#define debug(x) cerr << #x << ": " << x << '\n';
#define fi first
#define se second
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
template <typename T1, typename T2> bool chkmin(T1 &x, T2 y) { return y < x ? (x = y, true) : false; };
template <typename T1, typename T2> bool chkmax(T1 &x, T2 y) { return y > x ? (x = y, true) : false; };

void fast() {
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
}

const int N = 2e3 + 10;
int ans[N];

signed main() {
	fast();
	int x, y, a, b, c;
	cin >> x >> y >> a >> b >> c;
	vector<int> p(a), q(b), r(c);
	for (int i = 0; i < a; i++) cin >> p[i];
	for (int i = 0; i < b; i++) cin >> q[i];
	for (int i = 0; i < c; i++) cin >> r[i];
	sort(p.begin(), p.end());
	sort(q.begin(), q.end());
	reverse(q.begin(), q.end());
	reverse(p.begin(), p.end());
	for (int i = 0; i < x; i++) r.pb(p[i]);
	for (int i = 0; i < y; i++) r.pb(q[i]);
	sort(r.begin(), r.end());
	reverse(r.begin(), r.end());
	int ans = 0;
	for (int i = 0; i < x + y; i++) {
		ans += r[i];
	}
	cout << ans << '\n';
 	return 0;
}

Measured memory_bytes: 6512
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

using namespace __gnu_pbds;
using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> indexed_set;

#define mp make_pair
#define pb push_back
#define pf push_front
#define ss second
#define ff first
#define sz(x) (int)x.size()
#define newl "\n"
#define vi vector<int>
#define pii pair<int, int>
#define vii vector<pii>
#define vl vector<ll>
#define pll pair<ll, ll>
#define vll vector<pll>
#define coutp cout << fixed << setprecision(12)
#define mem(x, val) memset(x, val, sizeof(x))
#define fastio                        \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define all(v) (v).begin(), (v).end()

const ld pi = 3.14159265359;
ll INF = 1e18 + 10;
ll MOD = 998244353;
ll mod = 1e9 + 7;

inline ll add(ll a, ll b, ll m)
{
    if ((a + b) >= m)
        return (a + b) % m;
    return a + b;
}

inline ll mul(ll a, ll b, ll m)
{
    if ((a * b) < m)
        return a * b;
    return (a * b) % m;
}

ll power(ll x, ll y, ll m)
{
    ll res = 1;
    x = x % m;
    if (x == 0)
        return 0;
    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % m;
        y = y >> 1;
        x = (x * x) % m;
    }
    return res;
}

void solve()
{
    ll n;
    cin>>n;
    vector<bool> prime(n+1,1);
    vl p;
    for (int j = 2; j * j <= n; j++)
    {
        if (prime[j] == true)
        {
            for (int i = j * j; i <= n; i += j)
                prime[i] = false;
        }
    }
    ll ans=1;
    for(int i=2;i<=n;i++) {
        if(prime[i])
            p.pb(i);
    }
    for(int i=2;i<=n;i++) {
        int x=i;
        ll nod = 1;
        if(prime[x]) {
            ans+=2*i;
            continue;
        }
        for(int pr:p) {
            if(pr*pr>x) break;
            int cnt = 0;
            while(x%pr==0) {
                cnt++;
                x/=pr;
            }
            nod *= (cnt + 1);
        }
        if(x>1) {
            nod*=2;
        }
        ans+=nod*i;
    }
    cout<<ans;


}

int main()
{
    fastio;
    int t;
    t = 1;
    //cin >> t;
    //int test=t;
    
    while (t-- > 0)
    {
        //cout<<"Case #"<<(test-t)<<": ";
        solve();
        cout << newl;
    }

    return 0;
}

Measured memory_bytes: 12836
#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include "bits/stdc++.h"

using namespace std;

using u8 = uint8_t;
using u16 = uint16_t;
using u32 = uint32_t;
using u64 = uint64_t;
using i8 = int8_t;
using i16 = int16_t;
using i32 = int32_t;
using i64 = int64_t;

using vi = vector<int>;

constexpr char newl = '\n';
constexpr double eps = 1e-10;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = ((b)-1); i >=(a); i--)
#define RF0(i,b) RFO(i,0,b)
#define fi first
#define se second
#define show(x) cout << #x << " = " << x << '\n';
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define sz(x) (int)(x).size()
#define YesNo {cout<<"Yes";}else{cout<<"No";}
#define YESNO {cout<<"YES";}else{cout<<"NO";}
#define v(T) vector<T>

template<typename T1, typename T2> inline void chmin(T1& a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
template<class T> bool lcmp(const pair<T, T>& l, const pair<T, T>& r) {
  return l.first < r.first;
}
template<class T> istream& operator>>(istream& i, v(T)& v) {
  F0R(j, sz(v)) i >> v[j];
  return i;
}
template<class A, class B> istream& operator>>(istream& i, pair<A, B>& p) {
  return i >> p.first >> p.second;
}
template<class A, class B, class C> istream& operator>>(istream& i, tuple<A, B, C>& t) {
  return i >> get<0>(t) >> get<1>(t) >> get<2>(t);
}
template<class T> ostream& operator<<(ostream& o, const vector<T>& v) {
  F0R(i, v.size()) {
    o << v[i] << ' ';
  }
  o << newl;
  return o;
}
template<class T1, class T2> ostream& operator<<(ostream& o, const map<T1, T2>& m) {
  for (auto& p : m) {
    o << p.first << ": " << p.second << newl;
  }
  o << newl;
  return o;
}

#if 1


// INSERT ABOVE HERE
signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int n;
  cin >> n;
  while (n / 100 != n % 10 || n / 10 % 10 != n % 10) {
    n++;
  }
  cout << n;
}
#endif


Measured memory_bytes: 3572