akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;

int main()
{
	int N,Y,x,y,z;
	cin>>N>>Y;
	
	for(x=0;x<=Y/10000;x++)
	  for(y=0;y<=Y/5000;y++)
	  {
	  	z=N-x-y;
	  	if(z>=0&&x*10000+y*5000+z*1000==Y){
	  	cout<< x <<' '<< y <<' '<< z <<endl;
	  	return 0;
	  }                  
	  	}	
	  	
	cout<<"-1 -1 -1"<<endl;
	return 0;
}

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

int main()
{
    ll a[100000+9],n,i,s=0,p=999999999999,j;
    cin>>n;
    for(i=0; i<n; i++)
    {
        cin>>a[i];
    }

    for(i=1; i<=100; i++)
    {
        s=0;
        for(j=0; j<n; j++)
        {
         s+=((a[j]-i)*(a[j]-i));
        }
        //cout<<i<<"  "<<s<<endl;
       p=min(p,s);
    }
cout<<p<<endl;
    return 0;
}


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

int main() {
 int N,K; cin >> N >> K;
  double sum = 0;
 for(int i=1;i<=N;i++){
    double kaku = 1.0/N;
   int now = i;
   while(K > now){
     now *= 2;
     kaku /= 2;
   }
   sum += kaku;
 }
  cout << setprecision(12)<< sum << endl;
}
   
     
     
       
       
       
       
 

Measured memory_bytes: 256
fn main() {
    let v = read_vec::<u32>();
    let n = v[0];
    let r = v[1];

    if n >= 10 {
        println!("{}", r);
    } else {
        println!("{}", r + 100 * (10 - n));
    }
}

#[allow(dead_code)]
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()
}
#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
#[allow(dead_code)]
fn yn(result: bool) {
    if result {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 4352
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdbool.h>
#include <math.h>

int main(void){

    char N[5];

    scanf("%s", N);

    if((N[0] == N[1] && N[1] == N[2]) || (N[1] == N[2] && N[2] == N[3])){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}

Measured memory_bytes: 1664
import java.util.Scanner;
public class Main{
    int high;
	int low;
	int sa;
	
	public void solve(){
		Scanner sc = new Scanner(System.in);
		for(int i=0;i<=6;i++){
			high = sc.nextInt();
			low = sc.nextInt();
			sa = high-low;
			System.out.println(sa);
				
		}
    }
    
    public static void main(String[] args){
        Main obj = new Main();
        obj.solve();
    }
}

Measured memory_bytes: 17332
#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000;
int n, a[maxn + 10], id[maxn + 10], ans;

bool cmp(int x, int y) {
	return a[x] < a[y];
}

int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; ++i) {
		scanf("%d", &a[i]); id[i] = i;
	}
	sort(id + 1, id + n + 1, cmp);
	for (int i = 1; i <= n; i += 2)
		if (id[i] % 2 == 0) ++ans;
	printf("%d", ans);
}


Measured memory_bytes: 1024
package main

import (
  "fmt"
)

func main() {
  var a int
  var b int
  b = 100000
  fmt.Scan(&a)
  for i:= 0; i<a; i++ {
    b *= 105
    b /= 100
    if (b%1000 != 0) {
      b -= b%1000
      b += 1000
    }
  }
  fmt.Println(b)
}


Measured memory_bytes: 1072
#include <iostream>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <vector>
#include <stdio.h>
#include <math.h>
#include <algorithm>
#include <queue>
#include <cmath>
#include <cstdio>
using namespace std;
int main(){
long long a,b;
cin>>a>>b;
if(a==1&&b==1)
cout<<'1';
else
if(a==1)
cout<<b-2;
else
if(b==1)
cout<<a-2;
else
cout<<(a-2)*(b-2);
system("pause");
return 0;
}

Measured memory_bytes: 504
import sys


def main():
    input = sys.stdin.readline
    ryori_list = [int(input()) for _ in range(5)]
    loss_list = [10 - (r % 10) for r in ryori_list if r % 10] or [0]
    print(sum(ryori_list) + sum(loss_list) - max(loss_list))


if __name__ == "__main__":
    main()


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

void insert(int*,int,int);
void initialize(int*,int);
void print(int*,int);

int main(){
  int H;
  int key;
  int i;
  int *A;

  scanf("%d",&H);
  A=(int*)malloc((H*H)*sizeof(int));
  initialize(A,H);
  for(i=1;i<=H;i++){
    scanf("%d",&key);
    insert(A,key,i);
  }

  print(A,H);

  return 0;
}

void initialize(int* A,int h){
  for(int i=0;i<=h*h;i++){
    A[i]=0;
  }
}

void insert(int* A,int key,int i){
  A[i]=key;
}

void print(int* A,int H){
  int i;
  for(i=1;i<=H;i++){
    printf("node %d: key = %d, ",i,A[i]);
    if(A[i/2]!=0) printf("parent key = %d, ",A[i/2]);
    if(A[2*i]!=0) printf("left key = %d, ",A[2*i]);
    if(A[2*i+1]!=0) printf("right key = %d, ",A[2*i+1]);
    
    printf("\n");
  }
}



Measured memory_bytes: 2056
from collections import Counter

n = int(input())
A = list(map(int, input().split()))
q = int(input())

A_dic = Counter(A)
A_sum = sum(A)

for _ in range(q):
    b, c = map(int, input().split())
    tmp = A_dic[b]
    A_dic[c] += tmp
    A_dic[b] = 0
    A_sum += tmp * (c-b)
    print(A_sum)

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

long long N, MOD = 1000000007;
vector<vector<long long> > V;
static long long DP[100000][2] = {};

void DFS(long long P, long long Q) {
	long long W = 1, B = 1;
	for (long long NP : V[P]) {
		if (NP == Q) continue;
		DFS(NP, P);
		W *= DP[NP][0] + DP[NP][1];
		W %= MOD;
		B *= DP[NP][0];
		B %= MOD;
	}
	DP[P][0] = W, DP[P][1] = B;
	return;
}

int main() {
	cin >> N;
	V.resize(N);
	for (int i = 0; i < N - 1; i++) {
		long long A, B;
		cin >> A >> B;
		A--, B--;
		V[A].push_back(B);
		V[B].push_back(A);
	}
	DFS(0, -1);
	cout << (DP[0][0] + DP[0][1]) % MOD << endl;
}

Measured memory_bytes: 14208
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
	ll k,n,x,y,f,mx,dis,i,j;
	scanf("%lld %lld",&k,&n);
	ll d[n];
	for(i=0;i<n;i++)
	{
		scanf("%lld",&d[i]);
	}
	d[n]=d[0]+k;
	mx=-10;
	for(i=1;i<=n;i++)
	{
		dis=d[i]-d[i-1];
		mx=max(mx,dis);
	
	}
	ll min = d[n]-d[0]-mx;
	printf("%lld\n",min);
}

