akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
    using namespace std;
    #define ll long long
    int optimal=INT_MAX;
    void call(vector<vector<int> > &v,int n,int m,int temp,int k,vector<int> tt,int var,int cost[])
    {
    	if(n==temp)
    	{
    		int flag=1;
    		for(int i=0;i<m;i++)
    		{
     			if(tt[i]<k)
     			{
     				flag=0;
     				break;
     			}
    		}
     
    		if(flag)
    		{
    			optimal=min(optimal,var);
    		}
    		return ;
    	}
     
    	call(v,n,m,temp+1,k,tt,var,cost);
    	for(int i=0;i<m;i++)
    	{
    		tt[i]+=v[temp][i];
    	}
    	call(v,n,m,temp+1,k,tt,var+cost[temp],cost);
     
    }
    int main()
    {
    #ifndef ONLINE_JUDGE
    	freopen("input.txt","r",stdin);
    #endif
    	int n,m,k;
    	cin>>n>>m>>k;
    	vector<vector<int> > v(n,vector<int>(m));
    	int cost[n];
    	for(int i=0;i<n;i++)
    	{
    		cin>>cost[i];
    		for(int j=0;j<m;j++)
    		{	
    			cin>>v[i][j];
    		}
    	}
    	vector<int> tt(m,0);
    	int var=0;
    	int temp=0;
    	call(v,n,m,temp,k,tt,var,cost);
    	if(optimal==INT_MAX)
    	{
    		cout<<-1<<endl;
    	}
    	else
    	{
    	cout<<optimal<<endl;
        }
    	return 0;
    }

Measured memory_bytes: 3636
#include <atcoder/dsu>
#include <bits/stdc++.h>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)
#define vall(x) (x).begin(), (x).end()
using namespace std;
using namespace atcoder;
using lli = long long int;
void YESNO(bool), YesNo(bool);
template <class T1, class T2> bool chmin(T1 &l, const T2 &r);
template <class T1, class T2> bool chmax(T1 &l, const T2 &r);
template <class T1, class T2> void vadd(vector<T1> &v, T2 x);

#define int long long int

void solve(long long N, long long M, std::vector<long long> A,
           std::vector<long long> B) {
  dsu ds(N);
  rep(i, M) { ds.merge(A[i] - 1, B[i] - 1); }
  set<int> s;
  rep(i, N) s.insert(ds.leader(i));
  cout << s.size() - 1 << endl;
}

signed main() {
  long long N;
  scanf("%lld", &N);
  long long M;
  scanf("%lld", &M);
  std::vector<long long> A(M);
  std::vector<long long> B(M);
  for (int i = 0; i < M; i++) {
    scanf("%lld", &A[i]);
    scanf("%lld", &B[i]);
  }
  solve(N, M, std::move(A), std::move(B));
  return 0;
}

// -- lib
void YESNO(bool b) { cout << (b ? "YES" : "NO") << endl; }
void YesNo(bool b) { cout << (b ? "Yes" : "No") << endl; }

template <class T1, class T2> bool chmin(T1 &l, const T2 &r) {
  return (l > r) ? (l = r, true) : false;
}

template <class T1, class T2> bool chmax(T1 &l, const T2 &r) {
  return (l < r) ? (l = r, true) : false;
}

template <class T1, class T2> void vadd(vector<T1> &v, T2 x) {
  for (auto &s : v)
    s += T2(x);
}


