akhauriyash/Code-Regression huggingface dataset:
#include <iostream>

typedef long long ll;

using namespace std;
ll L[87];

int main(){
  int N; cin>>N;
  L[0]=2LL;L[1]=1LL;
  for(int i=2;i<=N;i++) L[i]=L[i-2]+L[i-1];
  cout<<L[N]<<endl;
  
  return 0;
}


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

int main(void) {
  int n, m, c;
  cin >> n >> m >> c;
  
  vector<int> b(m);
  for (int i = 0; i < m; i++) {
    cin >> b.at(i);
  }
  
  vector<vector<int>> a(n, vector<int>(m));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> a.at(i).at(j);
    }
  }
  
  int count = 0;
  
  for (int i = 0; i < n; i++) {
    int sum = 0;
    for (int j = 0; j < m; j++) {
      sum += a.at(i).at(j) * b.at(j);
    }
    sum += c;
    if (sum > 0) {
      count++;
    }
  }
  
  cout << count << endl;
  
}

Measured memory_bytes: 256
#include <iostream>

#include <string>

#include <vector>
using namespace std;
int main()
{

   int h,w;
   cin>>h>>w;
   string s;
   vector<string>res;
   for(int i=0;i<h;i++){
    cin>>s;
    res.push_back(s);
   }
   s.clear();
   for(int i=0;i<w+2;i++)
   {
       s+='#';
   }
   cout<<s<<endl;
   for(auto &x :res)
   {
       cout<<"#";
       cout<<x;
       cout<<"#"<<endl;
   }
   cout<<s<<endl;


    return 0;
}


Measured memory_bytes: 256
import scala.io.StdIn
import scala.annotation.tailrec
import scala.collection.mutable.ListBuffer

object Main{
  def main(args: Array[String]){
    StdIn.readLine()
    val line = StdIn.readLine().split(" ").toList.map(_.toInt)

    println(line.sorted.mkString(" "))
    println(sSort(List(), line, 0))
  }

  @tailrec
  def sSort(sorted: List[Int], unsorted: List[Int], n: Int): Int={
    if(unsorted.length == 0) n
    else if(unsorted.sorted == unsorted) n
    else if(unsorted.indexWhere(_ == unsorted.min) == 0) sSort(sorted :+ unsorted.min, unsorted.tail, n)
    else {
      val pos = unsorted.indexWhere(_ == unsorted.min)
      val swapped = unsorted.updated(0, unsorted(pos)).updated(pos, unsorted.head)

      sSort(sorted :+ unsorted.min, swapped.tail, n+1)
    }
  }
}

Measured memory_bytes: 44996
#define DEBUG(x) cout << #x << " is " << x << endl;

#include <iostream>
#include <algorithm>

using namespace std;
using ll = long long;

const int INF = 1e9;
const int MOD = 1e9 + 7;

ll pow(ll x, ll y) {
    ll ret = 1;
    while(y) {
        if(y & 1) ret *= x;
        x *= x;
        if(x >= MOD) x %= MOD;
        if(ret >= MOD) ret %= MOD;
        y >>= 1;
    }
    return ret;
}

ll factrial[200001];
void calcFactrial(int n) {
    factrial[0] = 1;
    for(int i = 1;i <= n;i++) {
        factrial[i] = i * factrial[i - 1];
        if(factrial[i] >= MOD) factrial[i] %= MOD;
    }
}

ll modinv(ll x) {
    ll a = x, b = MOD, u = 1, v = 0;
    while(b) {
        ll tmp = a / b;
        a -= tmp * b;
        u -= tmp * v;
        swap(a, b);
        swap(u, v);
    }
    u %= MOD;
    if(u < 0)u += MOD;
    return u;
}

ll binomial(ll n, ll k) {
    ll ret = modinv(factrial[k]);
    for(int i = 0;i < k;i++) {
        ret *= n - i;
        if(ret >= MOD) ret %= MOD;
    }
    return ret;
}

int main() {
    ll n, a, b;
    cin >> n >> a >> b;
    calcFactrial(200000);
    ll ans = pow(2, n) - binomial(n, a) - binomial(n, b) - 1;
    ans %= MOD;
    if(ans < 0)ans += MOD;
    cout << ans << endl;
    return 0;
}

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

using namespace std;

int a[200010];
int main()
{
    int n,ans=0;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    
    }
    int wa=100000000;
    for(int i=0;i<n;i++){
        wa=min(wa,a[i]);
        if (wa>=a[i]){
            ans++;
            
        }
        
    }
    cout<<ans;


    return 0;
}


Measured memory_bytes: 1152
import numpy as np

a, b, k = list(map(int, input().split(" ")))

if((b - a + 1) / 2 < k):
    for i in range(a, b+1, 1):
        print(i)
else:
    for i in range(a, a+k, 1):
        print(i)
    for i in range(b-k+1, b+1, 1):
        print(i)

Measured memory_bytes: 21368
#include<iostream>
using namespace std;
int main() {
  string s;
  cin >> s;
  if((s[0] == s[1] && s[1] == s[2]) || (s[1] == s[2] && s[2] == s[3])) cout << "Yes";
     else cout << "No";
     return 0;
}

Measured memory_bytes: 256
gets
s = gets

a = s.split.map {|x| x.to_i}


mind=999
mini=-1

