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

using namespace std;

int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	if ((a <= 10000 && a >= 1) && (b <= 10000 && b >= 1) && (c <= 10000 && c >= 1))
	{
		if (a >= b)
		{
			if (b >= c)
			{
				cout << c << " " << b << " " << a << endl;
			}
			else
			{
				if (a >= c)
				{
					cout << b << " " << c << " " << a << endl;
				}
				else
				{
					cout << b << " " << c << " " << a << endl;
				}
			}
		}
		else
		{
			if (a >= c)
			{
				cout << c << " " << a << " " << b << endl;
			}
			else
			{
				if (b >= c)
				{
					cout << a << " " << c << " " << b << endl;
				}
				else
				{
					cout << a << " " << b << " " << c << endl;
				}
			}
		}
	}
	return 0;
}


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

#define ll long long
#define fi first
#define se second
#define mp make_pair

#define fastio() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

using namespace std;

const int mod = 1e9+7;

ll power(ll n,ll m){
	ll ans = 1;
	for(int i=0;i<m;i++){
		ans*=n;
		ans%=mod;
	}
	return ans%mod;
}

int main(){
	
	fastio();
	ll x;cin>>x;
	
	ll ans = power(10,x)%mod;
	ll a = (power(9,x)%mod+power(9,x)%mod-power(8,x)%mod)%mod;
	
	
		
	cout<<((ans%mod-a%mod)+mod)%mod<<endl;
	
	return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>

typedef long long ll;

using namespace std;
int main() {
    string s;
    cin >> s;
    int ret = 0;
    for (auto it = s.begin(); it != s.end(); ++it){
        if (*it != 'A' && *it != 'T' && *it != 'C'  && *it != 'G') continue;
        int l = 1;
        for (auto jt = it+1; jt != s.end(); ++jt){
            if (*jt != 'A' && *jt != 'T' && *jt != 'C'  && *jt != 'G') break;
            ++l;
        }
        ret = max(ret, l);
    }
    cout << ret << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define dofloat cout<<fixed<<setprecision(8)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define bitcount __builtin_popcount
#define all(vec) vec.begin(),vec.end()
#define rall(vec) vec.rbegin(),vec.rend()
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<long long> vl;
typedef pair<long long,long long> pll;
typedef vector<pair<long long,long long> > vll;
typedef vector<pair<int,int> > vii;
typedef vector<int> vi;
typedef pair<int,int> ii;
const long long MOD=1000000007;
const long long MAX=100005;
const long double PI=3.14159265359;
const long double G=9.807;
const long long INF=1e18;
const long double EPS=1e-6;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
bool isprime(ll a){
  if(a==2)return 1;
  if(!(a&1))return 0;
  for(ll i=3;i*i<=a;i+=2)
    if(a%i==0)return 0;
  return 1;
}
ll mpow(ll base,ll exponent,ll modulus){
  if(modulus==1)return 0;
  long long result = 1;
  base=base%modulus;
  while(exponent){
    if(exponent%2 == 1)
	  result=(result*base)%modulus;
	  exponent=exponent>>1;
	  base=(base*base)%modulus;
  }
  return result;
}
ll minv(ll a,ll mod){
  ll _gcd=gcd(a,mod);
  assert(_gcd==1);
  return mpow(a,mod-2,mod);
}


/*
ll ncr(ll N,ll K){
	if(N<K)return 0;
	if(K==0)return 1;
	if(N==0)return 0;

	ll den=1;
	for(ll i=1;i<=K;i++)den*=i;
	ll num=1;
	while(K--){
		num*=N;
		if(num%den==0){
			num/=den;
			den=1;
		}
		N--;
	}

	return num;
}
*/
ll a,b,c;
int main(){FAST;
cin>>a>>b>>c;
ll del = min(a-b,c);
c-=del;
cout<<c;
return 0;
}

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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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

int N;
vector<ll> a;

void solve() {
	cin >> N;
    a.resize(N);
    rep(i, N){
        cin >> a[i];
    }
    // 漸化式で求める
    ll sum = 0;
    rep(i, N){
        sum += a[i];
    }
    ll X[N];
    X[0] = 0;
    for(int i=1; i <= N-2; i+=2){
        sum -= 2*a[i];
    }
    X[0] = sum;
    rep(i, N){
        X[i+1] = 2*a[i] - X[i];
    }

    rep(i, N){
        cout << X[i];
        if(i != N-1) cout << " ";
    }
    cout << endl;

}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 7040
import java.util.Scanner;
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 && b < c) {
            System.out.println("Yes");
        } else { 
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 26176
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>

using namespace std;
using ll = long long;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }

#define For(i, n) for(int i = 0; i < (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Vec2(T, n, m, xs, x0) vector<vector<T>> xs(n, vector<T>(m, x0))
#define Sum(a) accumulate(Range(a), 0)
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) for(const auto &e : xs) cout << e << " "; cout << "\n"
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")

// constexpr int MOD = 1e9+7;