Measured memory_bytes: 7688
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define INF 1000000000
int main(){
cin.tie(0);
ios::sync_with_stdio(false);

	long long int N,K;
	cin>>N>>K;
	vector<long long int>a(100001,0);
	REP(i,N){
		int A,B;
		cin>>A>>B;
		a[A]+=B;
	}
	long long int x=0;
	REP(i,100002){
		x+=a[i];
		if(x>=K){
			cout<<i<<endl;
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <tuple>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>
#include <random>
#include <cstring>

#define rep(i,n) for(int i=0;i<int(n);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back

using namespace std;
using ll = long long;


const ll mod = 1000000007;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
// bool debug=false;

/*---------------------------------------------------*/

ll INF = 100000000000;

struct Edge {
    int to;
    ll cost;
};

// typedef pair<int, int> P; と同じ意味
// firstには最短距離、secondには頂点の番号が入る
using P = pair<ll, ll>;

int main() {
    ll s, V, E;
    cin >> V >> E >> s;

    vector<Edge> G[V];
    for(int i = 0; i < E; i++) {
        int s, t, d;
        cin >> s >> t >> d;
        G[s].push_back({t, d});
    }
    priority_queue<P, vector<P>, greater<P>> que;
    ll d[V];
    for(int i = 0; i < V; i++) {
        d[i] = INF;
    }

    // ↓ここからダイクストラ法↓
    d[s] = 0;
    que.push(P(0, s));
    
    while(que.size()) {
        P p = que.top(); que.pop();
        ll cost = p.first;
        int v = p.second;
        if(d[v] < cost) continue;
        for(int i = 0; i < G[v].size(); i++) {
            Edge e = G[v][i];
            if(d[e.to] > d[v] + e.cost) {
                d[e.to] = d[v] + e.cost;
                que.push(P(d[e.to], e.to));
            }
        }
    }

    for(int i = 0; i < V; i++) {
        if(d[i] == INF) {
            cout << "INF" << endl;
        } else {
            cout << d[i] << endl;
        }
    }
    return 0;
}




Measured memory_bytes: 19416
#include <stdio.h>

int main(){
  int n;
  scanf("%d",&n);
  int N[3],M[3];
  N[2]=n/100;
  N[1]=(n%100)/10;
  N[0]=n%10;

  for(int i=0;i<=2;i++){
    if(N[i]==9) M[i]=1;
    else M[i]=9;
  }

  int m;
  m=100*M[2]+10*M[1]+M[0];
  printf("%d\n",m);
  return 0;
}


Measured memory_bytes: 128
#include<vector>
#include<cmath>
#include<map>
#include<cstdlib>
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<set>
#include<stack>
#include<bitset>
#include<functional>
#include<ctime>
#include<queue>
#include<deque>
#include<complex>
#include<cassert>
using namespace std;
#define pb push_back
#define pf push_front
typedef long long lint;
typedef complex<double> P;
#define mp make_pair
#define fi first
#define se second
typedef pair<int,int> pint;
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
//問題文および制約はちゃんと確認しよう！
//サイズは10^5じゃなくて2×10^5とかかもしれないし、重要な制約・条件を見落としているかも
//とりあえずサンプルを読んでから解法を考えよう？
int a[3];
int main()
{
	rep(i,3) cin>>a[i];sort(a,a+3);
	if(a[0]!=a[2] && (a[0]==a[1] || a[1]==a[2])) cout<<"Yes"<<endl;else cout<<"No"<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define FOR(i,a,b) for(long long int i=a;i<b;i++)
#define sz(s) (long long int)(s).size()
#define pb push_back
#define mp make_pair
const ll inf = 1000000000;
const ll MOD = 1000000007;

int main(void){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);   
    cout.tie(NULL);
    register ll i,j,k,y,m,n,t,q,temp,sum=0,count=0,f=1;
    ll x;
    cin>>x;
    // ll a = (log(x) - log(100))/(double)(log(101) - log(100));
    // cout<<a;
    ll ans = 100;
    while(ans < x){
        count++;
        ans *= 1.01;
        // cout<<ans<<" ";
    }
    cout<<count;
}    
    

Measured memory_bytes: 3644
#include<iostream>
#include<iomanip>
#include<cassert>
#include<math.h>
#include<complex>
#include<algorithm>
#include<utility>
#include<queue>
#include<string.h>
#include<string>
#include<set>
#include<map>
#include<unordered_map>
#include<functional>
#include<vector>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=2e18;
const ll MOD=1e9+7;

ll N;
ll A[100010];
ll B[100010];
map<ll,ll>mp;
int main(){
    cin>>N;
	ll sum=0;
	for(ll i=0;i<N;i++){
		cin>>A[i];
		mp[A[i]]++;
		sum+=A[i];
	}
	ll Q;
	cin>>Q;
	for(ll i=0;i<Q;i++){
		ll b,c;
		cin>>b>>c;
		sum+=mp[b]*(c-b);
		mp[c]+=mp[b];
		mp[b]=0;
		cout<<sum<<endl;
	}
    return 0;
}

Measured memory_bytes: 10172
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

struct SqrtDecomposition {
	int n, sqrt_n, bucket_size;
	vector<int> data;
	vector<int> bucket;
	SqrtDecomposition(int n, int val = 0) :n(n), sqrt_n(sqrt(n)) {
		assert(n);
		bucket_size = 1 + (n - 1) / sqrt_n;
		data.assign(bucket_size * sqrt_n, val);
		bucket.assign(bucket_size, val);
	}
	void update(int x, int y) {
		int k = x / sqrt_n;
		data[x] = y;
		int mini = y;
		for (int i = k * sqrt_n; i < (k + 1) * sqrt_n; i++) {
			chmin(mini, data[i]);
		}
		bucket[k] = mini;
	}
	int get_min(int l, int r) {
		int ret = data[l];
		for (int k = 0; k < bucket_size; k++) {
			int bl = k * sqrt_n, br = (k + 1) * sqrt_n;
			if (r <= bl || br <= l)
				continue;
			if (l <= bl && br <= r) {
				chmin(ret, bucket[k]);
			}
			else {
				for (int i = max(l, bl); i < min(r, br); i++) {
					chmin(ret, data[i]);
				}
			}
		}
		return ret;
	}
};

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n, q; cin >> n >> q;
	SqrtDecomposition sd(n, INT_MAX);
	rep(i, 0, q) {
		int com, x, y; cin >> com >> x >> y;
		if (com == 0) {
			sd.update(x, y);
		}
		else {
			cout << sd.get_min(x, y + 1) << endl;
		}
	}
	return 0;
}

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

using namespace std;

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

  string s;
  cin >> s;
  unordered_set<char> inc;
  for (size_t i = 0; i < s.size(); ++i) {
    inc.insert(s[i]);
  }
  for (char i = 'a'; i <= 'z'; ++i) {
    if (inc.find(i) == inc.end()) {
      cout << i << "\n";
      return 0;
    }
  }
  cout << "None\n";
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
int x[114];
int y[114];
int a[114];
using namespace std;
signed main(){
    int w,h,n;
    cin>>w>>h>>n;
    for(int i=0;i<n;i++){
        cin>>x[i];
        cin>>y[i];
        cin>>a[i];
    }
    int l=0;
    int r=w;
    int d=0;
    int u=h;
    for(int i=0;i<n;i++){
        if(a[i]==1){
            l=max(l,x[i]);
        }
        if(a[i]==2){
            r=min(r,x[i]);
        }
        if(a[i]==3){
            d=max(d,y[i]);
        }
        if(a[i]==4){
            u=min(u,y[i]);
        }
    }
    int w2=r-l;
    int h2=u-d;
    if(w2<0){
        w2=0;
    }
    if(h2<0){
        h2=0;
    }
    cout<<w2*h2<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>
#include <numeric>
#include <cctype>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <utility>
#include <fstream>

using namespace std;
typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { a = abs(a), b = abs(b); while (b > 0) { tie(a, b) = make_pair(b, a % b); } return a; }
//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

constexpr long long INF = 1LL << 60;
constexpr int inf = 1000000007;
constexpr long long mod = 1000000007LL;
constexpr int MAX = 5000000;

int main()
{
	/*
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	*/
	int x; cin >> x;
	x ^= 1;
	cout << x << endl;
	return 0;
}

Measured memory_bytes: 3632
#include <complex.h>
#include <math.h>
#include <iostream>
#include <stdio.h>

using namespace std;

typedef complex<double> xy_t;

double dot_product(xy_t a, xy_t b) {
  return (conj(a)*b).real();
}

double cross_product(xy_t a, xy_t b) {
  return (conj(a)*b).imag();
}

int main() {
  xy_t P[110];
  int N = 0;
  double x, y;
  
  while(scanf("%lf,%lf", &x, &y)!= EOF) {
    xy_t entry(x,y);
    P[N++] = entry;
  }

  //center all coordinates based on first element
  for (int i = 1; i < N; i++) {
    P[i] -= P[0];
  }
  
  //calculate sum
  double sum = 0.0;
  for (int i = 1; i+1 < N ; i++) {
    xy_t  a = P[i] , b = P[i + 1];
    sum += cross_product(a, b) / 2.0;
  }

  printf("%.6f\n", abs(sum));
  
}

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

using namespace std;
using ll=long long;
using vi=vector<int>;
using vl=vector<ll>;
using vs=vector<string>;
using li=list<int>;
using lil=list<ll>;
using lis=list<string>;
using fli=forward_list<int>;
using fll=forward_list<ll>;
using fls=forward_list<string>;
using si=stack<int>;
using sl=stack<ll>;
using ss=stack<string>;
using qi=queue<int>;
using ql=queue<ll>;
using qs=queue<string>;
using pqi=priority_queue<int>;
using pql=priority_queue<ll>;
using pqs=priority_queue<string>;
using dqi=deque<int>;
using dql=deque<ll>;
using dqs=deque<string>;

#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define All(s) s.begin(),s.end()
#define rAll(s) s.rbegin(),s.rend()
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, a, n) for(int i = (n); i < (a); i++)
#define repr(i, n) for(int i = (n); i >= 0; i--)
#define repr2(i, a, n) for(int i = (n); i >= (a); i--)

template<typename T,typename U>
void Inparray(T &f,U n){
  for(int i=0;i<n;i++) cin>>f[i];
}

template<typename T,typename U>
void Printarray(T f,U n){
  for(int i=0;i<n;i++) i!=n ? cout<<f[i]<<" " : cout<<f[i];
}

template<typename T,typename U>
void Printarray2(T f,U n){
  for(int i=0;i<n;i++) cout<<f[i]<<endl;
}
void flagfunc(bool flag,string A,string B){
  flag ? cout<<A<<endl : cout<<B<<endl;
}

void flag2func(bool flag){
  flag ? cout<<"Yes"<<endl : cout<<"No"<<endl;
}

void flag3func(bool flag){
  flag ? cout<<"YES"<<endl : cout<<"NO"<<endl;
}

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  string s,t;cin>>s>>t;
  bool flag=false;
  rep(i,100){
    if(s==t){
      flag=true;
      break;
    }
    rotate(s.begin(),s.begin()+1,s.end());
  }
  flag2func(flag);
}

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

using namespace std;

#define rep(i, n) for(int i = 0; i < (int)n; ++i)
#define FOR(i, a, b) for(int i = a; i < (int)b; ++i)

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

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

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<int> jobs[m];
    rep (i, n) {
        int a, b;
        cin >> a >> b;
        if (a > m) continue;
        jobs[m - a].push_back(b);
    }
    ll ans = 0;
    priority_queue<int> pq;
    for (int i = m - 1; i >= 0; --i) {
        for (int j = 0; j < jobs[i].size(); ++j) {
            pq.push(jobs[i][j]);
        }
        if (!pq.empty()) {
            ans += pq.top();
            pq.pop();
        }
    }
    cout << ans << endl;

    return 0;
}


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