r = []
while a.size > 0
  a.size.times { |i|
    v = a[i]
    d = i-v+1

    if d < 0
      puts "-1"
      exit
    end
    if d <= mind
      mind = d
      mini = i
    end
  }
  
  r << a[mini]
  a.delete_at(mini)
end

r.reverse.each {|u|
  puts u
}

Measured memory_bytes: 3836
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxn=18;
const int maxs=1<<16|1;
const int mod=1000000007;
int n,m,a[maxn];
ll f[maxn][maxs],fac[maxs],inv_fac[maxs];
inline ll C(int n,int m) { if(n<m) return 0; return fac[n]*inv_fac[m]%mod*inv_fac[n-m]%mod; }
int main()
{
	fac[0]=fac[1]=inv_fac[0]=inv_fac[1]=1;
	for(int i=2;i<maxs;i++) fac[i]=fac[i-1]*i%mod;
	for(int i=2;i<maxs;i++) inv_fac[i]=(mod-mod/i)*inv_fac[mod%i]%mod;
	for(int i=2;i<maxs;i++) (inv_fac[i]*=inv_fac[i-1])%=mod;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;i++) scanf("%d",&a[i]);
	f[m+1][0]=1;
	for(int i=m;i;i--)
		for(int j=0;j<(1<<n);j++)
			if(f[i+1][j] && j<=(1<<n)-a[i])
			{
				(f[i][j]+=f[i+1][j])%=mod;
				for(int k=0;k<n;k++)
					if(!(j&(1<<k)) && j+(1<<k)<=(1<<n)-a[i]+1)
						(f[i][j|(1<<k)]+=f[i+1][j]*C((1<<n)-a[i]-j,(1<<k)-1)%mod*fac[1<<k])%=mod;
			}
	ll ans=0;
	for(int i=0;i<(1<<n);i++)
	{
		ll now=0,s=1;
		for(int j=0;j<n;j++)
			if(!(i&(1<<j))) now+=(1<<j);
			else s=mod-s;
		(ans+=fac[now]*f[1][i]%mod*s)%=mod;
	}
	printf("%lld\n",(ans*(1<<n)%mod+mod)%mod);
	return 0;
}

Measured memory_bytes: 9984
#include "bits/stdc++.h"
using namespace std;

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

    int n;
    cin >> n;

    int op = n % 10;
    if (op == 2 || op == 4 || op == 5 || op == 7 || op == 9)
        cout << "hon" << '\n';
    if (op == 0 || op == 1 || op == 6 || op == 8)
        cout << "pon" << '\n';
    if (op == 3)
        cout << "bon" << '\n';
    return 0;
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())//vectorの降順ソート
#define ll long long
#define pb(a) push_back(a)
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;

typedef tuple<ll, ll, ll> T;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;
    cin>>n>>m;
    vector<vector<int> > gakusei(51,vector<int>(51,0));
    vector<vector<int> > check(51,vector<int>(51,0));
    REP(i,n) cin>>gakusei[i][0]>>gakusei[i][1];
    REP(i,m) cin>>check[i][0]>>check[i][1];
    REP(i,n){
        int min_d=INF;
        int ans=0;
        REP(j,m){
            int m_d = abs(gakusei[i][0]-check[j][0])+abs(gakusei[i][1]-check[j][1]);
            if(min_d > m_d ){
                min_d = m_d;
                ans=j+1;
            }
        }
        cout<<ans<<endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define inf 2000000000
#define infLL 2000000000000000000
#define MAX 100005
#define sf(a) scanf("%d", &a)
#define sfl(a) scanf("%lld", &a)
#define pf(a) printf("%d\n", a)
#define pfl(a) printf("%lld\n", a)
#define Case(t) printf("Case %d:\n", t)
#define pii pair<int, int>
#define MOD 1000000007
#define mod 1000000007
#define PI acos(-1.0)
#define eps 1e-9
#define mem(a, b) memset(a, b, sizeof(a))

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

inline int Set(int N, int pos){return N=N | (1<<pos);}
inline int Reset(int N, int pos){return N=N & ~(1<<pos);}
inline bool Check(int N, int pos){return (bool)(N & (1<<pos));}

inline void normal(ll &a) { a %= mod; (a < 0) && (a += mod); }
inline ll modMul(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a * b) % mod; }
inline ll modAdd(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a + b) % mod; }
inline ll modSub(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while (p) { if (p & 1LL) r = modMul(r, b); b = modMul(b, b); p >>= 1LL; } return r; }
inline ll modInverse(ll a) { return modPow(a, mod - 2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll fast_exp(ll x, ll n, ll m)
{
    ll res = 1;
    while(n>0)
    {
        if(n%2==1)
            res = (res * x) % m;
        x = (x * x) % m;
        n/=2;
    }
    return res%m;
}

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}

clock_t t_Start;
void Start()
{
    t_Start = clock();
}
void End()
{
    double Time = (double)(clock()-t_Start)/CLOCKS_PER_SEC;
    error(Time);
}

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>orderedSet;
typedef tree<int,null_type,greater<int>,rb_tree_tag,tree_order_statistics_node_update>orderedSet1;

int cnt[1000006];

void primeFactors(int n)
{
    int tot = 0;
    while(!(n%2))
    {
        n=n/2;
        tot++;
    }
    cnt[2] = max(cnt[2], tot);
    for(int i = 3; i <= sqrt(n); i+=2)
    {
        tot = 0;
        while(!(n%i))
        {
            n/=i;
            tot++;
        }
        cnt[i] = max(cnt[i], tot);
    }
    if(n>2)
        cnt[n] = max(cnt[n], 1);
}

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    //Start();

    int n;
    cin>>n;
    int a[n+5];
    for(int i = 0; i < n; i++)
    {
        cin>>a[i];
        primeFactors(a[i]);
    }
    ll lcm = 1;
    for(int i = 1; i < 1000006; i++)
        lcm = modMul(lcm, modPow((ll)i, (ll)cnt[i]));
    ll ans = 0;
    for(int i = 0; i < n; i++)
        ans = modAdd(ans, modDiv(lcm, a[i]));
    cout<<ans<<endl;


    //End();
    return 0;
}


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

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

