akhauriyash/Code-Regression huggingface dataset:
use std::cmp::max;
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
fn main(){
    let n : i64 = read();
    let ta = read_vec2(n as u32);
    // let mut ans = (ta[0][0],ta[0][1]);
    let mut ans = (1,1);
    for j in 0..n {
        let t:i64 = ta[j as usize][0];
        let a:i64 = ta[j as usize][1];
        let o =  max((ans.0+t -1) / t, (ans.1+a-1)/a );
        ans = (o *t,o*a);
    }
    println!("{}",ans.0 + ans.1 );
}

Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=1LL<<61;

ll m;
vec mul(vec &dp, mat &mt) {
  vec ret(m);
  for(ll i=0;i<m;i++) {
    for(ll j=0;j<m;j++) {
      ret[i]=(ret[i]+mt[i][j]*dp[j])%mod;
    }
  }
  return ret;
}

mat matmul(mat &a, mat &b) {
  mat res(m,vec(m,0));
  for(ll i=0;i<m;i++) {
    for(ll j=0;j<m;j++) {
      for(ll k=0;k<m;k++) {
        (res[i][j]+=a[i][k]*b[k][j])%=mod;
      }
    }
  }
  return res;
}

mat update(mat &mt) {
  mat ret(m,vec(m));
  for(ll i=0;i<m;i++) {
    for(ll j=0;j<m;j++) {
      for(ll k=0;k<m;k++) {
        ret[i][j]=(ret[i][j]+mt[i][k]*mt[k][j])%mod;
      }
    }
  }
  return ret;
}

void vmpow(vec &dp,mat &mt, ll k) {
  ll m=dp.size();
  while(k)  {
    if(k&1) dp=mul(dp,mt);
    mt=update(mt);
    k/=2;
  }
}

mat matpow(mat a, ll k) {
  mat res(m,vec(m,0));
  for(ll i=0;i<m;i++) {
    res[i][i]=1;
  }
  while(k>0) {
    if(k&1) res=matmul(res,a);
    a=matmul(a,a);
    k>>=1;
  }
  return res;
}

int main() {
  ll k;
  cin >> m >> k;
  mat dp(m,vec(m));
  for(ll i=0;i<m;i++) for(ll j=0;j<m;j++) cin >> dp[i][j];
  dp=matpow(dp,k);
  ll ans=0;
  for(ll i=0;i<m;i++) for(ll j=0;j<m;j++) (ans+=dp[i][j])%=mod;
  cout << ans << endl;
}

Measured memory_bytes: 384
/*
▄███████▀▀▀▀▀▀███████▄
░▐████▀▒ЗАПУСКАЕМ▒▀██████▄
░███▀▒▒▒▒▒ДЯДЮ▒▒▒▒▒▒▀█████
░▐██▒▒▒▒▒▒БОГДАНА▒▒▒▒▒████▌
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀
░░░░▄██████████████▒▒▐▌
░░░▀███▀▀████▀█████▀▒▌
░░░░░▌▒▒▒▄▒▒▒▄▒▒▒▒▒▒▐
░░░░░▌▒▒▒▒▀▀▀▒▒▒▒▒▒▒▐
*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
#define zhfs main
#define mp(a, b) make_pair(a, b)
#define fi first
#define se second
#define re return
#define forn(i, n) for (int i = 1; i <= n; i++)
const ll MOD = 1000 * 1000 * 1000 + 7;
const int MAXN = 100 * 1000 + 7;
ll x[MAXN], y[MAXN];
ll calc(ll x[], int n)
{
	ll res = 0;
	n--;
	for (int i = 1; i <= n; i++)
	{
		ll cur = (x[i + 1] - x[i]) * i % MOD * (n - i + 1) % MOD;
		res = (res + cur) % MOD;
	}
	return res;
}
int zhfs()
{
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
#endif
	int n, m;
	scanf("%d %d", &n, &m);
	for (int i = 1; i <= n; i++)
	{
		scanf("%lld", &x[i]);
	}
	for (int j = 1; j <= m; j++)
	{
		scanf("%lld", &y[j]);
	}
	ll res = (calc(x, n) * calc(y, m)) % MOD;
	printf("%lld\n", res);
}



Measured memory_bytes: 1792
from collections import deque
n = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
# Aの総和 = Cの総和
p = []
cnt_p = 0
cnt_m = 0
x = 0
for a,b in zip(A,B):
    if a > b:
        cnt_p += 1
        p.append(a-b)
    elif a < b:
        cnt_m += 1
        x += b-a

if cnt_m==0:
    print(0)
    exit()

p = deque(sorted(p)[::-1])
while p and x > 0:
    P = p.popleft()
    if P <= x: x -= P
    else: x = 0
if x == 0:
    print(cnt_m+cnt_p-len(p))
else:
    print(-1)

Measured memory_bytes: 24692
/*
 _____ ____ _____   ___   ___  __  ___  
|_   _/ __ \_   _| |__ \ / _ \/_ |/ _ \ 
  | || |  | || |      ) | | | || | (_) |
  | || |  | || |     / /| | | || |\__, |
 _| || |__| || |_   / /_| |_| || |  / / 
|_____\____/_____| |____|\___/ |_| /_/   
*/
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define per(i, a, b) for (long long i = (a); i > (b); i--)
#define a(x) (x.begin(), x.end())
#define ar(x) (x.rbegin(), x.rend())
#define pb push_back
#define Pb() pop_back()
#define ll long long int
#define ull unsigned long long int
#define pii pair<int, int>
#define pll pair<ll, ll>
#define sc scanf
#define scin(x) sc("%d", &(x))
#define scln(x) sc("%lld", &(x))
#define pf prllf
#define ms(a, b) memset(a, b, sizeof(a))
#define mp make_pair
#define db double
#define EPS 10E-10
#define ff first
#define ss second
#define sqr(x) (x) * (x)
#define vi vector<int>
#define vl vector<ll>
#define vii vector<vector<int>>
#define vll vector<vector<ll>>
#define DBG pf("HI\n")
#define MOD 1000000007
#define CIN                       \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0)
#define RUN_CASE(t, T) for (__typeof(t) t = 1; t <= T; t++)
#define CASE(t) prllf("Case %d: ", t)
#define CASEL(t) prllf("Case %d:\n", t)
#define intlimit 2147483647
#define longlimit 9223372036854775807
#define infinity (1 << 28)
#define gcd(a, b) __gcd(a, b)
#define lcm(a, b) ((a) * (b) / gcd(a, b))
#define PI 2 * acos(0.0)
using namespace std;
int main()
{
    CIN;
    int a,b;
    cin >> a >> b;
    cout <<floor((double)(b-2)/(a-1) +1);
}