Measured memory_bytes: 1792
n=int(input())
h=list(map(int,input().split()))
flag=False
ans,cnt=0,0

for i in range(max(h)):
  flag=False
  cnt=0
  for j in range(n):
    if h[j]>0 and flag==False:
      flag=True
      cnt+=1
    if h[j]<=0 and flag==True:
      flag=False
  ans+=cnt
  for j in range(n):
    h[j]-=1
print(ans)

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

#include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d", &x)
#define slld(x) scanf("%lld", &x)
#define all(x) x.begin(), x.end()
#define For(i, s, e) for (ll i = s; i < e; i++)
#define Forr(i, s, e) for (ll i = s; i > e; i--)
#define pb push_back
#define ll long long
#define mp make_pair
int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout << fixed << setprecision(8);
    ll n;
    cin >> n;
    ll a[n];
    ll b[n];
    ll c[n];
    For(i, 0, n)
    {
        cin >> a[i] >> b[i] >> c[i];
    }
    ll res[n][3];
    For(i, 0, n)
    {
        res[i][0] = 0;
        res[i][1] = 0;
        res[i][2] = 0;
    }
    res[0][0] = a[0];
    res[0][1] = b[0];
    res[0][2] = c[0];
    For(i, 1, n)
    {
        res[i][0] = max(
            res[i - 1][1] + a[i],
            res[i - 1][2] + a[i]);
        res[i][1] = max(
            res[i - 1][0] + b[i],
            res[i - 1][2] + b[i]);
        res[i][2] = max(
            res[i - 1][1] + c[i],
            res[i - 1][0] + c[i]);
    }
    cout << max(max(res[n - 1][0], res[n - 1][1]), res[n - 1][2]) << endl;
    return 0;
}

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

int c[3][3];
int a[3];
int b[3];
const int INF = 1001001001;
int main(){
  string A,B;
  cin>>A>>B;
  if(A.size()==B.size()){
  if(A>B){cout<<"GREATER"<<endl;}
  else if(A<B){cout<<"LESS"<<endl;}
  else {cout<<"EQUAL"<<endl;}
  }
  else if(A.size()>B.size()){
      cout<<"GREATER"<<endl;
  }
  else{cout<<"LESS"<<endl;}
  return 0;
}

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

int M, N;
char S[2100];
char T[2100];
int dp[2100][2100][2];
char G[3] = "IO";

int main() {
  cin >> M >> N;
  cin >> S;
  cin >> T;
  for (int i=0; i<=M; i++) {
    for (int j=0; j<=N; j++) {
      dp[i][j][1] = -1145141919;
    }
  }

  int ans = 0;
  for (int i=0; i<=M; i++) {
    for (int j=0; j<=N; j++) {
      for (int k=0; k<2; k++) {
        if (i > 0 && S[i-1] == G[k]) {
          dp[i][j][1-k] = max(dp[i][j][1-k], 1 + dp[i-1][j][k]);
        }
        if (j > 0 && T[j-1] == G[k]) {
          dp[i][j][1-k] = max(dp[i][j][1-k], 1 + dp[i][j-1][k]);
        }
        if (k == 0) ans = max(ans, dp[i][j][1-k]);
      }
    }
  }
  cout << ans << "\n";
  return 0;
}

Measured memory_bytes: 35940
import itertools

n = int(input())
ls = [0] + list(map(int, input().split()))
s0 = list(itertools.accumulate(ls))
s1 = list(itertools.accumulate(ls, lambda a, b: a ^ b))
res = 0
left = 0
right = 1
count = 0
while left <= n:
    while left < right - 1:
        a = s0[right] - s0[left]
        b = s1[right] ^ s1[left]
        if a != b:
            left += 1
        else:
            res -= (right - left - 1) * (right - left) // 2
            break
    while right <= n + 1:
        if right == n + 1:
            break
        a = s0[right] - s0[left]
        b = s1[right] ^ s1[left]
        if a == b:
            right += 1
        else:
            break
    res += (right - left - 1) * (right - left) // 2
    if right == n + 1:
        break
print(res)

Measured memory_bytes: 28744
#include<bits/stdc++.h>
using namespace std;
int s[100010];
int cmp[100010];
int cnt[100010];
int n,tot,ans;
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		scanf("%d",&s[i]);
		if(s[i]>100000){ans++;continue;}
		bool f=0;
		for(int j=1;j<=tot;j++)
		{
			if(cmp[j]==s[i])
			{
				cnt[j]--;
				f=1;
			}
		}
		if(!f)cmp[++tot]=s[i],cnt[tot]=s[i]-1;
	}
	for(int i=1;i<=tot;i++)
	{
		if(!cnt[i])continue;
		if(abs(cnt[i])!=cnt[i])
		{
			ans-=cnt[i];
		}
		else ans+=cmp[i]-cnt[i];
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 640
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    n, k = map(int, input().split())

    cnt0 = cntk = 0
    for num in range(1, n + 1):
        if num % k == 0:
            cnt0 += 1
        elif num % k == k // 2:
            cntk += 1

    if k % 2 == 0:
        res = pow(cnt0, 3) + pow(cntk, 3)
    else:
        res = pow(cnt0, 3)
    print(res)


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 9064
using System;
class Program{
    static void Main(string[]args){
        int N=int.Parse(Console.ReadLine());
        int div=0;
        int count=0;
        for(int i=1;i<=N;i++){
            div=divisor(i);
            if(i%2==1 && div==8){
                count++;
            }
        }
        Console.WriteLine(count);
    }
    static int divisor(int N){
        int count=0;
        for(int i=1;i<Math.Sqrt(N);i++){
            if(N%i==0)count=count+2;
        }
        if(N%(Math.Sqrt(N))==0)count++;
        return count;
    }
}

Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a=0;
  int b=0;
  char kigou='x';
  int kotae=0;
  while(kigou!='?'){
    cin >>a>>kigou>>b;
    if(kigou=='+')cout<<a+b<<endl;
    else if(kigou=='-')cout<<a-b<<endl;
    else if(kigou=='*')cout<<a*b<<endl;
    else if(kigou=='/')cout<<a/b<<endl;
  }
  return 0;
}