int main(void){
    Cin(string, s);
    int ans = 0;
    For(i, (int)s.size()){
        if(i % 2 == 0){
            if(s[i] == 'p') ans --;
        }
        else{
            if(s[i] == 'g') ans ++;
        }
    }
    Cout(ans);
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main(void){
  int n,d,ans=0;
  cin>>n>>d;
  vector<double> x(n),y(n),dis(n);
  for(int i=0;i<n;i++){
    cin>>x[i]>>y[i];
    dis[i]=pow(x[i]*x[i]+y[i]*y[i],0.5);
    if(dis[i]<=d){
      ++ans;
    }
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 7912
#include<stdio.h>
int main()
{
	int a,b,c;
	scanf("%d%d",&a,&b);
	if(a>b)
	{
		c=a;
		a=a-1;
	}
	else
	{
		c=b;
		b=b-1;
	}
	if(a>b)
		c=c+a;
	else
		c=c+b;
	printf("%d\n",c);
	return 0;
}



Measured memory_bytes: 128
def f(x):
    length=0
    array=[]
    for b in x:
        if b==True:
            length+=1
        else:
            array.append(length)
            length=0

    array.append(length)
    return array

s=input()
sb = ['A','C','G','T']
boola=list()
length=0

for x in s:
    boola.append(x in sb)

print(max(f(boola)))
    

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n; i >= 0; i--)
#define inf LLONG_MAX
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;


int main()
{
    ll H, W; cin >> H >> W;
    if (H % 3 == 0 || W % 3 == 0) {
        cout << 0 << endl;
        return 0;
    }

    ll ans = inf;
    for (size_t i = 1; i < H; i++)
    {
        ll a = W * i;

        ll b = (W / 2) * (H - i), c = (W / 2) * (H - i);
        if (W % 2 == 1) c += (H - i);

        ll num = abs(max(max(a, b), c) - min(min(a, b), c));
        ans = min(ans, num);

        ll hh = H - i;
        b = (hh / 2) * W, c = (hh / 2) * W;
        if (hh % 2) c += W;
        num = abs(max(max(a, b), c) - min(min(a, b), c));
        ans = min(ans, num);
    }

    for (size_t i = 1; i < W; i++)
    {
        ll a = H * i;
        ll b = (H / 2) * (W - i), c = (H / 2) * (W - i);
        if (H % 2) c += (W - i);

        ll num = abs(max(max(a, b), c) - min(min(a, b), c));
        ans = min(ans, num);

        ll ww = W - i;
        b = (ww / 2) * H, c = (ww / 2) * H;
        if (ww % 2) c += H;
        num = abs(max(max(a, b), c) - min(min(a, b), c));
        ans = min(ans, num);        
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize "-O3"
#pragma GCC target ("avx")
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;++i)
#define vi vector<int>
#define vvi vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define inf (1ll<<60)
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v),greater<int>())
#define SPEED ios::sync_with_stdio(false);cin.tie(0);cout<<fixed<<setprecision(12)
#define erase(i) erase(i, 1)
signed gcd(int a, int b){return b?gcd(b,a%b):a;}
signed lcm(int a, int b){return a*b/gcd(a,b);}
template<typename T> void remove(std::vector<T>& vector, unsigned int index){vector.erase(vector.begin() + index);}
//priority_queue<int, vi, greater<int> > que;//昇順
//priority_queue<int> que; // 降順

using namespace std;

const int mod=1e9+7;

signed main()
{
    SPEED;
    int n;string s;
    cin >> n >> s;
    rep(i,s.size())
    {
        rep(j,n)
        {
            if(s[i] != 'Z')s[i]++;
            else s[i] -= 25;
        }
    }
    cout << s << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int MOD = pow(10, 9) + 7;
//const int MOD = 998244353;
//const int MOD = ;
int mod(int A, int M) {return (A % M + M) % M;}
const int INF = 1LL << 60;
template <class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template <class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
int divCeil(int A, int B) {return (A + (B - 1)) / B;}
int myctoi(char C) {return C - 48;}
char myitoc(int N) {return '0' + N;}

class unionfind
{
public:
  vector<int> parent;

  unionfind(int N)
  {
    parent = vector<int>(N, -1);
  }

  int root(int X)
  {
    if (parent.at(X) < 0) return X;
    return parent.at(X) = root(parent.at(X));
  }

  int size(int X)
  {
    return -parent.at(root(X));
  }

  bool unite(int X, int Y)
  {
    int x = root(X);
    int y = root(Y);
    if (x == y) return false;
    
    if (size(x) < size(y)) swap(x, y);
    parent.at(x) += parent.at(y);
    parent.at(y) = x;
    return true;
  }
};

vector<vector<int>> G(111111);
vector<tuple<int, int, int>> dvp;
vector<bool> visited(111111, false);
void dfs(int V, int D, int P)
{
  if (visited.at(V)) return;
  visited.at(V) = true;

  dvp.push_back(make_tuple(D, V, P));

  for (int i = 0; i < G.at(V).size(); i++)
  {
    dfs(G.at(V).at(i), D + 1, V);
  }
}
 
signed main()
{
  int N, M;
  cin >> N >> M;

  if (M % 2 == 1)
  {
    cout << -1 << endl;
    return 0;
  }

  unionfind uf(N);
  vector<int> deg(N, 0);
  vector<pair<int, int>> CD;
  for (int i = 0; i < M; i++)
  {
    int a, b;
    cin >> a >> b;
    a--; b--;
    if (uf.unite(a, b))
    {
      G.at(a).push_back(b);
      G.at(b).push_back(a);
    }
    else
    {
      deg.at(a)++;
      CD.push_back(make_pair(a, b));
    }
  }

  dfs(0, 0, -1);
  sort(dvp.begin(), dvp.end(), greater<tuple<int, int, int>>());
  
  for (int i = 0; i < N - 1; i++)
  {
    int v = get<1>(dvp.at(i));
    int p = get<2>(dvp.at(i));
    if (deg.at(v) % 2 == 1)
    {
      deg.at(v)++;
      CD.push_back(make_pair(v, p));
    }
    else
    {
      deg.at(p)++;
      CD.push_back(make_pair(p, v));
    }
  }
  
  for (int i = 0; i < M; i++)
  {
    cout << CD.at(i).first + 1 << " " << CD.at(i).second + 1 << endl;
  }
}

Measured memory_bytes: 21744
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
using namespace std;
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919810364364
#define int long long
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first

int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}

int n, s;

signed main() {
	cin >> n >> s;
	if (n == s) {
		cout << n + 1 << endl;
		return 0;
	}
	else if (s > (n + 1) / 2) {
		cout << -1 << endl;
		return 0;
	}
	for (int i = 2; i <= sqrt(n); i++) {
		int cnt = 0;
		int k = n;
		int b = 1;
		while (k > 0) {
			b *= i;
			if (k%b) {
				cnt += (k%b) / (b / i);
				k -= k % b;
			}
		}
		if (cnt == s) {
			cout << i << endl;
			return 0;
		}
	}
	int x = sqrt(n - 1);
	for (int i = x; i >= 1; i--) {
		int p = s - i;
		if (p < 0)continue;
		if ((n - p) % i == 0 && (n - p) / i > p) {
			cout << (n - p) / i << endl;
			return 0;
		}
	}
}

Measured memory_bytes: 256
import java.util.Scanner;

// A - Five Antennas
public class Main {
	static int[] arr;
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		arr = new int[5];
		for (int i = 0; i < 5; i++) {
			arr[i] = sc.nextInt();
		}
		int k = sc.nextInt();
		System.out.println(check(k));

	}
	static String check(int k) {
		for (int i = 0; i < 5; i++) {
			for (int j = 0; j < 5; j++) {
				int x = Math.abs(arr[i] - arr[j]);
				if (k < x) {
					return ":(";
				}
			}
		}
		return "Yay!";
	}
}