Measured memory_bytes: 256
n=int(input())
array1=[]
c=[]
for i in range(n):
    a,b=map(int,input().split())
    array1.append([a,b])
array1.sort(reverse=True)
#print(array1)    
for i in range(n):
    c=array1[i][0]+array1[i][1]
    array1[i].insert(0,c) 
array1.sort(key=lambda x: x[0],reverse=True)
sum1=0
sum2=0
for i in range(n):
    if(i%2==0):
        sum1+=array1[i][1]
    else:
        sum2+=array1[i][2]
#print(array1)            
print(sum1-sum2)


Measured memory_bytes: 28200
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef long  l;
typedef pair<ll,ll> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
const double PI=3.141592653589;
const int INF=1000000007;
const ll LMAX=1000000000000001;
int gcd(int a,int b){if(a<b)swap(a,b);int c=a%b;while(c!=0){a=b;b=c;c=a%b;}return b;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};


int main(){
  int a, b; cin >> a >> b;
  cout << a*b << endl;


  return 0;
}


Measured memory_bytes: 3620
#define _CRT_SECURE_NO_WARNINGS
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#include <set>
#include <map>
#include <deque>
#include <cmath>
#include <queue>
#include <random>
#include <bitset>
#include <time.h>
#include <string>
#include <cstdio>
#include <vector>
#include <cstdlib>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
//++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++
//#define endl '\n'
#define mp make_pair
#define pbc push_back
#define pob pop_back()
#define empb emplace_back
#define sp system("pause")
#define queuel queue<long long>
#define all(x) (x).begin(),(x).end()
#define matrix vector<vector<ll>>
#define pin(p) cin >> p.first >> p.second;
#define rev(v) reverse(v.begin(),v.end());
#define mx(v) max_element(v.begin(), v.end());
#define mn(v) min_element(v.begin(), v.end());
#define sout(s, c) for(auto i : s) cout << i << c;
#define pout(p) cout << p.first << " " << p.second;
#define er(v, l, r) erase(v.begin() + l, v.begin() + r);
#define vin(v) for(ll i = 0; i < v.size(); ++i) cin >> v[i];
#define vout(v, c) for(int i = 0; i < v.size(); ++i) cout << v[i] << c;
#define pushi(v, a) for(int i = 0; i < a.size(); ++i) v.push_back(a[i]);
#define sin(s, n) for(int i = 0; i < n; ++i){int a; cin >> a; s.insert(a);}
#define fastio() ios_base::sync_with_stdio(0);cout.tie(0);cin.tie(0);srand(time(NULL));
//++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++
using namespace std;
//++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
//++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++--++
const ll INF = 1000LL * 1000 * 1000 * 1000 * 1000 * 1000;
const int inf = 1000 * 1000 * 1000;
const ld PI = acos(-1.0);
const ll mod1 = inf + 7;
const ll mod2 = inf + 9;
const int MAXN = 500001;
const ld EPS = 1e-9;
int hp = 179;

signed main()
{
	fastio();
	int n;
	cin >> n;
	vector<int> a(n);
	vin(a);
	int ans = 0;
	for (int i = 0; i < n; ++i)
	{
		for (int j = i + 1; j < n; ++j)
		{
			ans = max(ans, abs(a[j] - a[i]));
		}
	}
	cout << ans;
	sp;
}

Measured memory_bytes: 504
#include<iostream>
using namespace std;
int main(){
  int N;
  cin>>N;
  if((N%10)==2 || (N%10)==4 || (N%10)==5 || (N%10)==7 ||(N%10)==9) cout<<"hon"<<endl;
  else if((N%10)==3) cout<<"bon"<<endl;
  else cout<<"pon"<<endl;
  return 0;
}


Measured memory_bytes: 3640
M,D=map(int,input().split())
if D<=21:print(0);exit()
ans=0
for i in range(1,M+1):
    for j in range(22,D+1):
        d1=int(str(j)[0])
        d2=int(str(j)[1])
        if i==d1*d2 and d1>=2 and d2>=2:
            ans+=1
print(ans)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long long MOD = 1000000007;
constexpr long long INF = 1LL << 60;
const long double PI = acosl(-1.0);
constexpr long double EPS = 1e-11;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
ll n,a,b;
cin >> n >> a >> b;
vector<ll> x(n);
for (ll i = 0; i < n; i++) cin >> x[i];
ll ans = 0;
for (ll i = 0; i < n - 1;i++){
    ans += min(b, (x[i + 1] - x[i]) * a);
}
cout << ans << endl;
}

Measured memory_bytes: 4052
#include <bits/stdc++.h>
#include <experimental/iterator>

/* snippet: useful macros and functions */
#define ARC(i, a, b) for(Int i = (a); i < (b); ++i)
#define RC(i, n) ARC(i, 0, n)
#define ARCH(i, a, b) for(Int i = (a) - 1; i >= (b); --i)
#define RCH(i, n) ARCH(i, n, 0)
template<class T> T ant(const T &a, const T &b){ return a > b ? a : b; }
template<class T> T ont(const T &a, const T &b){ return a < b ? a : b; }
template<class T> T rng(const T &a, const T &b){ return a < b ? b - a : a - b; }
template<class T> void th(T &a, const T &b, T (*f)(const T &, const T &)){ a = f(a, b); }
#define anth(a, b) th(a, b, ant)
#define onth(a, b) th(a, b, ont)