Measured memory_bytes: 3100
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <algorithm>
#include <math.h>
#include <cassert>
#define rep(i,n) for(int i = 0; i < n; ++i )
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main() {
  ll a,v,b,w,t;
  cin >> a >> v >> b >> w >> t;
  bool ans = a<b ? (a+t*v) >= (b+t*w) : (a-t*v) <= (b-t*w);
  cout << (ans?"YES":"NO") << endl;
}


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

using ll = long long;
using pii = pair<int, int>;

#define vt          vector
#define sz(x)       (int)(x).size()
#define all(x)      (x).begin(), (x).end()
#define rall(x)     (x).rbegin(), (x).rend()
#define fi          first
#define se          second

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

    ll a, b;
    cin >> a >> b;

    ll g = __gcd(a, b);
    int cnt = 1;
    for (int i = 2; (ll)i * i <= g; i++) {
        if (g % i == 0) {
            cnt++;
            while (g % i == 0) g /= i;
        }
    }
    if (g != 1) cnt++;

    cout << cnt;
}


Measured memory_bytes: 3644
#include <iostream>
#include <cmath>
using namespace std;
typedef long long ll;

int main()
{
    int k;
    cin >> k;
    ll a[100002];
    for(int i = 0; i < k; i++) cin >> a[i];
    ll up = pow(2, 55);
    ll mid = up / 2;
    ll copy;
    while(mid){
        copy = up;
        for(int i = 0; i < k; i++){
            copy /= a[i];
            copy *= a[i];
        }
        if(copy > 2) up -= mid;
        else up += mid;
        mid /= 2;
    }
    copy = up;
    for(int i = 0; i < k; i++){
        copy /= a[i];
        copy *= a[i];
    }
    if(copy > 2) up--;
    copy = up;
    for(int i = 0; i < k; i++){
        copy /= a[i];
        copy *= a[i];
    }
    if(copy != 2){
        cout << -1 << endl;
        return 0;
    }
    ll low = pow(2, 55);
    mid = low / 2;
    while(mid){
        copy = low;
        for(int i = 0; i < k; i++){
            copy /= a[i];
            copy *= a[i];
        }
        if(copy >= 2) low -= mid;
        else low += mid;
        mid /= 2;
    }
    copy = low;
    for(int i = 0; i < k; i++){
        copy /= a[i];
        copy *= a[i];
    }
    if(copy < 2) low++;
    cout << low << " ";
    cout << up << endl;
}

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

using namespace std;

#ifdef LOCAL_DEFINE
	#include "DebugUtils.cpp"
#endif

using Long = long long;
using ULong = unsigned long long;
using LD = long double;
using IntPair = pair<int, int>;
using IntVector = vector<int>;


template <class T>              void read(T& x)          { cin >> x; }
template <class T, class... U>  void read(T& t, U&... u) { read(t); read(u...); }
template <class T>              void reada(T* a, int n)  { for (int i = 0; i < n; ++i) read(a[i]); }

template <class T = bool>      bool println()            { return !!(cout << endl); }
template <class T>             bool print(T t)           { return !!(cout << t); }
template <class T>             bool println(T t)         { print(t); return println(); }
template <class T, class... U> bool print(T t, U... u)   { print(t); print(' '); return print(u...); }
template <class T, class... U> bool println(T t, U... u) { print(t); print(' '); return println(u...); }

template <class T, class U>             auto maxx(T t, U u)         -> typename common_type<T, U>::type       { return (t > u) ? t : u; }
template <class T, class U, class... V> auto maxx(T t, U u, V... v) -> typename common_type<T, U, V...>::type { return maxx(maxx(t, u), v...); }
template <class T, class U>             auto minn(T t, U u)         -> typename common_type<T, U>::type       { return (t < u) ? t : u; }
template <class T, class U, class... V> auto minn(T t, U u, V... v) -> typename common_type<T, U, V...>::type { return minn(minn(t, u), v...); }

mt19937 mrand(chrono::steady_clock::now().time_since_epoch().count());
uniform_int_distribution<Long> uid(0L); 
Long randInt(Long x, Long y) { return (uid(mrand) % (y - x + 1)) + x; } // [x, y] inclusive

template <class T> T powi(T x, int y) { T ans = 1; while (y > 0) { if (y & 1) ans *= x; y >>= 1; x *= x; } return ans; }

#ifdef LOCAL_DEFINE
	Long ITR = 1e8; // nil; (for no infinite loop)
#else
	#define tr(x...) 0;
	#define nil 0;
	#define pr(x...) 0;
	#define prl(x...) 0;
	#define pra(x...) 0; // pra(a, n)
	#define pr2d(x...) 0; // pr2d<M, N>(a, -2) or (a, 3, 4)
	#define ts(x...) "";
#endif



namespace Solver {

	const int N = 1e6;
	int zeroes[N], ones[N], dp[N], testCases = 1;
	// int n, v, ans, z, o;
	

	bool solve(int testNumber) {
		LD h, a;
		read(h, a);
		println((Long) ceill(h / a));
		return println();
	}