using namespace std;

int main()
{

    long long n;
    long long k;
    cin >>n>>k;

    vector<long> a(n);
    vector<long> f(n);
    for(int i=0;i<n;i++)
    {
        cin>>a[i]; 
    }
    long long maxa=LONG_MIN; 
    for(int i=0;i<n;i++)
    {
        cin>>f[i]; 
    }
    sort(a.begin(),a.end());
    sort(f.begin(),f.end(),greater<long>()); 

    for(int i=0;i<n;i++)
    {
        if(f[i]*a[i] >maxa)
        {
            maxa = f[i]*a[i]; 
        }
    }
    //display arrays after sort
    for(int i=0;i<n;i++)
    {
        //cout<<a[i]; 
    }
    //cout<<endl; 
    for(int i=0;i<n;i++)
    {
        //cout<<f[i]; 
    }
    //cout<<endl; 


    long long l,r;
    l=0;
    r=maxa; 

    long long m; 
    while(l<r)
    {
        m=l+(r-l)/2; 

        long long sum=0; 

        for(int i=0;i<n;i++)
        {
            if(a[i]*f[i] > m)
            {
                sum += a[i]- m/f[i]; 
            }
        }
        if(sum <=k)
        {
            r=m; 

        }
        else
        {
            l=m+1; 
        }
    }
    long long sum=0; 
    for(int i=0;i<n;i++)
        {
            if(a[i]*f[i] > min(l,r))
            {
                sum += a[i]- min(l,r)/f[i]; 
            }
        }
    if(sum<=k)
    {
        cout<<min(r,l)<<endl; 
    }
    else
    {
        cout<<max(r,l)<<endl; 

    }



    return 0; 
}



Measured memory_bytes: 3328
#include <cstdio>
#define ll long long
#define MOD 1000000007LL

int n;
int a [200000];

int main () {
    scanf ("%d", &n);
    for (int i = 0; i < n; ++i) {
        scanf ("%d", &a[i]);
    }
    ll ans = 1, last = 1;
    //4 6 8 9 10 12 14 15 16 18 20 21 22
    for (int i = 1; i < n; ++i) {
        if (a[i - 1] >= 2 * last - 1) {
            last += 1;
        }
        ans = ans * last % MOD;
    }
    printf ("%lld\n", ans);
    return 0;
}


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

#define scd second
#define fst first
#define pb push_back
#define mkp make_pair
#define all(x) x.begin(), x.end()

using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vint;
typedef vector<ll> vlong;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vint> vvint;
typedef vector<vlong> vvlong;
typedef list<int> lint;
typedef list<ll> llong;
typedef list<pii> lpii;
typedef list<pll> lpll;
typedef list<lint> llint;
typedef list<llong> lllong;

int const N=1e6+100;
ll const LINF=numeric_limits<long long int>::max();
int const INF=numeric_limits<int>::max();
int const BN = 31;

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

ll pow_mod(ll a, ll e, ll m){
	ll res=1;
	while(e){
		if(e&1) res=res*a%m;
		a=a*a%m;
		e>>=1;
	}
	return res;
}

