akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); ++i)
#define rep0(i,n) for (int i=0; i<=(int)(n); ++i)
#define rep1(i,n) for (int i=1; i<=(int)(n); ++i)
#define rrep(i,n) for (int i=(int)(n)-1; i>=0; --i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using Graph = vector<vi>;
using llGraph = vector<vl>;
using vb = vector<bool>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int MOD = 1e9+7;
const int MOD2 = 998244353;
const double EPS = 1e-9;

template<typename T>
struct is_vector : false_type{};

template<typename T>
struct is_vector<vector<T>> : true_type{};

template<typename T>
ostream &operator << (ostream &ostr, const vector<T> &vec) {
  if (vec.empty()) {
    return ostr;
  }
  ostr << vec.front();
  for (auto itr = ++vec.begin(); itr != vec.end(); ++itr) {
    if (is_vector<T>()) ostr << "\n" << *itr;
    else ostr << ' ' << *itr;
  }
  return ostr;
}

template<typename T>
bool CompareBySecond(pair<T, T> a, pair<T, T> b) {
  if (a.second != b.second) {
    return a.second < b.second;
  } else {
    return a.first < b.first;
  }
}

template<typename T>
bool CompareBySlope(pair<T, T> a, pair<T, T> b) {
// counterclockwise from 12 o'clock direction
  if (a.first * b.first < 0) {
    return a.first < b.first;
  }
  if (a.first == 0) {
    if (a.second >= 0) {
      return true;
    }
    return a.first < b.first;
  }
  if (b.first == 0) {
    if (b.second >= 0) {
      return false;
    }
    return a.first < b.first;
  }
  return a.second * b.first < a.first * b.second;
}

template<typename T>
T GCD(T a, T b) {
  T c = a % b;
  while (c != 0) { a = b; b = c; c = a % b; }
  return b;
}


/* -------- <templates end> -------- */


void solve() {
  ll n; cin >> n;
  ll rt = sqrt(n);
  for (ll i=rt; i>0; --i) {
    if (n%i == 0) {
      cout << i + n/i - 2 << endl;
      return;
    }
  }
}


/* -------- <programs end> -------- */


int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(12);
  solve();
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int N,Y,i,j;
  cin>>N>>Y;
  for(i=0;i<=N;i++){
    for(j=0;j<=N-i;j++){
      if(10000*i+5000*j+1000*(N-i-j)==Y){
        cout<<i<<" "<<j<<" "<<N-i-j<<endl;      
      return 0;
      }
    }
  }
cout<<-1<<" "<<-1<<" "<<-1<<endl;
  
  return 0;
}

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