/* debug */
auto debug = std::experimental::make_ostream_joiner(std::cout, " ");

/* snippet: modint library */
template<class T, int MOD>
class Modint{
	T val;
public:
	Modint(T val = 0) : val(val % MOD + (val > 0 ? 0 : MOD)) {}
	operator T(){ return val; }
	Modint &operator+=(const Modint &a){ val += a.val; if(val >= MOD) val -= MOD; return *this; }
	Modint &operator-=(const Modint &a){ val -= a.val; if(val < 0) val += MOD; return *this; }
	Modint &operator*=(const Modint &a){ val = val * a.val % MOD; return *this; }
	void inverse(){T x[2]={MOD,val},a[2]={0,1};int i;for(i=0;x[!i];i^=1){a[i]-=x[i]/x[!i]*a[!i];x[i]=x[i]%x[!i];}if(!i)a[i]+= MOD;val=a[i];}
	Modint &operator/=(Modint a){ a.inverse(); return *this *= a; }
	friend Modint modpow(Modint a, int n){ Modint ret(1); while(n){ if(n & 1) ret *= a; a *= a; n >>= 1; } return ret; }
	friend Modint operator+(Modint a, const Modint &b){ return a += b; }
	friend Modint operator-(Modint a, const Modint &b){ return a -= b; }
	friend Modint operator*(Modint a, const Modint &b){ return a *= b; }
	friend Modint operator/(Modint a, const Modint &b){ return a /= b; }
	friend std::ostream &operator<<(std::ostream &os, const Modint &a){ return os << a.val; }
};

/* snippet: using declarations */
using Int = long long;
using std::cout;
using std::cin;
using std::endl;
using Mint = Modint<long long, 1000000007>;

Int n, m, x;
Int c[20], a[20][20];

int main(){
	cin >> n >> m >> x;
	RC(i, n){
		cin >> c[i];
		RC(j, m){
			cin >> a[i][j];
		}
	}
	Int ans = LLONG_MAX;
	for(Int i = 0; i < 1 << n; ++i){
		Int count[20] = {};
		Int money = 0;
		for(Int j = 0; j < n; ++j) if((i >> j) & 1){
			for(Int k = 0; k < m; ++k){
				count[k] += a[j][k];
			}
			money += c[j];
		}
		bool ok = true;
		for(Int j = 0; j < m; ++j){
			if(count[j] < x){
				ok = false;
			}
		}
		// cout << ok << "," << money << endl;
		if(ok){
			onth(ans, money);
		}
	}
	if(ans == LLONG_MAX){
		cout << -1 << endl;
	}else{
		cout << ans << endl;
	}
}


Measured memory_bytes: 3636
#include<iostream>

using namespace std;

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

    int max = 0;
    int sum = 0;
    for(int i = 0; i < N; i++) {
        int L;
        cin >> L;
        sum += L;
        if(max < L) {
            max = L;
        }
    }

    if(max < sum - max) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;






int main(void) 
{
	int N;
	cin >> N;
	set<int> memo;
	int n=0;
	for (int i=0; i< N; i++) {
		int A;
		cin >> A;
		auto itr = memo.find(A);
		if (itr != memo.end()) {
			n--;
			memo.erase(itr);
		}else {
			n++;
			memo.insert(A);
		}
	}

	cout << n << endl;
	return 0;
}

Measured memory_bytes: 4864
#include<iostream>
#include<algorithm>
#include<map>
#include<vector>
using namespace std;
typedef long long ll;
int main()
{
  ll n,k,a,i,s=0,res=0;
  map<ll,vector<ll>> m;
  decltype(m)::iterator im;
  vector<ll>::iterator iv;
  cin >> n >> k;
  if(k==1){
    cout << "0" << endl;
    return 0;
  }
  m[0]={0};
  for(i=1;i<=n;i++){
    cin >> a;
    s+=a-1;
    s%=k;
    im=m.find(s);
    if(im==m.end()){
      m[s]={i};
    }else{
      if(i<=k-1){
        res+=m[s].size();
      }else{
        iv=lower_bound(m[s].begin(),m[s].end(),i-k+1);
        res+=(ll)distance(iv,m[s].end());
      }
      m[s].push_back(i);
    }
  }
  cout << res << endl;
  return 0;
}

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

int main() {
  int N,K;
  cin >> N >> K;
  if(N>=13){
    cout << K << endl;
    return 0;
  }
  else if(N<=5){
    cout << 0 << endl;
    return 0;
  }
  else{
    cout << K/2 << endl;
  }
}


Measured memory_bytes: 3636
#include<stdio.h>
using namespace std;

int main(){
  int a, b;
  scanf("%d %d", &a, &b);
  if (a < b) {
    printf("a < b\n");
  } else if (a > b) {
    printf("a > b\n");
  } else {
    printf("a == b\n");
  }
  return 0;
}


Measured memory_bytes: 2608
n,m,x = map(int,input().split())
c = [list(map(int,input().split())) for i in range(n)]

ans = float('inf')

for i in range(2**n):#行数回す。(１０進数)
    hold = [0] * (m+1)
    for j in range(n):#行数回す（２進数）。flagを立てる。
        if (i >> j) & 1:#　i(二進数)をj個右に動かす。
            for k in range(m+1):
                hold[k] += c[j][k]
    if min(hold[1:]) >= x : 
        ans = min(ans,hold[0])

if ans != float('inf'):
    print(ans)
else:
    print("-1")