Measured memory_bytes: 21844
// ABC177B - 

#include <bits/stdc++.h>
using namespace std;

typedef unsigned long long int ull;
typedef long long int ll;

int main() {
	string S, T;
	cin >> S >> T;

	int ans = 10000;
	int temp;

//	cout << S.size() << " " << T.size() << endl;

	for (int i = 0; i < S.size() - T.size() + 1; i++) {
		temp = 0;
		for (int j = 0; j < T.size(); j++) {
			if (S[i+j] != T[j]) {
//				cout << S[i] << " " << T[j];
				temp++;
			}
		}
//		cout << endl;
//		cout << temp << endl;
		ans = min(ans, temp);
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
 using namespace std;
 
 
int main(){
    long int n;
    cin >> n;
    vector<string> a(n);
    string x;
    for (int i = 0; i < n; i++)
    {
        cin >> x;
        sort(x.begin(), x.end());
        a[i] = x;
    }
    sort(a.begin(), a.end());
 
    long int ans = 0;
    long int c = 1;
    for (int i = 0; i < n - 1; i++)
    {
        if (a[i] == a[i + 1])
            c++;
        else
        {
            ans += (c * (c - 1)) / 2;
            c = 1;
        }
    }
    ans += (c * (c - 1)) / 2;
    cout << ans << endl;
}

Measured memory_bytes: 5760
N = int(input())
a_n = [int(i) for i in input().split()]

is_yes = False

a_n_unique = list(set(a_n))

if len(a_n_unique) == 1:
    if a_n_unique[0] == 0:
        is_yes = True

elif N % 3 == 0:
    if len(a_n_unique) == 2:
        if a_n_unique[0] == 0 or a_n_unique[1] == 0:
            if a_n.count(a_n_unique[0]) > a_n.count(a_n_unique[1]):
                if a_n.count(a_n_unique[0]) / a_n.count(a_n_unique[1]) ==2:
                    is_yes = True
            else:
                if a_n.count(a_n_unique[1]) / a_n.count(a_n_unique[0]) ==2:
                    is_yes = True
    elif len(a_n_unique) == 3:
        if a_n_unique[0] ^ a_n_unique[1] == a_n_unique[2]:
            if a_n.count(a_n_unique[0]) == a_n.count(a_n_unique[1]) and a_n.count(a_n_unique[0]) == a_n.count(a_n_unique[2]):
                is_yes = True


if is_yes:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 14212
s = gets.chomp.chars

l = s.length
sum = 0

if l == 1
  sum = s.join.to_i
else
  ["", "+"].repeated_permutation(l - 1) do |plus|
    plus << ""
    tmp = s.zip(plus).flatten.join
    sum += eval(tmp)
  end
end

puts sum

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

int main()
{
	while (1) {
		int a;
		cin >> a;
		if (a == 0)break;
		int b = 0;
		while (1) {
			if (a == 1)break;
			if (a % 2 == 0)a /= 2;
			else a = a * 3 + 1;
			b++;
		}
		cout << b << endl;
	}
}

Measured memory_bytes: 3056
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<sstream>
#include<complex>
#include<functional>
#include<vector>
#include<map>
#include<queue>
#include<deque>
#include<stack>
#include<set>

using namespace std;
#define endl '\n'
#define pb push_back
#define fst first
#define scd second
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define REP(i,n) for(int i = 0;i < (n);i++)
#define FOR(i,a,b) for(int i = (a);i <= (b);i++)
#define YES(n) cout << ((n) ? "YES" : "NO" ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No" ) << endl

constexpr int MOD = 1000000007;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<ll> vl;

template <class T = int> T in() { T x; cin >> x; return (x); }
template <class T = int> void out(T x) { cout << (x) << endl; }

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

// value


void solve() {

    int X , Y;
	cin >> X >> Y;

	cout << X + Y / 2 << endl;

	return;

}

int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);

	solve();

	return 0;

}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
	int n,q;
	int c[500100];
	int l[500100],r[500100];
	int pos[500100]={0};
	int fenwick[500100]={0};
	int index[500100]={0};
	int ans[500100]={0};
	int h,flg,tmp;
	int i,j,k;
	scanf("%d%d",&n,&q);
	for(i=1;i<=n;i++){
		scanf("%d",&c[i]);
	}
	for(i=1;i<=q;i++){
		scanf("%d%d",&l[i],&r[i]);
		index[i]=i;
	}
	h=n;flg=1;
	while(h>1||flg){
		if(h>1) h=h/1.3;
		if(h==10||h==9) h=11;
		flg=0;
		for(i=1;i<=q-h;i++){
			if(r[i]>r[i+h]){
				tmp=r[i];
				r[i]=r[i+h];
				r[i+h]=tmp;
				tmp=l[i];
				l[i]=l[i+h];
				l[i+h]=tmp;
				tmp=index[i];
				index[i]=index[i+h];
				index[i+h]=tmp;
				flg=1;
			}
		}
	}
	j=1;
	for(i=1;i<=q;i++){
		while(j<=r[i]){
			if(pos[c[j]]) for(k=pos[c[j]];k<=n;k+=k&-k) fenwick[k]--;
			pos[c[j]]=j;
			for(k=j;k<=n;k+=k&-k) fenwick[k]++;
			j++;
		}
		flg=tmp=0;
		for(k=r[i];k>0;k-=k&-k) flg+=fenwick[k];
		for(k=l[i]-1;k>0;k-=k&-k) tmp+=fenwick[k];
		ans[index[i]]=flg-tmp;
	}
	for(i=1;i<=q;i++){
		printf("%d\n",ans[i]);
	}
	return 0;
}


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

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).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; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }

int N; long long L, T;
vector<long long> X;
vector<int> W;

int main() {
    cin >> N >> L >> T;
    X.resize(N); W.resize(N); for (int i = 0; i < N; ++i) cin >> X[i] >> W[i];
    vector<long long> tmp(N);
    for (int i = 0; i < N; ++i) {
        if (W[i] == 1) tmp[i] = (X[i] + T) % L;
        else tmp[i] = ((X[i] - T) % L + L) % L;
    }
    sort(tmp.begin(), tmp.end());
    long long count = 0;
    for (int i = 0; i < N; ++i) {
        if (W[i] == 1) count -= (T - (L - X[i]) + L) / L;
        else count += (T - (X[i] + 1) + L) / L;
    }
    count = (count % N + N) % N;
    //COUT(tmp); COUT(count);
    vector<long long> res(N);
    for (int i = 0; i < N; ++i) res[(i+count)%N] = tmp[i];
    for (int i = 0; i < N; ++i) cout << res[i] << endl;
}

Measured memory_bytes: 3968
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>


using namespace std;
using Int = long long;
Int INF = 1LL << 60;


int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int N, K;
	cin >> N >> K;

	Int all = 1;//確率全体の分母
	while (all <= K - 1) {
		all *= 2;
	}

	Int temp = 0;
	for (Int i = 1; i <= min(N,K-1); i++) {
		Int temp1 = i;
		Int temp2 = all;
		while (temp1 <= K - 1) {
			temp1 *= 2;
			temp2 /= 2;
		}
		temp += temp2;
	}

	temp += all * (max(0LL, N - K + 1));

    double ans = 0;
	ans = (double) temp / all / N;

	printf("%.20f\n", ans);

}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<iomanip>
#include<vector>
using namespace std;

int main() {
	int N, total=0, yakusu;
	cin >> N;
	for (int i = 1; i <= N; i+=2) {
		yakusu = 0;
			for (int j = 1; j <= i; j++) {
				
				if (i % j == 0) yakusu++;
			}
			if (yakusu == 8) total++;
	}

	cout << total << endl;
	return 0;
}




Measured memory_bytes: 256
var ModUtils = function(mod){
	this.mod = mod;
}
ModUtils.prototype.inv = function(n) {
  function euclidean(a,b){
  	if(a == 1 && b == 0)return {x:1,y:0};
  	var ans = euclidean(b,a%b);
    var x = ans.y;
    var y = ans.x - x * Math.floor(a/b);
    return {x:x,y:y};
  }
  var c = euclidean(this.mod,n).y;
  while(c < 0){c += this.mod}
  return c;
};
ModUtils.prototype.product = function() {
  var initVal = 1;
  var len = arguments.length;
  for(var i = 0; i < len;i++){
  	var elem = arguments[i];
  	initVal = this.times(initVal,elem);
  }
  return initVal;
};
ModUtils.prototype.times = function(hoge,fuga) {
	if(hoge*fuga > Number.MAX_SAFE_INTEGER){
    var b = hoge % this.mod;
    var d = fuga % this.mod;
    var min = Math.min(b,d);
    var max = Math.max(b,d);
    
    var hogehoge = 0;
    if(min % 2){
    	hogehoge += max;
      min -= 1;
    }
    hogehoge += this.times(max,min/2);
    hogehoge %= this.mod;
    hogehoge += this.times(max,min/2);
    hogehoge %= this.mod;
    return hogehoge;
  }else{
  	return (hoge*fuga) % this.mod;
  }
};
ModUtils.prototype.combination = function(n,k){
  k = Math.min(k,n-k);
  var a = this.product(...Array.from({length:k},(v,k)=>n-k));
  var b = this.product(...Array.from({length:k},(v,k)=>k+1));
  var bInv = this.inv(b);
  return this.product(a,bInv);
}