int main()
{
    int a;
    char buf[30];

    fgets(buf, sizeof(buf), stdin);

    a = atoi(buf);

    int b = a + (a*a) + (a*a*a);

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

Measured memory_bytes: 1696
#include <bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define REPS(i,n) for(int i=1;i<=(int)(n);i++)
using namespace std;
using ll = long long;
using ld = long double;

int main(void) {
    int N;
    cin >> N;
    int A[N] = {};
    REP (i, N-1) {
        int tmp;
        cin >> tmp;
        A[tmp-1]++;
    }
    REP (i, N) {
        cout << A[i] << endl;
    }
}

Measured memory_bytes: 4376
using System;
using System.Collections.Generic;
class Program
{
	static void Main(string[] args)
	{
		string[] str = Console.ReadLine().Split();
		long T1 = long.Parse(str[0]);
		long T2 = long.Parse(str[1]);
		string[] str2 = Console.ReadLine().Split();
		long A1 = long.Parse(str2[0]);
		long A2 = long.Parse(str2[1]);
		string[] str3 = Console.ReadLine().Split();
		long B1 = long.Parse(str3[0]);
		long B2 = long.Parse(str3[1]);
		long ans = 0;
		if(A1*T1+A2*T2==B1*T1+B2*T2){
			Console.WriteLine("infinity");
		} else {
			if(A1*T1>B1*T1 && A1*T1+A2*T2>B1*T1+B2*T2){
				Console.WriteLine(0);
			} else if(A1*T1<B1*T1 && A1*T1+A2*T2<B1*T1+B2*T2){
				Console.WriteLine(0);
			} else {
				long L1 = Math.Abs(A1*T1-B1*T1);
				long L2 = Math.Abs((A1*T1+A2*T2)-(B1*T1+B2*T2));
				ans = L1/L2 * 2 + 1;
				if(L1%L2==0){
					ans -= 1;
				}
				Console.WriteLine(ans);
			}
		}
	}
}

Measured memory_bytes: 11092
def main():
    a,b,c = map(int,input().split())
    k = int(input())

    cnt = 0
    while b<=a:
        b=b*2
        cnt +=1
    while c<=b:
        c=c*2
        cnt += 1
    if cnt>k:
        print('No')
    else:
        print('Yes')
        

if __name__ == "__main__":
    main()


Measured memory_bytes: 9168
#include<bits/stdc++.h>
# define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
# define CS
using namespace std;
int main(){
    speed;
    int a,b,c;
    cin >> a >> b >> c;
    int vol = a;
    if (c > a){
        cout << b+(c-a);
    }else{
        vol -= c;
        if (b > vol){
            cout << b-vol;
        }else{
            cout << 0;
        }
    }
}






Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long int64;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long  INFL = 1e18;
const int MOD = 1000000007;
const int MAX = 210000;
const int MAX_NUM = 999999999;
vector<pair<int64, int64>> prime_factorize(int64 N) {
	vector<pair<int64, int64>> res;
	for (int64 a = 2; a * a <= N; ++a) {
		if (N % a != 0) continue;
		int64 ex = 0;
		while(N % a == 0) {
			++ex;
			N /= a;
		}
		res.push_back({a, ex});
	}
	if (N != 1) res.push_back({N, 1});
	return res;
}
void solve() {
	int N; cin >> N;
	int ans = 0;
	for (int i = 1; i <= N; i+=2) {
		vector<pair<int64, int64>> ret_pair = prime_factorize(i);
		int64 tmp = 1;
		for (auto p: ret_pair) {
			tmp *= p.second + 1;
		}
		if (tmp == 8) ans++;
	}
	cout << ans << endl;
	return;
}
int main() {
	solve();
	return 0;
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define rep(i,n) for(int i=0, i##_len=(int)(n); i<i##_len; i++)
#define reps(i,n) for(int i=1 , i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=((int)(n)-1);i>=0;i--)
#define rreps(i,n) for(int i=((int)(n));i>0;i--)
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define solve(a) ((a)?"Yes":"No")
typedef vector<long long> V;
typedef vector<V> VV;
typedef pair<long long , long long> P;
typedef vector<P> VP;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
const long long INFLL = 1LL<<62;
const int INF = 1<<30;
const double PI=acos(-1);
int main(){
	ll n,a,b,c,d,e;
	ll ans=0;
	cin >>n>>a>>b>>c>>d>>e;
	vector<ll>time(5,0LL);
	time[0]=(n+a-1)/a;
	time[1]=(n+b-1)/b;
	time[2] = (n + c - 1 )/ c;
	time[3] = (n + d - 1 )/ d;
	time[4] = (n + e - 1) / e;
	rep(i,5){
		chmax(ans,time[i]+4);
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int K = sc.nextInt();
		boolean[] res = new boolean[N];
		for (int i = 0; i < K; i++) {
			int d = sc.nextInt();
			for (int j = 0; j < d; j++) {
				int tmp = sc.nextInt();
				res[tmp - 1] = true;
			}

		}
		int output = 0;
		for (int i = 0; i < res.length; i++) {
			if (!res[i]) {
				output++;
			}
		}
		System.out.println(output);
	}
}

Measured memory_bytes: 46396
// ???????¬¬???????????±????????????????????¬???????????? IOIOI
// PCPCP
#include <iostream>
#include <string>
using namespace std;

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

	int n, m;
	//cin >> n >> m;
	while (cin >> n && n != 0){
		cin >> m;

		string str;
		cin >> str;

		size_t i = 0;
		int cnt = 0;
		int ans = 0;
		while (i < str.size()){
			//if (str[i] == 'P' && str[i + 1] == 'C' && str[i + 2] == 'P'){
			//cout << i << " ";
			if (str[i] == 'I'){
				cnt++;
				if (cnt >= n + 1)
					ans++;

				if (str[i + 1] != 'I')
					i += 2;
				else cnt = 0, ++i;
			}
			else
				cnt = 0, ++i;
			//cout << ans << endl;
		}
		cout << ans << endl;
	}
	return 0;
}

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

vector<int> s;
int min_turn(int x) {
    int level = 1;
    int strongest = s[s.size()-1];
    int count = 1;

    while (level + x <= strongest) {
        int flag = true;
        int pos = lower_bound(s.begin(), s.end(), level) - s.begin();
        int diff = 1;
        if (pos != 0 && level + x > s[pos - 1]) {
            diff = max(diff, x-abs(level-s[pos - 1]));
            flag = false;
        }
        if (level + x > s[pos]) {
            diff = max(diff, x-abs(level-s[pos]));
            flag = false;
        }
        if (flag) {
            return 1e9;
        }
        level += diff;
        count++;
        //cout << "level, pos " << level << " " << pos << endl;
    }
    return count;
}

int main() {
    int N, M;
    while(cin >> N >> M, N+M) {
        s = vector<int>(N);
        int high = -1e9, low = 1;
        for (int i = 0; i < N; i++) {
            cin >> s[i];
            high = max(high, s[i]);
        }

        int turn = -1;
        while (low + 1 < high) {
            int mid = (high + low) / 2;

            // cout << "# " << low << " " << high << " " << mid;
            turn = min_turn(mid);
            if (turn < M) {
                high = mid;
            } else {
                low = mid;
            }
            // cout << " " << turn << endl;
        }
        turn = min_turn(low);
        //cout << "turn, mid " << turn << " " << high << endl;
        if (turn < M || turn > 1e7) {
            cout << -1 << endl;
        } else {
            cout << low << endl;
        }
    }
}


Measured memory_bytes: 3656
using System;

public class Program
{
    private long N;

    public void Solve()
    {
        var sc = new Scanner();
        Console.WriteLine(6 - sc.NextInt() - sc.NextInt());
    }

    public static void Main(string[] args)
    {
        new Program().Solve();
    }
}

class Scanner
{
    public Scanner()
    {
        _pos = 0;
        _line = new string[0];
    }

    const char Separator = ' ';
    private int _pos;
    private string[] _line;

    #region スペース区切りで取得

    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = Console.ReadLine().Split(Separator);
            _pos = 0;
        }

        return _line[_pos++];
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public double NextDouble()
    {
        return double.Parse(Next());
    }

    #endregion

    #region 型変換

    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }

        return result;
    }

    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }

        return result;
    }

    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }

        return result;
    }

    #endregion

    #region 配列取得

    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = Console.ReadLine().Split(Separator);

        _pos = _line.Length;
        return _line;
    }

    public int[] IntArray()
    {
        return ToIntArray(Array());
    }

    public long[] LongArray()
    {
        return ToLongArray(Array());
    }

    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }

    #endregion
}

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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { std::cout << #a << " = " << a << "\n"; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T, class V> istream& operator>> (istream& ist, pair<T, V>& p) { return ist >> p.first >> p.second; }
template<class T> ostream& operator<< (ostream& ost, pair<T, T>& p) { return ost << p.first << ", " << p.second; }
template<class T> istream& operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) ist >> e; return ist; }

typedef long long ll;
int const inf = INT_MAX / 2;

ll MOD = 2019;