	void solve() {
		#ifdef LOCAL_DEFINE
			freopen("input.txt", "r", stdin); freopen("output.txt", "w+", stdout); freopen("output.txt", "a", stderr); read(testCases);
		#else
			ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
		#endif
		// read(testCases);
		for (int i = 1; i <= testCases; ++i) solve(i);
	}

};


int main() {
	auto t1 = chrono::high_resolution_clock::now(); Solver::solve(); auto t2 = chrono::high_resolution_clock::now(); chrono::duration<double> t = t2 - t1;
	cerr << "\nTime taken: " << fixed << setprecision(5) << t.count() << "s\n" << endl;
	return 0;
}




Measured memory_bytes: 256
#pragma GCC optimize("O3")
#pragma GCC target("sse4")

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <typeinfo>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T>
using Tree =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define shandom_ruffle random_shuffle

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001;  // check the limits, dummy

typedef long long ll;
const int inf = INT_MAX / 2;
const ll infl = 1LL << 60;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}

template <class T>
void print(const vector<T> v) {
  cout << "[ ";
  F0R(i, v.size()) { cout << v[i] << ' '; }
  cout << "]" << '\n';
}

int mod(int i, int j) {
  return (i % j) < 0 ? (i % j) + 0 + (j < 0 ? -j : j) : (i % j + 0);
}

// --------------------------------------------------------
// This is tool
// --------------------------------------------------------
void Main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int A, B, C, D, N, M, sum, d;
  cin >> A >> B >> C >> D;
  while (B > 0) {
    C = C - B;
    if (C <= 0) {
      cout << "Yes" << endl;
      break;
    }
    A = A - D;
    if (A <= 0) {
      cout << "No" << endl;
      break;
    }
  }
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef priority_queue<string, vector<string>, less<string> > QUE_string;
typedef priority_queue<double, vector<double>, less<double> > QUE_double;
typedef priority_queue<char, vector<char>, less<char> > QUE_char;
typedef priority_queue<int, vector<int>, less<int> > QUE_int;
const int MAX = pow(10, 5)+1;//+1しないとREになる(out of rangeになるんかな?? )

int main(){
  char s;
  cin >> s;
  int ans_int = (int)(unsigned char)s  + 1;
  cout << (char)ans_int << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
        using namespace std;
        #define int long long int
        #define pb push_back
        #define mk make_pair
        #define ft first
        #define sc second
        #define ppb pop_back
        #define sz size
        #define forn(i,a,n) for(i=a;i<n;i++)
        #define M 998244353 
        #define inf 2e18

        signed main() {
 
 
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);
        int n;
        cin>>n;
        map<string,int> mp;

        for(int i=0;i<n;i++){
            string s;
            cin>>s;
            mp[s]++;
        }

        cout<<"AC x "<<mp["AC"]<<"\n";
        cout<<"WA x "<<mp["WA"]<<"\n";
        cout<<"TLE x "<<mp["TLE"]<<"\n";
        cout<<"RE x "<<mp["RE"]<<"\n";

        return 0;
    }


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

int main() {
    ll A, B; cin >> A >> B;
    ll sum = 0;
    if(A <= B){
        sum += B;
        B--;
    }
    else{
        sum += A;
        A--;
    }
    if(A <= B){
        sum += B;
        B--;
    }
    else{
        sum += A;
        A--;
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	final String[] operationName = {"North" , "East" , "South" , "West" , "Right" , "Left"};
	final static int[][] operation = {{3,2,0,1,4,5},{4,5,2,3,1,0},{2,3,1,0,4,5},{5,4,2,3,0,1},{0,1,5,4,2,3},{0,1,4,5,3,2}};
	public int[] dice = null;
	public int sum = 1;
	final int[] fDice = {1 , 6 , 2 , 5 , 3 , 4};//上、下、南、北、東、西
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		Main main = new Main();
		int n = scan.nextInt();
		while(n != 0) {
			for(int i = 0 ; i < n ; i++) {
				main.moveTheDice(scan.next());
			}
			main.print();

			main = new Main();
			n = scan.nextInt();
		}

	}
	Main() {
		dice = fDice;
		sum = 1;
	}
	public void moveTheDice(String doOperation) {
		for(int i = 0 ; i < operationName.length ; i++) {
			if(operationName[i].equals(doOperation)) {
				int newDice[] = new int[6];
				for(int j = 0 ; j < 6 ; j++) {
					newDice[operation[i][j]] = dice[j];
				}
				dice = newDice;
				break;
			}
		}
		sum = sum + dice[0];
	}
	public void print() {
		System.out.println(sum);
	}
}



Measured memory_bytes: 33508
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

int ans[10001];
int main(){
    int n;
    cin>>n;
    int mx=0,cur=1,t;
    FOR(i,2,n+1){
        cout<<"? 1 "<<i<<endl;
        cin>>t;
        if(mx<t) mx=t,cur=i;
    }
    ans[0]=cur;
    FOR(i,1,n+1){
        if(i==cur) continue;
        cout<<"? "<<cur<<" "<<i<<endl;
        cin>>t;
        ans[t]=i;
    }
    cout<<"!";
    rep(i,n)cout<<" "<<ans[i];
    cout<<endl;
    return 0;
}


Measured memory_bytes: 3656
#include<bits/stdc++.h>
using  namespace std;
typedef long long ll;
int bingo[3][3];
int a[11];
int main()
{
    int n;
    int i,j;
    int ans[3][3];
    for(i=0; i<3; i++)
        for(j=0; j<3; j++)
            ans[i][j]=0;
    for(i=0; i<3; i++)
        for(j=0; j<3; j++)
            cin>>bingo[i][j];
    cin>>n;
    for(i=0; i<n; i++)
        cin>>a[i];
    int k=0;
    for(k=0;k<n;k++)
    for(i=0; i<3; i++)
        for(j=0; j<3; j++)
        {
            if(a[k]==bingo[i][j])
                ans[i][j]=1;

        }
    int flag=0;
    if(ans[0][1]+ans[0][2]+ans[0][0]==3)
        flag=1;
    if(ans[1][0]+ans[1][1]+ans[1][2]==3)
        flag=1;
    if(ans[2][0]+ans[2][1]+ans[2][2]==3)
        flag=1;
    for(i=0; i<3; i++)
        if(ans[0][i]+ans[1][i]+ans[2][i]==3)
            flag=1;
    if(ans[0][0]+ans[1][1]+ans[2][2]==3)
        flag=1;
    if(ans[0][2]+ans[1][1]+ans[2][0]==3)
        flag=1;
    if(flag==1)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;

    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
  int a, b, c=0;
  scanf("%d %d \n", &a, &b);
  if(a>b){
    c += a;
    a--;
  }
  else{
    c+=b;
    b--;
  }
  if(a>b) c+=a;
  else c+=b;
  printf("%d \n", c);
}