using namespace std;

int main(){
	int n,k;
	string s; cin>>n>>k>>s;

	k=min(k,15);

	rep(i,k-1){
		s=s+s;
		reverse(s.begin()+n,s.end());

		string t="~";
		rep(j,n+1){
			string tmp=s.substr(j,n);
			reverse(tmp.begin(),tmp.end());
			t=min(t,tmp);
		}
		reverse(t.begin(),t.end());
		s=t;
	}

	string ans="~";
	s=s+s;
	reverse(s.begin()+n,s.end());
	rep(j,n+1) ans=min(ans,s.substr(j,n));
	cout<<ans<<'\n';

	return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
void solve()
{
    ll a,b;cin>>a>>b;
    cout<<a*b;
}
int32_t main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
        solve();
    return 0;
}

Measured memory_bytes: 3636
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include<bits/stdc++.h>
using namespace std;
#define rint register int
#define rep(i,l,r) for(rint i=l;i<=r;i++)
#define per(i,l,r) for(rint i=l;i>=r;i--)
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define fir first
#define sec second
#define mset(s,t) memset(s,t,sizeof(s))
template<typename T1,typename T2>void ckmin(T1 &a,T2 b){if(a>b)a=b;}
template<typename T1,typename T2>void ckmax(T1 &a,T2 b){if(a<b)a=b;}
template<typename T>T gcd(T a,T b){return b?gcd(b,a%b):a;}
int read(){
  int x=0,f=0;
  char ch=getchar();
  while(!isdigit(ch))f|=ch=='-',ch=getchar();
  while(isdigit(ch))x=10*x+ch-'0',ch=getchar();
  return f?-x:x;
}
int main(){
  int n;cin>>n;
  while(n--)printf("ACL");
} 

Measured memory_bytes: 3764
#include<cstdio>
int a[5]={-1,-1,-1,-1,-1};
int main(void)
{
    int n,m,s,c;
    scanf("%d %d" ,&n,&m);

    for(int i=1;i<=m;i++)
    {
        scanf("%d %d" ,&s,&c);
        if(a[s]==-1)
        {
            if(n!=1 && s==1 && c==0)
            {
                printf("-1");
                return 0;
            }
            a[s]=c;
        }
        else
            if(a[s]!=c)
            {
                printf("-1");
                return 0;
            }
    }
    for(int i=1;i<=n;i++)
        if(a[i]==-1)
        {
            if(i==1 && n!=1) a[i]=1;
            else a[i]=0;
        }
    for(int i=1;i<=n;i++)
        printf("%d" ,a[i]);
    return 0;
}

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

#define gcd(a,b)		__gcd(a,b)
#define lcm(a,b)		(a*b)/gcd(a,b)
#define ff              first
#define ss              second
#define int             long long
#define pb              emplace_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             INT64_MAX
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
#define all(x)			x.begin(),x.end()
#define digits(x)		floor(log10(x))+1
#define FIO				ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

class dsu {
private:
	int *id;
	int* sz;

	int root(int i) {
		while (i != id[i]) {
			id[i] = id[id[i]];
			i = id[i];
		}
		return i;
	}
public:
	int n;
	dsu(int v) {
		n = v;
		id = new int[n];
		sz = new int[n];

		for (int i = 0; i < n; i++) {
			id[i] = i;
			sz[i] = 0;
		}
	}

	bool find(int p , int q) {
		return root(p) == root(q);
	}

	void join(int p , int q) {
		int i = root(p);
		int j = root(q);
		if (i == j) {
			return;
		}
		if (sz[i] < sz[j]) {
			id[i] = j ;
			sz[j] += sz[i];
		}
		else {
			id[j] = i;
			sz[i] += sz[j];
		}
	}
};

class BIT {
private:
	int* FT;
	int n;
public:
	void updateBIT(int index , int val) {
		index += 1;
		while (index <= n) {
			FT[index] += val;
			index += (index & (-index));
		}
	}

	int getSum(int index) {
		index += 1;
		int sum = 0 ;
		while (index > 0) {
			sum += FT[index];
			index -= (index & (-index));
		}
		return sum;
	}


	BIT(int* a , int v) {
		n = v ;
		FT = new int[n + 1];
		for (int i = 1 ; i <= n ; i++) {
			FT[i] = 0 ;
		}
		for (int i = 0 ; i < n ; i++) {
			updateBIT(i, a[i]);
		}
	}
};