int main() {
  string s; cin >> s;
  const int N = s.size();
  reverse(s.begin(), s.end());
  vector<int> S(N), T(N + 1);
  int ten = 1;
  rep(i, N) S[i] = (s[i] - '0') * ten % MOD, (ten *= 10) %= MOD;
  rep(i, N) T[i + 1] = (T[i] + S[i]) % MOD;
  ll m[2019] = {};
  rep(i, N + 1) {
    m[T[i]]++;
  }
  ll ans = 0;
  rep(i, 2019) {
    ans += m[i] * (m[i] - 1) / 2;
  }
  cout << ans << endl;
}


Measured memory_bytes: 5200
#include <bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(false); cin.tie(NULL);

#define endl '\n'
#define D(x) cout << #x << " = " << (x) << endl;

int main() { IO;
  string c;
  cin >> c;

  map<string, string> m = {{"A", "T"}, {"T", "A"}, {"C", "G"}, {"G", "C"}};
  cout << m[c] << endl;

  return 0;
}


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

#define repo(i,n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;

int main(){


    ll H,W;
    cin >> H >> W;

    ll ans = 0;
    
    if(H == 1 || W == 1){
        cout << 1 << endl;
        return 0;
    }



    ll w = W/2;
    ll w1 = 0;
    if(W%2 == 1){
        w1 = w + 1;
    }else {
        w1 = w;
    }



    ll h = H/2;
    ll h1 = 0;
    if (H % 2 == 1){
    h1 = h +1;
    }else{
        h1 = h;

    }

    ans = h1 * w1;
    ans += h * w;
    cout << ans << endl;

//    if(H == 1 && W== 1){
//        ans = 1;
//        cout << ans << endl;
//        return 0;
//    } 
//
//    if(H == 1 && W%2 == 0){
//        cout << W/2 << endl;
//        return 0;
//    }
//
//    if(H == 1 && W%2 == 1){
//        ll w = W/2;
//        w++;
//        cout << w << endl;
//        return 0;
//    }
//
//     if(H%2 == 0 && W == 1){
//         ll h = W/2;
//         cout << h << endl;
//         return 0;
//
//
//     }   
//     if(H%2 == 1 && W == 1){
//         ll h = H/2;
//         h++;
//         cout << h << endl;
//     }
//     if(H % 2 == 0 ){
//         ans = W * H/2;
//         cout << ans << endl;
//          return 0;
//     }
//
//
//     if(H%2 == 1&& W%2 == 0){
//         ll h = H/2;
//         ans = W/2 * h;
//         ans += W/2 * (h-1);
//         cout << ans << endl;
//         return 0;
//     }
//
//
//     if(H%2 == 1&& W%2 == 1){
//         ll h = H/2;
//         h++;
//         ll w = W/2;
//         w++;
//         ans = w * h;
//         ans += (w-1)*(h-1);
//         cout << ans << endl;
//     }
        return 0;
}




Measured memory_bytes: 256
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>

using namespace std;