Measured memory_bytes: 9204
#include <bits/stdc++.h>
using namespace std;
int arr[500];
int main(){
	int n;
	cin>>n;
	for(int i=0;i<2*n;i++){
		cin>>arr[i];
	}
	sort(arr,arr+2*n);
	int total=0;
	for(int i=0;i<2*n;i+=2){
		total+=arr[i];
	}
	cout<<total<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
	int seat[17] = {0};
	int X = 0;
	int stop[100] = {0};
	int time = 0;
	queue<int> Q;
	while(X < 100){
		int x;
		if(time%5 == 0 && time < 500){
			Q.push(time/5);
		}
		while(1){
			if(Q.size())x = Q.front();
			else x = -1;
			bool f = false;
			
			if(~x){
				int people = (x%5==1?5:2);
				int use = 19 + 3 * (x%3) + 17 * (x%2);
				rep(i,17-people+1){
					bool flag = true;
					rep(j,people){
						flag &= seat[i+j] == 0;
					}
					if(flag){
						rep(j,people){
							seat[i+j] = use;
						}
						f = true;
						break;
					}
				}
			}
			if(f){	
				stop[x] = time - x * 5;
				Q.pop();
				X++;
			}
			if(!f)break;
		}
		rep(i,17){
			seat[i] = max(0,seat[i]-1);
		}
		time++;
	}
	int n,c=0;
	
	while(cin >> n){
		if(n == 3)c++;
		cout << stop[n] << endl;
	}
	int a = 0;
	while(c>=1){cout << a/a << endl;};
	
}

Measured memory_bytes: 0
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define sort(a)         sort((a).begin(), (a).end())
#define uniq(a)         SORT(a);(a).erase(unique((a).begin(), (a).end()), (a).end())
#define reverse(a)      reverse((a).begin(), (a).end())
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define Yes()           printf("Yes\n")
#define No()            printf("No\n")
#define YES()           printf("YES\n")
#define NO()            printf("NO\n")
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }

using namespace std;
using ll = long long;
using P = pair<ll,ll>;

const ll MOD = 1000000007; // 10^9 + 7

void solve() {
  string s; cin >> s;
  int idxc = s.find("C");
  int idxf = s.rfind("F");

  if (idxc == string::npos || idxf == string::npos || idxc > idxf) No();
  else Yes();
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}


Measured memory_bytes: 256
import queue
q = queue.Queue()
for i in range(1,10):
    q.put(i)
K = int(input())
for k in range(K):
    x =q.get()
    last = x % 10
    if last != 0:
        q.put(10*x + last - 1)
    q.put(10*x + last)
    if last != 9:
        q.put(10*x + last + 1)
print (x)

Measured memory_bytes: 12480
import java.util.Scanner;
 
public class Main{
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int numa = scan.nextInt();
        int numb = scan.nextInt();
        int numc = scan.nextInt();
        int numd = scan.nextInt(); 
        int i;
        for(i=0;i<10000;i++){
            if(i%2 == 0){
                if(numc>0){
                    numc = numc - numb;}
                else{
                    System.out.println("Yes");
                    break;}
                }
            else{
                if(numa>0){
                    numa = numa - numd;}
                else{
                    System.out.println("No");
                    break;}
                }        
          }        
        scan.close();
    }
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using pi = pair<int, int>;
const ll INF = 1LL << 60;

int main() {
	string s;
	cin >> s;
	int ans = 0;
	if (s == "RRR")ans = 3;
	else if (s.substr(0, 2) == "RR" || s.substr(1, 2) == "RR")ans = 2;
	else if (s[0] == 'R' || s[1] == 'R' || s[2] == 'R')ans = 1;
	cout << ans << endl;
	return 0;
}



Measured memory_bytes: 3596
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int h = sc.nextInt();
        int[] hh = new int[h];
        for (int i = 0; i < h; i++) {
            hh[i] = sc.nextInt();
        }
        int ans = 0;
        for (int i = 0; i < h; i++) {
            int hei = hh[i];
            boolean ok = true;
            for (int j = 0; j < i; j++) {
                if (hh[j] <= hei) {

                } else {
                    ok = false;
                    break;
                }
            }
            if (ok) {
                ans++;
            }
        }
        System.out.println(ans);
        sc.close();

    }
}

Measured memory_bytes: 23124
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
typedef tree<ii,null_type,less<ii>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int A,B,M; cin>>A>>B>>M;
	vector<int> a(A), b(B);
	for (int i=0; i<A; i++)
		cin>>a[i];
	for (int i=0; i<B; i++)
		cin>>b[i];
	int ret=*min_element(a.begin(),a.end())+*min_element(b.begin(),b.end());
	for (int i=0; i<M; i++) {
		int x,y,c; cin>>x>>y>>c; x--; y--;
		ret=min(ret,a[x]+b[y]-c);
	}
	cout<<ret<<"\n";
	return 0;
}

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

using namespace std;

typedef long long ll;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	string S, T;
	cin >> S >> T;
	int ans = 0;

	for (int i = 0; i < S.size(); i++){
		if(S[i] != T[i]){
			ans++;
		}
	}
	
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3824
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <ctime>
#include <queue>

#define rep(x,to) for(x=0;x<to;x++)
#define rep2(x,from,to) for(x=from;x<to;x++)

using namespace std;


int main(void){

int i,j;

	rep2(i,1,10) rep2(j,1,10) 
		cout << i << "x" << j << "=" << i*j << endl;
	return 0;
}

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

int main() {
  vector<int> s={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 
                     1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 
                     2, 2, 5, 4, 1, 4, 1, 51};
  int K;
  cin >> K;
  cout << s.at(K-1) << endl;
}


Measured memory_bytes: 256
a =[list(map(int,input().split())) for i in range(3)]
n =int(input())
b =[int(input()) for i in range(n)]

ac = [[0] * 3 for i in range(3)]


for i in range(3):
  for k in range(3):
    for f in range(len(b)):
        if b[f] == a[i][k]:
            ac[i][k]= 1
 
bingo =0

if ac[0][0]+ac[0][1]+ac[0][2] ==3:
  bingo +=1
if ac[1][0]+ac[1][1]+ac[1][2] ==3:
  bingo +=1
if ac[2][0]+ac[2][1]+ac[2][2] ==3:
  bingo +=1

if ac[0][0]+ac[1][0]+ac[2][0] ==3:
  bingo +=1
if ac[0][1]+ac[1][1]+ac[1][1] ==3:
  bingo +=1
if ac[0][2]+ac[1][2]+ac[2][2] ==3:
  bingo +=1
  
if ac[0][0]+ac[1][1]+ac[2][2] ==3:
  bingo +=1