int nCr(int n , int r ) {
	int p = 1, k = 1;

	if (n - r < r ) {
		r = n - r;
	}
	if (r != 0) {
		while (r != 0) {
			p *= n ;
			k *= r ;
			int m = __gcd(p, k);
			p /= m;
			k /= m;
			n--;
			r--;
		}
	}
	else {
		p = 1;
	}
	return p ;
}

int modPower(int x, int y , int p) {
	//Used to calculate (x^y)%p
	int res = 1;
	if (y == 0) {
		return 1;
	}

	x = x % p;
	if (x == 0) {
		return 0  ;
	}

	while (y > 0) {
		if (y & 1) {
			res = (res * x) % p;
		}

		y >>= 1;
		x = (x * x) % p;
	}
	return res ;

}

int32_t main() {
	FIO;

	int n ;
	cin >> n;
	vi a(n);
	for (int i = 0;  i < n ; i++) {
		cin >> a[i];
		a[i] -= (i + 1);
	}
	sort(all(a));
	int sum = 0 ;

	for (int i = 0; i < n / 2 ; i++) {
		sum += (a[n - i - 1] - a[i]);
	}

	cout << sum;







	return 0;
}


Measured memory_bytes: 4788
#include<bits/stdc++.h>
#define ll long long
#define min(a,b) a>b?b:a
using namespace std;
int main()
{
	ll n,k;
	cin>>n>>k;
	ll *A=new ll[n];
	for(ll i=0;i<n;i++)
	{
		cin>>A[i];
	}
	ll *dp=new ll[n];
	for(ll i=0;i<n;i++)
		dp[i]=INT_MAX;
	dp[0]=0;
	dp[1]=abs(A[0]-A[1]);
	for(ll i=2;i<n;i++)
	{
		for(ll j=1;j<=k && (i-j)>=0;j++)
		dp[i]=min(dp[i],dp[i-j]+abs(A[i-j]-A[i]));
	}
	cout<<dp[n-1]<<endl;

}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long

using namespace std;

// 5 3

const int MAX = 2010;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

void initComb() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX; i++) {
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

long long comb(int n, int k) {
  if (n < k) {
    return 0;
  }
  if (n < 0 || k < 0) {
    return 0;
  }
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
  initComb();
  int n, k;
  scanf("%d %d", &n, &k);

  int r = (n - k);

  for (ll i = 1; i <= k; i++) {
    ll v1 = comb(r + 1, i);
    ll v2 = comb(k - 1, i - 1);

    cout << (v1 * v2 % MOD) << endl;
  }
}


Measured memory_bytes: 256
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod // i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return self.g1[n] * self.g2[r] * self.g2[n - r] % self.MOD


# --------------------------------------------

dp = None


def main():
    x, a, b = li_input()

    if b <= a:
        print("delicious")
    else:
        if (b - a) <= x:
            print("safe")
        else:
            print("dangerous")


main()


Measured memory_bytes: 4724
#include <bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define double long double
using namespace std;
//桁
int kt(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }
signed main(){
  double a,b,c;
  cin>>a>>b>>c;
  c=c/a;
  if(c<=a*b/2){
    double d=(c*2)/b;
    double e=sqrt(d*d+b*b);
    double f=(c*2)/e;
    double h=acos(f/b);
    double i=h*180/M_PI;
    cout<<setprecision(12)<<i;
  }
  else{
  double d=a*b-c;
    double e=d*2/a;
    double f=sqrt(a*a+e*e);
    double g=d*2/f;
    double h=asin(g/a);
    double i=h*180/M_PI;
    cout<<setprecision(12)<<i;
  }
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef long double ld;
const ll inf=1e9+7;
const ll mod=998244353;
int main(){
    ll l;
    cin>>l;
    l--;
    vector<vector<pll> >G(20);
    ll cnt=0;
    ll now=0;
    bool f=0;
    for(int i=19;i>=0;i--){
        if(f){
            G[i].pb(mp(i+1,(1<<i)));
            G[i].pb(mp(i+1,0));
            cnt+=2;
        }
        f|=((1<<i)&l);
        if((1<<i)&l){
            if(i!=19){
                G[i].pb(mp(19,now));
                cnt++;
            }
            now+=(1<<i);
        }
    }
    G[0].pb(mp(19,now));
    cnt++;
    cout<<20<<' '<<cnt<<endl;
    rep(i,19){
        for(auto e:G[i]){
            cout<<i+1<<' '<<e.first+1<<' '<<e.second<<endl;
        }
    }
}

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

#define ll long long

void solve(){
	int x, y; cin>>x>>y;
	int n = 4 * x;
	for(int i = 0; i<=x; i++){
		if(y == n){
			cout<<"Yes"<<endl;
			return;
		}
		n -= 2;
	}
	cout<<"No"<<endl;
}

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int t = 1; //cin>>t;
	while(t--){
		solve();
	}
	return 0;
}



Measured memory_bytes: 3620
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <functional>
#include <bitset>
#include <iomanip>

#define repeat(i,n) for (long long i = 0; (i) < (n); ++ (i))
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i] << '\n'
#define debugArrayP(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i].first<< " " << x[i].second << '\n'

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef vector<int> vint;
typedef vector<ll> vll;
const ll INF = INT_MAX;
const ll MOD = 1e9+7;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a,b;cin>>a>>b;
  int n;
  for(n=1;n<=b;n*=10);
  n=a*n+b;
  int i;
  for(i=1;i*i<n;i++);
  cout << (i*i==n? "Yes":"No")<<endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1145141919810893364