ll inv_mod(ll b, ll m){
	b%=m;
	ll x=0, y=1, r, q, a=m;
	while(b){
		q=a/b;
		r=a%b;
		a=b;
		b=r;
		r=x;
		x=y;
		y=r-q*y;
	}
	x+=m;
	return x%m;
}

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

	ll n, k;
	cin>>n>>k;
	vint arr(n);
	for(int i=0; i<n; i++) cin>>arr[i];
	
	vint cnt(n,0), cnt2(n,0);
	for(int i=0; i<n; i++){
		for(int j=i+1; j<n; j++){
			cnt[i]+=(arr[i]>arr[j]);
		}

		for(int j=0; j<n; j++){
			cnt2[i]+=(arr[i]>arr[j]);
		}
	}

	ll ans=0, mod=1e9+7;
	for(int i=0; i<n; i++){
		ans+=cnt2[i]*((k*(k-1)/2)%mod)%mod+cnt[i]*k%mod;
	}

	cout<<ans%mod<<endl;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
    #pragma GCC optimize("no-stack-protector")
    #pragma GCC optimize("unroll-loops")
    #pragma GCC optimize("fast-math")
    #pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native")
    #include <iostream>
    #include <vector>
    #include <algorithm>
    #include <set>
    #include <map>
    #include <unordered_set>
    #include <unordered_map>
    #include <stdio.h>
    #include <cstdio>
    #include <math.h>
    #include <cmath>
    #include <string>
    #include <cstring>
    #include <queue>
    #include <deque>
    #include <random>
    #include <iomanip>
    #include <bitset>
                            
    using namespace std;
                            
    template<typename T> void uin(T &a, T b) {
        if (b < a) {
            a = b;
        }
    }
                            
    template<typename T> void uax(T &a, T b) {
        if (b > a) {
            a = b;
        }
    }
     
     
    #define int long long
    #define ghost signed
    #define left left228
    #define right right228
    #define prev prev228
    #define list list228
     
    const int N = 100 * 1000 + 228;
     
    namespace DSU
    {
    	int p[N], sz[N];
     
    	void init(int n) {
    		for (int i = 1; i <= n; ++i) {
    			p[i] = i;
    			sz[i] = 1;
    		}
    	}
     
    	int getp(int v) {
    		if (v == p[v]) return v;
    		p[v] = getp(p[v]);
    		return p[v];
    	}
     
    	bool join(int u, int v) {
    		u = getp(u);
    		v = getp(v);
    		if (u == v) return 0;
    		if (sz[u] < sz[v]) {
    			p[u] = v;
    			sz[v] += sz[u];
    		} else {
    			p[v] = u;
    			sz[u] += sz[v];
    		}
    		return 1;
    	}
    };
     
    vector<int> g[N];
    vector< pair<int, int> > ans;
    int deg[N];
     
    void dfs(int v, int par = -1) {
    	for (int to : g[v]) {
    		if (to != par) dfs(to, v);
    	}
    	if (deg[v]) {
    		ans.emplace_back(v, par);
    	} else {
    		if (par != -1) {
    			ans.emplace_back(par, v);
    			deg[par] ^= 1;
    		}
    	}
    }
     
    int a[100];
     
    ghost main() {
        ios_base::sync_with_stdio(false);
        cin.tie(0);
    	int n, m;
    	cin >> n >> m;
    	if (m & 1) {
    		cout << -1 << '\n';
    		return 0;
    	}
    	DSU::init(n);
    	for (int i = 0; i < m; ++i) {
    		int u, v;
    		cin >> u >> v;
    		if (DSU::join(u, v)) {
    			g[u].push_back(v);
    			g[v].push_back(u);
    		} else {
    			ans.emplace_back(u, v);
    			deg[u] ^= 1;
    		}
    	}
    	dfs(1);
    	for (auto p : ans) cout << p.first << ' ' << p.second << '\n';
        return 0;
    } // kek ;

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

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

  vector<int> ans(N);

  for (int x = 1; x * x <= N; x++) {
    for (int y = 1; y * y <= N; y++) {
      for (int z = 1; z * z <= N; z++) {
        int calc = x * x + y * y + z * z + x * y + y * z + z * x;
        if (calc <= N) {
          ans[calc - 1]++;
        }
      }
    }
  }
  rep(i, N) cout << ans[i] << endl;
  return 0;
}

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

class Proc{
public:
  string nam;
  int tim;
  Proc(){
    nam="";
    tim=0;
  }
};

Proc Q[100001];

class Queue{
private:
  int fp;
  int rp;
public:
  Queue(){
    fp=0;
    rp=0;
  }
  int next(int p){
    return (p+1)%100001;
  }
  bool isFull(){
    return (next(rp)==fp);
  }
  bool isEmpty(){
    return rp==fp;
  }
  void push(Proc d){
    if(isFull())return;
    Q[rp]=d;
    rp=next(rp);
  }
  Proc front(){
    if(isEmpty()){
      Proc er;
      er.tim=-1;
      return er;
    }
    return Q[fp];
  }
  void pop(){
    if(isEmpty())return;
    fp=next(fp);
  }
};

int main(){
  Queue que;

  int n,q;
  cin >> n >> q;

  for(int i=0; i<n; i++){
    Proc p;
    cin >> p.nam >> p.tim;
    que.push(p);
  }

  int total_tim = 0;

  while(!que.isEmpty()){
    Proc p = que.front();
    que.pop();
    if(p.tim<=q){
      total_tim += p.tim;
      cout << p.nam << ' ' << total_tim << endl;
    }else{
      total_tim += q;
      p.tim -= q;
      que.push(p);
    }
  }

  return 0;
}


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

int main(){
    int64_t n, k; cin >> n >> k;
    vector<int64_t> a(n); int64_t left = 1, right = 0;
    for(auto i = 0; i < n; i++) { cin >> a[i]; right = max(right, a[i]); }
    if(k == 0) { cout << right << endl; return 0; }
    while(right > left) {
        int64_t mid = (left + right) / 2, cnt = 0;
        for (auto i = 0; i < n; i++) cnt += (a[i] + mid - 1) / mid - 1;
        // midにするために必要な切断回数
        // k回以内にmidにすることはできないので、長くする
        // cout << left << " " << right << " " << mid << " " << cnt << endl;
        if(cnt > k) left = mid + 1;
        else right = mid;
    }
    cout << right << endl;
    return 0;
}

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

