akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define dd(x) cout<<#x<<" = "<<x<<" "
#define de(x) cout<<#x<<" = "<<x<<endl
#define sz(x) int(x.size())
#define All(x) x.begin(),x.end()
#define fi first
#define se second
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef priority_queue<int> pq;
const int maxn=1e5+10,mod=1e9+7,INF=0x3f3f3f3f;

int main()
{
	ll a,b;
	cin>>a>>b;
	if ((a+b)%2)
		cout<<"IMPOSSIBLE";
	else
		cout<<(a+b)/2;
	return 0;
}

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

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

  int n, k;
  cin >> n >> k;

  vector<int> a(n);
  for (int& e: a)
    cin >> e;

  vector<int> s(n + 1);
  for (int i = 0; i < 100 && k > 0; ++i, --k) {
    for (int i = 0; i < n; ++i) {
      int l = max(i - a[i], 0);
      int r = min(i + a[i], n - 1);
      ++s[l];
      --s[r + 1];
    }

    int cur = 0;
    for (int i = 0; i < n; ++i) {
      cur += s[i];
      a[i] = cur;
      s[i] = 0;
    }
  }

  for (int e: a)
    cout << e << ' ';
  
  cout << '\n';
}

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

#define fa(x,v) for(auto x:v)
#define f(i,a,b) for(ll i=(ll)a;i<=(ll)b;i++)
#define rf(i,a,b) for(ll i=(ll)a;i>=(ll)b;i--)
#define spc " "
#define endl '\n'
#define ll long long
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define len(s) (ll)int(s.length())
#define sz(v) (ll)int(v.size())
#define MOD 1000000007

void Fast_IO() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    #ifndef ONLINE_JUDGE
    freopen("input.in","r",stdin);
    freopen("output.out","w",stdout);
    freopen("debug.out","w",stderr);
    #endif
} 

// Code Here

ll gcdExtended(ll a, ll b, ll *x, ll *y) 
{ 
    if (a == 0) 
    { 
        *x = 0, *y = 1; 
        return b; 
    }
    ll x1, y1; 
    ll gcd = gcdExtended(b%a, a, &x1, &y1);
    *x = y1 - (b/a) * x1; 
    *y = x1; 
    return gcd; 
}

ll invMOD(ll b, ll m) 
{ 
    ll x, y;
    ll g = gcdExtended(b, m, &x, &y);
    return (x % m + m) % m; 
}