if ac[2][0]+ac[1][1]+ac[0][2] ==3:
  bingo +=1
  
if bingo >0: print("Yes")
else: print("No")

Measured memory_bytes: 3064
#include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;
#include <cstdio>
#include <tuple>
#include <string>
#include <vector> 
#include <set>
#include <string.h>
#include <map>
#include <cmath>
#include <deque>
using ll = long long;
using Graph = vector<vector<int>>;
#include <queue>
#include <stack>

int main(){
    
    string n;
    cin >> n;
    vector<int> p(n.size());
    bool flag = true;
    for(int i = 0;i < n.size();i++){
        p[i] =n[i] - '0';
        if(i != 0 && n[i] != '9') flag = false;//c99999...ではないとき
    }
    int c = p[0];//最上位桁取得
    int sum = c;
    for(int i=1;i < n.size();i++){
        sum += 9;
    }

    if(flag) cout << sum << endl;
    else cout << sum -1 << endl;

    
    // char a = '1';
    // int aa = (int)(a - '0');
    // cout << aa << endl;


    return 0;
}

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

using namespace std;

int A, B;
vector<int> vi;

int ask(int x, int y) {
    cout << "? " << x << " " << y << endl;
    char ch; cin >> ch;
    return (ch == 'Y');
}

int findhonest() {
    int tmp = B + 1;
    for (int i = 0; i < A + B; i++) {
        if (!vi.size()) {
            vi.push_back(i);
            if (vi.size() >= tmp) break;
            continue;
        }
        if (ask(i, vi.back())) {
            vi.push_back(i);
            if (vi.size() >= tmp) break;
        } else {
            vi.pop_back();
            tmp--;
        }
    }
    return vi[0];
}

int main() {
    cin >> A >> B;
    if (B >= A) {
        cout << "Impossible";
        return 0;
    }
    int honest = findhonest();
    string res = "! ";
    for (int i = 0; i < A + B; i++)
        res += (char)(ask(honest, i) + '0');
    cout << res << endl;
}