int main(){

    int n;
    cin >> n;
    int ans=0;
    for(int i=3;i<=n;i++){
        if(i%2==0) continue;
        int cnt=0;
        for(int j=1;j<=i;j++){
            if(i%j==0){
                cnt++;
            }
        }
        if(cnt==8){
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <fstream>
#include <cstring>

using namespace std;

const int mx = 50;
char ss[3][mx];

int main(){
    while(~scanf("%s%s%s", ss[0], ss[1], ss[2])){
        int p = 1;
        for(int i = 0; i < 2; ++i){
            if(ss[i][strlen(ss[i]) - 1] != ss[i + 1][0]){
                p = 0;
                break;
            }
        }
        if(p){
            printf("YES\n");
        }
        else{
            printf("NO\n");
        }
    }
    return 0;
}

Measured memory_bytes: 128
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
  let stdin = stdin();
  let stdin = stdin.lock();
  let token: String = stdin
    .bytes()
    .map(|c| c.expect("failed to read char") as char)
    .skip_while(|c| c.is_whitespace())
    .take_while(|c| !c.is_whitespace())
    .collect();
  token.parse().ok().expect("failed to parse token")
}

fn read_n<T: FromStr>(n: usize) -> Vec<T> {
  read_n_logic::<T>(n, vec![])
}

fn read_n_logic<T: FromStr>(n: usize, mut a: Vec<T>) -> Vec<T> {
  match n {
    0 => a,
    _ => {
      a.push(read::<T>());
      read_n_logic(n - 1, a)
    }
  }
}

fn main() {
  let n = read::<usize>();
  let mut a = read_n::<usize>(n + 1);
  let mut b = read_n::<usize>(n);
  let mut answer = 0;

  a.reverse();
  b.reverse();

  for i in 0..b.len() {
    if b[i] > a[i] {
      answer += a[i];
      b[i] -= a[i];
      a[i] = 0;
    } else {
      answer += b[i];
      a[i] -= b[i];
      b[i] = 0;
    }

    if b[i] > a[i + 1] {
      answer += a[i + 1];
      b[i] -= a[i + 1];
      a[i + 1] = 0;
    } else {
      answer += b[i];
      a[i + 1] -= b[i];
      b[i] = 0;
    }
  }

  println!("{}", answer);
}


Measured memory_bytes: 15740
n = input()
k = int(input())
l = len(n)
dp = [[[0 for i in range(2)] for t in range(3+1)] for j in range(l+1)]
dp[0][0][0] = 1
for i in range(1,l+1):
  for j in range(k+1):
    x = int(n[i-1])
    if x != 0:
      for m in range(1,3+1):
        dp[i][m][0] = dp[i-1][m-1][0]
    else:
      for m in range(3+1):
        dp[i][m][0] = dp[i-1][m][0]
    dp[i][0][1] = dp[i-1][0][0]+dp[i-1][0][1]
    dp[i][1][1] = dp[i-1][0][1]*9+dp[i-1][1][1]+dp[i-1][0][0]*(max(0,x-1))+dp[i-1][1][0]*(x>0)
    dp[i][2][1] = dp[i-1][1][1]*9+dp[i-1][2][1]+dp[i-1][1][0]*(max(0,x-1))+dp[i-1][2][0]*(x>0)
    dp[i][3][1] = dp[i-1][2][1]*9+dp[i-1][3][1]+dp[i-1][2][0]*(max(0,x-1))+dp[i-1][3][0]*(x>0)
print(dp[l][k][0]+dp[l][k][1])

Measured memory_bytes: 3192
n = int(input())
A = [int(i) for i in input().split()]
odd = A[1::2]
even = A[0::2]

if len(A) % 2 == 0:
    odd.reverse()
    ans = odd + even
else:
    even.reverse()
    ans = even + odd
    
print(' '.join(map(str, ans)))

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

using namespace std;
typedef long long int LL;
typedef long long int ll;
typedef pair<long long int, long long int> pii;
typedef pair<double, double> pdd;

#define SORT(c) sort((c).begin(),(c).end())
#define BACKSORT(c) sort((c).begin(),(c).end(),std::greater<LL>())
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SP << " " <<

LL mod = 1000000007;
LL INF = 1000000007;

//昇順ソート
int xcomp(pii& a, pii& b) {
	return a.first < b.first;
}

#define XSORT(c) sort((c).begin(),(c).end(),xcomp)

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

  vector<LL> A(N);
  vector<LL> B(N);
  vector<pii> card;

  REP(i,N){
    cin >> A[i];
  }
  REP(i,N){
    cin >> B[i];
  }
  REP(i,N){
    card.push_back({A[i], B[i]});
  }

  LL mn = INF;

  REP(bit,1<<N){
    vector<pii> guusuu;//0,2,...
    vector<pii> kisuu;//1,3,...
    REP(i, N)
    {
      if((bit&(1<<i))!=0){
        //bitがたってたらkisuu
        if(i%2==0){
          kisuu.push_back({B[i], i});
        }else{
          kisuu.push_back({A[i], i});
        }
      }
      else
      {
        if(i%2==0){
          guusuu.push_back({A[i], i});
        }else{
          guusuu.push_back({B[i], i});
        }
      }
    }

    //size check
    if(kisuu.size()!=N/2){
      continue;
    }

    XSORT(guusuu);
    XSORT(kisuu);
    
    

    vector<pii> idxs;
    
    REP(i,N){
      if(i%2==0){
        idxs.push_back(guusuu[i / 2]);
      }else{
        idxs.push_back(kisuu[i / 2]);
      }
    }
    // cout << "a" << endl;
    
    REP(i,N){
      // cout << idxs[i].first SP idxs[i].second << endl;
    }

    bool flag = false;

    REP(i,N-1){
      if(idxs[i].first>idxs[i+1].first){
        flag=true;
      }
    }
    
    if(flag){
      continue;
    }

    LL sum = 0;


    REP(i,N){
      FOR(j,i+1,N){

        // cout << idxs[i].second SP idxs[j].second << endl;
        if (idxs[i].second > idxs[j].second)
        {
          sum++;
        }
      }
    }

    // cout << sum << endl;

    if(sum<mn){
      mn = sum;
    }
  }
  
  if(mn==INF){
    cout << -1 << endl;
  }else{
    cout << mn << endl;
  }
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
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; }

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<P> v;
    rep(i,m){
        int a, b;
        cin >> a >> b;
        a--; b--;
        v.emplace_back(b, a);
    }
    sort(v.begin(), v.end());
    int l = -1, r = 100005, ans = 0;
    rep(i,m){
        if(v[i].first <= l || r <= v[i].second){
            ans++;
            l = -1;
            r = 100005;
        }
        chmin(r, v[i].first);
        chmax(l, v[i].second);
    }
    cout << ans + 1 << endl;
    return 0;
}