Measured memory_bytes: 128
/*Whose woods these are I think I know.
His house is in the village though;
He will not see me stopping here
To watch his woods fill up with snow.

My little horse must think it queer
To stop without a farmhouse near
Between the woods and frozen lake
The darkest evening of the year.

He gives his harness bells a shake
To ask if there is some mistake.
The only other sound’s the sweep
Of easy wind and downy flake.

The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep.*/

#include<bits/stdc++.h>
using namespace std;
#define lli long long int
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
const int maxn= 100010;
lli a[maxn];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n=0;lli res=0ll;
    cin>>n;
    for(int i=0;i<n;++i)
        cin>>a[i];
    for(int i=1;(i+1)<=n;++i)
    {
        lli temp=0ll,curr=0ll;
        int l=0,r=n-1;
        if((n-1)%i==0)
        {
            while(l<r)
            {
                curr+=(a[l]+a[r]);
                temp=max(temp,curr);
                l+=i;r-=i;
            }
        }
        else
        {
            while((l+1)<n&&(r>i))
            {
                curr+=(a[l]+a[r]);
                temp=max(temp,curr);
                l+=i;r-=i;
            }
        }
        res=max(res,temp);
    }
    cout<<res<<endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <bitset>
 
#define rep(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define all(v) (v).begin(), (v).end()
#define rev(s) (s).rbegin(), (s).rend()
#define MP make_pair
#define X first
#define Y second
 
using namespace std;
 
typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> vi;

void fin(){
	freopen("test.txt", "r", stdin);
}

const int INF = 1 << 29;

struct state{
	int ticket; // 0 => 未使用 1 => 使用中 2 => 使用済み
	int cost;
	int pos;

	state(int t = 0, int c = 0, int p = 0){
		ticket = t; cost = c; pos = p;
	}

	bool operator<(const state &r) const{
		return cost > r.cost;
	}
};

int main(){
	//fin();
	while(1){
		int n, m;
		cin >> n >> m;
		if(!n) break;
		n++;
		vector<vi> edge(n, vi(n, INF));
		rep(i, m){
			int a, b, c;
			cin >> a >> b >> c;
			edge[a][b] = edge[b][a] = c;
		}

		vector<vi> cost(3, vi(n, INF));

		priority_queue<state> q;
		q.push(state(0, 0, 1));

		while(!q.empty()){
			state s = q.top(); q.pop();

			if(cost[s.ticket][s.pos] <= s.cost) continue;
			cost[s.ticket][s.pos] = s.cost;
			if(s.ticket != 1 && s.pos == n) break;

			rep(i, n){
				if( edge[s.pos][i] == INF) continue;
				state next = s;
				next.pos = i;
				if( s.ticket == 0){
					next.ticket += 1;
					q.push(next);
					next.ticket -= 1;
					next.cost += edge[s.pos][i];
					q.push(next);
				}
				else if( s.ticket == 1){
					next.ticket += 1;
					q.push(next);
				}else{
					next.cost += edge[s.pos][i];
					q.push(next);
				}
			}
		}
		int ans = INF;
		ans = min(cost[0][n-1], cost[2][n-1]);

		cout << ans << endl;
	}

	return 0;
}

Measured memory_bytes: 1276
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>

using namespace std;

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

	long long sum = 0;
	for (int i = 1; i <= N; i++) {
		if (i % 3 == 0 && i % 5 == 0) {
			//cout << "FizzBuzz" << endl;
		}
		else if (i % 3 == 0) {
			//cout << "Fizz" << endl;
		}
		else if (i % 5 == 0) {
			//cout << "Buzz" << endl;
		}
		else {
			sum += i;
		}
	}

	cout << sum << endl;
}






Measured memory_bytes: 3560
// template {{{
#include <bits/stdc++.h>

using namespace std;

#define all(c) (c).begin(), (c).end()
#define sz(c) (static_cast<int>(c.size()))
#define endl "\n"

using ld = long double;
using ll = long long;

inline ll addm(ll __a, ll __b, ll __m);
inline ll subm(ll __a, ll __b, ll __m);
inline ll mulm(ll __a, ll __b, ll __m);
ll powm(ll __a, ll __b, ll __m);
ll inv(ll __x, ll __m);
// }}}

const ll INFL = numeric_limits<ll>::max() / 2;
const ll INF = numeric_limits<int>::max() / 2;
const ll MOD = 1e9+7;

const int N = 17;
const int TPN = 50500500;
int n;
ll a[N][N];
ll dp[TPN];
int p[N];
ll cost[N][(1<<N)];
int bits[N];

void solve()
{
    for (int i = 0; i < TPN; i++)
        dp[i] = -INFL;
    cin >> n;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            cin >> a[i][j];
        }
    }
    for (int i = 0; i < n; i++) for (int g = 0; g < (1<<n); g++) {
        for (int j = 0; j < n; j++) {
            if (g&(1<<j)) cost[i][g] += a[i][j];
        }
    }
    p[0] = 1;
    for (int i = 1; i < N; i++) p[i] = 3*p[i-1];
    int M = p[n];

    int on = 0, nm = 0;
    dp[0] = 0;
    for (int m = 0; m < M; m++) {
        if (nm != m) dp[nm] = max(dp[nm], dp[m]); // convert all 1s to 2s
        for (int i = 0; i < n; i++) {
            int v = bits[i];
            if (v == 0) {
                dp[m+p[i]] = max(dp[m+p[i]], dp[m]+cost[i][on]);
            }
        }
        for (int i = 0; i < n; i++) {
            if (bits[i] == 2) {
                bits[i] = 0;
                nm -= 2*p[i];
            }
            else {
                on ^= (1<<i);
                if (on&(1<<i)) nm += 2*p[i];
                bits[i]++;
                break;
            }
        }
    }
    cout << dp[p[n]-1] << endl;
}