function Main(input){
	var N = input.split(" ")[0];
	var M = input.split(" ")[1];

	N = ~~N;
  M = ~~M;
	var primeList = [2,3];
  
  input = M;
  
  var inputRoot = Math.floor(Math.sqrt(input));
  
  for(var i = primeList[primeList.length-1] + 1; i <= inputRoot;i++){
  	if(primeList.find(a=>i%a==0)===undefined)primeList.push(i);
  } 
  
  var primeFact = {};
  
  for(var elem of primeList){
  	while(input%elem == 0){
    	input /= elem;
      primeFact[elem] = (primeFact[elem] || 0)+1;
    }
  }
  
  if(input != 1){
  	primeFact[input] = (primeFact[input] || 0)+1;
  }
  
  var mod = 1000000007;
  var mu = new ModUtils(mod);
  
  var arr = [];
  for(var key in primeFact){
  	var elem = primeFact[key];
  	arr.push(mu.combination(elem+N-1,elem));
  }
  return mu.product(...arr);
}

// If you are interested in the algorithms I used, 
// there is no need to read down from this line.

((b,c,d)=>"undefined"!=typeof require?console.log(Main(require("fs").readFileSync("/dev/stdin","utf8"))):[b=b.split("\n").slice(1,-1).join("\n"),c=function(){try{return Main(b)}catch(f){return f.stack||f.message}}(),d=typeof c,"string"==d||(c=JSON.stringify(c)),$("<form>").append([[10,b],0,[1,d],0,[10,c]].map(f=>$(f?"<textarea>":"<br>",f&&{rows:f[0],cols:40,text:f[1]}))).appendTo("body")])(`
2 35
`);

Measured memory_bytes: 12348
package main

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

func main() {
	K := nextInt()
	X := nextInt()

	if K*500 >= X {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}

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<stdio.h>
#include<stdlib.h>

int main(){
	int q;
	int com,x;
	int *a;
	int idx=0;
	
	scanf("%d",&q);
	a=malloc(sizeof(int)*q);
	
	for(int i=0;i<q;i++){
		scanf("%d",&com);
		
		switch(com){
			case 0:scanf("%d",&x);
				   a[idx++]=x;
				   break;
			
			case 1:scanf("%d",&x);
				   printf("%d\n",a[x]);
				   break;
				   
			case 2:a[idx--]=-1;
				   break;
		}
	}
	
	free(a);
	
	return 0;
	
}


Measured memory_bytes: 2188
import java.util.*;
public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    if(n%1000==0){
    System.out.print(0);
    }else{
    System.out.print(1000-n%1000);
    }
  }
}


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