int main() {
  string s;
  map<char, bool> mp;
  cin >> s;
  for (int i = 0; i < s.size(); i++)
    mp[s[i]] = true;
  if (mp['a'] && mp['b'] && mp['c'])
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;


public class Main {
    int X;
    private void solve() {
        X = nextInt();

        if (X == 3 || X == 5 || X == 7) {
            out.println("YES");
        } else {
            out.println("NO");
        }
    }

    public static void main(String[] args) {
        out.flush();
        new Main().solve();
        out.close();
    }

    /* Input */
    private static final InputStream in = System.in;
    private static final PrintWriter out = new PrintWriter(System.out);
    private final byte[] buffer = new byte[4096];
    private int p = 0;
    private int buflen = 0;

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

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

    private boolean isPrint(int ch) {
        if (ch >= '!' && ch <= '~')
            return true;
        return false;
    }

    private int nextByte() {
        if (!hasNextByte())
            return -1;
        return buffer[p++];
    }

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

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

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


Measured memory_bytes: 22356
#include <stdio.h>

int main(void){
	int a,b;
	do{
		scanf("%d %d",&a,&b);
	}while(a<1 || a>1000000000 || b<1 || b>1000000000);

	printf("%d ",a/b);
	printf("%d ",a%b);
	printf("%f\n",(double)a/(double)b);
	return 0;
}

Measured memory_bytes: 632
s = input()
W = 0
B = 0
for i in range(len(s)):
  if i%2==0 and s[i]=="0":
    W +=1
  if i%2!=0 and s[i]!="0":
    W +=1

for i in range(len(s)):
  if i%2==0 and s[i]=="1":
    B +=1
  if i%2!=0 and s[i]!="1":
    B +=1
    
print(min(W,B))

  

Measured memory_bytes: 3188
#include <stdio.h>
#define NOT_FOUND -1
int array1[100000],array2[50000],num1;
int binary_search(int);

int main(){

  int i,num2,count=0;
  
  scanf("%d",&num1);

  for(i=0;i<num1;i++){
    scanf("%d",&array1[i]);
  }
  
  scanf("%d",&num2);

  for(i=0;i<num2;i++){
    scanf("%d",&array2[i]);
  }
   for(i=0;i<num2;i++){
    if(binary_search(array2[i])==NOT_FOUND);
    else count++;
  }
  
    printf("%d\n",count);
  
  return 0;
}

int binary_search(int key){

  int left=0;
  int right=num1;
  while(left<right){
   int  mid=(left+right)/2;
    if(array1[mid]==key){
      return mid;
    }
    else if(key<array1[mid]){
      right=mid;
    }
      else{
	left = mid +1;
      }
  }
      return NOT_FOUND;
}



Measured memory_bytes: 2348
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define CHAL_BC_APNE_BAAP_KO_MAT_SIKHA ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb push_back
#define fr first
#define se second
signed main()
{
	CHAL_BC_APNE_BAAP_KO_MAT_SIKHA;		
	int l,r;
	cin>>l>>r;
	if(r-l+1>=2019){
		cout<<0<<endl;
	}
	else{
		l=l%2019;
		int mn=INT_MAX;
		r=r%2019;
		if(r<l){
			cout<<0<<endl;
			return 0;
		}
		for(int i=l;i<=r;i++){
			for(int j=i+1;j<=r;j++)
				mn=min(mn,(i*j)%2019);
		}
		cout<<mn<<endl;
	}
}


Measured memory_bytes: 256
// Contest: AtCoder Beginner Contest 153 (https://atcoder.jp/contests/abc153)
// Problem: A: Serval vs Monster (https://atcoder.jp/contests/abc153/tasks/abc153_a)


// region {{{ boilerplate
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdint>
#include <deque>
#include <exception>
#include <forward_list>
#include <functional>
#include <initializer_list>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#if __cplusplus >= 201703L
#   include <optional>
#   include <string_view>
#   include <variant>
#endif

using namespace std;

#if __cpp_lib_nonmember_container_access >= 201411
#   define sz(x) ((int)size(x))
#else
#   define sz(x) ((int)(x).size())
#endif

#define rep(a, b)      for(int a = 0; a < (b); ++a)
#define reps(a, b, c)  for(int a = (b); a < (c); ++a)
#define all(a)         (a).begin(),(a).end()
#define trav(a, b)     for(auto& a : b)

using ll = long long;
using ld = long double;
using u64 = uint64_t;
using u32 = uint32_t;

using pi = pair<int, int>;
using pl = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vpi = vector<pi>;

#if __has_cpp_attribute(maybe_unused) >= 201603
#   define MAYBE_UNUSED [[maybe_unused]]
#else
#   define MAYBE_UNUSED
#endif

MAYBE_UNUSED static constexpr int INF = (int)1e9;
MAYBE_UNUSED static constexpr ll INFL = (ll)1e18;
//endregion }}}

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

    int h, a; cin >> h >> a;
    cout << ((h + a - 1) / a) << '\n';

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>

using namespace std;
typedef long long lint;

const lint mod = 1e9+7;
const int maxn = 2e5+5;
lint n, a, b;
lint fact[maxn];

lint pw(lint a, lint b) {
    if(b == 0) { return 1; }
    if(b == 1) { return a; }
    lint half = pw(a, b / 2);
    if(b % 2 == 0) { return (half * half) % mod; }
    else { return (((half * half) % mod) * a) % mod; }
}

lint im(lint a) {
    return pw(a, mod - 2);
}

lint sum(lint n, lint k) {
    lint ans = 1;
    for(lint i = n; i >= n - k + 1; i --) {
        ans *= i; ans %= mod;
    }
    return ans;
}

lint comb(lint n, lint k) {
    return (((sum(n, k) * im(fact[k])) % mod)) % mod;
}

lint query(lint a, lint b) {
    lint n, k, ans = 1;
    while(a > 0) {
        n = a % mod; k = b % mod;
        if(k > n) { return 0; }
        ans *= comb(n, k); ans %= mod;
        a /= mod; b /= mod;
    }
    return ans;
}

lint md(lint x) {
    x %= mod;
    if(x < 0) {
        x += mod;
    }
    return x;
}

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

    cin >> n >> a >> b;

    fact[0] = 1;
    lint mxa = max(a, b);
    for(int i = 1; i <= mxa + 2; i ++) {
        fact[i] = fact[i-1] * i;
        fact[i] %= mod;
    }

    cout << md(pw(2, n) - 1 - query(n, a) - query(n, b)) << '\n';

    return 0;
}


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

int ans = 0x3f3f3f3f;

int dsum(int x){
	int ans = 0;
	for(;x;) ans += x % 10,x /= 10;
	return ans;
}

int main(){
	int n;
	scanf("%d",&n);
	for(int a = 1;a < n;a++){
		int b = n - a;
		ans = min(ans,dsum(a) + dsum(b));
	}
	printf("%d",ans);
} 

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

int main()
{
    int n,q1;
    cin>>n>>q1;
    vector<vector<int> > vec(n);
    for(int i=0;i<n-1;i++)
    {
        int a,b;
        cin>>a>>b;
        --a;--b;
        vec[a].push_back(b);
        vec[b].push_back(a);

    }
   /* for(int i=0;i<vec.size();i++)
    {
        cout<<i<<endl;
        for(int j=0;j<vec[i].size();j++)
        {
           cout<<vec[i][j]<<" ";
        }
        cout<<endl;
    }*/
    vector<int> qq(n,0);
    for(int i=0;i<q1;i++)
    {
       int p,q;
       cin>>p>>q;
       qq[--p]+=q;
    }
    /*for(int i=0;i<qq.size();i++)
    {
        cout<<qq[i]<<" ";
    }*/
    //cout<<endl;
    vector<bool>visited(n,false);
    vector<int>ans(n,0);
    queue<int>q;
    q.push(0);
    while(!q.empty())
    {
        int u= q.front();
        q.pop();

        ans[u]+=qq[u];
        for(int i=0;i<vec[u].size();i++)
        {
           if(visited[vec[u][i]]==false)
           {
              // cout<<u<<" hmm "<<endl;

               q.push(vec[u][i]);
               ans[vec[u][i]]+=ans[u];
               //cout<<"bal"<<endl;
           }
        }
        visited[u]=true;
    }
    for(int i=0;i<n-1;i++)
    {
        cout<<ans[i]<<" ";
    }
    cout<<ans[n-1]<<endl;
}


Measured memory_bytes: 16372
#include <bits/stdc++.h>
#define N 100020
#define ll long long
using namespace std;
inline ll read(){
  ll x=0,f=1;char ch=getchar();
  while(ch>'9'||ch<'0')ch=='-'&&(f=0)||(ch=getchar());
  while(ch<='9'&&ch>='0')x=(x<<3)+(x<<1)+ch-'0',ch=getchar();
  return f?x:-x;
}
map<ll, int> cnt, vis;
ll a[N], cub[N];
const ll MAX_CUB = 2154;
bool mark[MAX_CUB + 20];
int prime[MAX_CUB + 20], tot;
void filter_prime(int size) {
  for (int i = 2; i <= size; ++ i) {
    if (!mark[i]) prime[++ tot] = i;
    for (int j = 1; j <= size && prime[j] * i <= size; ++ j) {
      mark[prime[j] * i] = 1;
      if (i % prime[j] == 0) {
        break;
      }
    }
  }
}
bool isSquare(ll x) {
  for (ll i = 1; i * i <= x; ++ i) {
    if (i * i == x) {
      return true;
    }
  }
  return false;
}
ll calc(ll x) {
  ll rev = 1;
  for (int i = 1; i <= tot; ++ i) {
    int c = 0;
    while (x % prime[i] == 0) {
      x /= prime[i];
      ++ c;
    }
    if (c) {
      for (; c < 3; ++ c) {
        rev *= prime[i];
      }
    }
  }
  // 此时 x 要么是质数，要么是平方数
  if (isSquare(x)) {
    rev *= sqrt(x);
  } else {
    rev *= x * x;
  }
  return rev;
}
int main(int argc, char const *argv[]) {
  // freopen("../../temp/test.in", "r", stdin);
  filter_prime(MAX_CUB);
  int n = read();
  for (int i = 2; i <= MAX_CUB; ++ i) {
    cub[i] = (ll) i * i * i;
  }
  for (int i = 1; i <= n; ++ i) {
    a[i] = read();
    for (int j = 2; j <= MAX_CUB; ++ j) {
      while (a[i] % cub[j] == 0) {
        a[i] /= cub[j];
      }
    }
    ++ cnt[a[i]];
  }
  cnt[1] = min(cnt[1], 1);
  int ans = 0;
  for (int i = 1; i <= n; ++ i) {
    if (vis[a[i]]) {
      continue;
    }
    vis[a[i]] = 1;
    ll rev = calc(a[i]);
    vis[rev] = 1;
    ans += max(cnt[a[i]], cnt[rev]);
  }
  printf("%d\n", ans);
  return 0;
}
/*

首先发现将每个数的立方因子筛去对答案不会有影响。

于是对每个数使其质因子的指数都 mod 3

可以发现能与每个数相乘是立方数的数只有 1 个，这里定义其为该数的补数。

对于每个数和它的补数，将出现次数较多的计入答案。

只需要考虑如何计算补数即可。

*/

Measured memory_bytes: 26112
#include <stdio.h>
int main(void){
    int N;
    int A;
    int B;

    1<=N<=20;
    1<=A<=50;
    1<=B<=50;

    scanf("%d %d %d",&N,&A,&B);
  
    if(A * N <= B){
        printf("%d",A * N);
    }else{
        printf("%d",B);
    }
    return 0;
}

Measured memory_bytes: 128
A = list(map(str, input().split()))
B = []

for A_sub in A:
    if A_sub in ['+', '-', '*']:
        b = int(B.pop())
        a = int(B.pop())
        if A_sub == '+':
            B.append(a+b)
        elif A_sub == '-':
            B.append(a-b)
        elif A_sub == '*':
            B.append(a*b)
    else:
        B.append(A_sub)

print(B[0])


Measured memory_bytes: 5600
#include<iostream>
#include<stdio.h>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
#include<map>
#pragma warning(disable: 4996)
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;


int main() {

	ll A, B, K;

	cin >> A >> B >> K;

	if (A >= K) {
		A -= K;
		cout << A << ' ' << B << endl;
		return 0;
	}
	else if (A < K) {
		K -= A;
		A = 0;
		if (B >= K) {
			B -= K;
			cout << A << ' ' << B << endl;
			return 0;
		}
		else if (K > B) {
			cout << 0 << ' ' << 0 << endl;
		}
	}

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#define ll long long
#define N 210000
#define md 1000000007
using namespace std;
int read()
{
	int x=0;char ch=getchar();
	while (ch<'0'||ch>'9') ch=getchar();
	while (ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
	return x;
}
ll dp[N],sum;
int ex[N],cnt,q[N],size,l[N],r[N],n,m,tmp,i,head,tail;
struct node {int v,x;}a[N];
bool cmp(node x,node y){return x.x<y.x;}
void init()
{
	sort(ex+1,ex+1+cnt);size=unique(ex+1,ex+1+cnt)-ex-1;
	for (ll i=1;i<=n;i++) l[i]=upper_bound(ex+1,ex+1+size,l[i])-ex-1,r[i]=upper_bound(ex+1,ex+1+size,r[i])-ex-1;
}
int main()
{
	scanf("%d",&n);
	for (i=1;i<=n;i++)a[i].x=read(),a[i].v=read();
	sort(a+1,a+1+n,cmp);
	for (i=1;i<=n;i++) tmp=max(tmp,a[i].v),r[i]=tmp;
	tmp=2000000000;for (i=n;i>=1;i--) tmp=min(tmp,a[i].v),l[i]=tmp;
	for (i=1;i<=n;i++) ex[++cnt]=a[i].v;
	init();
	dp[0]=1;n++;l[n]=r[n]=n;
	q[++tail]=0;sum=1;
	for (i=1;i<=n;i++) 
	{
		while (head!=tail&&r[q[head+1]]<l[i]-1) sum=(sum-dp[q[head+1]]+md)%md,head++;
		dp[i]=sum;sum=(sum+dp[i])%md;
		q[++tail]=i;
	}
	printf("%lld\n",dp[n]%md);
}

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

int main(void){
	ll a,b,x;
	cin >> a >> b >> x;
	b/=x,a=(a+x-1)/x;
	cout << b-a+1 << endl;
	return 0;
}

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

int main()
{
	int n, m, l;
	int i, j, k;
	int A[100][100],  B[100][100]; 
	long C[100][100]={0};
	
	cin >> n >> m >> l;
	
	for(i = 0; i < n; i++){
		for(j = 0; j < m; j++){
			cin >> A[i][j];
		}
	}
	
	for(i = 0; i < m ; i++){
		for(j = 0; j < l ; j++){
			cin >> B[i][j];
		}
	}

	for(i = 0; i < n; i++){
		for(j = 0; j < l; j++){
			for(k = 0; k < m; k++){
				C[i][j] += A[i][k] * B[k][j];
			}
		}
	}
	
	for(i = 0; i < n ; i++){
		for(j = 0; j < l ; j++){
			cout << C[i][j];
			if(j != l - 1){
				cout << " "; 
			}
		}
		cout << endl;
	}
	
	return 0;
}

Measured memory_bytes: 3216
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
constexpr int INF = 1001001001;
constexpr int MOD = 1000000007;

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

  int n;
  cin >> n;

  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if(i % 2 == 0) continue;

    int cnt = 0;
    for (int d = 1; d <= i; d++) {
      if (i % d == 0) {
        cnt++;
      }
    }

    if (cnt == 8) {
      ans++;
    }
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
    using namespace std ;
    int main(){
        int a;
        cin>>a;
        if(a<1200){
            cout<<"ABC"<<endl;
            return 0;
        }
        if(a<2800){
            cout<<"ARC"<<endl;
            return 0;
        }
        if(a>=2800)cout<<"AGC"<<endl;
        return 0 ;
    }

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <queue>
#include <vector>
using namespace std;
#define INF 1000000000
int n,m;
int G[50][50];
int res[50][50];
double memo[50][50][50]; //????????????????????????????????????
 
struct node{
  int s,g,v;
  node(int s=0,int g=0,int v=0):s(s),g(g),v(v){}
};
 
bool operator < (node a,node b){
  return memo[a.s][a.g][a.v] > memo[b.s][b.g][b.v];
}
 
double solve(int s,int g){
  for(int i=0;i<50;++i) for(int j=0;j<50;++j) for(int k=0;k<50;++k) memo[i][j][k] = INF;
  memo[s][s][0] = 0;
  bool used[50][50][50];
  memset(used,0,sizeof(used));
 
  priority_queue<node> St;
  St.push(node(s,s,0));
 
  while(!St.empty()){
    node now = St.top();
    St.pop();
    double mincost = memo[now.s][now.g][now.v];
    int id1 = now.s;
    int id2 = now.g;
    int id3 = now.v;
    for(int i=0;i<n;++i){
      if(!G[id2][i] || i==id1) continue;
      for(int j=-1;j<=1;++j){
	int nxtv = id3+j;
	if(nxtv<=0 || nxtv > res[id2][i]) continue;
	if(memo[id2][i][nxtv] > mincost + (double)G[id2][i]/nxtv){
	  memo[id2][i][nxtv] = mincost + (double)G[id2][i]/nxtv;
	  St.push(node(id2,i,nxtv));
	}
      }
    }
  }
  double ret = INF;
  for(int i=0;i<n;++i){
    ret = min(ret,memo[i][g][1]);
  }
  return ret;
}
 
 
int main(){
  while(scanf("%d%d",&n,&m),n||m){
    memset(G,0,sizeof(G));
    memset(res,0,sizeof(res));
    int s,g;
    scanf("%d%d",&s,&g);
    s--;
    g--;
    while(m--){
      int x,y,d,c;
      scanf("%d%d%d%d",&x,&y,&d,&c);
      x--;
      y--;
      G[x][y] = G[y][x] = d;
      res[x][y] = res[y][x] = c;
    }
 
    double ans = solve(s,g);
    if(ans==INF) printf("unreachable\n");
    else printf("%lf\n",ans);
  }
  return 0;
}

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

using namespace std;

typedef long long LL;
typedef vector<int>    VI;
typedef vector<bool>   VB;
typedef vector<string> VS;

#define MP make_pair
#define PB push_back
#define ALL(x)  (x).begin(),(x).end()
#define rep(i, N)  for (int i = 0; i < (int)(N); i++)
#define REP(i, init, N)  for (int i = (init); i < (int)(N); i++)
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl

int n, m;
VI sns, sms;
const int INF = INT_MAX / 2;

int main(void) {
	while (1) {
		sns.clear();
		sms.clear();
		cin >> n >> m;
		if (n == 0 && m == 0) break;
		rep (i, n) {
			int sn;
			cin >> sn;
			sns.PB(sn);
		}
		rep (i, m) {
			int sm;
			cin >> sm;
			sms.PB(sm);
		}
		int max_v = INF;
		int ans1, ans2;
		rep (i, n) rep (j, m) {
			int sum1, sum2;
			swap(sns[i], sms[j]);
			sum1 = accumulate(ALL(sns), 0);
			sum2 = accumulate(ALL(sms), 0);
			if (sum1 == sum2 && max_v > sns[i] + sms[j]) {
				ans1 = sms[j];
				ans2 = sns[i];
				max_v = sns[i] + sms[j];
			}
			swap(sns[i], sms[j]);
		}
		if (max_v == INF) {
			cout << -1 << endl;
		} else {
			cout << ans1 << " " << ans2 << endl;
		}
	}
    return 0;
}

Measured memory_bytes: 3140
// #include <iostream>
// #include <fstream>
// #include <cstdio>
// #include <set>
// #include <vector>
// #include <algorithm>
// #include <cmath>
// #include <cstdlib>
// #include <queue>
// #include <string>
// #include <map>
// #include <unordered_map>
// #include <cstring>
// #include <numeric>
// #include <stack>
// #include <iomanip>
// #include <chrono>

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

#define sd(mark) scanf("%d",&mark)
#define ss(mark) scanf("%s",mark)
#define clr(mark) memset(mark,0,sizeof(mark))
#define setinf(mark) memset(mark,0x3f,sizeof(mark))
#define setneg(mark) memset(mark,-1,sizeof(mark))



#ifndef strange
#define trace(...)
// #define endl '\n'
#define start_routine() 
#define end_routine()
#endif
typedef long long ll;   
//__gcd


const ll infl=0x3f3f3f3f3f3f3f3fLL;
const int infi=0x3f3f3f3f;
#define PI 3.141592653589793238
#define mod 1000000007


#define F first 
#define S second
#define mp make_pair
#define all(x) x.begin(), x.end()
#define trav(a,x) for(auto &a:x)
#define pii pair<int,int>

#define pb push_back
#define int long long

#define fr(i, a, b) for (int i = (a), _b = (b); i <= _b; i++)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define frr(i, a, b) for (int i = (a), _b = (b); i >= _b; i--)

#define sz(x) (int)(x).size()
typedef pair<pii, int> piii;
typedef vector<int> vi;
typedef vector<vi> vii;
#define vp vector <pii>
int x;
void solve(){
    cin>>x;
    cout<<1-x<<"\n";
}


signed main(){
    int t=1;
    start_routine();
    cin.tie(0); cout.tie(0);
    ios_base::sync_with_stdio(NULL);
    cout<<fixed<<setprecision(10);
    
    
    // cin>>t;
    
    fr(i,1,t) {
		// cout<<"Case #"<<i<<": ";
		solve();
	}

    end_routine();
    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
#define sz(x) int(x.size())
using ll = long long;
const ll LLINF = numeric_limits<long long>::max();
const int mod = 1000000007;
const int INF = 1001001001;

struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}
mint smax[200005];
mint smin[200005];

int main()
{
    int N,K;
    cin >> N >> K;
    mint sum=0;
    

    smax[0] = 0;
    smin[0] = 0;
    for(int i=1;i<=N+1;i++){
        smax[i] = smax[i-1] + N - (i-1);
        smin[i] = smin[i-1] + (i-1);
        //cout << i << " "  << smax[i] << " " << smin[i] << endl;
    }
    //cout << " ddddd" ;
    mint a;
  	for(int i=K;i<=N+1;i++){
      //cout << sum << i <<endl;
      // cout << smax[i] << " " << smin[i] << endl;
      sum += smax[i];
      sum -= smin[i];
      sum += 1;
      //cout << sum  <<endl;
      a=sum;
    }
    
    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 6768
#include <bits/stdc++.h>
#define um unordered_map
#define us unordered_set
#define f first
#define s second
#define pb push_back
#define MOD 1000000007
#define eps 1e-9
#define INF 1000000002

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<int, pii> piii;
typedef pair<pii,pii> piiii;

const int N = 255;
int n;

int ans;
int lev[N], parent[N];
bool vis[N];
string adj[N];

void solve(int start) {
    memset(parent, -1, sizeof parent);
    memset(lev, -1, sizeof lev);
    queue<int> q;
    q.push(start);
    lev[start] = 1;
    while(!q.empty()) {
        int i = q.front();
        q.pop();
        for(int j = 0;j<n;j++) {
            if(adj[i][j] != '1')
                continue;
            if(parent[i] != j) {
                if(lev[j] != -1) {
                    if(abs(lev[j] - lev[i]) != 1) {
                        printf("-1");
                        exit(0);
                    }
                } else {
                    parent[j] = i;
                    lev[j] = lev[i] + 1;
                    ans = max(lev[j], ans);
                    q.push(j);
                }
            }
        }
    }
}

int main() {
    cin>>n;
    for(int i =0;i<n;i++)
        cin>>adj[i];
    for(int i = 0;i<n;i++)
        solve(i);
    cout<<ans;
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<vector>
#include<algorithm>
#include<string>

using namespace std;
const long long int MOD=1e9+7;

int main(){
  int n;
  cin >> n;
  for(int i=1;i<=9;i++){
    if(n%i==0 && n/i<=9){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
}


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

int main(void)
{
    char str[21];
    int i,l;

    gets(str);
    l = strlen(str);
    for(i=0; i<l; i++){
        printf("%c", str[l-i-1]);
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 520
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("unroll-loops") 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define int long long
#define fr(i,a,b) for(int i = a ; i <= b ; ++i)
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
#define fst first
#define snd second
using namespace __gnu_pbds;
using ordered_set =
 tree<int, null_type,less<int>,
 rb_tree_tag,tree_order_statistics_node_update>;
//find_by_order(k):returns iterator to kth element starting from 0
//order_of_key(k):returns count of elements strictly smaller than k
typedef long long ll;typedef pair<int, int> pii;
typedef vector<int> vi;typedef long double ld;
template<class T>
using min_heap = priority_queue<T,vector<T>,greater<T>>; 
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
template<class T> void re(T& x) { cin >> x; }
template<typename T> 
void remdup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)), v.end());
}
template<typename T> void re(vector<T> &v) {trav(i,v) cin >> i;}
template<class H, class... T> void re(H& h, T&... t) { re(h); re(t...); }
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
#ifdef np
#include "/home/o_o/MyCodes/pr.h"
#else
#define trace(...)
#endif

#define MOD 1000000007  

void solve(){
	string s ;
	re(s);
	int n = sz(s);
	vi pre(n);
	rep(i,0,n){
		pre[i] = (s[i]=='R')?i:pre[i-1];
	}
	
	vi suf(n);
	for(int i = n -1 ; i>=0 ; --i){
		suf[i] = (s[i]=='L')?i:suf[i+1];
	}
	vi ans(n);
	trace(pre,suf);
	rep(i,0,n){
		if(s[i] == 'R'){
			ans[suf[i] - (suf[i]- i&1)]++;
		}
		else{
			++ans[pre[i] + (i- pre[i]&1)];
		}
	}
	trav(i,ans) cout << i << ' ';
	cout << endl; 
}

signed main() {
	unsyncIO();
	int tt =1 ;
	// cin >> tt;
	rep(i,0,tt) solve();













#ifdef np
	cout <<endl<<endl<< "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}


Measured memory_bytes: 5844
def solve():
    N = int(input())
    C = input().strip()
    R = C.count('R')
    if R == 0 or R == N:
        print(0)
        return
    leftR = 0
    pos = 0
    ans = N - R
    for i, c in enumerate(C):
        if c == 'R':
            leftR += 1
        leftW = i + 1 - leftR
        rightR = R - leftR
        #print(leftW, rightR)
        changes = abs(rightR - leftW)
        swaps = min(rightR, leftW)
        ans = min(ans, swaps + changes)
    print(ans)

solve()

Measured memory_bytes: 73824
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, x = 0;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    string op;
    cin >> op;
    
    if (op == "Y") {
      x++;
      break;
    }
  }
  
  if (x == 0)
    cout << "Three" << endl;
  
  else if (x == 1)
    cout << "Four" << endl;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int a[100000];

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


Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> mochi(N);

  for (int i = 0; i < N; i++) {
    cin >> mochi.at(i);
  }

  sort(mochi.begin(), mochi.end(), greater<int>());
  mochi.erase(unique(mochi.begin(), mochi.end()), mochi.end());
  cout << mochi.size() << endl;
}

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

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    if(a==b){
        if(b!=c){
            cout << "Yes" << endl;
            return 0;
        }
    }
    if(b==c){
        if(c!=a){
            cout << "Yes" << endl;
            return 0;
        }
    }
    if(a==c){
        if(c!=b){
            cout << "Yes" << endl;
            return 0;
        }
    }

    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#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++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
ll n;
int main(){
    cin>>n;
    vector<int> v(n,0);
    rep(i,n) cin>>v[i];
    int cnt=0;//割る個数
    int now=1;
    rep(i,n){
        if(v[i]!=now) cnt++;
        else now++; 
    }
    if(cnt==n) cout<<"-1"<<endl;
    else cout<<cnt<<endl;
    return 0;
}

Measured memory_bytes: 1024
# coding: utf-8
# Your code here!
num =[]
ans =0
for i in range(3):
    x,y = map(int,input().split(" "))
    num.append(x)
    num.append(y)
for i in range(1,5):

    if num.count(i)==3:
        ans +=1
if ans>0:
    print("NO")
else:
    print("YES")


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

int main() {
    int n;
    while(cin >> n, n) {
        map<char, char> conv;
        for(int i=0; i<n; ++i) {
            char c1, c2;
            cin >> c1 >> c2;
            conv[c1] = c2;
        }
        int m;
        cin >> m;
        for(int i=0; i<m; ++i) {
            char c;
            cin >> c;
            if(conv.count(c) == 0) cout << c;
            else                   cout << conv[c];
        }
        cout << endl;
    }
}

Measured memory_bytes: 2996
#include<iostream>
#include<vector>
#include<algorithm>


int main(){
    int num[32] = {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;
    std::cin >> K;
    
    std::cout << num[K-1] << std::endl;
    
}


Measured memory_bytes: 256
#include<stdio.h>

int main (void){
	
	int H,W,i,t;
	
	for(;;){
	scanf("%d %d",&H,&W);
	if(H==0&&W==0)break;
	for(i=0;i<H;i++){
		for(t=0;t<W;t++){
			if(t==0||t==W-1){
			printf("#");
			}else if(i==0||i==H-1){
			printf("#");
			}else{
			printf(".");
			}
		}
	printf("\n");
	}
	printf("\n");
	}
	
return 0;
}

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

#define int long long
#define str string
#define rep(x,y) for(int i=x;i<y;i++)
#define REP(x,y) for(int j=x;j<y;j++)
#define all(x) x.begin(),x.end()
#define vint vector<int>
#define vchar vector<char>
#define vstr vector<string>
#define pb(n) push_back(n)

signed main(){
  int A,B,N;
  cin>>A>>B>>N;
  cout<<B*(N/A)<<endl;
}


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

int N;

int main(void){
    cin >> N;
    vector<long> l(N);
    for(int i=0; i<N; i++){
        cin >> l[i];
    }
    
    int cnt = 0;
    for(int i=0; i<N; i++){
        for(int j=i+1; j<N; j++){
            for(int k=j+1; k<N; k++){
                if(l[i]+l[j]>l[k]&&l[k]+l[j]>l[i]&&l[i]+l[k]>l[j]&&l[i]!=l[j]&&l[k]!=l[j]&&l[i]!=l[k]){
                    cnt++;
                }
            }
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 3632
using System;
using System.Collections.Generic;
using System.Linq;


namespace TestApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var a = int.Parse(Console.ReadLine());
            if (a>= 64)
                Console.WriteLine(64);
            else if (a >= 32)
                Console.WriteLine(32);
            else if (a >= 16)
                Console.WriteLine(16);
            else if(a >=8)
                Console.WriteLine(8);
            else if (a >=4)
                Console.WriteLine(4);
            else if (a>=2)
                Console.WriteLine(2);
            else
                Console.WriteLine(1);
        }
    }

}

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

int main() {
    int N;
    cin >> N;
    int H[100];
    for (int i = 0; i < N; i++) {
        cin >> H[i];
    }
    
    int H_M = H[0];
    int Count = 1;
    for (int i = 1; i < N; i++) {
        if (H[i] > H_M) {
            H_M = H[i];
            Count++;
        }
        else if (H[i] == H_M) {
            Count++;
        }
    }
    
    cout << Count << endl;
}

Measured memory_bytes: 256