typedef pair<int,int> PP;
typedef long long ll;
#define int ll
#define setdouble setprecision
#define REP(i,n) for(int i=0;i<(n);++i)
#define RREP(i,n) for(int i=(n)-1;i>=0;--i)
#define GOODBYE cout << -1 << endl;return 0
#define Endl endl

signed main(void){
    int N,C,B,A;
    int l[14];
    int Ans=INF,sum=0;
    cin >> N >> A >> B >> C ;
    REP(i,N){
        cin >> l[i];
    }
    for(int j=0;j<(1<<(2*N));j++){
        sum=0;
        int E[4]={};
        REP(i,N){
            int k=0;
            if((j>>(2*i))%2==1){
                k+=1;
            }
            if((j>>(2*i+1))%2==1){
                k+=2;
            }
            if(E[k]!=0 && k!=3){
                E[k]+=l[i];
                sum+=10;
            }else{
                E[k]=l[i];
            }
        }
        if(E[0]==0||E[1]==0||E[2]==0)continue;
        sum+=abs(A-E[0]);
        sum+=abs(B-E[1]);
        sum+=abs(C-E[2]);
        Ans=min(Ans,sum);
    }
    cout << Ans << endl;
    
    return 0;
}





Measured memory_bytes: 256
/*input

*/
#include <bits/stdc++.h>
#define up(i,a,b) for(int (i) = (a);(i)<=(b);++(i))
#define down(i,b,a) for(int (i) = (b);i>=(a);--i)
#define debug(x) cerr << (x) << '\n';
#define bits(x,i) ((x >> i) & 1)
#define mid ((l+r)/2)
#define pr pair<int,int>
using namespace std;
const int N = 2000005;
const long long mod = 1e9 + 7;
long long fact[N];
int k,n;
string s;
void init(){
	fact[0] = 1;
	up(i,1,n+k) fact[i] = (fact[i-1] * i) % mod;
}
long long power(long long x, long long n){
	long long ans = 1;
	for(int i=0;i<31;++i){
		if (bits(n, i)) ans = (ans * x) % mod;
		x = (x * x) % mod;
	}
	return ans;
}
long long inv(long long num, long long den){
	return (num * power(den, mod - 2)) % mod;
}
long long C(int k,int n){
	int num = fact[n];
	int den = (fact[k] * fact[n-k]) % mod;
	return inv(num, den);
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	cin >> k >> s;
	n = s.size();
	init();
	long long ans = 0;
	for(int i=0;i<=k;++i){
		long long cur = (power(25, k-i) * power(26, i)) % mod;
		ans += (C(k-i, n+k-i-1) * cur) % mod;
		ans %= mod;
	}
	cout << ans;
}

Measured memory_bytes: 19800
#include <bits/stdc++.h>
#define pb          emplace_back
#define ll          long long
#define fi          first
#define se          second
#define mp          make_pair

using namespace std;

const int N = int(2e3) + 7;
const int mod = int(1e9) + 7;
typedef pair<int, int> pii;

int n, a, b, c, d, f[N][N], fac[N], rev[N];

void add(int& x, int y) {if((x += y) >= mod) x -= mod;}
int mul(int x, int y) {return 1ll * x * y % mod;}

int Pow(int x, int y) {
   int res = 1;
   for(; y > 0; y >>= 1) {
       if(y & 1) res = mul(res, x);
       x = mul(x, x);
   }
   return res;
}

int32_t main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    #define Task        "test"
    if(fopen(Task".inp", "r")) {
        freopen(Task".inp", "r", stdin);
        freopen(Task".out", "w", stdout);
    }
    cin >> n >> a >> b >> c >> d;
    fac[0] = 1;
    for(int i = 1; i <= n; ++i) fac[i] = mul(fac[i - 1], i);
    rev[n] = Pow(fac[n], mod - 2);
    for(int i = n - 1; i >= 0; --i) rev[i] = mul(rev[i + 1], i + 1);
    for(int i = 0; i <= b; ++i) f[0][i] = 1;
    for(int i = 1; i <= n; ++i) {
       for(int j = a; j <= b; ++j) {
          for(int k = c; i - k * j >= 0 && k <= d; ++k)
             add(f[i][j], mul(f[i - k * j][j - 1], mul(Pow(rev[j], k), rev[k])));
          add(f[i][j], f[i][j - 1]);
          //cout << f[i][j] << ' ';
       }
       //cout << '\n';
    }
    cout << mul(f[n][b], fac[n]);
}


Measured memory_bytes: 8448
S = input()

odd = ["R", "U", "D"]
even = ["L", "U", "D"]

if all([e in even for i, e in enumerate(S) if (i + 1) % 2 == 0]) and \
   all([o in odd for i, o in enumerate(S) if (i + 1) % 2 == 1]):
  print("Yes")
else:
  print("No")

Measured memory_bytes: 38384
function main()
    n=myread(Int)
    ans=0
    for a=1:n
        for b=1:n÷a+1
            if n-a*b>0
                ans+=1
            end
        end
    end
    println(ans)
end

# ----------input function----------
sread()=chomp(readline())
sreads(sp=" ")=split(readline(),sp)
myread(ty)=parse(ty,readline())
myreads(ty)=map(x->parse(ty,x),split(readline()))
main()