Measured memory_bytes: 1400
use std::io;
use std::str::FromStr;

fn input_int_tuple() -> (u64, u64) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<u64> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1])
}

fn main() {
    let (mut l, mut r) = input_int_tuple();
    if r - l >= 2019 {
        println!("0");
        return;
    }

    l = l % 2019;
    r = r % 2019;
    let mut min = 2019;
    for i in l..(r+1) {
        for j in (i+1)..(r+1) {
            let n = (i * j) % 2019;
            if n < min {
                min = n;
            }
        }
    }
    println!("{}", min);
}


Measured memory_bytes: 4352
N = int(input())
T, A = map(int,input().split())
H = list(map(int, input().split()))

temp = 0
anslist = []
for i in range(N):
    temp = (T - H[i] * 0.006) - A
    anslist.append(abs(temp))

print(anslist.index(min(anslist))+1)

Measured memory_bytes: 9144
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const long long mod = 1e9+7;
long long power(long long a, long long b, long long m = mod) {
    if(b < 0) {
        return power(power(a, -b), mod-2);
    }
    long long x = 1;
    while(b) {
        if(b & 1) {
            x = 1ll * x * a % m;
        }
        a = 1ll * a * a % m;
        b /= 2;
    }
    return x;
}
const int N = 3e5+9;

signed main() {  
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    
    int n; cin >> n;
    vector<long long> a(n+1), pre(n+1);
    for(int i = 1; i <= n; i++) {
        cin >> a[i];
        pre[i] = pre[i-1] + a[i];
    }
    // cout << 
    int p1 = 1, p2 = 3;
    const ll inf = 1e18;
    ll ans = inf;
    for(int i = 2; i < n; i++) {
        while(p1 < i-1 && pre[i-1]-pre[p1-1]>pre[p1-1]) {
            p1++;
        }
        while(p2 < n && pre[n]-pre[p2-1]>pre[p2-1]-pre[i-1]) {
            p2++;
        }
        ll a1 = pre[p1-1], a2 = pre[i-1]-pre[p1-1];
        ll b1 = inf, b2 = 0;
        if(p1-2>=0) {
            b1 = pre[p1-2]; b2 = pre[i-1]-pre[p1-2];
        }
        ll mx1, mx2, mn1, mn2;
        if(abs(a1-a2) > abs(b1-b2)) {
            mx1 = max(b1, b2);
            mn1 = min(b1, b2);
        } else {
            mx1 = max(a1, a2);
            mn1 = min(a1, a2);
        }
        ll a3 = pre[p2-1]-pre[i-1], a4 = pre[n]-pre[p2-1];
        ll b3 = inf, b4 = 0;
        if(p2-1>=i) {
            b3 = pre[p2-2]-pre[i-1]; b4 = pre[n]-pre[p2-2];
        } 
        if(abs(a3-a4) > abs(b3-b4)) {
            mx2 = max(b3, b4);
            mn2 = min(b3, b4);
        } else {
            mx2 = max(a3, a4);
            mn2 = min(a3, a4);
        }
        ans = min(ans, max(mx1, mx2)-min(mn1, mn2));
        // cout << p1 << " " << i << " " << p2 << ": (" << mn1 << " " << 
        //     mx1 << ") (" << mn2 << " " << mx2 << ") ans=" << ans << endl;
    }
    cout << ans << "\n";








    return 0;
    
}

Measured memory_bytes: 3328
#pragma warning disable

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
// Do not use: System.Numerics; at CodeIQ

public class Test
{
    public class Collision
    {
        public int X;
        public int Y;
    }

    public static void Main()
    {
        var line1 = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x)).ToArray();
        var N = line1[0];  // 頂点数
        var M = line1[1];  // 辺の数

        var edges = Enumerable.Range(0, N).Select(x => new List<int>()).ToArray();  // 隣接リスト

        List<int> leftside = new List<int>();  // パスを左に伸ばしたもの
        List<int> rightside = new List<int>();  // パスを右に伸ばしたもの

        bool[] contains = new bool[N];  // パスが頂点を含んでいるかどうか

        for (int i = 0; i < M; i++)
        {
            var line2 = Console.ReadLine().Split(' ').Select(x => Int32.Parse(x) - 1).ToArray();  // 0オリジンに修正

            edges[line2[0]].Add(line2[1]);
            edges[line2[1]].Add(line2[0]);

            if (i == 0)
            {
                leftside.Add(line2[0]);
                rightside.Add(line2[1]);

                contains[line2[0]] = true;
                contains[line2[1]] = true;
            }
        }

        int lastpos = leftside[leftside.Count - 1];  // ここでは Count == 1
        while (true)
        {
            int nextpos = -1;
            foreach (var pos in edges[lastpos])
            {
                if (!contains[pos])
                {
                    // その点は（パス中に）出ねぇよぉ！

                    leftside.Add(pos);
                    contains[pos] = true;
                    nextpos = pos;
                    break;
                }
            }

            if (nextpos == -1)
            {
                break;
            }

            lastpos = nextpos;
        }

        // コピペ
        lastpos = rightside[rightside.Count - 1];  // ここでは Count == 1
        while (true)
        {
            int nextpos = -1;
            foreach (var pos in edges[lastpos])
            {
                if (!contains[pos])
                {
                    // その点は（パス中に）出ねぇよぉ！

                    rightside.Add(pos);
                    contains[pos] = true;
                    nextpos = pos;
                    break;
                }
            }

            if (nextpos == -1)
            {
                break;
            }

            lastpos = nextpos;
        }

        var path = ((IEnumerable<int>)leftside).Reverse().Concat(rightside).Select(x => x + 1).ToArray();  // 1オリジンに修正

        Console.WriteLine(path.Length);
        Console.WriteLine(String.Join(" ", path));
    }
}