int main()
{
    // Fast_IO();
    ll n, k; cin >> n >> k;
    vector < pair<ll,ll> > a;
    f(_,1,n) {
    	ll num; cin >> num;
    	if(num < 0) a.pb(mp(num * -1, -1));
    	else a.pb(mp(num,1));
    }
    sort(a.begin(), a.end(), greater< pair<ll,ll> >());
    ll pp = -1, ap = -1, pn = 1, an = 1;
    ll ans = 1;
    f(i,0,k-1) ans *= a[i].ff, ans %= MOD;
    ll cc = 0;
    f(i,0,k-1) if(a[i].ss == -1) cc = 1 - cc;
    if(cc) {
    	rf(i,k-1,0) if(a[i].ss == 1) {
    		pp = a[i].ff; break;
    	}
    	f(i,k,n-1) if(a[i].ss == 1) {
    		ap = a[i].ff; break;
    	}
    	rf(i,k-1,0) if(a[i].ss == -1) {
    		pn = a[i].ff; break;
    	}
    	f(i,k,n-1) if(a[i].ss == -1) {
    		an = a[i].ff; break;
    	}
    	ll c1 = 1, c2 = 1;
    	if(pp == -1 || an == 1) c1 = 0;
    	if(pn == 1 || ap == -1) c2 = 0;
    	if(!c1 && !c2) {
    		ans = -1 + MOD;
    		f(i,0,k-1) ans *= a[n-1-i].ff, ans %= MOD;
    	}
    	else if(!c1 && c2) {
    		ans *= invMOD(pn, MOD);
    		ans %= MOD;
    		ans *= ap;
    		ans %= MOD;
    	}
    	else if(c1 && !c2) {
    		ans *= invMOD(pp, MOD);
    		ans %= MOD;
    		ans *= an;
    		ans %= MOD;
    	}
    	else {
    		if(ap * pp > an * pn) {
    			ans *= invMOD(pn, MOD);
    			ans %= MOD;
    			ans *= ap;
    			ans %= MOD;
    		}
    		else {
    			ans *= invMOD(pp, MOD);
    			ans %= MOD;
    			ans *= an;
    			ans %= MOD;
    		}
    	}
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 7464
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define F first
#define S second
#define int long long
#define ll long long
//#define int  unsigned long long
#define pb push_back
//#define double long double

using namespace std;
using namespace __gnu_pbds;
typedef  tree< int , null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int mod = 1e9 + 7;
const int N = 200005;
const int K = 50;
set < int > g[N];
int f[N], invf[N], s[N], dp[N];
int binpow(int x, int y){
    if (y == 0) return 1;
    if (y % 2) return x * binpow(x, y - 1) % mod;
    int z = binpow(x, y / 2);
    return z * z % mod;
}
main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
   // freopen("input.txt", "r", stdin);
    int n;
    cin >> n;
    f[0] = 1;
    invf[0] = 1;
    for (int i = 1; i <= n; i++) f[i] = f[i - 1] * i % mod;
    for (int i = 1; i <= n; i++) invf[i] = binpow(f[i], mod - 2);
    for (int i = 1; i <= n; i++){
        s[i] = (s[i - 1] + binpow(i, mod - 2)) % mod;
    }
    int ans = 0;
    for (int i = 1; i <= n; i++){
        int x;
        cin >> x;
        ans = (ans + x * f[n] % mod * (s[i] + s[n - i + 1] - 1 + mod) % mod) % mod;
    }
    cout << ans;
}


Measured memory_bytes: 14336
#!/usr/bin/env python
# -*- coding: utf-8 -*-

M = 1000000007


def main():
  a = [int(c) for c in input().strip()][::-1]
  n = [1]
  c = 1

  for _ in range(len(a)):
    n.append((n[-1] * 3) % M)

  for i, v in enumerate(a):
    if v == 1:
      c = (n[i] + c * 2) % M

  print(c)


if __name__ == '__main__':
  main()



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

struct UnionFind {
  vector<int> d;
  // 子は親のIDを，根は木のサイズ*-1を持つ
  UnionFind(int n = 0): d(n,-1){}
  // rootを探索する
  int find(int x){
    if(d[x] < 0) return x;
    return d[x] = find(d[x]);
  }
  // 集合を統合する
  bool unite(int x, int y){
    x = find(x); y = find(y);
    if (x == y) return false;
    if (d[x] > d[y]) swap(x,y);
    d[x] += d[y];
    d[y] = x;
    return true;
  }
  // 同じ集合に属しているか判定
  bool same(int x, int y) {return find(x) == find(y);}
  // 集合のサイズを返す
  int size(int x) {return -d[find(x)];}
};

int main(){
  int n, m;
  cin >> n >> m;
  UnionFind uf(n);
  rep(i,m){
    int a, b;
    cin >> a >> b;
    a--; b--;
    if(!uf.same(a,b)) uf.unite(a,b);
  }  

  vector<int> arr(n,0);
  rep(i,n) arr[uf.find(i)] |= 1;
  int ans = -1;
  rep(i,n) if(arr[i]) ans++;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 4048
#include <iostream>
#include <algorithm>
using namespace std;
const int N=200000+10;

int h,w,n;
pair<int,int> p[N];

int main(){
    scanf("%d%d%d",&h,&w,&n);
    int ans=h;
    for(int i=1;i<=n;i++){
        scanf("%d%d",&p[i].first,&p[i].second);
    } sort(p+1,p+1+n);

    int low=-1;
    for(int i=1;i<=n;i++){
        if(p[i].first>=p[i].second){
            int d=p[i].first-p[i].second;
            if(d==low+1) {
                low++;
            } else if(d>low+1) {
                ans=min(ans,p[i].first-1);
            }
        }
    }

    printf("%d\n", ans);
}


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

int main(){
    int n;
    cin >> n;
    vector<int> p(n);
    for(int i=0; i<n; i++) cin >> p[i];

    int ans = 0;
    /*
    if(p[0] < p[1] && p[1] < p[2] ||
       p[2] < p[1] && p[1] < p[0] ) {
           ans++;
       }

    if(p[n-3] < p[n-2] && p[n-2] < p[n-1] ||
       p[n-1] < p[n-2] && p[n-2] < p[n-3] ) {
           ans++;
       }
*/
    for(int i=0; i<n; i++) {
        if( i == 0 || i == n-1 ) continue;
        else if( p[i-1] < p[i] && p[i] < p[i+1] 
         || p[i+1] < p[i] && p[i] < p[i-1] ) {
             ans++;
         }
    }

    cout << ans << endl;
}

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

int main(){
	double a,b,t,y;
	int n;
	while(cin >> a){
		t = a / 9.8;
		y = 4.9 * t * t + 5;
		b = y / 5;
		n = ceil(b);
		cout << n << endl;
	}
	return 0;
}

Measured memory_bytes: 1228
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);



int main(){
  int k, x;
  cin >> k >> x;

  int l = x - (k-1);
  int r = x + (k-1);

  for(int i = l; i < r ; ++i){
    cout << i << " ";
  }
  cout << r << endl;
  return 0;
}

Measured memory_bytes: 3564
#include<stdio.h>
#include<stdlib.h>
#define MAX 100
#define LARGE 10000

typedef struct edge{
	int cost;
	int u;
	int v;
}edge;


int n;
int a[MAX][MAX];
edge E[LARGE];


/*qsort用*/
int cmp(const void *p,const void *q){
	return ((edge*)p)->cost - ((edge*)q)->cost;
}


int find(int u,int b[]){
	if(b[u]==u){
		return u;
	}else {
		return b[u]=find(b[u],b);
	}
}

void merge(int u,int v,int b[]){
	if(b[u] < b[v]){
		if(v!=b[v])
			merge(u,b[b[v]],b);
		b[v]=b[u];
	}
	else {
		if(u!=b[u])
			merge(v,b[b[u]],b);
            	b[u]=b[v];
	}
	return;
}



int main(){
	int i,j;
	int num=0;
	int ans=0;
	int b[MAX];/*親の配列*/
	
	scanf("%d",&n);
	
	for(i=0;i<n;i++)b[i]=i;
	
	
	/*隣接行列の読み込み*/
	for(i=0;i<n;i++){
	
		for(j=0;j<n;j++){
			scanf("%d",&a[i][j]);
			if(a[i][j]!=-1 && j>=i+1){
				E[num].cost=a[i][j];
				E[num].u=i;
				E[num++].v=j;
			}
		}
		
	}
	
	/*edgeのソート*/
	qsort(E,num,sizeof(edge),cmp);
	
	for(i=0;i<num;i++){
		if(find(E[i].u,b) != find(E[i].v,b)){
			merge(E[i].u,E[i].v,b);
			ans+=E[i].cost;
		}
	}
	
	printf("%d\n",ans);
	
    return 0;
}


Measured memory_bytes: 1992
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	long long  ans=0;
	ll n,m;
	cin>>n>>m;
	if(m==0){
		cout<<n*n<<endl;
		return 0;
	}
	for(int j=1,i=m+1;i<=n;i++,j++){
		ans=ans+n/i*j;
		ll tmp=0;
		tmp=max((ll)0,n%i-m+1);
		ans=ans+tmp;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
char s[10000];
int main() {
    scanf("%s",s);
    int n=strlen(s);
    for(int i=0;i<n;i++) {
        if(s[i]!=s[n-1-i]) {
            printf("No");
            return 0;
        }
    }
    int m=(n-1)/2;
    for(int i=0;i<m;i++) {
        if(s[i]!=s[m-1-i] || s[m+1+i]!=s[n-1-i]) {
            printf("No");
            return 0;
        }
    }
    printf("Yes");
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <set>
#include <vector>
#include <map>
#include <cmath>
#include <algorithm>
#include <memory.h>
#include <string>
#include <sstream>
#include <cstdlib>
#include <ctime>
#include <cassert>

using namespace std;

typedef long long LL;
typedef pair<int,int> PII;

#define MP make_pair
#define PB push_back
#define FF first
#define SS second

#define FORN(i, n) for (int i = 0; i <  (int)(n); i++)
#define FOR1(i, n) for (int i = 1; i <= (int)(n); i++)
#define FORD(i, n) for (int i = (int)(n) - 1; i >= 0; i--)

#define DEBUG(X) { cout << #X << " = " << (X) << endl; }
#define PR0(A,n) { cout << #A << " = "; FORN(_,n) cout << A[_] << ' '; cout << endl; }

#define MOD 1000000007
#define INF 2000000000

int GLL(LL& x) {
    return scanf("%lld", &x);
}

int GI(int& x) {
    return scanf("%d", &x);
}

int n;

int main() {
    GI(n); int a;

    int oddcnt = 0;

    FOR1(i, n) {
        GI(a);
        oddcnt += a % 2;
    }

    if (oddcnt % 2) {
        cout << "NO\n";
    }
    else {
        cout << "YES\n";
    }
    
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<set>
#include<utility>
#include<algorithm>
#include<cmath>
using namespace std;

#define fo(i,n) for (int i = 0; i < n; ++i)
#define tr(i,n) for(auto i=n.begin();i!=n.end();i++)
#define w(t) while(t--)
#define ll long long int
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define fst ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define all(x) (x).begin(), (x).end()

int main()
{
	fst;
	string a,b;
	cin>>a>>b;
	if(b.substr(0,a.length())==a)
	{
		cout<<"Yes";
	}
	else
	{
		cout<<"No";
	}
}


Measured memory_bytes: 3660
#include <stdio.h>
 
int main(void){
     
    int i,n,max,min,a;
    long long int sum=0;
     
    max=-1000000;
    min=1000000;
     
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&a);
        if(a>max) max=a;
        if(a<min) min=a;
        sum+=a;
    }
     
    printf("%d %d %lld\n",min,max,sum);
     
    return 0;
}


Measured memory_bytes: 2112
void main() {
	auto ip = readAs!(int[]), N = ip[0], M = ip[1];
	auto uf = new UnionFind!long(N);
	foreach(i; 0..M) {
		auto ip2 = readAs!(int[]), X = ip2[0], Y = ip2[1], Z = ip2[2];
		uf.unite(X-1, Y-1);
	}
	N.iota.map!(i => uf.root(i) == i).sum.writeln;
}

class UnionFind(T) {
	T[] arr;
	this(ulong n) {
		arr.length = n;
		arr[] = -1;
	}
	T root(T x) {
		return arr[x] < 0 ? x : root(arr[x]);
	}
	bool same(T x, T y) {
		return root(x) == root(y);
	}
	bool unite(T x, T y) {
		x = root(x);
		y = root(y);
		if(x == y) return false;
		if(arr[x] > arr[y]) swap(x, y);
		arr[x] += arr[y];
		arr[y] = x;
		return true;
	}
	T size(T a) {
		return -arr[root(a)];
	}
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}


Measured memory_bytes: 3836
#include <bits/stdc++.h>
#define INF 1e9
#define endl '\n'
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define FORE(i, a, b) for (int i = (a), e = (b); i < e; ++i)
#define RFORE(i, a, b) for (int i = (b)-1, e = (a); i >= e; --i)
#define ALL(x) (x).begin(), (x).end()
#define SORT(c) sort((c).begin(), (c).end())
#define SORTR(c) sort((c).begin(), (c).end(), greater<int>())
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int N;
    cin >> N;
    vector<int> d(N);
    for (int i = 0; i < N; i++) {
        cin >> d.at(i);
    }
    SORT(d);
    d.erase(unique(ALL(d)), d.end());
    cout << d.size() << endl;
}


Measured memory_bytes: 3644
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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

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

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------
int N;

int main() {
  cin >> N;
  if (N <= 999) {
    cout << "ABC";
    return 0;
  } else {
    cout << "ABD";
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vi  vector<int>
#define pb  push_back
#define mp  make_pair
#define ALL(x) x.begin(),x.end()
#define M(a,x) memset(a,x,sizeof(a))
#define sci(x) scanf("%d",&x);
#define scl(x) scanf("%lld",&x);
#define scs(x) scanf("%s",x);
#define SZ(x) (int)x.size()
#define print(x) printf("%d",x);
#define nl printf("\n")
#define fr first
#define se second
#define printl(x) printf("%lld",x)
#define F(i,a,n) for(int i=a;i<n;i++)
#define INF 100000000000000000LL
#define LL long long

const int N = 1e5+5;
int deg[N];
int flag[N];
int main() {
  int n,m;
  sci(n) ; sci(m);
  for(int i = 1 ; i<= n ; i++) {
    deg[i]++;
  }
  flag[1] = 1;
  F(i,0,m) {
    int x,y;
    sci(x); sci(y);
    if(flag[x] && deg[x] == 1) {
      flag[x] = 0;
      deg[x] = 0;
      deg[y]++;
      flag[y] = 1;
    }
    else if(flag[x] && deg[x]>1) {
      flag[y] = 1;
      deg[x]--;
      deg[y]++;
    }
    else if(!flag[x] && deg[x] >= 1) {
      deg[x]--;
      deg[y]++;
    }
  }
  int ans = 0;
  F(i,1,n+1) {
    ans += (flag[i] == 1);
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <string>
#include <functional>
#include <utility>
#include <queue>
#include <vector>
#include <string>
#include <stack>
#include <cmath>
#define rep(i,n) for(ll i=0;i<n;i++)
using namespace std;
typedef long long int ll;
const ll  MOD = 1000000007;
typedef pair<ll,ll> P;
const ll INF = 100100100100100100;

ll H,W,h,w;
ll field[1000][1000];
int main(){
  cin >> H >> W >> h >> w;
  if((H%h == 0 && W%w == 0) || H*W == h*w){
    cout << "No" << endl;
    return 0;
  }
  cout << "Yes" << endl;
  if(h == 1 || w == 1){
    rep(i,H){
      rep(j,W){
        if((i+1)%h == 0 && (j+1) % w == 0){
          field[i][j] = -((h*w-1)*2000000)-1;
        }
        else{
          field[i][j] = 2000000;
        }
      }
    }
  }
  else{
    rep(i,H){
      rep(j,W){
        if((i+1)%h == 0 && (j+1) % w == 0){
          field[i][j] = -(h*w-1)*4000-1;
        }
        else{
          field[i][j] = 4000;
        }
      }
    }
  }
  rep(i,H){
    rep(j,W){
      if(j==0){
        cout << field[i][j];
      }
      else{
        cout << " " << field[i][j];
      }
    }
    cout << endl;
  }
}


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

int main(){
  int A,B;
  cin >> A >> B;
  int ans=0;
  for(int i=A;i<=B;++i){
    string s=to_string(i);
    if(s.at(0)==s.at(4) && s.at(1)==s.at(3)) ++ans;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <tuple>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <random>
#include <set>
#include <stack>
#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define SORT(x) sort(x.begin(),x.end())
#define SORTR(x) sort(x.begin(),x.end(),greater<int>())
#define rn return
#define F first
#define S second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#include <time.h>
using namespace std;
using ll = long long;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;







int main(){
    int s,w;
    cin >> s >> w;
    if (w>=s) cout << "unsafe";
    else cout << "safe";


}









Measured memory_bytes: 3636
using System;

namespace At
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();
            int a = int.Parse(input[0]), b = int.Parse(input[1]);
            a += b;
            if (a >= 24)
            {
                a -= 24;
            }
            Console.WriteLine(a);
        }
    }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
#define all(x) (x).begin(), (x).end()
#define MOD 1000000007
int main() {
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    int p = n;
    vector<int> S(n + 2, 0);
    for(size_t i = 0; i < n + 1; i++) {
        S[i + 1] = S[i] + (s[i] == '1');
    }
    for(int i = 0; i <= n - m + 2; i++) {
        if(S[i + m] - S[i] == m) {
            cout << -1 << endl;
            return 0;
        }
    }

    vector<int> ans;
    while(p > 0) {
        int prev = p;
        int l = max(0, p - m), r = p;
        while(l + 1 < r) {
            int k = (l + r) / 2;
            if(S[k] - S[l] != k - l) {
                r = k;
                continue;
            }
            if(S[r] - S[k] != r - k) {
                l = k;
                continue;
            }
            cout << -1 << endl;
            return 0;
        }
        p = l;
        ans.push_back(prev - p);
    }
    for(int i = ans.size() - 1; i >= 0; i--) {
        cout << ans[i] << " ";
    }
    cout << endl;
}


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

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

typedef long long ll;
using namespace std;
int mod = 1000000007;

int main(void){
    while(true){
        int N; cin >> N;
        int sum = 0;
        if(N == 0) break;
        vector<int> A(N);
        rep(i, N){
            cin >> A[i];
            sum += A[i];
        }
        sort(A.begin(), A.end());
        cout << (sum - A[0] - A[A.size()-1]) / (A.size()-2) << endl;
    }
    return 0;
}


Measured memory_bytes: 3068
l,r=map(int,input().split())
a=2018
for i in range (l,min(r,l+2019)):
  for j in range(i+1,min(r+1,i+2019)):
    c= ((i%2019)*(j%2019))%2019
    if c<a:
      a=c
print(a)
    

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

int main(){
    int n,k; long long sum=0; cin >>n >>k;
    vector<int>a(n);
    for(int i=0; i<n; i++){cin >> a[i];}
    sort(a.begin(),a.end());
    for(int i=0; i<n-k; i++){sum += a[i];}
    cout <<sum;

return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
#define pb push_back
#define pp pair<int,int>
#define rep(i,l,r) for(int i=l;i<r;i++)
vi g[100005];
vi indeg(100005,0);
vi lp(100005,0);
int main()
{
	// #ifndef ONLINE_JUDGE
	// freopen("input.txt.txt","r",stdin);
	// freopen("output.txt.txt","w",stdout);
	// #endif
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n,m;
	cin>>n>>m;
	set<pp > vert; 
	while(m--)
	{
		int u,v;cin>>u>>v;
		g[u].pb(v);
		indeg[v]++;
	}
	for(int i=1;i<=n;i++) 
	{
		vert.insert({indeg[i],i});
	}
	int done = 0;
	while(done!=n)
	{

		pp vv = *vert.begin();
		int v = vv.second;
		for(auto &x:g[v])
		{
			lp[x] = max(lp[v] + 1,lp[x]);
			vert.erase({indeg[x],x});
			indeg[x]--;
			vert.insert({indeg[x],x});

		}
		vert.erase({indeg[v],v});


		done++;
	}
	int ans = 0;
	rep(i,1,n+1) ans = max(ans,lp[i]);
	cout<<ans<<endl;





}

Measured memory_bytes: 11264
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define erep(i, n) for (ll i = 0; i <= (ll)(n); ++i)
#define FOR(i,a,b) for (ll i = (a); i < (ll)(b); ++i)
#define EFOR(i,a,b) for (ll i = (a); i <= (ll)(b); ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } }

#include <iostream>
#include <vector>
#include <queue>
using namespace std;
using Graph = vector<vector<int>>;
using P = pair<int, int>;

ll modnum = 1000000007;

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}



int main() {

    int x; cin >> x;
    if(x < 1200) cout << "ABC" <<endl;
    else cout << "ARC" <<endl;


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define tcase int _; cin >> _; while(_--)
const int MAX = 1e6;

int n;

void solve() {
	cin >> n;
	cout << (n >= 30 ? "Yes" : "No");
}

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

 	solve();

  	return 0;
}



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

int main() {
	int n;
    char s;
    cin >> n;
  
  for (int i = 0; i < n; i++){
  	cin >> s;
    if(s == 'Y'){
    	cout << "Four" << endl;
      	break;    
    }else if(i == n-1){
    	cout << "Three" << endl;
      	break;
    }
    
  }
  
  
  
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}
int bits(int x) {
    int ret = 0;
    while (x) {
        ret += x & 1;
        x >>= 1;
    }
    return ret;
}

int main() {
    int n;
    cin >> n;
    vvi a(n, vi(n));
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < n; ++j) {
            cin >> a[i][j];
        }
    }
    vvl dp(n + 1, vl(1 << n, 0));
    dp[0][0] = 1;
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j <= 1 << n; ++j) {
            if (bits(j) != i)
                continue;
            for (int k = 0; k < n; ++k) {
                if (a[i][k] == 1 && !(j & 1 << k)) {
                    dp[i + 1][j | 1 << k] += dp[i][j];
                    dp[i + 1][j | 1 << k] %= MOD;
                }
            }
        }
    }
    cout << dp[n][(1 << (n)) - 1] << "\n";
    return 0;
}

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

int main()
{
    vector<int> h(0),w(0);
    for (int i=0; ; i++)
    {
        h.push_back(0);
        w.push_back(0);
        cin>>h[i]>>w[i];
        if (h[i]==0 && w[i]==0) break;
    }
    for (int i=0; i<h.size()-1; i++)
    {
        for (int j=0; j<h[i]; j++)
        {
            for (int k=0; k<w[i]; k++)
            {
                if (j%2==1)
                {
                    if (k%2==1) cout<<"#";
                    else cout<<".";
                }
                else
                {
                    if (k%2==1) cout<<".";
                    else cout<<"#";
                }
            }
            cout<<'\n';
        }
        cout<<'\n';
    }
    return 0;
}



Measured memory_bytes: 3160
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define vl vaector<long>
#define vll vector<long long int>
#define vC  vector<char>
#define FastIO ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define db(...) ZZ(#__VA_ARGS__, __VA_ARGS__)
ll pow(ll x, ll y,ll m) { ll res = 1;x=x%m; while (y > 0) { if (y & 1) res = ((res%m) * (x%m))%m; y = y >> 1; x = ((x%m) * (x%m))%m; } return res%m; }
template <typename Arg1> void ZZ(const char* name, Arg1&& arg1){std::cerr << name << " = " << arg1 << endl;}
template <typename Arg1, typename... Args>void ZZ(const char* names, Arg1&& arg1, Args&&... args)
{
	const char* comma = strchr(names + 1, ',');
	std::cerr.write(names, comma - names) << " = " << arg1;
	ZZ(comma, args...);
}
const ll INF = 0xFFFFFFFFFFFFFFFL;
clock_t time_p=clock();
void abhigyan10()
{time_p=clock()-time_p;cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";}
ll seed;
mt19937 rng(seed=chrono::steady_clock::now().time_since_epoch().count());
inline ll rnd(ll l=0,ll r=INF){return uniform_int_distribution<ll>(l,r)(rng);}
#define clrbuf cin.ignore(numeric_limits<streamsize>::max(),'\n');
#define preciset(x) cout<<setprecision(x)<<fixed;
const ll mod =1000000007;
ll a[3][3];
int b[101];
int main()
{
    
        FastIO

        int i,j, n,flag=0,x;
        for(i=0;i<3;i++)
        
        	for(j=0;j<3;j++)
        		cin>>a[i][j];
        
        	cin>>n;
        	while(n--)
        	{
        		cin>>x;
        		b[x]=1;
        	}

        	for(i=0;i<3;i++)
        	{
        		flag=1;
        		for(j=0;j<3;j++)
        		{
        			if(b[a[i][j]]!=1)
        				flag=0;
        		}
        		if(flag!=0)
        			{cout<<"Yes";return 0;}
        	}

        	for(i=0;i<3;i++)
        	{
        		flag=1;
        		for(j=0;j<3;j++)
        		{
        			if(b[a[j][i]]!=1)
        				flag=0;

        		}
        		if(flag!=0)
        			{cout<<"Yes";return 0;}

        	}

        	if(b[a[0][0]]==1 && b[a[1][1]]==1 && b[a[2][2]]==1)
        		{cout<<"Yes";return 0;}

        	if(b[a[0][2]]==1 && b[a[1][1]]==1 && b[a[2][0]]==1)
        		{cout<<"Yes";return 0;}

        	cout<<"No";
        	return 0;
        }




Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<utility>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<complex>
#include<map>
#define INF 2147483647
#define llINF 9223372036854775807
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long

using namespace std;
int main(){
  int n;cin>>n;
  for(int i=0;i<n;i++){
    string s;cin>>s;
    ll ans=0;
    map<string,int>used;
    for(int j=1;j<s.size();j++){
      string s2=s.substr(0,j);
      string s3=s.substr(j,s.size()-j);
      string str=s2+s3;
      if(used.find(str)==used.end()){
	ans++;
	used[str]=1;
      }
      //cout<<s2<<" "<<s3<<endl;
      str=s3+s2;
      //cout<<s2<<" "<<s3<<endl;
      if(used.find(str)==used.end()){
	ans++;
	used[str]=1;
      }
      reverse(s3.begin(),s3.end());
      str=s2+s3;
      //cout<<s2<<" "<<s3<<endl;
      if(used.find(str)==used.end()){
	ans++;
	used[str]=1;
      }
      str=s3+s2;
      //cout<<s2<<" "<<s3<<endl;
      if(used.find(str)==used.end()){
	ans++;
	used[str]=1;
      }
      reverse(s2.begin(),s2.end());
      str=s2+s3;
      //cout<<s2<<" "<<s3<<endl;
      if(used.find(str)==used.end()){
	ans++;
	used[str]=1;
      }
      str=s3+s2;
      //cout<<s2<<" "<<s3<<endl;
      if(used.find(str)==used.end()){
	ans++;
	used[str]=1;
      }
      reverse(s3.begin(),s3.end());
      str=s2+s3;
      //cout<<s2<<" "<<s3<<endl;
      if(used.find(str)==used.end()){
	ans++;
	used[str]=1;
      }
      str=s3+s2;
      //cout<<s2<<" "<<s3<<endl;
      if(used.find(str)==used.end()){
	ans++;
	used[str]=1;
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}



Measured memory_bytes: 3148
#include<cstdio>
const int N=1e5+7;
int n,k,fa[N],in[N],q[N],ql=0,qr=0,ans=0,md[N];
void maxs(int&a,int b){if(a<b)a=b;}
int main(){
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;++i)scanf("%d",fa+i);
	if(fa[1]!=1)fa[1]=1,++ans;
	for(int i=1;i<=n;++i)++in[fa[i]];
	for(int i=1;i<=n;++i)if(!in[i])q[++qr]=i;
	while(ql!=qr){
		int w=fa[q[++ql]];
		if(!--in[w])q[++qr]=w;
	}
	for(int t=1;t<=qr;++t){
		int w=q[t],f=fa[w];
		if(md[w]+1==k&&f!=1)++ans;
		else maxs(md[f],md[w]+1);
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 1664
#include <algorithm>
#include <map>
#include <vector>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cstdlib>
#include <cmath>
#include <string>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define IREP(it,array) for(vector<int>::iterator it=array.begin(); it!=array.end(); ++it)
#define SREP(it,array) for(vector<string>::iterator it=array.begin(); it!=array.end(); ++it)
#define MP make_pair


int main()
{
  cout.setf(ios::fixed, ios::floatfield);
  cout.precision(10);

  int INF = 1000000;

  int a,b;
  while(cin>>a>>b){
    int sum=a+b;
    int deg=0;
    while(sum>0){
      sum /= 10;
      deg++;
    }
    cout << deg << endl;
  }

  return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  string S;
  cin>>S;
  int ans = 0;
  for(int i=0;i<S.size();++i) {
    if(i%2==0) { //ぐーだす
      if(S[i]=='p') ans--;
    }
    else {
      if(S[i]=='g') ans++;
    }
  }
  cout<<ans<<endl;
}



Measured memory_bytes: 3668
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e9;
const int N = 200000;



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


    int a, b;
    cin >> a >> b;
    cout << a * b;

    return 0;
}


Measured memory_bytes: 3572
#include <bits/stdc++.h>
#define N 6001
#define INF (1e9)
using namespace std;
typedef pair<int,int> P;
typedef pair<int,P> PP;
vector<P> G[N];
int n,m,cap,ls[N];
void add_edge(int a,int b,int d){
  G[a].push_back(P(b,d));
  G[b].push_back(P(a,d));
}

int dijkstra(){
  int used[N]={};
  vector<vector<int> >D(cap+1,vector<int>(n,INF));
  priority_queue<PP,vector<PP>,greater<PP> > Q;
  Q.push(PP(0,P(cap,0)));
  D[cap][0]=0;

  while(!Q.empty()){
    PP t=Q.top();Q.pop();
    int d=t.first,c=t.second.first,pos=t.second.second;

    if(pos==1) return d;
    if(ls[pos])c=cap;
    if(D[c][pos]<d||used[pos]>c)continue;
    used[pos]=c;

    
    for(int i=0;i<G[pos].size();i++){
      int nd=d+G[pos][i].second;
      int nx=G[pos][i].first;
      int nc=c-G[pos][i].second;
      if(nc>=0&&D[nc][nx]>nd)Q.push(PP(nd,P(nc,nx))),D[nc][nx]=nd;
    }
  }
  return -1;
}


int main(){
  while(1){
    cin>>n>>m>>cap;cap*=10;
    if(!n&&!m&&!cap)break;
    for(int i=0;i<N;i++)G[i].clear(),ls[i]=0;
    
    map<string,int> M;
    string a,b;
    cin>>a>>b;
    M[a]=0,M[b]=1;
    int _n=2;
    for(int i=0,d;i<n;i++){
      cin>>a>>b>>d;
      if(!M.count(a)) M[a]=_n++;
      if(!M.count(b)) M[b]=_n++;
      add_edge(M[a],M[b],d);
    }
    n=_n;
    for(int i=0;i<m;i++) {cin>>a;if(M.count(a))ls[M[a]]=1;}
    cout <<dijkstra()<<endl;
  }
  return 0;
}

Measured memory_bytes: 50988
/**
 *   author: Shubham Srivastava
 *   created: 27 January 2020  13:34:08
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define MOD 1000000007
#define INF 0x7fffffff
#define sorti(v) sort(v.begin(),v.end())
#define sortd(v) sort(v.rbegin(),v.rend())
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;
ll parent[2000005];

int helper(int k, int n, vector <int> &arr, vector <int> &dp){
	if(k == 0)
		return 1;
	int ans = 0;
	if(dp[k] != -1)
		return dp[k];
	for(int i=0;i<n;i++){
		if(k-arr[i] >= 0){
			if(helper(k-arr[i],n,arr,dp))
				ans = 1;
		}
	}
	return dp[k] = !ans;
}
	
int main(){
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
	int n,k;cin>>n>>k;
	vector <int> dp(k+1,-1);
	vector <int> arr(n);
	for(int i=0;i<n;i++)
		cin>>arr[i];
	if(helper(k,n,arr,dp))
		cout<<"Second";
	else
		cout<<"First";
	//cout<<ans;
return 0;
}

Measured memory_bytes: 8448
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define rep(i,n) for(int i = 0; i < n; i++)
#define reps(i,j,n) for(int i = j; i < n; i++)
#define rrep(i,j,n) for(int i = j-1; i >= n; i--)
#define prec(n) fixed << setprecision(n)
#define print_array(v) rep(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; }
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define MOD 1e+7
#define inf 1e9
#define fi first
#define se second
using namespace std;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  string s;
  cin >> n >> s;
  vector<int> w(n+1, 0);
  vector<int> e(n+1, 0);
  rep(i,n) {
    int W = 0, E = 0;
    if(s[i] == 'W') W++;
    if(s[i] == 'E') E++;
    w[i+1] = w[i] + W;
    e[i+1] = e[i] + E;
  }
  int res = inf;
  rep(i,n+1) {
    int cur = 0;

    cur += e[n] - e[i];
    cur += w[i];
    res = min(res, cur);
    //cout << i << " => " << e[n] - e[i] << " " << w[i] << endl;
  }
  cout << res << endl;
  //print_array(w);
  //print_array(e);
  return 0;
}
//templete by private_yusuke

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

int main()
{
    int a,b;
    while(cin>>a>>b)
    {
        double l=max(double(a)*12.5,double(b)*10.0);
        double r=min(12.5*double(a+1),10.0*double(b+1));
       // cout<<l<<" "<<r<<endl;
        int ans=l;
        if(!(double(ans)*0.08>=a and double(ans)*0.1>=b))
            ans++;
        if(ans<r)
            cout<<ans<<endl;
        else cout<<-1<<endl;
    }



    return 0;
}

Measured memory_bytes: 256
/*
 #pragma GCC target ("avx2")
 #pragma GCC optimize ("Ofast")
 #pragma GCC optimize ("unroll-loops")
*/
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
#include <set>
#include <map>
#include <unordered_map>
#include <iomanip>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#define F first
#define S second
#define pb push_back
using namespace std;
const long long N = 2e5 + 10;
bool is(string s){
    string h=s;
    reverse(h.begin(),h.end());
    return (h==s);
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    string s;
    cin>>s;
    int n=(int)s.size();
    string a=s.substr(0,(n-1)/2);
    string b=s.substr(n/2+1,n);
    if(is(s)&&is(a)&&is(b)){
        cout<<"Yes";
    }else{
        cout<<"No";
    }
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <vector>
#include <stack>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define link(x) for(edge *j=h[x];j;j=j->next)
#define inc(i,l,r) for(int i=l;i<=r;i++)
#define dec(i,r,l) for(int i=r;i>=l;i--)
const int MAXN=3e5+10;
const double eps=1e-8;
const int mod=1e9+9;
#define ll long long
using namespace std;
struct edge{int t,v;edge*next;}e[MAXN<<1],*h[MAXN],*o=e;
void add(int x,int y,int vul){o->t=y;o->v=vul;o->next=h[x];h[x]=o++;}
ll read(){
    ll x=0,f=1;char ch=getchar();
    while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();}
    while(isdigit(ch))x=x*10+ch-'0',ch=getchar();
    return x*f;
}


int n;

int main(){
    n=read();
    inc(i,1,500){
	for(int j=-500;j<=500;j++){
	    ll x=1ll*i*i*i*i*i;
	    ll y=1ll*j*j*j*j*j;
	    if(x-y==n)return 0*printf("%d %d\n",i,j);
	}
    }
}


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

int main(){
    string s;
    cin>>s;
    ll count =0;
    for(ll i=0;i<s.length();i++){
        if(i%2==0){
            if(s[i]=='L') count++;
        }
        else {
            if(s[i]=='R') count++;
        }
    }
    if(count==0) cout<<"Yes";
    else cout<<"No";
    
    return 0;
}

Measured memory_bytes: 256
p_max = 100000 * 10000

nk = list(map(int, input().split()))
w = [int(input()) for i in range(nk[0])]


def search(pt):
    m = 0
    for j in range(nk[1]):
        weight = 0
        while weight + w[m] <= pt:
            weight += w[m]
            m += 1
            if m == nk[0]:
                return nk[0]
    return m


def main():
    st_p = p = 0
    en_p = p_max
    while en_p - st_p > 1:
        p = int((en_p + st_p) / 2)
        chk = search(p)
        if chk >= nk[0]:
            en_p = p
        else:
            st_p = p
    return en_p


if __name__ == '__main__':
    print(main())



Measured memory_bytes: 9580
N = int(input())

from collections import Counter
def factorize(n):
    d = Counter()
    m = 2
    while m*m <= n:
        while n%m == 0:
            n //= m
            d[m] += 1
        m += 1
    if n > 1:
        d[n] += 1
    return d

fac = Counter()
for n in range(1,N+1):
    fac += factorize(n)

ans = 0
v4 = v2 = 0
for v in fac.values():
    if v >= 4:
        v4 += 1
    elif v >= 2:
        v2 += 1
t = v4 * (v4-1)//2 * (v4-2+v2)
if t > 0:
    ans += t

v24 = v2 = 0
for v in fac.values():
    if v >= 24:
        v24 += 1
    elif v >= 2:
        v2 += 1
t = v24 * (v24-1+v2)
ans += t

v14 = v4 = 0
for v in fac.values():
    if v >= 14:
        v14 += 1
    elif v >= 4:
        v4 += 1
t = v14 * (v14-1+v4)
ans += t

v74 = 0
for v in fac.values():
    if v >= 74:
        v74 += 1
ans += v74

print(ans)

Measured memory_bytes: 9420
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
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 FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

int main() {
    int n;
    cin >> n;
    VI b(n);
    REP(i,n) b[i] = in();
    VI a(n);
    int ans = 0;
    while (true){
        int x = -1, y = -1;
        REP(i,n){
            if (a[i] < b[i]){
                if (x == -1) x = i;
            }else if (x != -1 && a[i] == b[i]){
                y = i - 1;
                break;
            }
        }
        if (x == -1) break;
        if (y == -1) y = n - 1;
        FOR(i,x,y) a[i]++;
        ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <malloc.h>
#include <string.h>

int main(void) {
  int a, b, c;
  scanf("%d %d %d", &a, &b, &c);
  if(a == b && a == c) printf("No");
  else if(a == b || a == c || b == c) printf("Yes\n");
  else printf("No");
  return 0;
}



Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
    int n,x;
    cin>>n>>x;
    vector<int> vec;
    for(int i=0;i<n;i++){
        int t;
        cin>>t;
        vec.push_back(t);
    }
    int ans=0;
    if(vec[0]>x){
        ans+=vec[0]-x;
        vec[0]=x;
    }
    for(int i=1;i<vec.size();i++){
        int t=max((int)0,vec[i]+vec[i-1]-x);
        vec[i]-=t;
        ans+=t;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1400
R, C, K = map(int, input().split())

V = [[0]*(C+1) for _ in range(R+1)]
for _ in range(K):
    r, c, v = map(int, input().split())
    V[r][c] = v

pre0 = [0]*(C+1)
pre1 = [0]*(C+1)
pre2 = [0]*(C+1)
pre3 = [0]*(C+1)
for i in range(R+1):
    now0 = [0]*(C+1)
    now1 = [0]*(C+1)
    now2 = [0]*(C+1)
    now3 = [0]*(C+1)
    for j in range(C+1):
        v = V[i][j]
        la = lb = 0
        if j > 0:
            la = now0[j-1]
            lb = now1[j-1]
            now2[j] = max(now2[j], now2[j-1], lb + v)
            now3[j] = max(now3[j], now3[j-1], now2[j-1] + v)
        if i > 0:
            max_p = max(pre0[j], pre1[j], pre2[j], pre3[j])
            now0[j] = max(now0[j], max_p, la)
            now1[j] = max(now1[j], max_p + v, la + v, lb)
    pre0 = now0
    pre1 = now1
    pre2 = now2
    pre3 = now3

print(max(now0[C], now1[C], now2[C], now3[C]))


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

int main(){
  int x,a;
  cin >> x >> a;
  if(x<a) cout << "0" << endl;
  else cout << "10" << endl;
}

Measured memory_bytes: 256
//============================================================================
//Everyone has a different way of thinking, so God Created us
//   Hope You Respect My Way..,Thank You ):
// Author      : Murad
// Name        : Codeforces.cpp & Atcoder.cpp
// Description : Problem name
//============================================================================
#include<bits/stdc++.h>
#include<unordered_map>
#include<unordered_set>
using namespace std;
#define pi 3.1415926536
#define forn(i,a,b)for(int i=a;i<b;i++)
#define LL long long
#define ULL unsigned long long
#define MP make_pair
#define ff first
#define ss second
#define endl '\n'
#define INF 1e9 + 1
#define _INF INT32_MIN
#define pq priority_queue
#define MM multimap
#define PB push_back
#define vii vector<int>
#define ipair pair<int,int>
#define lpair pair<LL,LL>
#define El3zba ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define modd 1000000007
#define sfll1(v) scanf("%I64d",&v);
#define sfll2(v1,v2) scanf("%I64d %I64d",&v1,&v2)
#define sfll3(v1,v2,v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)
//std::transform(s1.begin(), s1.end(), s1.begin(),::tolower);
char alphz[27] = { 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z' };
float Euclidean(LL x1, LL x2, LL y1, LL y2) {
	return sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2));
}
LL gcd(LL a,LL b) {
	return !b ? a : gcd(b, a % b);
}
LL LCM(LL a, LL b) {
	return (a*b) / gcd(a, b);
}
void PrimeFactor(LL n)
{
	while (n % 2 == 0) {
		//printf("%d ", 2);
//		aa.insert(2);
		n /= 2;
	}
	for (int i = 3; i <= sqrt(n); i += 2)
	{
		if (n%i == 0) {
			//printf("%d ", i);
			//aa.insert(i);
			n /= i;
		}
	}
	if (n > 2){
		//printf("%d ", n);
	//	aa.insert(n);
	};
}
bool is_square(LL x) {
	LL l = 0, r = x;
	while (l <= r) {
		LL mid = l + (r - l) / 2;
		if (mid*mid == x)return true;
		if (mid*mid > x)r = mid - 1;
		else l = mid + 1;
	}
	return false;
}
LL power(LL x, LL y)
{
	LL temp;
	if (y == 0)return 1;
	temp = power(x, y / 2);
	if (y % 2 == 0)
		return temp*temp;
	else return x*temp*temp;
}
bool is_Prime(int x) {
	if (x == 2)return 1;
	else if (x % 2 == 0 || x < 2)return 0;
	for (int i = 3; i*i <= x; i += 2)
		if (x%i == 0)return 0;
	return 1;
}
const int N = 105;
int main()
{
	El3zba;
	/***  بسم الله الرحمن الرحيم   ***/
	int n;
	cin >> n;
	int ans = 0,cnt=0;
	for (int i = 1; i <= n; i++)
	{
		if (!is_Prime(i)&&i%2!=0)
		{
			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
import java.util.*;

public class Main {
    void run() {
        Scanner sc = new Scanner(System.in);
        int r = sc.nextInt();
        System.out.println(r * 2 * Math.PI);
    }

    void debug(Object... os) {
        System.err.println(Arrays.deepToString(os));
    }

    public static void main(String[] args) {
        new Main().run();
    }
}


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

typedef long long ll;

int main() {
    string S;
    cin >> S;
    int N = (unsigned int)S.size();
    const int MOD = 1000000007;

    vector<vector<ll>> dp((unsigned int)N + 1, vector<ll>(4));
    for (int i = N; i >= 0; i--) {
        for (int j = 3; j >= 0; j--) {
            if (i == N) {
                dp[i][j] = (j == 3 ? 1 : 0);
            } else {
                dp[i][j] = dp[i + 1][j] * (S[i] == '?' ? 3 : 1);
                if (j < 3 && (S[i] == '?' || S[i] == "ABC"[j])) {
                    dp[i][j] += dp[i + 1][j + 1];
                }
                dp[i][j] %= MOD;
            }
        }
    }
    cout << dp[0][0] << endl;
    return 0;
}

Measured memory_bytes: 7424