Measured memory_bytes: 158856
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
    
    string s,t;
    cin >> s;
    t = s;
    std::reverse(s.begin(),s.end());
    
    if(t == s){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    
}


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

int main() {
    int n, summ = 0, maxx = 0;
    cin >> n;
    vector<int> p(n);
    for(int i = 0; i < n; i++){
        cin >> p[i];
        summ += p[i];
        maxx = max(maxx, p[i]);
    }
    summ -= maxx / 2;
    cout << summ << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

const int MAX_N = 1333;

int dp[MAX_N][MAX_N];

int LCS(string &s, string &t) {
    int n=s.length(); int m=t.length();
    if (!n||!m) return 0;
    memset(dp,-1,sizeof(dp));
    rep(i,n+1) dp[i][0]=0;
    rep(i,m+1) dp[0][i]=0;

    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= m; ++j) {
            if (s[i-1]==t[j-1]) dp[i][j]=max({dp[i-1][j-1]+1,dp[i-1][j],dp[i][j-1]});
            else dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
        }
    }

    return dp[n][m];
}

int main(int argc, char const *argv[]) {
    int q;cin>>q;
    rep(i,q) {
        string s,t;
        cin>>s>>t;
        cout << LCS(s,t) << endl;
    }
    return 0;
}


Measured memory_bytes: 10152
#!/usr/bin/env python3
import sys


def solve(N: int, b: "List[int]"):
    c = b[:] # debug
    ans = []
    while c:
        x = max(filter(lambda x: x[0] == x[1], enumerate(c, 1)), default=0)
        if not x:
            return [-1]
        ans.append(x[0])
        del c[x[0]-1]
    return ans[::-1]

# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    b = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(*solve(N, b), sep="\n")

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()


Measured memory_bytes: 9188
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
using namespace std;
int main()
{
	int s1,s2,e1,e2;
	cin>>s1>>s2>>e1>>e2;
	int x=s1,y=s2;
	for(int i=0;i<e2-s2;i++)
	{
		cout<<"U";
	}
	for(int i=0;i<e1-s1;i++)
	{
		cout<<"R"; 
	}
	for(int i=0;i<e2-s2;i++)
	{
		cout<<"D";
	}
	for(int i=0;i<e1-s1;i++)
	{
		cout<<"L"; 
	}
	cout<<"L";
	for(int i=0;i<e2-s2+1;i++)
	{
		cout<<"U";
	}
	for(int i=0;i<e1-s1+1;i++)
	{
		cout<<"R"; 
	}
	cout<<"DR";
	for(int i=0;i<e2-s2+1;i++)
	{
		cout<<"D";
	}
	for(int i=0;i<e1-s1+1;i++)
	{
		cout<<"L"; 
	}
	cout<<"U"<<endl;
	return 0;
} 

Measured memory_bytes: 256
def main():
    n = int(input())
    ab = [sorted(list(map(int, input().split()))) for _ in [0]*(n-1)]
    s = list(map(int, input().split()))

    g = [[] for _ in [0]*n]
    [g[a-1].append(b-1) for a, b in ab]
    [g[b-1].append(a-1) for a, b in ab]
    root = 0  # 根
    d = [-1]*n  # 根からの距離
    d[root] = 0
    q = [root]
    cnt = 0
    while q:  # BFS
        cnt += 1
        qq = []
        while q:
            i = q.pop()
            for j in g[i]:
                if d[j] == -1:
                    d[j] = cnt
                    qq.append(j)
        q = qq

    dd = [[j, i] for i, j in enumerate(d)]
    dd.sort(key=lambda x: -x[0])
    dd = [j for i, j in dd]

    dp = [1]*n
    for i in dd:
        for j in g[i]:
            if d[j] > d[i]:
                dp[i] += dp[j]

    ans = []
    for a, b in ab:
        a -= 1
        b -= 1
        if d[a] > d[b]:
            a, b = b, a
        ay = dp[b]-1
        ax = n-2-ay
        if ax-ay == 0:
            ans.append(1j)
        else:
            ans.append(abs(s[a]-s[b])//abs(ax-ay))

    ab_dict = {(ab[i][0]-1, ab[i][1]-1): ans[i] for i in range(n-1)}

    if 1j in ans:
        cnt = 0
        for i in ans:
            if i == 1j:
                cnt += 1
        if cnt > 1:
            return
        p = ans.index(1j)
        q = [root]

        temp_1 = 0
        temp_2 = 0
        while q:
            qq = []
            while q:
                i = q.pop()
                for j in g[i]:
                    if d[j] > d[i]:
                        a, b = min(i, j), max(i, j)
                        temp = ab_dict[(a, b)]
                        if temp == 1j:
                            temp_2 = dp[j]
                        else:
                            temp_1 += dp[j]*temp
                        qq.append(j)
            q = qq

        ans[p] = (s[0]-temp_1)//temp_2

    for i in ans:
        print(i)


main()


Measured memory_bytes: 84356
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {
		FScanner sc = new FScanner();
		int N = sc.nextInt();
		System.out.println(N * N * N);
	}

}

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

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

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

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

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

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

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

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

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