Measured memory_bytes: 33324
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.TreeMap;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskX solver = new TaskX();
		solver.solve(1, in, out);
		out.close();
	}

	static class TaskX {
		public void solve(int testNumber, InputReader in, PrintWriter out) {
			int a = in.nextInt();
			int b = in.nextInt();
			int c = in.nextInt();
			String ans = "";
			if (a+b>=c) {
				ans = "Yes";
			} else {
				ans = "No";
			}
			out.println(ans);
		}
	}

	static class ArrayUtils {
		public static Map<Integer, Integer> getCountMap(int[] array) {
			Map<Integer, Integer> map = new TreeMap<>();
			for (int x : array)
				map.merge(x, 1, Integer::sum);
			return map;
		}
	}

	static class InputReader {
		BufferedReader in;
		StringTokenizer tok;

		public String nextString() {
			while (!tok.hasMoreTokens()) {
				try {
					tok = new StringTokenizer(in.readLine(), " ");
				} catch (IOException e) {
					throw new InputMismatchException();
				}
			}
			return tok.nextToken();
		}

		public int nextInt() {
			return Integer.parseInt(nextString());
		}

		public long nextLong() {
			return Long.parseLong(nextString());
		}

		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextInt();
			}
			return res;
		}

		public long[] nextLongArray(int n) {
			long[] res = new long[n];
			for (int i = 0; i < n; i++) {
				res[i] = nextLong();
			}
			return res;
		}

		public InputReader(InputStream inputStream) {
			in = new BufferedReader(new InputStreamReader(inputStream));
			tok = new StringTokenizer("");
		}

	}

}


Measured memory_bytes: 21460
n = int(input())
h = list(map(int, input().split()))

mizu=0

while True:

    end=True
    for i in range(n):
       if h[i]!=0:
           end=False

    if end:
        break

    for l in range(n):
        if h[l]!=0:
            break

    for r in range(l,n):
        if h[r]==0:
            r-=1
            break

    mizu+=1
    for i in range(l,r+1):
        h[i] -= 1

print(mizu)

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

typedef long lint;
typedef long long llint;
typedef pair<int, int> pint;
typedef pair<long long, long long> pllint;

// static const int MAX = 1e6;
// static const int NIL = -1;
// static const llint INF = 1<<21;
// static const llint MOD = 1e9 + 7;

bool compPair(const pint& arg1, const pint& arg2) { return arg1.first > arg2.first; }
template<class T> void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> void chmin(T& a, T b) { if (a > b) { a = b; } }

int main(void) {
    int w, a, b;
    cin >> w >> a >> b;

    if(abs(a-b)<=w) cout << 0 << endl;
    else cout << abs(b-a)-w << endl;
    return 0;
}


Measured memory_bytes: 3588
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<climits>
#include<cmath>
#include<sstream>
#include<iomanip>
#include <map>
#include <stack>

struct max_min
{
    int64_t max = 0;
    int64_t min = 0;
};

const int64_t cc = pow( 10, 9 ) + 7;
//std::cout<< std::fixed << std::setprecision(10) << ( double )( max ) / 2;
bool sort_pair( std::pair< int64_t, int64_t > origin, std::pair< int64_t, int64_t > another )
{
    return origin.first < another.first;
}

int64_t
gcd( int64_t x,  int64_t y )
{
     int64_t min = ( x < y ) ? x : y;
     int64_t max = ( x < y ) ? y : x;
    
    while( 1 )
    {
         int64_t mod = max % min;
        
        if( mod == 0 )
        {
            return min;
        }

        max = min;
        min = mod;
    }
    
    return 1;
}

int main()
{
    std::string word;
    std::string w = "No";
    int64_t a,b,c,d,e,f;
    std::cin>> a;
    d = 0;

    for( int i = 1; i <= a; i++ )
    {
        for( int r = 1; r <= a; r++ )
        {
            for( int t = 1; t <= a; t++ )
            {
                b = gcd( i, r );
                c = gcd( t, b );
                d += c;
            }
        }
    }

    std::cout<< d;
 }


Measured memory_bytes: 3624
/**
 * @brief ユーザ定義リテラル
 * @author えびちゃん
 */

#ifndef H_int_literals
#define H_int_literals
#include <cstddef>
#include <cstdint>

constexpr intmax_t  operator ""_jd(unsigned long long n) { return n; }
constexpr uintmax_t operator ""_ju(unsigned long long n) { return n; }
constexpr size_t    operator ""_zu(unsigned long long n) { return n; }
constexpr ptrdiff_t operator ""_td(unsigned long long n) { return n; }

#endif  /* !defined(H_int_literals) */

#include <cstdio>
#include <cstdint>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <string>