// main {{{
int main()
{
    cin.sync_with_stdio(0); cin.tie(NULL);
    solve();
    return 0;
}

inline ll addm(ll __a, ll __b, ll __m = MOD) {
    return ((__a+__b)%__m);
}
inline ll subm(ll __a, ll __b, ll __m = MOD) {
    return (((__a-__b)%__m+__m)%__m);
}
inline ll mulm(ll __a, ll __b, ll __m = MOD) {
    return ((__a*__b)%__m);
}
ll powm(ll __a, ll __b, ll __m = MOD) {
    ll ret = (!__b) ? 1 : powm(__a, __b/2, __m);
    return (!__b) ? 1 : mulm(mulm(ret, ret, __m), (__b%2) ? __a : 1, __m);
}
ll inv(ll __x, ll __m = MOD) {
    return powm(__x, __m-2, __m);
}
// }}}


Measured memory_bytes: 411264
N, X = map(int, input().split())

# ドーナツ一個あたりのお菓子の元の消費量
m = []
for i in range(N):
    m.append(int(input()))


# m_left = X - (m1 + ... + mN)が、一種類ずつ作った後のお菓子の元の量
m_left = 0
sum = 0
for i in range(N):
    sum += m[i]
    m_left = X - sum

# もっともお菓子の元の消費量が少ないドーナツの消費量を求める
m_min = min(m)
numOfDonuts = 0
while numOfDonuts * m_min <= m_left:
    numOfDonuts += 1

# ドーナツの最大個数を出力
print(N + numOfDonuts - 1)

Measured memory_bytes: 3188
import java.util.Scanner;

public class Main {
	
	Scanner sc = new Scanner(System.in);
	public void run() {
			int n = sc.nextInt();
			sc.nextLine();
			for(int i = 0; i < n; i++){
				calc(sc.nextLine());
			}
	}
	