Measured memory_bytes: 21204
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC128
{
    class C
    {
        static int[] nm;
        static int[] k;
        static int[][] s;
        static int[] p;
        static void Main(string[] args)
        {
            nm = Console.ReadLine().Split().Select(int.Parse).ToArray();
            k = new int[nm[1]];
            s = new int[nm[1]][];
            for (int i = 0; i <nm[1]; i++)
            {
                int[] a= Console.ReadLine().Split().Select(int.Parse).ToArray();
                k[i] = a[0];
                s[i] = new int[k[i]];
                Array.Copy(a, 1, s[i], 0, a[0]);
            }
            p = Console.ReadLine().Split().Select(int.Parse).ToArray();
            long sum = 0;
            bool flag = true;
            for (long i = 0; i < Math.Pow(2,nm[0]); i++)
            {
                for (int l = 0; l < nm[1]; l++)
                {
                    ulong sum1 = 0;
                    for (int j = 0; j < k[l]; j++)
                    {
                        sum1 += (ulong)(i >> s[l][j] - 1) % 2;
                    }
                    if (sum1 % 2 != (ulong)p[l]) { flag = false; }
                }
                if (flag) { sum++; }
                flag = true;
            }
            Console.WriteLine(sum);
        }
    }
}


Measured memory_bytes: 13396
def main():
    X, K, D = map(int, input().split())
    X = abs(X)
    cnt = X // D
    if cnt >= K:
        print(X - (K * D))
        exit()
    
    if cnt % 2 == K % 2:
        print(X - (cnt * D))
    else:
        print(abs(X - ((cnt + 1) * D)))




if __name__ == "__main__":
    main()

Measured memory_bytes: 61864
import math
list_a=[]
list_op=[]
list_b=[]
while True:
    a,op,b=str(input()).split()
    if op!="?":
        a=int(a)
        list_a.append(a)
        list_op.append(op)
        b=int(b)
        list_b.append(b)
    else:
        break
for i in range(len(list_op)):
    A=list_a[i]
    OP=list_op[i]
    B=list_b[i]
    if OP=="+":
        x=math.floor(A+B)
    elif OP=="-":
        x=math.floor(A-B)
    elif OP=="*":
        x=math.floor(A*B)
    else:
        x=math.floor(A/B)
    print(x)



Measured memory_bytes: 5668
#include <iostream>                                                                
#include <string>                                                                  
                                                                                   
int main()                                                                         
{                                                                                  
  std::string s;                                                                   
  int a, b;                                                                        
                                                                                   
  std::cin >> s;                                                                   
  for ( a = 0; s[a] != 'A'; a++ );                                                 
  for ( b = s.size() - 1; s[b] != 'Z'; b--);                                       
                                                                                   
  std::cout << b - a + 1 << std::endl;                                             
                                                                                   
  return 0;                                                                        
}

Measured memory_bytes: 640
s = input()

if(s == 'SUN'):
    print(7)
elif(s == 'MON'):
    print(6)
elif(s == 'TUE'):
    print(5)
elif(s == 'WED'):
    print(4)
elif(s == 'THU'):
    print(3)
elif(s == 'FRI'):
    print(2)
elif(s == 'SAT'):
    print(1)


Measured memory_bytes: 2940
package main

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

func main() {
	m1 := nextInt()
	nextInt()
	m2 := nextInt()
	nextInt()

	if m1 != m2 {
		fmt.Println("1")
	} else {
		fmt.Println("0")
	}
}

var stdin = initStdin()

func initStdin() *bufio.Scanner {
	bufsize := 1 * 1024 * 1024 // 1 MB
	var stdin = bufio.NewScanner(os.Stdin)
	stdin.Buffer(make([]byte, bufsize), bufsize)
	stdin.Split(bufio.ScanWords)
	return stdin
}

func nextString() string {
	stdin.Scan()
	return stdin.Text()
}

func nextBytes() []byte {
	stdin.Scan()
	return stdin.Bytes()
}

func nextInt() int {
	i, _ := strconv.Atoi(nextString())
	return i
}

func nextInt64() int64 {
	i, _ := strconv.ParseInt(nextString(), 10, 64)
	return i
}


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

constexpr double EPS = 1e-9;

struct circle {
	double x, y, r;
	circle(double x_ = 0.0, double y_ = 0.0, double r_ = 0.0):x(x_), y(y_), r(r_) {}
};

istream &operator>>(istream &is, circle &c) {
	return is >> c.x >> c.y >> c.r;
}

// Is b in a
bool in(const circle &a, const circle &b) {
	const double d = hypot(a.x - b.x, a.y - b.y);
	return b.r + EPS < a.r && d + EPS < a.r - b.r;
}

bool intersect(const circle &a, const circle &b) {
	const double d = hypot(a.x - b.x, a.y - b.y);
	return d < a.r + b.r + EPS && d + EPS > abs(a.r - b.r);
}

int solve() {
	circle a, b;
	cin >> a >> b;

	if(in(a, b)) return 2;
	if(in(b, a)) return -2;
	if(intersect(a, b)) return 1;
	return 0;
}

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

	while(t--) cout << solve() << endl;

	return EXIT_SUCCESS;
}

Measured memory_bytes: 1252
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <numeric> // accumulate(v.begin(), v.end(), 0)                                                         

using namespace std;
#define ll long long

ll calc_rest_time(ll N, ll A, ll B, const vector<ll> &H, int t){
  ll sub = A - B;
  ll ret = 0;
  for(int i=0; i<N; i++)
    if(H[i] - t * B > 0)
      ret += (ll)ceil(1.0 * (H[i] - t * B) / sub);
  return ret;
}