int main() {
  size_t n;
  scanf("%zu", &n);

  std::vector<std::pair<intmax_t, intmax_t>> xy(n);
  for (auto& p: xy)
    scanf("%jd %jd", &p.first, &p.second);

  for (size_t i = 1; i < n; ++i) {
    if ((xy[0].first+xy[0].second + xy[i].first+xy[i].second) % 2 != 0)
      return puts("-1"), 0;
  }

  bool odd = ((xy[0].first + xy[0].second) % 2 != 0);
  if (!odd) {
    for (auto& p: xy) p.first -= 1;
  }

  size_t m = 32;
  std::vector<intmax_t> d(m);
  for (size_t i = 0; i < m; ++i)
    d[i] = 1_jd << (m-i-1);

  std::vector<std::string> w(n);

  for (size_t i = 0; i < n; ++i) {
    intmax_t x, y;
    std::tie(x, y) = xy[i];

    for (size_t j = 0; j < m; ++j) {
      std::pair<intmax_t, char> cl(std::abs(-d[j]-x) + std::abs(y), 'L');
      std::pair<intmax_t, char> cr(std::abs(+d[j]-x) + std::abs(y), 'R');
      std::pair<intmax_t, char> cd(std::abs(x) + std::abs(-d[j]-y), 'D');
      std::pair<intmax_t, char> cu(std::abs(x) + std::abs(+d[j]-y), 'U');

      auto c = std::min({cl, cr, cd, cu}).second;
      w[i] += c;
      if (c == 'L') {
        x += d[j];
      } else if (c == 'R') {
        x -= d[j];
      } else if (c == 'U') {
        y -= d[j];
      } else if (c == 'D') {
        y += d[j];
      }
    }
  }

  if (!odd) {
    ++m;
    d.insert(d.begin(), 1);
    for (auto& wi: w) wi = 'R' + wi;
    for (auto& p: xy) p.first += 1;
  }

  printf("%zu\n", m);
  for (size_t i = 0; i < m; ++i)
    printf("%jd%c", d[i], i+1<m? ' ': '\n');

  for (size_t i = 0; i < n; ++i) {
    intmax_t x = 0;
    intmax_t y = 0;
    for (size_t j = 0; j < m; ++j) {
      if (w[i][j] == 'L') {
        x -= d[j];
      } else if (w[i][j] == 'R') {
        x += d[j];
      } else if (w[i][j] == 'U') {
        y += d[j];
      } else if (w[i][j] == 'D') {
        y -= d[j];
      }
    }
    // fprintf(stderr, "(%jd, %jd)\n", x, y);
    assert(x == xy[i].first && y == xy[i].second);
    printf("%s\n", w[i].c_str());
  }
}


Measured memory_bytes: 384
package main

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

var sc = bufio.NewScanner(os.Stdin)

func read() string {
    sc.Scan()
    return sc.Text()
}

func main() {
	sc.Split(bufio.ScanWords)
	n, _ := strconv.Atoi(read())
	odd := n / 2
	even := (n + 1) / 2
	fmt.Println(odd * even)
}


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

int main() {
  int N, M, sum = 0, Ai;
  cin >> N >> M;
  for(int i = 0; i < M; i++){
    cin >> Ai;
    sum += Ai;
  }
  if(sum <= N)cout << N-sum << endl;
  else cout << -1 << endl;
}


Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <utility>
#include <numeric>
#include <iomanip>

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

using namespace std;

int main()
{
    string s,t; cin >> s >> t;
    cout << t << s << endl;
}

/*

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

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

*/

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

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repp(i, n, m) for(int (i) = (n); (i) < (m); (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 x,a, b; cin>>x>>a>>b;
out((x-a)%b);
}

Measured memory_bytes: 3632
a, b = map(int, input().split())
g1, g2, g3 = {1, 3, 5, 7, 8, 10, 12}, {4, 6, 9, 11}, {2}
print('Yes' if not ({a, b} - g1) or not ({a, b} - g2) else 'No')

Measured memory_bytes: 3060
/*************************************************************************
    > File Name: test.cpp
    > Author: Akira 
    > Mail: qaq.febr2.qaq@gmail.com 
 ************************************************************************/

#include<bits/stdc++.h>
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
#define MST(a,b) memset(a,b,sizeof(a))
#define CLR(a) MST(a,0)
#define Sqr(a) ((a)*(a))
using namespace std;

#define MaxN 110
#define MaxM 
#define INF 0x3f3f3f3f
#define PI 3.1415926535897932384626
const int mod = 1E9+7;
const double eps = 1e-6;
#define bug cout<<88888888<<endl;
#define debug(x) cout << #x" = " << x << endl;

LL N,W;
LL w[MaxN], v[MaxN];
LL DP[MaxN][4*MaxN][MaxN];
void solve()
{
    LL W1 = w[1];
    for(int i=1;i<=N;i++) w[i] = w[i] - W1;
    for(int i=1;i<=N;i++)
    {
        for(int j=0;j<=300;j++)
        {
            for(int k=1;k<=N;k++)
            {
                if( j >= w[i] ) 
                    DP[i][j][k] = max( DP[i-1][j][k], DP[i-1][j-w[i]][k-1]+v[i]);
                else 
                    DP[i][j][k] = DP[i-1][j][k];
            }
        }
    }
    LL ans = 0;
    for(int j=0;j<=300;j++)
    {
        for(int k=0;k<=N;k++)
        {
            if( k*W1+j<=W)
            {
                ans = max(ans, DP[N][j][k]);
            }
        }
    }
    printf("%lld\n", ans);
}

int main()
{
    //std::ios::sync_with_stdio(false);
    scanf("%lld%lld", &N, &W);
    for(int i=1;i<=N;i++) scanf("%lld%lld", &w[i], &v[i]);
    solve();
    //system("pause");
}


Measured memory_bytes: 38272
#include <bits/stdc++.h>
#define DUMP(x)  cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define IFOR(i, m, n) for(int i = n - 1; i >= m; i-- )
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
const ll INF = 1e18;
/* テンプレートここまで */

int main() {
  ll n; cin >> n;
  ll ans = 0;
  FOR(i, 1, n+1) if(i%2 == 1){
    ll d = 0;
    FOR(j, 1, i+1){
      if(i%j == 0) d++;
    }
    if(d == 8) ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int x,n;
    cin>>x>>n;
    int fre[102]={0};
    int mi=101,ma=-1;
    if(n==0)
    {
        cout<<x;
        return 0;
    }
    for(int i=0;i<n;i++)
    {
        int y;
        cin>>y;
        fre[y]++;
        if(mi>y)
            mi=y;
        if(ma<y)
            ma=y;
    }
    int ans=101;
    int index=0;
    for(int i=0;i<=101;i++)
    {
        if(fre[i]==0)
        {
            if(ans>abs(x-i))
            {
                ans=abs(x-i);
                index=i;
            }
        }
    }
    cout<<index<<"\n";

}

Measured memory_bytes: 3612