	public void calc(String line){
		String[] button1 = {".",",","!","?"," "};
		String[] button2 = {"a","b","c"};
		String[] button3 = {"d","e","f"};
		String[] button4 = {"g","h","i"};
		String[] button5 = {"j","k","l"};
		String[] button6 = {"m","n","o"};
		String[] button7 = {"p","q","r","s"};
		String[] button8 = {"t", "u", "v"};
		String[] button9 = {"w","x","y","z"};
		
		String[] input = line.split("0");
		String ans = "";
		for(int i = 0; i < input.length; i++){
			if(input[i].length() > 0){
				String[] button = null;
				if(input[i].charAt(0) == '1') button = button1;
				else if(input[i].charAt(0) == '2') button = button2;
				else if(input[i].charAt(0) == '3') button = button3;
				else if(input[i].charAt(0) == '4') button = button4;
				else if(input[i].charAt(0) == '5') button = button5;
				else if(input[i].charAt(0) == '6') button = button6;
				else if(input[i].charAt(0) == '7') button = button7;
				else if(input[i].charAt(0) == '8') button = button8;
				else if(input[i].charAt(0) == '9') button = button9;
				int num = getNum(input[i].length(), button.length);
				ans = ans + button[num];
			}
		}
		System.out.println(ans);
	}
	public int getNum(int lineleng, int buttonNum){
		if(lineleng > buttonNum){
			return getNum(lineleng-buttonNum, buttonNum);
		}
		else return lineleng-1;
	}

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

Measured memory_bytes: 26644
#include<iostream>
using namespace std;
int main()
{
    int input;
    int digit[4];
    int max, min;
    int base[4]={1000,100,10,1};
    int c=0,i,j,tmp;

    cin >> input;
    while(input != 0)
    {
        if(input % 1111 == 0){
	    cout << "NA" << endl;
	    cin >> input;
	    continue;
        }
	while(input != 6174){
            for(i=0; i<4; i++) // 各桁を取り出す
            {
                digit[i]= input / base[i];
                input = input % base[i]; // Highestを除く
            }
            for(i=0;i<3;i++) // sort
            {
                for(j=i+1;j<4;j++)
                {
                     if(digit[i]<digit[j])
                    {
                        tmp=digit[i];
                        digit[i]=digit[j];
                        digit[j]=tmp;
                    }
                }
            }
	    max = min = 0;
            for(i=0;i<4;i++)
            {
                max += (digit[i]*base[i]);
                min += (digit[i]*base[3-i]);
            }
            input = max-min;
            c++;
	}
	//
        cout << c << endl;
	c = 0;
        cin >> input;
    }
    return 0;
}

Measured memory_bytes: 1160
#pragma gcc optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,r,n) for(ll i=(ll)(r);i<(ll)(n);++i)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
#define pb(n) push_back(n)
#define endl '\n'
#define P(x)  cout << #x << " = " << (x) << endl
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(i, (V).size()) {cout << (V)[i] << endl;}
#define VOUT2(V) REP(i, (V).size()) {cout << (V)[i] << " ";} cout<<endl;
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<pair<ll, ll> > vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;
const long long INF = numeric_limits<ll>::max();
const long long MOD = 1000000007;
const long double PI = 3.1415926;
template <class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
ll n, m, k, ans, sum, count = 0; string s; char c; bool flg;

int main(){
  cin.tie(0);ios::sync_with_stdio(false);
  IN(s);
  ll count = 0;
  FOR(i,2,s.size()-1) {
    if (s[i] == 'C') count++;
  }
  //P(count);
  flg = true;
  if (s[0] == 'A' && count == 1) {
    FOR(i,1,s.size()) {
      if (!(s[i] == 'C' || islower(s[i]))) {
        flg = false;
      }
    }
  } else {
    flg = false;
  }
  if (flg) {
    OUT("AC");
  } else {
    OUT("WA");
  }
}


Measured memory_bytes: 256
/**                                                     **\
 *    created by:   Divianshu Bansal                     *
 *    e-mail id:    god_coder@icloud.com                 *
*                                                        */

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>


using namespace std;
using namespace __gnu_pbds;


typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>new_data_set;
#define MOD 1000000007
#define int long long
#define BIG 998244353
#define pf push_front
#define print(x) for(auto el: x) cout<<el<<" ";cout<<endl
#define bits(x) __builtin_popcount(x)
#define ff first
#define se second
#define pb push_back
#define pii pair<int,int>
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define PSET(x,y) fixed<<setprecision(y)<<x
#define mp make_pair
#define pi 3.141592653589


int power(int x, int y) {
    int r = 1, z = x;
    while (y) {
        if (y & 1)r *= z;
        z *= z; y = y >> 1;
    }
    return r;
}
int powerm(int x, int y, int p) {
    int r = 1;
    while (y) {
        if (y & 1)r = (r * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return r % p;
}
int modinv(int x, int m) {
    return powerm(x, m - 2, m);
}
int logarithm(int a, int b) {
    int x = 0;
    while (a > 1) {
        x++;
        a /= b;
    }
    return x;
}
int max3(int a, int b, int c) {
    return max(a, max(b, c));
}
int min3(int a, int b, int c) {
    return min(a, min(b, c));
}
#define N 2000005
int fact[N];
int inv[N];
int nCr(int n, int r) {
    int ans = fact[n];
    ans *= inv[r];
    ans %= MOD;
    ans *= inv[n - r];
    ans %= MOD;
    return ans;
}
int32_t main() {
    fast;
    fact[0] = 1;
    for (int i = 1; i < N; ++i) {
        fact[i] = fact[i - 1] * i;
        fact[i] %= MOD;
    }
    inv[N - 1] = modinv(fact[N - 1], MOD);
    for (int i = N - 2; i >= 0; i--)
    {
        inv[i] = inv[i + 1] * (i + 1);
        inv[i] %= MOD;
    }
    int k;
    cin >> k;
    string s;
    cin >> s;
    int n = s.length();
    int ans = 0;
    for (int len = n; len <= n + k; len++) {
        int cur = powerm(26, n + k - len, MOD) * powerm(25, len - n, MOD);
        cur %= MOD;
        cur *= nCr(len - 1, n - 1);
        cur %= MOD;
        ans += cur;
        ans %= MOD;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 35512
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define ALL(vec) vec.begin(), vec.end()
#define rALL(vec) vec.rbegin(), vec.rend()
using namespace std;
using ll = long long;
// ------------------------------

int main() {
    ll x;
    cin >> x;
    ll ans = 0;
    ans = (x / 11) * 2;
    x = x % 11;
    if (x > 0) {
        ans += 1;
        x -= 6;
    }
    if (x > 0) {
        ans += 1;
        x -= 5;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define ld long double
#define pb push_back
#define all(x) (x).begin(), (x).end()
template <typename T> using ord_set = tree <T, null_type, less <T>, rb_tree_tag, tree_order_statistics_node_update>;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 1e5 + 123;
int n, m, p[N], used[N], f[N];
vector <int> g[N], vec;

void dfs(int v, int par) {
	used[v] = 1;
	vec.pb(v);
	f[p[v]] = 1;
	for (int to : g[v]) {
		if (used[to]) continue;
		dfs(to, v);
	}
}

int main() {
	ios_base::sync_with_stdio(false), cin.tie(NULL);
	#ifdef LOCAL
		freopen("input.txt", "r", stdin);
	#endif
	
	cin >> n >> m;
	for (int i = 1; i <= n; i++) cin >> p[i];
	while (m--) {
		int x, y;
		cin >> x >> y;
		g[x].pb(y), g[y].pb(x);
	}
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		if (!used[i]) {
			vec.clear();
			dfs(i, i);
			for (int i : vec) if (f[i]) ans++;
			for (int i : vec) f[p[i]] = 0;
		}
	}
	cout << ans;
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define pb push_back
#define pf push_front
#define rep(i, n) for(int i = 0; i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod (ll)(1e9+7)
#define int ll

__attribute__((constructor))
void initial() {
    cin.tie(0);
    ios::sync_with_stdio(false);
}

signed main() {
    int w, a, b;
    cin >> w >> a >> b;
    int ans = abs(a-b) - w;
    if(ans <= 0) cout << 0 << endl;
    else cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
lst = input().split()
A = int(lst[0])
B = int(lst[1])
K = int(lst[2])

if (B - A + 1) <= 2 * K:
   for n in list(range(A, B+1)):
      print(n)
else:
   for n in list(range(A, A+K)):
      print(n)
   for n in list(range(B-K+1, B+1)):
      print(n)

Measured memory_bytes: 9060
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>

#define rep(i,a) for(int i = 0 ; i < a ; i ++)
#define loop(i,a,b) for(int i = a ; i < b ; i ++)
#define vi vector<int>
#define vs vector<string>
#define pii pair<int, int>
#define f first
#define s second
#define pb push_back
using namespace std;

int main(){
  long long x,y, t, tt = 1 , r = 0;

  cin>>x>>y;
  t = y / x;
  while(tt <= t){
    r ++;
    tt *= 2;
  }
  cout<<r<<endl;
}

Measured memory_bytes: 256
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        s: String
    }

    let ans = if s == "RRR" {
        3
    } else if s == "RRS" || s == "SRR" {
        2
    } else if s == "SSS" {
        0
    } else {
        1
    };

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


Measured memory_bytes: 2208
#pragma GCC optimize (2)
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

void file()
{
 	#ifndef ONLINE_JUDGE
	    freopen("data.in", "r", stdin);
	    freopen("data.out", "w", stdout);
	#endif
}

inline int read()
{
    int x=0,f=1;char ch=getchar();
    for (;ch<'0'||ch>'9';ch=getchar()) if (ch=='-') f=-1;
    for (;ch>='0'&&ch<='9';ch=getchar()) x=(x<<1)+(x<<3)+ch-'0';
    return x*f;
}

#define LL long long
const int N = 1005;
const int md = (int)1e9 + 7;
int n, m;
int a[N], b[N];
int mp[N][N], leftpoint = 1;
int used[N][N];
pair<int, int> point[N * N];
int choose, fix;
struct node
{
	int x, y;
	bool operator <(const node &rhs)const
	{
		return min(a[x], b[y]) > min(a[rhs.x], b[rhs.y]);
	}
	int val()
	{
		return min(a[x], b[y]);
	}
	int check()
	{
		return (used[x][y] == 0);
	}
} expand[N * N];
int mark[N * N];
long long ans = 1;
int main()
{
	n=read(); m=read(); 
	for (int i = 1; i <= n; ++i)
	{
		a[i]=read();
		if (mark[a[i]])
			return cout << 0, 0; 
		 point[a[i]].first = i;
		mark[a[i]] = 1;
	} 
	memset(mark, 0, sizeof(mark));
	for (int i = 1; i <= m; ++i)
	{
		b[i]=read(); point[b[i]].second = i;
		if (mark[b[i]])
			return cout << 0, 0;
		mark[b[i]] = 1;
	}
	for (int i = 1; i <= n; ++i)
		for (int j = 1; j <= m; ++j)
			expand[(i - 1) * m + j] = (node){i, j};
	sort(expand + 1, expand + n * m + 1);
	for (int i = n * m; i > 0; --i)
	{
		if (point[i].first > 0 && point[i].second > 0)
		{
			used[point[i].first][point[i].second] = 1;
			--choose;
			continue;
		}
		if (point[i].first > 0)
		{
			int tot = 0;
			int x = point[i].first;
			for (int j = 1; j <= m; ++j)
			if (used[x][j] == 0 && i <= b[j])
				++tot;
			ans = ans * tot % md;
			--choose;
			continue;
		}
		if (point[i].second > 0)
		{
			int tot = 0;
			int y = point[i].second;
			for (int j = 1; j <= n; ++j)
			if (used[j][y] == 0 && i <= a[j])
				++tot;
			ans = ans * tot % md;
			--choose;
			continue;
		}
		while (leftpoint <= n * m && i <= expand[leftpoint].val())
		{
			leftpoint++;
			choose++;
		}
		ans = ans * (choose - fix) % md;
		--choose;
	}
	cout << ans;
	return 0;
}


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

using namespace std;

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15);
  }
} initializer;

int main() {
  int64_t n, a = 2, b = 1;
  cin >> n;
  for (int i = 1; i < n; ++i) {
    b += a;
    a = b - a;
  }
  cout << b << endl;
}



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

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

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int A, B, C;
    cin >> A >> B >> C;
    int X;
    cin >> X;
    int ans = 0;
    rep(i, 0, A + 1) rep(j, 0, B + 1) rep(k, 0, C + 1) {
        if (500 * i + 100 * j + 50 * k == X) { ans++; }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<string>
#include<array>
#include<cmath>
#include<vector>
#include<utility>
#include<algorithm>
#include<ctype.h>
using namespace std;


int main(){
	int n, a[110];
	cin >> n;
	for (int i = 0; i < n;i++) {
		cin >> a[i];
	}
	sort(a,a+n);
	cout << a[n - 1] - a[0] << endl;
}

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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define fill(a,x) memset(a,x,sizeof(a))
#define pb push_back
#define sz(x) (int)x.size()
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const ll mod = 1e9+7;
const int N = 5e5+10;

int main(){
fast;
int a,b,c,d,e;
cin>>a>>b>>c>>d>>e;
if(a==0){
    cout<<1<<endl;
    return 0;
}
if(b==0){
    cout<<2<<endl;
    return 0;
}
if(c==0){
    cout<<3<<endl;
    return 0;
}
if(d==0){
    cout<<4<<endl;
    return 0;
}
if(e==0){
    cout<<5<<endl;
    return 0;
}
return 0;
}

Measured memory_bytes: 3640
#include<stdio.h>
#define MAX 10000
#define NIL -1

struct Node{int p,l,r;};
struct Node T[MAX];
int n;

void preParse(int u){
  if(u==NIL) return;
  printf(" %d",u);
  preParse(T[u].l);
  preParse(T[u].r);
}

void inParse(int u){
  if(u==NIL) return;
  inParse(T[u].l);
  printf(" %d",u);
  inParse(T[u].r);
}

void postParse(int u){
  if(u==NIL) return;
  postParse(T[u].l);
  postParse(T[u].r);
  printf(" %d",u);
}

int main(){
  int i,v,l,r,root;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    T[i].p=NIL;
  }

  for(i=0;i<n;i++){
    scanf("%d%d%d",&v,&l,&r);
    T[v].l=l;
    T[v].r=r;
    if(l!=NIL) T[l].p=v;
    if(r!=NIL) T[r].p=v;
  }

  for(i=0;i<n;i++) if(T[i].p==NIL) root=i;

  printf("Preorder\n");
  preParse(root);
  printf("\n");
  printf("Inorder\n");
  inParse(root);
  printf("\n");
  printf("Postorder\n");
  postParse(root);
  printf("\n");
  return 0;
}

Measured memory_bytes: 620
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
const int INF = 1001001001;
const int MOD = 1000000007;
typedef long long ll;

template<typename T> void print(const T & v);


int main() {
    int X;
    cin >> X;
    int maxi = -1;
    for(int i = 1; i <= sqrt(X); i++){
        for(int j = 0; j < X; j++){
            int num = pow(i, j);
            if(num <= X){
                maxi = max(maxi, num);
                continue;
            }
            break;
        }
    }
    cout << maxi << endl;
    return 0;
}


// Use For Debug
template <typename T>
void print(T const & v){
    for(int i = 0; i < v.size(); i++){
        if(i) cout << " ";
        cout << v[i];
    }
    cout << endl;
}


Measured memory_bytes: 256