int main(){
  int N;
  ll A, B;
  cin >> N >> A >> B;
  vector<ll> H(N);
  for(int i=0; i<N; i++)
    cin >> H[i];
  sort(H.begin(), H.end());
  int low = 0, high = (int)ceil(1.0 * H[N-1] / B);
  while(low < high){
    int mid = (low + high) / 2;
    if(calc_rest_time(N, A, B, H, mid) <= mid)
      high = mid;
    else
      low = mid + 1;
  }
  cout << high << endl;
  return 0;
}

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

int main() {
  int a;
  int b;
  	cin >> a >> b;
  int x;
  x = a % 2;
  int y;
  y = b % 2;
      if(x == 0 || y == 0){
        cout << "Even" << endl;
      }
  		else{
          cout << "Odd" << endl;
        }
}

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

int main()
{
  	char something[4];char a; bool stuff =true;
  	for(int i=0;i<4;i++){scanf("%c",&a);something[i]=a;}
  	for(int i=1;i<4;i++)
    {
      if(something[i]==something[i-1])
        stuff=false;
    }
  	if(stuff)
    	cout<<"Good"<<endl;
  	else
      	cout<<"Bad"<<endl;
    return 0;
}

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

struct element_tag
{
    long long v;
    struct element_tag *prev;
    struct element_tag *next;
};
typedef struct element_tag element;

struct list_tag
{
    struct element_tag *first;
    struct element_tag *last;
};
typedef struct list_tag list;

void pushback(struct list_tag *l, long long x)
{
    if (l->first == NULL)
    {
        struct element_tag *t = malloc(sizeof(element));
        t->v = x;
        t->next = NULL;
        t->prev = NULL;
        l->first = t;
        l->last = t;
        return;
    }

    element *t = malloc(sizeof(element));
    t->v = x;
    l->last->next = t;
    t->prev = l->last;
    t->next = NULL;
    l->last = t;
}

void pushfront(list *l, long long x)
{
    if (l->first == NULL)
    {
        element *t = malloc(sizeof(element));
        t->v = x;
        t->next = NULL;
        t->prev = NULL;
        l->first = t;
        l->last = t;
        return;
    }

    element *t = malloc(sizeof(element));
    t->v = x;
    l->first->prev = t;
    t->next = l->first;
    t->prev = NULL;
    l->first = t;
}

void popback(list *l)
{
    if (l->first == NULL)
    {
        return;
    }

    if (l->last->prev == NULL)
    {
        free(l->last);
        l->first = NULL;
        l->last = NULL;
        return;
    }

    l->last->prev->next = NULL;
    element *t = l->last;
    l->last = t->prev;
    free(t);
}

void popfront(list *l)
{
    if (l->first == NULL)
    {
        return;
    }

    if (l->last->prev == NULL)
    {
        free(l->last);
        l->first = NULL;
        l->last = NULL;
        return;
    }

    l->first->next->prev = NULL;
    element *t = l->first;
    l->first = t->next;
    free(t);
}

void popall(list *l)
{
    while (1)
    {
        popback(l);
        if (l->first == NULL)
        {
            break;
        }
    }
}

int main(int argc, char const *argv[])
{
    //list ls;
    list ls = {NULL,NULL}; // ls に初期値を設定しました。
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++)
    {
        long long a;
        scanf("%lld", &a);
        if (i % 2 == 0)
        {
            pushback(&ls, a);
        }
        else
        {
            pushfront(&ls, a);
        }
    }

    if (n % 2 == 0)
    {
        while (1)
        {
            if (ls.first == NULL)
            {
                break;
            }
            //printf("%lld", ls.first->v);
            printf("%lld ", ls.first->v); // space を追加しました。
            popfront(&ls);
        }
    }
    else
    {
        while (1)
        {
            if (ls.first == NULL)
            {
                break;
            }
            //printf("%lld", ls.last->v);
            printf("%lld ", ls.last->v); // space を追加しました。
            popback(&ls);
        }
    }

    printf("\n"); // 改行出力を追加しました。

    return 0;
}


Measured memory_bytes: 8320
// 4:22
#include <iostream>
#include <cstring>
#include <cmath>
#include <vector>
#include <map>
#include <algorithm>
#include <deque>
#include <tuple>
#include <utility>
using namespace std;
typedef long long ll;
#define for1(i,n) for (ll i=0;i<(n);(i)++)
#define for2(i,m,n) for (ll (i)=(m);(i)<(n);(i)++)
#define for3(i,m,n,d) for (ll (i)=(m);(i)<(n);(i)+=(d))
#define INF (1LL << 60)

void solve()
{
    ll a,b,x;
    cin >> a >> b >> x;
    ll ans = 0;
    ans = b / x + 1;
    if (a >= 1) {
        ans -= (a-1) / x + 1;
    }

    cout << ans << endl;
}

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


Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = sc.nextInt();
    if(a + b == c || b + c == a || c + a == b){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}

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

#define mx 500005
#define ll long long
#define MOD 1000000007
#define fs first
#define sc second

int main()
{
    int n, a, b;
    scanf("%d %d %d", &n, &a, &b);
    a = abs(a - b);
    if(a&1) cout << "Borys" << endl;
    else cout << "Alice" << endl;
    return 0;
}


Measured memory_bytes: 256