Measured memory_bytes: 852
def resolve():
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
    # a, b, c = list(map(int, input().split()))
    # 整数 N 個 (改行区切り)
    N = [int(input()) for i in range(4)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    result = 0
    cntA_max = min(N[3] // 500, N[0])

    for i in range(N[0]+1):
        for j in range(N[1]+1):
            for k in range(N[2]+1):
                if 500 *i + 100 *j + 50 *k == N[3]:
                    result += 1

    print(result)


resolve()

Measured memory_bytes: 38896
#include <stdio.h>
#include <iostream>

using namespace std;

int main() {
	int n;
	int number[12];
	int hantei;
	int count;

	while (cin >> n) {
		if (n == 0) {
			break;
		}
		int counter[100] = {0};
		for (int i = 0; i < n; i++) {
			cin >> number[i];
			counter[number[i]-1]++;
		}
		hantei = 0;
		count = 0;
		while (1) {
			for (int i = 0; i < n; i++) {
				if (number[i] == counter[number[i]-1]) {
					if (i == n-1) {
						hantei = 1;
						break;
					}
					continue;
				} else {
					break;
				}
			}
			if (hantei == 1) {
				break;
			}
			for (int i = 0; i < n; i++) {
				number[i] = counter[number[i]-1];
			}
			for (int i = 0; i < 100; i++) {
				counter[i] = 0;
			}
			for (int i = 0; i < n; i++) {
				counter[number[i]-1]++;
			}
			count++;
		}
		cout << count << endl;
		cout << number[0];
		for (int i = 1; i < n; i++) {
			cout << " " << number[i] ;
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#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 fi first
#define se second
#define mp make_pair
#define itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
#define dame { printf("No\n"); return 0;}
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;
typedef long long llong;
char moji[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char moji2[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char moji3[10]={'0','1','2','3','4','5','6','7','8','9'};
#define Sort(a) sort(a.begin(),a.end());
#define Reverse(a) reverse(a.begin(),a.end());
#define print(a) cout << a << endl;
#define MOD llong(1e9+7)
#define MAX int(2 * 1e5 +5)
#define debug(x)  cout << #x << " = " << (x) << endl;
#define pi acos(-1.0)
#define int llong
#define INF llong(1e17)


signed main(){
    string s;
    cin >> s;
    int maru = 0;
    REP(i,s.length()) if(s[i] == 'o') maru ++;
    maru += 15 - s.length();
    if(maru >= 8) cout << "YES" << endl;
    else cout << "NO" << endl;
}


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

long long n, k;
vector<long long> a;
map<long long, long long> mp;

long long solve();

int main() {
  cin >> n >> k;
  a.resize(n);
  for(int i = 0; i < n; ++i) cin >> a[i];
  cout << solve() << endl;
  return 0;
}

long long solve() {
  long long ans = 0, nowsum = 0, nowcnt = 0, erasesum = 0,
            erasecnt = 0;
  mp[0] = 1;
  for(int i = 0; i < n; ++i) a[i] %= k;
  for(int i = 0; i < n; ++i) {
    if(i + 1 >= k) {
      --mp[erasesum];
      erasesum += a[i - k + 1] - 1 + k;
      erasesum %= k;
    }

    nowsum += a[i] - 1 + k;
    nowsum %= k;
    ans += mp[nowsum % k];
    ++mp[nowsum];
  }
  return ans;
}

Measured memory_bytes: 14336
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
  int n,s;
  while( cin >> n ){
    int sum = 0,ans = 0,a[10000];
    for(int i = 0 ; i < n ; i++){
      cin >> a[i];
    }
    sort(a,a+n);
    for(int i = 0 ; i < n ; i++){
      sum+=a[i];
      ans+=sum;
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 1180
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include <cmath>
#include <math.h>

using namespace std;
const long long INF = (long long) (1e18)+1;

int main() {
  string s, t;
  long double a;
  long double b;
  cin >> a >> b;
  long long ans = floor(a*b);
  cout << ans << endl;
  return 0;
}

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

int main() {
  bool answer = false;
  
  int N;
  cin >> N;
  
  for (int i = 0; i < 9; i++) {
    for (int j = 0; j < 9; j++) {
      if ((i+1) * (j+1) == N) answer = true;
    }
  }
  if (answer) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
def solve():
    sameFlag = False
    N = int(input())
    words = []
    for i in range(N):
        s = input()
        if(s in words):
            sameFlag = True
        words.append(s)
    if(sameFlag):
        print('No')
        return
    current = ''
    for i in range(N):
        if(i != 0):
            if(words[i][0] != current):
                print('No')
                return
        current = words[i][-1]
    print('Yes')

solve()

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/vector.hpp>

using namespace std;
using namespace boost::numeric;

typedef long long ll;
#define FOR(i,n) for(int i=0; i<int(n); i++)
#define FOR1(i,m,n) for(int i=int(m); i<int(n); i++)

const int MOD=1e9+7;
int N, M;
int X;
ublas::matrix<ll> mat1(3,3), mat2(3,3);
ublas::vector<ll> vec(3);
ublas::matrix<ll> accum=ublas::identity_matrix<ll>(3);

ublas::matrix<ll> pow(ublas::matrix<ll> base, int exponent) {
    ublas::matrix<ll> ans;
    if (exponent == 0)
        ans = ublas::identity_matrix<ll>(3);
    else if (exponent % 2 == 1)
        ans = ublas::prod(base, pow(base, exponent-1));
    else {
        ublas::matrix<ll> tmp = pow(base, exponent / 2);
        ans = ublas::prod(tmp, tmp);
    }

    transform(ans.data().begin(), ans.data().end(),
              ans.data().begin(), [](ll x){return x%MOD;});
    return ans;
}

int main(int argc, char *argv[])
{
    int init1[3][3] = {{1,2,1},
                       {0,1,1},
                       {1,2,2}};
    int init2[3][3] = {{1,2,1},
                       {0,1,1},
                       {0,0,1}};
    int init3[3] = {0,0,1};
    ublas::vector<ll> ans;
    
    FOR(i,3) {
        FOR(j,3) {
            mat1(i,j) = init1[i][j];
            mat2(i,j) = init2[i][j];
        }
        vec(i) = init3[i];
    }

    cin >> N >> M;
    int n=0;
    FOR(i,M) {
        cin >> X;
        int exponent = X-n;
        accum = ublas::prod(accum, pow(mat1, exponent));
        accum = ublas::prod(accum, mat2);
        transform(accum.data().begin(), accum.data().end(),
                  accum.data().begin(), [](ll x){return x%MOD;});
        n = X+1;
    }
    accum = ublas::prod(accum, pow(mat1, N-n));
    transform(accum.data().begin(), accum.data().end(),
              accum.data().begin(), [](ll x){return x%MOD;});
    cout << accum(0,2) << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
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; }
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
const ll MOD = 1e9+7;
const ll INF = 1LL << 60;
const vi d8x = {1, 0, -1, 0, 1, -1, -1, 1};
const vi d8y = {0, 1, 0, -1, 1, 1, -1, -1};
const vi d4x = {1, 0, -1, 0};
const vi d4y = {0, 1, 0, -1};

//---------------from here-----------------

int main(){
    int n; cin>>n;
    int cnt=0;
    for(int i=1; i<=n; i++){
        string s=to_string(i);
        if(s.size()%2==1){
            cnt++;
        }
    }
    cout<<cnt<<endl;
}

Measured memory_bytes: 256
#include <functional>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;
const ll MOD = 1000000007LL;
typedef pair <int, int> P;

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

    int n;
    cin >> n;

    vector <P> lr(n);
    for (int i = 0; i < n; i++) {
        int x, l;
        cin >> x >> l;
        lr[i].first = x + l;
        lr[i].second = x - l;
    }

    sort(lr.begin(), lr.end());

    int ans = 0;
    int cur = -MOD;
    for (P p : lr) {
        if (p.second >= cur) {
            ans++;
            cur = p.first;
        }
    }

    cout << ans << "\n";
    return 0;
}

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

int main(){
    ll n;
    cin >> n;
    vector<ll> a(n);
    for(ll i =0; i < n; i++){
        cin >> a[i];
    }
    vector<ll> dp(n, 0);
    dp[1] = abs(a[0] - a[1]);
    for(ll i = 2; i < n; i++){
        dp[i] = min(dp[i - 1] + abs(a[i - 1] - a[i]), dp[i - 2] + abs(a[i - 2] - a[i]));
    }
    cout << dp[n -1] << endl;
}

Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
using namespace std;
typedef long long ll;

int D;

int main(){
    cin>>D;

    string ans="Christmas";
    for(int i=0;i<25-D;i++){
        ans+=" Eve";
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int t;
	while(cin>>t)
	{
		map<int,int> m;
		int k;
		while(t--) cin>>k,m[k]++;
		bool f=1;
		for(auto i=m.begin();i!=m.end();i++)
		{
			if(i->second%2==0) {f=0;break;
			}
		}	
		if(f) cout<<"YES\n";
		else cout<<"NO\n";
	}
}

Measured memory_bytes: 9600
# -*- coding: utf-8 -*-
import sys
import math
from bisect import bisect_left
from bisect import bisect_right
import collections
import copy
import heapq
from collections import defaultdict
from heapq import heappop, heappush
import itertools
input = sys.stdin.readline

##### リストの 二分木検索 #####
# bisect_left(lists, 3)
# bisect_right(lists, 3)

##### プライオリティキュー #####
# heapq.heapify(a) #リストaのheap化
# heapq.heappush(a,x) #heap化されたリストaに要素xを追加
# heapq.heappop(a) #heap化されたリストaから最小値を削除＆その最小値を出力

# heapq.heappush(a, -x) #最大値を取り出す時は、pushする時にマイナスにして入れよう
# heapq.heappop(a) * (-1) #取り出す時は、-1を掛けて取り出すこと

##### タプルリストのソート #####
# sorted(ans) #(a, b) -> 1st : aの昇順, 2nd : bの昇順
# sorted(SP, key=lambda x:(x[0],-x[1])) #(a, b) -> 1st : aの昇順, 2nd : bの降順
# sorted(SP, key=lambda x:(-x[0],x[1])) #(a, b) -> 1st : aの降順, 2nd : bの昇順
# sorted(SP, key=lambda x:(-x[0],-x[1])) #(a, b) -> 1st : aの降順, 2nd : bの降順

# sorted(SP, key=lambda x:(x[1])) #(a, b) -> 1st : bの昇順
# sorted(SP, key=lambda x:(-x[1])) #(a, b) -> 1st : bの降順

def inputInt(): return int(input())
def inputMap(): return map(int, input().split())
def inputList(): return list(map(int, input().split()))

def main():
	SS = list(input())
	SS = SS[:-1]

	S = []
	f = False
	for i, val in enumerate(SS):
		if val == "R" and f == False:
			f = True
			continue
		if val == "R" and f == True:
			S.append("R")
			continue
		if val == "L" and f == False:
			S.append("L")
			continue
		if val == "L" and f == True:
			S.append("")
			f = False
			continue

	ans = []
	tmp = 0
	flg = False
	for i, val in enumerate(S):
		if val == "R":
			tmp += 1
			ans.append(0)
		elif val == "":
			child_L = 1
			child_R = 1
			for j in range(1, tmp+1):
				if j % 2 == 1:
					child_R += 1
				else:
					child_L += 1
			tmp = 0
			ans.append(child_L)
			ans.append(child_R)
		else:
			flg = True
			ans.append(0)

	if flg == False:
		print(*ans)
		sys.exit()

	tmp = 0
	cnt = 0
	for i, val in enumerate(reversed(S)):
		if val == "L":
			tmp += 1
			continue
		elif val == "":
			child_L = 0
			child_R = 0
			for j in range(1, tmp+1):
				#print("{} {}".format(i, len(SS)))
				if j % 2 == 1:
					child_R += 1
				else:
					child_L += 1
			tmp = 0
			#print("{} {} {} {}".format(i, len(SS), child_L, child_R))
			ans[len(SS)-i-1-cnt] += child_L
			ans[len(SS)-i-2-cnt] += child_R
			cnt += 1

	print(*ans)


if __name__ == "__main__":
	main()


Measured memory_bytes: 60264
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <cstring>

/* 
PascalCase  クラス名
camelCase   メソッド名，関数名，変数名
snake_case  ファイル名，名前空間，std のメソッド名，変数名，型名に準じる場合
SNAKE_CASE	マクロ名，static const 定数，列挙体
*/

#define REP(i, n) for (int i = 0; i < (n); i++)
#define FOR(i, init, n) for(int i = init; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define Cout(obj) cout << obj << endl
#define Size(obj) (int)(obj).size()
#define fcout cout << fixed << setprecision(10)
#define fi first
#define se second

using namespace std;
using ll = long long int;
using P = pair<int, int>;
using T = tuple<int, int, int>;
using edge = struct
{
    int to, cost;
};

const int MOD = 1e9 + 7;
const int iINF = 1e9;
const long long int llINF = 1e18;
const double PI = acos(-1.0);

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

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

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

    int x, y;
    cin >> x >> y;

    Cout(x + y - gcd(x, y) + 1);
    return 0;
}


Measured memory_bytes: 3212
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
bool digit[10][7]={
  {1,1,1,0,1,1,1},
  {0,0,1,0,0,1,0},
  {1,0,1,1,1,0,1},
  {1,0,1,1,0,1,1},
  {0,1,1,1,0,1,0},
  {1,1,0,1,0,1,1},
  {1,1,0,1,1,1,1},
  {1,0,1,0,0,1,0},
  {1,1,1,1,1,1,1},
  {1,1,1,1,0,1,1}
};
bool use[14][7];
ll n,k,a,b,cnt1[57],cnt2[43];
int D[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};

bool check(int y){
  if(!(y%400)||((y%100)&&!(y%4)))return true;
  return false;
}

void Cnt1(int y,int m,int d){
  ll c=0,idx=3;
  for(int i=0;i<4;i++){
    for(int j=0;j<7;j++)
      if(digit[y%10][j]&&!use[idx][j])c++;
    y/=10;
    idx--;
  }
  idx=5;
  for(int i=0;i<2;i++){
    for(int j=0;j<7;j++)
      if(digit[m%10][j]&&!use[idx][j])c++;
    m/=10;
    idx--;
  }
  idx=7;
  for(int i=0;i<2;i++){
    for(int j=0;j<7;j++)
      if(digit[d%10][j]&&!use[idx][j])c++;
    d/=10;
    idx--;
  }
  cnt1[c]++;
}

void Cal(){
  int y=0,m=1,d=1;
  while(y<=9999){
    while(m<=12){
      while(d<=D[m]+(m==2&&check(y))){
	Cnt1(y,m,d);
	d++;
      }
      d=1;
      m++;
    }
    m=1;
    y++;
  }
}

void Cnt2(int h,int m,int s){
  ll c=0,idx=9;
  for(int i=0;i<2;i++){
    for(int j=0;j<7;j++)
      if(digit[h%10][j]&&!use[idx][j])c++;
    h/=10;
    idx--;
  }
  idx=11;
  for(int i=0;i<2;i++){
    for(int j=0;j<7;j++)
      if(digit[m%10][j]&&!use[idx][j])c++;
    m/=10;
    idx--;
  }
  idx=13;
  for(int i=0;i<2;i++){
    for(int j=0;j<7;j++)
      if(digit[s%10][j]&&!use[idx][j])c++;
    s/=10;
    idx--;
  }
  cnt2[c]++;
}

void Cal2(){
  int h=0,m=0,s=0;
  while(h<=23){
    while(m<=59){
      while(s<=59){
	Cnt2(h,m,s);
	s++;
      }
      s=0;
      m++;
    }
    m=0;
    h++;
  }
}

int main(){
  cin>>n>>k;
  for(int i=0;i<k;i++){
    cin>>a>>b;
    use[a][b]=1;
  }
  Cal();
  Cal2();
  ll ans=0;
  for(int i=0;i<=56;i++){
    for(int j=0;j<=42;j++)
      if(i+j==n)ans+=cnt1[i]*cnt2[j];
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 3088
#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(i64 i = 0; i < N; i++)
#define Rep(i, k, N) for(i64 i = k; i < N; i++)
#define all(v) v.begin(), v.end()
#define eb emplace_back
#define Cout(s) cout << s << endl
string Yes(bool b) {if(b){return "Yes";} else {return "No";}}
string YES(bool b) {if(b){return "YES";} else {return "NO";}}

std::map<i64,i64> Pfact(i64 N){
    std::map<i64,i64> factor;
    i64 M = N;
    for(i64 i = 2; i*i <= M; i++){
        while(N % i == 0) {
            factor[i]++;
            N /= i;
        }
    }
    if(N != 1) factor[N]++;

    return factor;
}

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

    vector<i64> z;
    for(i64 i = 1; i*i <= N; i++){
        if(N % i == 0) {
            i64 a = i;
            i64 b= N/i;

            auto fact_b = Pfact(b);
            if(fact_b.size() == 1) z.emplace_back(b);

            if(a == 1 || a == b) continue;

            auto fact_a = Pfact(a);
            if(fact_a.size() == 1) z.emplace_back(a);
        }
    }

    sort(all(z));
    i64 ans = 0;
    for(int i = 0; i < z.size(); i++){
        if(N % z[i] == 0){
            N /= z[i];
            ans++;
        }
    }

    cout << ans << endl;
}


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

int main() {
	int W, H, x, y;

	cin >> W >> H >> x >> y;

	double ans = (double)W * H / 2;
	int ans1 = 0;
	if( x * 2 == W && y * 2 == H ) {
		ans1 = 1;
	}

	cout << fixed << setprecision(6) << ans;
	cout << " " << ans1 << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>

using namespace std;
int main(){
    int a;
    string s;
    cin >> a >> s;
    if(a>=3200){
        cout<<s<<endl;
    }else{
        cout<<"red"<<endl;
    }
}

Measured memory_bytes: 256
n = int(input())

z = []
for i in range(n):
  z.append(tuple(map(int,input().split())))

from math import sqrt,factorial
from itertools import permutations

ans = 0

for zz in permutations(z):
  for i in range(n-1):
    ans += sqrt((zz[i][0] - zz[i+1][0]) ** 2 + (zz[i][1] - zz[i+1][1]) ** 2)

print(ans/factorial(n))




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

using namespace std;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define all(vr) vr.begin(),vr.end()
#define pi pair<int,int>

typedef long long ll;
namespace myrand
{
    mt19937 mt(chrono::system_clock::now().time_since_epoch() / chrono::microseconds(1));
    ll Int(ll l,ll r) { return uniform_int_distribution<ll> (l,r)(mt); }
}
using namespace myrand;
auto ss=chrono::system_clock::now();
double remain_time()
{
    auto en=chrono::system_clock::now();
    return (chrono::duration_cast<chrono::nanoseconds>(en-ss).count()*1e-9);
}

int a[15][1005],s[15][1005];
int bitmask[15];
int kqtemp,res,H,W,k;
vector<int> bitt;

int sum(int x,int y,int i,int j)
{
    return (s[x][y] + s[i-1][j-1] - s[i-1][y] - s[x][j-1]);
}
int main()
{
   ios_base::sync_with_stdio(0);
   cin.tie(0);cout.tie(0);
   //freopen("input.txt","r",stdin);
   cin >> H >> W >> k;
   for(int i=1;i<=H;i++){
        string s;
        cin >> s;
        s='@'+s;
        for(int j=1;j<=W;j++) a[i][j] = s[j]-'0';
   }
   res = (H-1) + (W-1);
   bitmask[0] = 1;
   for(int i=1;i<=H+1;i++) bitmask[i] = bitmask[i-1] * 2;
   for(int i=1;i<=H;i++)
    for(int j=1;j<=W;j++)
        s[i][j] = s[i-1][j] + s[i][j-1] - s[i-1][j-1] + a[i][j];
   for(int i=bitmask[H-1]-1;i>=0;i--){
        bitt.clear();
        bitt.push_back(0);
        for(int j=0;j<=H-2;j++){
            if ((i>>j)&1 == 1) bitt.push_back(j+1);
        }
        int j1 = W;
        kqtemp = __builtin_popcount(i);
        bitt.push_back(H);
        while(j1>=1){
            int temp = j1;
            bool flag=true;
            while(temp>=1){
                for(int bit = bitt.size()-2;bit>=0;bit--){
                    if (bitt[bit]==-1) continue;
                    int cucu = sum(bitt[bit+1],j1,bitt[bit]+1,temp);
                    if (sum(bitt[bit+1],j1,bitt[bit]+1,temp)>k){
                        flag=false;
                        break;
                    }
                }
                if (!flag) break; else temp--;
            }
            if (flag==false) kqtemp++;
            if (flag==true && temp<=1){j1=0;break;}
            if (j1==temp && flag==false){
                kqtemp=1000000;
                break;
            }
            j1 = temp;
        }
        res = min(res,kqtemp);
   }
   cout << res << endl;
   return 0;
}


Measured memory_bytes: 512
import java.util.Scanner;

public class Main{
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);

		int n=sc.nextInt();
		int profit=-1000000000;

		int r[]=new int[n];
		r[0] = sc.nextInt();
		int nmin=r[0];

		for(int i=1;i<n;++i){
			r[i]=sc.nextInt();
			profit = Math.max(profit, r[i]-nmin);
			nmin=Math.min(nmin,r[i]);
		}

		System.out.println(profit);
	}

}


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

using namespace std;

int main() {
    string s;
    cin >> s;
    int a = 15 - s.size();
    int cnt = count(s.begin(), s.end(), 'o');

    if (cnt + a >= 8) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
    return 0;
}


Measured memory_bytes: 256