int main() {
    int A, B; char op;
    cin>>A>>op>>B;
    int ans=0;
    switch (op) {
        case '+': ans=A+B; break;
        case '-': ans=A-B; break;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
n = gets.to_i
sAry = gets.split.map(&:to_i)

INF = 10 ** 9 + 5
$nComp = 0

def merge(aAry, left, mid, right)
    # puts "aAry = " + aAry.to_s + ", left = " + left.to_s + ", mid = " +  mid.to_s + ", right = " + right.to_s
    n1 = mid - left
    n2 = right - mid
    # lAry = aAry[left, n1 - 1]
    # rAry = aAry[mid, n2 - 1]
    lAry = aAry[left, n1]
    rAry = aAry[mid, n2]
    lAry[n1] = INF
    rAry[n2] = INF
    # puts "lAry = " + lAry.to_s
    # puts "rAry = " + rAry.to_s
    i = 0
    j = 0
    (left..(right - 1)).each do |k|
        # puts "k = " + k.to_s
        if lAry[i] <= rAry[j] then
            aAry[k] = lAry[i]
            i += 1
        else
            aAry[k] = rAry[j]
            j += 1
        end
        $nComp += 1
    end
end

def mergeSort(aAry, left, right)
    if left + 1 < right then
        mid = (left + right) / 2
        mergeSort(aAry, left, mid)
        mergeSort(aAry, mid, right)
        merge(aAry, left, mid, right)
    end
end

mergeSort(sAry, 0, n)

puts sAry.join(' ')
puts $nComp


Measured memory_bytes: 62724
#include <iostream>
#include <cmath>
#include <numeric>
#include <algorithm>
#include <deque>
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <iomanip>
#include <map>
#include <stack>
#include <queue>
#include <functional>
#include <climits>
#include <numeric>
#include <bitset>
#include <random>
#include <tuple>
#include <initializer_list>
#include <fstream>
#include <cctype>
#include <string>

int main() {
	int n, k; std::cin >> n >> k;
	long double result{ 0 };
	for (auto i = 1; i <= n; ++i) {
		int val = i;
		long double prob = 1.0;
		while (val < k) {
			val <<= 1;
			prob *= 0.5;
		}
		result += prob / n;
	}
	std::cout << std::setprecision(15) << std::fixed << result << std::endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <cstring>
#include <algorithm>
#include <cstdio>

#define FOR(i, a, b) for(int i = (a), _b = (b); i <= _b; i++)

using namespace std;

const int MAXN = 200000;
long long a[MAXN];

int main() {
  int n, c, k;
  ios::sync_with_stdio(false);
  cin >> n >> c >> k;
  FOR(i, 0, n-1) cin >> a[i];
  sort(a, a + n);
  long long start = -1e9, tempc = 0, res = 0;
  FOR(i, 0, n-1) {
    if (tempc == 0 || (a[i] > start)) {
      res++;
      start = a[i] + k;
      tempc = c; tempc --;
    } else {
      tempc--;
    }
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include<algorithm>
#include<iomanip>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,m,n) for(int i=m;i<(int)(n);i++)
typedef pair<int,int> pint;
typedef long long ll;
const int inf   = 1<<30;
const ll  longinf = 1LL<<60;
int dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};
int main(){
  int n;
  cin>>n;
  ll a[n],sum=0;
  rep(i,n){
    cin>>a[i];
    sum+=a[i];
    }
  ll ans=longinf;
  ll snuke=0;
  rep(i,n-1){
    snuke+=a[i];
    ll x=abs(2*snuke-sum);
    ans=min(ans,x);
    }
  cout<<ans<<endl;
  return 0;
  }

      


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

int main(){
	int A,B,C;
       cin >> A >> B >> C;
	if(A>=B && A>=C){
	 cout <<10*A + B + C <<endl;
	}
	else if(B>=C){
	 cout << A + 10*B + C << endl;
	}else {
	 cout << A + B + 10*C << endl;
       }
	return 0;
}


Measured memory_bytes: 256
using System;

namespace AGC039
{
    class A
    {
        static void Main(string[] args)
        {
            string S = Console.ReadLine();
            long K = long.Parse(Console.ReadLine());

            long count = 1;
            long res = 0;

            bool eQu = false;
            bool sC = false;
            bool eC = false;

            for (int i = 0; i < S.Length - 1;)
            {
                if (S[i] != S[i + 1])
                {
                    i++;
                }
                else
                {
                    while (i < S.Length - 1 && S[i] == S[i + 1])
                    {
                        count++;
                        i++;
                    }
                    i++;
                }
                res += count / 2;
                if (count == S.Length) eQu = true;
                count = 1;
            }

            res *= K;

            int count2 = 1;
            int count3 = 1;
            if (1 < K && S[0] == S[S.Length - 1] && !eQu)
            {
                for (int i = 0; i < S.Length - 1; i++)
                {
                    if (S[i] == S[i + 1]) count2++;
                    else break;
                }
                if (count2 % 2 == 1) { sC = true; }

                for (int i = S.Length - 1; 0 < i; i--)
                {
                    if (S[i] == S[i - 1]) count3++;
                    else break;
                }
                if (count3 % 2 == 1) { eC = true; }
            }

            //if (S.Length != 1 && 2 <= K && S[0] != S[1] && S[S.Length - 2] != S[S.Length - 1] && S[0] == S[S.Length - 1]) { res += K - 1; }
            if (S.Length != 1 && 2 <= K && sC && eC && S[0] == S[S.Length - 1]) { res += K - 1; }
            if (S.Length == 1) res = K / 2;
            if (eQu && S.Length % 2 == 1) res += K / 2;



            Console.WriteLine(res);
        }
    }
}


Measured memory_bytes: 11220
#include <bits/stdc++.h>
#define ll long long int
//#define m 1000000007
using namespace std;
// #include <ext/pb_ds/assoc_container.hpp> //required
// #include <ext/pb_ds/tree_policy.hpp>     //required
// using namespace __gnu_pbds;              //required
// using namespace std;
// template <typename T>
// using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

// ordered_set<int> s;
// ordered_set<int>::iterator itr;
// /* or:
// typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// ordered_set s;
// This works in C++98 but the above version only works in C++11
// */
// //char str[10000000];
void swap(ll *xp, ll *yp)
{
    ll temp = *xp;
    *xp = *yp;
    *yp = temp;
}
ll coun[1000004] = {0};
ll
    ans[2000004] = {0};
int main()
{
    ll n;
    cin >> n;
    ll arr[n];
    ll arr1[n];
    for (int i = 0; i < n; i++)
    {
        cin >> arr[i];
        arr1[i] = arr[i];
        coun[arr[i]]++;
    }
    sort(arr, arr + n);
    //  ll ans[n] = {0};
    if (ans[0] == 1)
    {
        cout << 0 << "\n";
        return 0;
    }
    ll j = 2;
    for (int i = 0; i < n; i++)
    {
        if (ans[arr[i]] != -1)
            while (j * arr[i] <= arr[n - 1])
            {
                if (coun[j * arr[i]])
                {
                    ans[j * arr[i]] = -1;
                }
                j++;
            }
        j = 2;
        if (coun[arr[i]] > 1)
        {
            ans[arr[i]] = -1;
        }
    }
    ll sum = 0;

    for (int i = 0; i < 1000002; i++)
    {
        if (ans[i] == 0 && coun[i] == 1)
            sum += 1;
    }
    cout << sum << "\n";

    return 0;
}

Measured memory_bytes: 22348
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <map>
#include <stack>
#include <string>
#include <list>
#include <math.h>
using namespace std;

typedef pair<int, int> P;
#define ll long long
#define mod 1000000007


int main(){

	ll n, a, b;
	cin >> n >> a >> b;
	if (n == 1 && a != b) cout << 0 << endl;
	else if (a > b) cout << 0 << endl;
	else cout << (a + b*(n - 1)) - (a*(n - 1) + b) + 1 << endl;

	return 0;
}

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

int main(){
  int h, w;
  cin >> h >> w;
  
  int c, r;
  
  for(int i=0;i<h;++i){
    for(int j=0;j<w;++j){
      string s;
      cin >> s;
      if(s == "snuke"){
        c = j;
        r = i;
      }
    }
  }
  
  cout << (char)('A'+c) << r+1 << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
void Unused(...) {}
#ifndef DEBUG
  #define echo(...) Unused(__VA_ARGS__)
#else
  #define echo(...) fprintf(stderr, __VA_ARGS__)
#endif

const int MaxN = 1e5 + 7;

int n;
int val[MaxN];
std::vector<int> rest[MaxN];
int len;

/*
 * int idx[MaxN];
 * int lis()
 * {
 *   int len = 0;
 *   for (int i = 1; i <= n; ++i)
 *   {
 *     if (val[i] > val[idx[len]])
 *       idx[++len] = val[i];
 *     else
 *       *upper_bound(idx, idx + len + 1, val[i]) = val[i];
 *   }
 *   return len;
 * }
 */

int find(int v)
{
    int l = 1, r = len;
    while (l < r)
    {
        int mid = (l + r) / 2;
        if (v > rest[mid].back())
            r = mid;
        else
            l = mid + 1;
    }
    return l;
}

int main()
{
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i)
        scanf("%d", val + i);
    rest[len = 1].push_back(val[1]);
    for (int now = 2; now <= n; ++now)
    {
        int ins = find(val[now]);
        //echo("find %d(%d %d)\n", ins);
        if (ins == len && val[now] <= rest[ins].back())
            rest[++len].push_back(val[now]);
        else
            rest[ins].push_back(val[now]);
    }
    /*
    for (int i = 1; i <= len; ++i)
    {
        for (int j = 0; j < rest[i].size(); ++j)
            echo("%d ", rest[i][j]);
        echo("\n");
    }
    */
    printf("%d\n", len);
    return 0;
}



Measured memory_bytes: 6144
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;

ll c[51][51];

void comb(int n) {
    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= i; j++) {
            if (j == 0 || j == i) {
                c[i][j] = 1LL;
            } else {
                c[i][j] = c[i - 1][j] + c[i - 1][j - 1];
            }

        }
    }
}


int main() {
    int n, a, b;
    cin >> n >> a >> b;
    comb(n);
    ll v[n];
    for (int i = 0; i < n; i++) {
        cin >> v[i];
    }
    sort(v, v + n);
    reverse(v, v + n);
    int maxValueCnt = 0;
    for (int i = 0; i < n; i++) {
        if (v[0] == v[i]) {
            maxValueCnt++;
        } else {
            break;
        }
    }

    if (maxValueCnt >= a) {
        int mn = min(maxValueCnt, b);
        ll ans = 0;
        for (int i = a; i <= mn; i++) {
            ans += c[maxValueCnt][i];
        }
        double meanValue = v[0];
        printf("%.10f\n",meanValue);
        printf("%lld\n", ans);
        return 0;
    }

    double meanValue = 0;
    for (int i = 0; i < a; i++) {
        meanValue += v[i];
    }
    meanValue /= a;
    ll minValueCnt = 0;
    ll idx;
    for (int i = n - 1; i >= 0; i--) {
        if (v[a - 1] == v[i]) {
            minValueCnt++;
            idx = i;
        }
    }
    printf("%.10f\n", meanValue);
    printf("%lld\n", c[minValueCnt][a - idx]);



    return 0;
}


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

namespace AtCoder.Abc
{
    class QuestionD
    {

        /// <summary>
        /// B - 1%
        /// https://atcoder.jp/contests/abc165/tasks/abc165_b
        /// </summary>
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            // 整数の入力
            long num_X = long.Parse(Console.ReadLine());

            long num_Sum = 100; //残高

            int num_N = 0;

            while (num_Sum < num_X)
            {
                num_Sum += num_Sum / 100;
                num_N++;
            } 

            Console.WriteLine(num_N);

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 27348
#include<bits/stdc++.h>
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int, int>P;

int dp[1000][1000];
bool dfs(int u,int v) {
	if (dp[u][v] != -1)return dp[u][v];
	for (int i = 1; i <= max(v / 2, u / 2); i++) {
		if (v >= i * 2) {
			if (!dfs(v - i * 2, u + i))return dp[u][v] = true;
		}
		if (u >= i * 2) {
			if (!dfs(v + i, u - i * 2))return dp[u][v] = true;
		}
	}
	return dp[u][v] = false;
}
signed main() {
	ll x, y; cin >> x >> y;
	if (x == 0 && y == 0)puts("Brown");
	else if (x == 0 || y == 0)puts("Alice");
	else {
		if (abs(x - y) <= 1)puts("Brown");
		else puts("Alice");
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define fi first
#define sc second
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#define ANS cout << ans << endl
#define RETURN(x)    \
  cout << x << endl; \
  return 0
clock_t CLOCK;
#define START_TIMER CLOCK = clock()
#define SHOW_TIMER cerr << "time: " << (ld)(clock() - CLOCK) / 1000000 << endl
#define init() \
  cin.tie(0);  \
  ios::sync_with_stdio(false)
#define debug(x) cerr << "[debug] " << #x << ": " << x << endl;
#define debugV(v)                       \
  cerr << "[debugV] " << #v << ":";     \
  rep(i, v.size()) cerr << " " << v[i]; \
  cerr << endl;
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using mll = map<ll, ll>;
using qll = queue<ll>;
using P = pair<ll, ll>;

constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr ld PI = 3.141592653589793238462643383279;
ll get_digit(ll x) {
  return to_string(x).size();
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

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

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

vll divisor(ll n) {
  vll ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  SORT(ret);
  return (ret);
}

signed main() {
  init();
  ll sx, sy, gx, gy;
  cin >> sx >> sy >> gx >> gy;

  rep(i, gy - sy) cout << "U";
  rep(i, gx - sx) cout << "R";
  rep(i, gy - sy) cout << "D";
  rep(i, gx - sx) cout << "L";
  cout << "L";
  rep(i, gy - sy + 1) cout << "U";
  rep(i, gx - sx + 1) cout << "R";
  cout << "D";
  cout << "R";
  rep(i, gy - sy + 1) cout << "D";
  rep(i, gx - sx + 1) cout << "L";
  cout << "U";
  ENDL;
  return 0;
}

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

typedef long long ll;
typedef pair<int,int> P;

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

int main(){
    int N; cin >> N;
    int p[N];
    for(int i=0;i<N;i++){
        cin >> p[i]; p[i]--;
    }
    int a[N];
    int b[N];
    int r[N];
    for(int i=0;i<N;i++){
        r[p[i]]=i+1;
    }
    for(int i=0;i<N;i++){
        a[i]=N*(i+1);
        b[i]=N*(N-i-1)+r[i];
    }
    
    for(int i=0;i<N;i++){
        cout << a[i] << " ";
    }
    cout << endl;
    for(int i=0;i<N;i++){
        cout << b[i] << " ";
    }
    cout << endl;
    
}

Measured memory_bytes: 3924
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
#include <stdio.h>
using namespace std;
ostringstream oss ;
int64_t gmr(int64_t a,int64_t b){
    if(a < b)
    {
        int64_t temp = a;
        a = b ;
        b = temp;
    }
    int64_t copya = a;
    int64_t copyb = b;
    int64_t r = a%b ;
    while (r != 0)
    {
        a = b ;
        b = r ;
        r = a%b ;
    }
    return copya * copyb / b ;
    
}

int main(){
    int64_t n,m ;
    cin >> n >> m ;
    vector<int64_t> a(n) ;
    for (size_t i = 0; i < n; i++)
    {
        cin >> a.at(i) ;
        a.at(i) /= 2 ;
    }
    int64_t ans;
    if (n == 1)
    {
        ans = (m / a.at(0) + 1 ) / 2 ;
        cout << ans << endl ;
        return 0;
    }
    
    int64_t nowgmr = gmr(a.at(0), a.at(1)) ;
    if (n > 2)
    {
    
        for (size_t i = 2; i < n; i++)
        {
            if (nowgmr >= a.at(i) )
            {
                if ((nowgmr/a.at(i)) % 2 == 0 && (nowgmr % a.at(i)) == 0)
                {
                    m = 0 ;
                    break;
                }
                
            }else
            {
                if ((a.at(i)/nowgmr) % 2 == 0 && (a.at(i) % nowgmr) == 0)
                {
                    m = 0 ;
                    break;
                }
            }
            
            
            nowgmr = gmr(nowgmr,a.at(i)) ;
        }
    }
    int64_t an = m / nowgmr ;
    ans = (an+1)/2 ;
    cout << ans << endl ;
}

Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
	private static long N;
	
	private static void cal(){
		boolean flag = true;
		for(long h = 1;h<=3500&&flag;h++){
			for(long w = h;w<=3500&&flag;w++){
				long rs = 4*h*w - h*N - N*w;
				long  t = N*h*w;
				
				if( rs>0 && t%rs == 0 && t/rs<=3500){
					System.out.println(h+" "+w+" "+t/rs);
					flag = false;
				}
			}
		}
		
	}
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		while (in.hasNext()){
			N = in.nextLong();
			cal();
		}
	}
}


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

int n;

struct node
{
	int id, pid, k, d;
	int* cid;
	string type;
}N[100005];

void GetDepth(node& GN)
{
	GN.d = 0;
	node temp = GN;

	while (temp.pid != -1)
	{
		GN.d++;
		temp = N[temp.pid];
	}
}

void GetType(node& GN)
{
	if (GN.pid == -1)
		GN.type = "root";
	else if (GN.k == 0)
		GN.type = "leaf";
	else
		GN.type = "internal node";
}

void print()
{
	for (int i = 0; i < n; i++)
	{
		cout << "node " << N[i].id << ": " << "parent = " << N[i].pid << ", " << "depth = " << N[i].d << ", " << N[i].type << ", " << "[";

		if (N[i].k != 0)
		{
			for (int j = 0; j < N[i].k - 1; j++)
				cout << N[i].cid[j] << ", ";
			cout << N[i].cid[N[i].k - 1];
		}

		cout << "]" << endl;
	}	
}

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

	int place;
	cin >> n;
	
	for (int i = 0; i < n; i++)
		N[i].pid = -1;
	
	for (int i = 0; i < n; i++)
	{
		cin >> place;
		N[place].id = place;
		cin >> N[place].k;

		if (N[place].k > 0)
			N[place].cid = new int[N[place].k];

		for (int j = 0; j < N[place].k; j++)
		{
			cin >> N[place].cid[j];
			N[N[place].cid[j]].pid = N[place].id;
		}			
	}

	for (int i = 0; i < n; i++)
		GetDepth(N[i]);

	for (int i = 0; i < n; i++)
		GetType(N[i]);	

	print();

	return 0;
}



Measured memory_bytes: 11512
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,ans=0;
	cin>>n;
	for (int i=1;i<=n;i+=2){
		int a;
		cin>>a;
		if (a%2==1) ans++;
		if ((i+2)<=n) cin>>a;
	}
	cout<<ans<<endl;
	return 0;
} 

Measured memory_bytes: 3528
import sys

def ryuka(i):
    if i == 0:
        return 2
    elif i == 1:
        return 1
    else:
        return ryuka(i-1) + ryuka(i-2)

def eryuka(i):
    a = 2
    b = 1
    for _ in range(i):
        a, b = b, a+b
    return a


n = int(input())
print (eryuka(n))

Measured memory_bytes: 3060