akhauriyash/Code-Regression huggingface dataset:
s=list(input())
a=0
b=0
c=0
for i in s:
    if i=='a':
        a+=1
    elif i=='b':
        b+=1
    else:
        c+=1
m=min(a,b,c)
a-=m
b-=m
c-=m
if a<2 and b<2 and c<2:
    print('YES')
else:
    print('NO')

Measured memory_bytes: 3956
#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
#define sz(s) (int)(s.size())
#define mod 1000000007

using namespace std;

int main(){

  int n;

  //入力を受け取る
  cin >> n;
  int b[n-1];

  rep(i,0,n-2)cin >> b[i];
  
  long long ans = b[0];
  rep(i,1,n-2){
  //b_i, b_{i+1}のうち小さい方がA_iの最大値となる
  ans += min(b[i-1],b[i]);
  }
  ans += b[n-2];
  
  cout << ans << endl;

  return 0;

}

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

int main(){
    int r,c;
    cin >> r >> c;
    int ans[r+1][c+1] = {};
    for (int i = 0; i < r; i++){
        for (int j = 0; j < c; j++){
            int ansd;
            cin >> ansd;
            ans[i][j] = ansd;
            ans[i][c] += ansd;
            ans[r][j] += ansd;
            ans[r][c] += ansd;
        }
    }
    for (int i = 0; i < r+1; i++){
        for (int j = 0; j < c+1; j++){
            if (j > 0){
                cout << " ";
            }
            cout << ans[i][j];
        }
        cout << endl;
    }
}


Measured memory_bytes: 3124
n=input()
keta=len(n)
k=int(input())
#上からi桁、0以外の数がk個、smallerはless flag

dp=[[[0]*2 for _ in range(4)] for _ in range(keta +1 )]
dp[0][0][0]=1
for i in range(keta):
    for j in range(4):
        for smaller in range(2):
            nd = int(n[i]) #見ている桁の数字
            for d in range(10):
                #遷移先の数字をn付きで定義しておく
                ni=i+1
                nj=j
                nsmaller=smaller
                #変数ごとに条件を見ていく
                #iは必ず1ずつ増える
                #jについて
                if d!=0:
                    nj+=1
                if nj > k:
                    continue  #条件に合わないのはcontinueで飛ばす
                #smallerについて
                if smaller ==0:  # 今までnと同じで来ている
                    if d > nd:
                        continue
                    if d <nd:
                        nsmaller=1
                #最後はこれで足し合わせてfinish
                dp[ni][nj][nsmaller]+=dp[i][j][smaller]
ans = dp[keta][k][0]+dp[keta][k][1]
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++) 
#define all(x) (x).begin(), (x).end()
typedef long long ll;
using namespace std;

int main() {
	int N,K;
	cin >> N >> K;
  double ans = 0;

  rep(i,N){
    int deme = i+1;
    if(deme>=K){
      ans += 1/(double)N;
    } else { 
      double prob = 1/(double)N;
      while(deme<K){
        prob*=((double)1/2);
        deme*=2;
      }
      ans += prob;
    }
  }

  cout << fixed << setprecision(10);
  cout << ans << endl;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
abc126a()
}

func abc126a() {
	var n, k int
	var line string
	fmt.Scanf("%d", &n)
	fmt.Scanf("%d", &k)
	fmt.Scanf("%s", &line)

	ans := fmt.Sprintf("%s%c%s", line[:k-1], line[k-1]-'A'+'a', line[k:])
	fmt.Print(ans)
}


Measured memory_bytes: 512
n=gets.to_i

if n>=400 && n<=599
    p 8
elsif n>=600 && n<=799
   p 7
   elsif n>=800 && n<=999
   p 6
   elsif n>=1000 && n<=1199
   p 5
   elsif n>=1200 && n<=1399
   p 4
   elsif n>=1400&& n<=1599
   p 3
   elsif n>=1600 && n<=1799
   p 2
   elsif n>=1800 && n<=1999
   p 1
end


Measured memory_bytes: 14328
import java.io.IOException;
import java.util.Scanner;
public class Main {

	static int mod = (int) 1E9 + 7;

	public static void main(String[] args) throws IOException {

		Scanner in = new Scanner(System.in);
		char[] s = in.next().toCharArray();

		// i文字目までを13で割った余りがｊであるものの個数を格納する
		long dp[][] = new long[s.length][13];

		// 初期値
		if ( s[0] == '?' ) {
			for ( int n = 0; n < 10; n++ ) {
				dp[0][n] = 1;
			}
		} else {
			dp[0][s[0] - '0'] = 1;
		}

		// 1文字づつ見ていく
		for ( int i = 1; i < s.length; i++ ) {

			if ( s[i] == '?' ) {
				for ( int t = 0; t < 13; t++ ) {
					for ( int n = 0; n < 10; n++ ) {
						dp[i][(t * 10 + n) % 13] += dp[i - 1][t];
					}
				}
			} else {
				int now = s[i] - '0';
				for ( int t = 0; t < 13; t++ ) {
					dp[i][(t * 10 + now) % 13] += dp[i - 1][t];
				}
			}
			
			for ( int t = 0; t < 13; t++ ) {
				dp[i][t] %= mod;
			}
		}
				
		System.out.println(dp[s.length-1][5]);
		in.close();
	}
}

Measured memory_bytes: 39160
#include<iostream>
using namespace std;
int main(){
  long long n,a,cnt=0,cnt2=0;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a;
    if(a%4==0)cnt++;
    else if(a%2==0)cnt2++;
  }
  if(cnt>=n/2)cout<<"Yes";
  else if(cnt>=(n-cnt2+1)/2)cout<<"Yes";
  else cout<<"No";
  return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) FOR(i,0,b)
#define INF mugen
#define dump(x) cerr<<#x<<"="<<x<<endl
#define all(a) (a).begin(),(a).end()
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<vii> viii;
typedef pair<int,int> P;
template <class T> void chmin(T & a, T const & b) { if (b < a) a = b; }
template <class T> void chmax(T & a, T const & b) { if (b > a) a = b; }

template <typename T>
string to_string(const T &n){ostringstream stm;stm << n;return stm.str();}
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
using ll = long long;
const ll mod = LLONG_MAX;
 

string s,t;
int dp[3123][3123];
int i,j;
int main() {
    cin >> s >> t;

    for(i=0;i<(int)s.size();i++){
        for(j=0;j<(int)t.size();j++){
            if(s[i]==t[j]){
                dp[i+1][j+1]=max(dp[i][j]+1,dp[i+1][j+1]);
            }
            dp[i+1][j+1]=max(dp[i+1][j+1],dp[i][j+1]);
            dp[i+1][j+1]=max(dp[i+1][j+1],dp[i+1][j]);
        }
    }
    //cout<<dp[s.size()][t.size()]<<endl;
    string res="";
    i=(int)s.size(),j=(int)t.size();
    while(i>0&&j>0){
        if(dp[i][j]==dp[i-1][j]){
            i--;
        }else if(dp[i][j]==dp[i][j-1]){
            j--;
        }else{
            res+=s[i-1];
            i--;j--;
        }
    }
    reverse(res.begin(),res.end());
    cout<<res<<endl;
}


Measured memory_bytes: 37120
#include<stdio.h>
int main(){
  int h ,m ,s;
  int time,rest;
  scanf("%d",&time);
  h = time/3600;
  time = time - (3600*h);
  m = time / 60;
  s = time - (60*m);
  printf("%d:%d:%d\n",h,m,s);

  return 0;
}

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

int main()
{
    int N,Y,k;
    cin >> N >> Y;

    for(int i=0; i<=N ; i++)
    {
      for(int j=0; j<=N-i; j++)
      {
        k=N-i-j;
        if(Y==10000*i+5000*j+1000*k)
        {
          cout<<i<<' '<<j<<' '<<k<<endl;
          return 0;
        }
      }
    }
    cout <<-1<<' '<<-1<<' '<<-1;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define fastIO ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define el '\n'
#define deb(x) cout << #x << " "<< x << endl;
#define fo(i, n) for(int i=0; i<n; i++)
#define Fo(i, k, n) for(int i=k; i<n; i++)
#define all(x) x.begin(),x.end()
#define  int long long
 int inf = 1e18;

int32_t main()
{
    fastIO
    int t=1;
    //cin>>t;

    while(t--)
    {
        int n;
        cin>>n;
        int arr[n];
        fo(i,n)
        cin>>arr[i];
        int brr[n];
        fo(i,n)
        brr[i] = arr[i];
        for(int i=1;i<n;++i)
        {
            arr[i]= arr[i]+arr[i-1];
        }

        int minn = inf;
        int sum  =0;
        for(int i=n-1;i>=1;--i)
        {
            sum+= brr[i];
            //cout<<sum<<" "<<arr[i-1]<<el;
            minn = min(minn,abs(sum-arr[i-1]));
        }
        cout<<(minn==inf?arr[n-1]:minn)<<el;

   }
    return 0;
}
// always test the corner cases ALWAYS;


Measured memory_bytes: 3328
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int N, M, l, r, max_l = -1, min_r = 100001;
    cin >> N >> M;
    vector<int> cards(N);
    for(int i=0;i<M;i++){
        cin >> l >> r;
        max_l = l > max_l ? l : max_l;
        min_r = r > min_r ? min_r : r;
    }
    cout << max(min_r - max_l + 1, 0) << endl;
}

Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		
		String[] tmpArray = br.readLine().split(" ");
		
		int n = Integer.parseInt(tmpArray[0]);
		int k = Integer.parseInt(tmpArray[1]);
		
		long result = 0;
		
		for(int b = 1; b <= n; b++){
			int p = n / b;
			int r = n % b;
			result += p*Math.max(0, b - k) + Math.max(0, r - k + 1);
		}
		
		if(k == 0){
			result -= n;
		}
		System.out.println(result);
	}

}


Measured memory_bytes: 21332
// Anve$hi $hukla
#include <bits/stdc++.h>
using namespace std;
struct ${$(){ios_base::sync_with_stdio(false);cin.tie(NULL);}}$;

typedef long long LL;
const int Maxn = 200005;

int main() {
   int a, b;
   cin >> a >> b;
   if(a <= 0 && b >=0)
      cout << "Zero" << endl;
   else if(a > 0)
      cout << "Positive" << endl;
   else {
      // b < 0;
      if((b - a + 1) % 2 == 0)
         cout << "Positive" << endl;
      else
         cout << "Negative" << endl;
   }      
   return 0;
}


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

template <typename InputIterator>
typename InputIterator::value_type summation(InputIterator first,
                                             InputIterator last) {
  return std::accumulate(first, last, typename InputIterator::value_type());
}
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v);
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p);
template <typename T>
std::istream &operator>>(std::istream &stream, std::vector<T> &v) {
  for (auto &i : v) {
    stream >> i;
  }
  return stream;
}
template <typename T1, typename T2>
std::istream &operator>>(std::istream &stream, std::pair<T1, T2> &p) {
  stream >> p.first >> p.second;
  return stream;
}

int main() {
  int64_t a, b, k;
  std::cin >> a >> b >> k;
  b -= std::max(int64_t(0), k - a);
  b = std::max(int64_t(0), b);
  a = std::max(int64_t(0), a - k);
  std::cout << a << " " << b << std::endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define endl '\n'
#define mod 1000000007
#define tol(s) transform(s.begin(),s.end(),s.begin(),::tolower)
#define tou(s) transform(s.begin(),s.end(),s.begin(),::toupper)
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define all(x) (x).begin(), (x).end()
void make_unique(vector<ll> vec)
{
sort(all(vec));
vec.resize(unique(all(vec)) - vec.begin());
}


int main() 
{   ios;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    int t1=1;
    //cin>>t;
    while(t1--)
    {ll q,k,h,p,a,b,v,c,n,m,i,j,flag=0,count=0,move=0;
     cin>>n;
     ll A[n],B[n];
     for(i=0;i<n;i++)
      cin>>A[i];
      B[n-1]=A[n-1];
     for(i=n-2;i>=0;i--)
     {
         B[i]=(B[i+1]+A[i])%mod;
     }
      ll sum=0;
    for(i=0;i<n-1;i++)
    {
       ll temp=(A[i]*B[i+1])%mod;
       sum=(sum+temp)%mod;
    }
    cout<<sum<<endl;
     
     
    }
	return 0;
}


Measured memory_bytes: 6768
n = int(input())
b = list(map(int, input().split()))
#print(b)

anslist = []
for i in range(len(b)):
    if i - b[i] + 1 >= 0:
        anslist = anslist[0:i - b[i] + 1] + [b[i]] + anslist[i - b[i] + 1::]

        #print(anslist, i,  i - b[i] + 1, b[i])
    else:
        anslist = False
        break
#print(anslist)
if not anslist:
    print(-1)
else:
    for i in anslist[::-1]:
        print(i)

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <math.h>
#include <cmath>
#include <ctime>
#include <stdlib.h>

using namespace std;

#define int long long
#define endl "\n"
#define all(v)  v.begin(),v.end()
#define fir first
#define sec second
#define m_p make_pair
#define m_t make_tuple
#define rep(i,n)  for(int i=0; i<(int) (n); i++)
typedef pair<int, int> P;

const double pai = 3.1415926535897;
const int mod = 1000000007;
const int INF = 1000000021;
const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];


//x未満の要素数を返す二分探索関数
int b_s(vector<int>& vec, int xx) {
	return lower_bound(all(vec), xx) - vec.begin();
}
template<typename T>void vecout(vector<T>& vec) { for (T t : vec) cout << t << " "; cout << endl; }
template<typename TT>void vecin(vector<TT>& vec) {
	for (int i = 0; i < vec.size(); i++) {
		cin >> vec[i];
	}
}
template<class tt> struct counter {
	map<tt, int>mp;
	bool add(tt t, int xx) {
		if (!mp.count(t)) {
			mp[t] = xx;
			return true;
		}
		mp[t] += xx;
		if (!mp[t]) {
			mp.erase(t);
		}
		return false;
	}

};

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

//n個を1個以上のx組のグループに分ける重複組み合わせはcom(n-1,x-1)
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
long long modinv(long long a, long long m) {
	long long b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
long long modpow(int a, int n) {
	int res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

bool chmax(int& xx, int yy) {
	if (xx < yy) {
		xx = yy;
		return true;
	}
	return false;
}
bool chmin(int& xx, int yy) {
	if (xx > yy) {
		xx = yy;
		return true;
	}
	return false;
}
int gcd(int xx, int yy) {
	int p = xx;
	int q = yy;
	if (q > p)swap(p, q);
	while (p % q != 0) {
		p %= q;
		swap(p, q);
	}
	return q;
}
int lcm(int xx, int yy) {
	return xx * yy / gcd(xx, yy);
}
bool prime(int xx) {
	if (xx <= 1) {
		return 0;
	}
	for (int i = 2; i * i <= xx; i++) {
		if (xx % i == 0) {
			return 0;
		}
	}
	return 1;
}



signed main() {
	int n,t=INF,ans=0;
	cin >> n;
	vector<int>vec(n);
	vecin(vec);
	for (int i = -100; i <= 100; i++) {
		int t2 = 0;
		rep(j, n) {
			t2 += (vec[j] - i) * (vec[j] - i);
		}
		if(chmin(t, t2)) {
			ans = i;
		}
	}
	cout << t << endl;
}

Measured memory_bytes: 3612
import java.util.Scanner;
import java.util.ArrayList;

public class Main {
	Scanner sc = new Scanner(System.in);
	int[] memo = new int[1000];
	public void run(){
		int n = sc.nextInt();
		calc(n);
	}
	public void calc(int n){
		int[] nums = new int[n];
		for(int i = 0; i < n; i++){
			nums[i] = sc.nextInt();
		}
		
		for(int i = 0; i < n; i++){
			int sum = 0;
			for(int j = 0; j < 3; j++){
				if(i+j < n){
					sum = sum * 10 + nums[i+j];
					memo[sum] = 1;
				}
			}
		}
		
		for(int i = 0; i < 1000; i++){
			if(memo[i] == 0){
				System.out.println(i);
				break;
			}
		}
	}
	
	public static void main(String[] args){
		new Main().run();
	}
	
}

Measured memory_bytes: 29676
#include <stdio.h>
#include <ctype.h>
#include <stdlib.h>

int main()
{
	int e[101][101];
	int R, C, r, c;
	int s, total;

	scanf("%d%d", &R, &C);
	for (r = 1; r <= R; r++) {
		for (c= 1; c <= C; c++) scanf("%d", &e[r][c]);
	}
	
	for (r = 1; r <= R; r++) {
		s = 0;
		for (c = 1; c <= C; c++) s += e[r][c];
		e[r][0] = s;
	}
	total = 0;
	for (c = 1; c <= C; c++) {
		s = 0;
		for (r = 1; r <= R; r++) s += e[r][c];
		e[0][c] = s;
		total += s;
	}
	for (r = 1; r <= R; r++) {
		for (c = 1; c <= C; c++) printf("%d ", e[r][c]);
		printf("%d\n", e[r][0]);
	}
	for (c = 1; c <= C; c++) printf("%d ", e[0][c]);
	printf("%d\n", total);
	return 0;
}



Measured memory_bytes: 2128
#include<bits/stdc++.h>
using namespace std;
int n,ans,Left[200005],Right[200005];
string s;
int main()
{
	scanf("%d",&n),ans=1e9;
	cin>>s,s=' '+s;
	for(int i=1;i<n;i++)
		if(s[i]=='W') Left[i+1]=Left[i]+1;
		else Left[i+1]=Left[i];
	for(int i=n;i>1;i--)
		if(s[i]=='R') Right[i-1]=Right[i]+1;
		else Right[i-1]=Right[i];
	for(int i=1;i<=n;i++) ans=min(ans,max(Right[i],Left[i]));
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 5476
#include<bits/stdc++.h>
 
using namespace std;
 
int main(){
    int long long a,b,n;
    cin >> a >> b >> n;
 
    if(n<b){
        int long long total = (a*n)/b;
        cout << total << endl;
    }
    else{
        int long long left = (a*(b-1))/b;
        cout << left << endl;
    }
    return 0;
}

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

#ifndef ONLINE_JUDGE
    #define gc getchar
    #define pc putchar
#else
    #define gc getchar_unlocked
    #define pc putchar_unlocked
#endif

using namespace std;

#define vi vector<int>
#define si set<int>
#define vs vector<string>
#define pii pair<int,int>
#define vpi vector<pii>
#define pri priority_queue<int>
#define rev_pri priority_queue<int,vector<int>,greater<int> >
#define mpi map<int,int>
#define i64 long long int
#define endl '\n'
#define pi acos(-1)
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define mod 1000000007
#define inf INT_MAX/2
#define infll LLONG_MAX/3
#define For(i,n) for(int i=0;i<n;i++)
#define Fre(i,a,b) for(int i = a; i < b; i++)
#define sf(n) scanf("%d", &n)
#define sff(a,b) scanf("%d %d", &a, &b)
#define sfff(a,b,c) scanf("%d %d %d", &a, &b, &c)
#define pfn(n) printf("%d\n", n)
#define pfs(n) printf("%d ", n)
#define eps 1e-8
#define ff first
#define ss second
#define mem(a,b) memset(a,b,sizeof(a))
#define READ freopen("in.txt", "r", stdin)
#define WRITE freopen("out.txt", "w", stdout)
#define sz size()
#define dbg(i) printf("yo %d\n", i)
#define foreach(i,c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); i++)
#define sqr(a) (a) * (a)
#define clr clear()
#define CASE(a) printf("Case %d: ",a)

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


//i64 gcd(i64 a,i64 b){if(!b)return a;return gcd(b,a%b);}

//inline void fastRead(int *a){register char c=0;while(c<33)c=gc();*a=0;while(c>33){*a=*a*10+c-'0';c=gc();}}

//inline void fastWrite(int a){char snum[20];int i=0;do{snum[i++]=a%10+48;a=a/10;}while(a!=0);i=i-1;while(i>=0)pc(snum[i--]);pc('\n');}

//i64 bigmod(i64 num,i64 n){if(n==0)return 1;i64 x=bigmod(num,n/2);x=x*x%mod;if(n%2==1)x=x*num%mod;return x;}

//i64 modinverse(i64 num){return bigmod(num,mod-2)%mod;}

//i64 po(i64 a,i64 b){i64 ans=1;while(b--)ans *= a;return ans;}

//i64 ncr(i64 n,i64 r){if(n==r)return 1;if(r==1)return n;if(dp[n][r]!=-1)return dp[n][r];return dp[n][r]=ncr(n-1,r)+ncr(n-1,r-1);}


// bit manipulations

//bool checkbit(int mask,int bit){return mask & (1<<bit);}

//int setbit(int mask,int bit){ return mask  (1<<bit) ; }

//int clearbit(int mask,int bit){return mask & ~(1<<bit);}

//int togglebit(int mask,int bit){return mask ^ (1<<bit);}


int gg[200];

int main()
{

        int a,b,c,d;
        cin >> a >> b >> c >> d;
        Fre(i,a,b)
                gg[i] = 1;
        Fre(i,c,d)
                gg[i]++;

        int ans = 0;

        For(i,200)
                if(gg[i]==2)
                        ans++;
        cout << ans << endl;













        return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
//macros
using namespace std;
typedef long long ll;
typedef pair<int, int > Pii;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
typedef vector<ll> Vll;
#define pb push_back
#define rs resize 
#define rep(i, a, b) for(int i=(a); i<(b); i++)
const long long int mod = 1e9 + 7;
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define COUT(a) cout << a << endl;

Vi A(0);
int main(){
    int N;
    cin >> N;
    A.rs(N);
    rep(i,0,N) cin >> A[i];
    Vi B(N);
    rep(i,0,N){
        B[A[i]-1] = i+1;
    }

    rep(i,0,N) COUT(B[i]);

}


Measured memory_bytes: 1664
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <algorithm>
using namespace std;
int main(void){
    int N , count , count1  ;
    cin >> N ;
    count = N ;
    count1 = 0;
    long long  a[N];
     for(int i = 0; i < N ; i++ ){
        cin >> a[i] ;
    }


 while(count==N){

    for(int j = 0; j < N ; j++ ){
         if(a[j]%2==0){
            count--;
        }else{
            break;
        }
        a[j] = a[j]/2 ;

    }
    if(count == 0){
        count = N ;
        count1++;
    }else{
        break;
    }

 }
    cout << count1 << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<algorithm>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

const int MAX = 510000;
const int MOD = 1000000007;

ll gcd(ll a, ll b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}


int main(){

  ll K; cin>>K;
  ll ans = 0;

  repn(i,K){
    repn(j,K){
      repn(k,K){
        ans += gcd(gcd(i,j),k);
      }
    }
  }

  cout<<ans<<endl;
}


Measured memory_bytes: 3624
#include<iostream>
#include<cstdio>
#define ll long long int
using namespace std;
ll gcd(ll x, ll y)
{
    if(x==0) return y;
    else
        return gcd(y%x,x);
}
int main()
{
    ll a,b,c;
    while(scanf("%lld %lld",&a,&b)!=EOF)
    {
        c= gcd(a,b);
        printf("%lld\n",(a*b)/c);
    }
    return 0;
}

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

int main(){
    
    long int  n,hi,i;
    cin>>n;
    
    vector<long int>h;
    for(i=0;i<n;i++){
        cin>>hi;
        h.emplace_back(hi);
    }
  
    long int m=1;
    long int cnt=1;
    
    for(i=1;i<n;i++){
     
        if(h[i-1]>=h[i])
            cnt++;
        else{
            m = max(m,cnt);
            cnt=1;
        }
    }
    m = max(m,cnt);
    cout<<m-1;
    
    
  return 0;
}


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


using namespace std;
#define l long long int 
#define vl vector<l>
#define vvi vector<vector<int>>
#define rep(i,n) for (i = 0; i < n; i++) 
#define REP(i,k,n) for (i = k; i <= n; i++) 
#define REPR(i,k,n) for (i = k; i >= n; i--) 
#define pii pair<int,int>

int  main(int arg,char** argc)
{
    ios_base::sync_with_stdio(false);
    cout.tie(NULL);
    cin.tie(NULL);    
    // l s,w;
    // cin>>s>>w;
    // if(s>w)
    // {
    //     cout<<"safe\n";
    // }
    // else{
    //     cout<<"unsafe\n";
    // }
    // l a,b,c,d;
    // l flag=0;
    // cin>>a>>b>>c>>d;
    // while(a>0 && c>0)
    // {
    //     if(flag%2!=0)
    //     {
    //         c-=b;
    //     }
    //     else{
    //         a-=d;
    //     }
    //     flag++;
    // }
    // cout<<a<<" "<<c;
    // if(a<=0)
    // {
    //     cout<<"No";
    // }
    // else if(c<=0)
    // {
    //     cout<<"Yes";
    // }
    l n;
    cin>>n;
    string s;
    l x=1,ans=0;
    unordered_map<string,l> map;
    for(l i=0;i<n;i++)
    {
        x=1;
        cin>>s;
        if(map.count(s)==0)
        {
            map[s]=x;
            ans++;
        }
        
    }
    cout<<ans;


    return 0;
}


Measured memory_bytes: 17640
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010


int main() {
  char c;

  cin >> c;

  c++;

  cout << c << endl;

  return 0;
}


Measured memory_bytes: 256
// Shuffle.cc
// １つのアルファベットが描かれた n 枚のカードの山をシャッフルします。
// 1回のシャッフルでは、下から h 枚のカードをまとめて取り出し、それを残ったカードの山の上に積み上げます。
// カードの山は以下のように１つの文字列で与えられます。
//   abcdeefab
// 最初の文字が一番下にあるカード、最後の文字が一番上にあるカードを示しています。
// 例えば、これを h が 4 でシャッフルすると、最初の4文字 abcd が、
// 残りの文字 eefab の末尾へ連結されるので以下のようになります：
//   eefababcd
// このシャッフルを何回か繰り返します。
// カードの山の最初の並び（文字列）と h の列を読み込み、最後の並び（文字列）を出力するプログラムを作成して下さい。
// 【入力】
// 複数のデータセットが入力として与えられます。各データセットは以下の形式で与えられます：
//   最初の並びを表す文字列
//   シャッフル回数 m
//   h1
//   h2
//     .
//     .
//   hm
// 最初の並びを表す文字列が "-" のとき入力の終わりとします。
// 【制約】
// 1 ≤ 文字列の長さ≤ 200
// 1 ≤ m ≤ 100
// 1 ≤ hi < 文字列の長さ
// データセットの数は10を超えない
// 【出力】
// 各データセットに対して、最後の並び（文字列）を１行に出力して下さい。
// 【例】
// 入力：
// aabc
// 3
// 1
// 2
// 1
// vwxyz
// 2
// 3
// 4
// -
// 出力：
// aabc
// xyzvw
#include<iostream>
#include<string>
using namespace std;

string shuffle( string str, int h) {
  string sub;

  sub = str.substr( 0, h);
  str = str.erase( 0, h);
  return str + sub;
}

int main( void) {
  string cards;
  int shuffle_num;
  int h;
  
  while ( true) {
    cin >> cards;
    if ( cards == "-") break;

    cin >> shuffle_num;
    for ( int i = 0; i < shuffle_num; i++) {
      cin >> h;
      cards = shuffle( cards, h);
    }
    cout << cards << endl;
  }

  return 0;
}



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

int main() {
    int H, W;

    while(1) {
        cin >> H >> W;
        if(H == 0 && W == 0) break;
        for(int i = 0; i < H; i++) {
            for(int j = 0; j < W; j++) {
                cout << "#" << flush;
            }
            cout << endl;
        }
        cout << endl;
    }
    return 0;
}


Measured memory_bytes: 3084
import java.util.Arrays;
import java.util.Scanner;
 
public class Main {

	public static final MyScanner in = new MyScanner();

	public static void main(String[] args) {

		int i = in.nextInt();
		
		double num = i / 2;
		if (!(i % 2 == 0)) num += 1;
		
		double answer = num / i;

		System.out.println(answer);
	}

	public static class MyScanner{
		Scanner sc = new Scanner(System.in);
		String nextLine() {return sc.nextLine();}
		String next() {return sc.next();}
		int nextInt() {return Integer.valueOf(sc.next());}
		long nextLong() { return Long.valueOf(sc.next());}
	}
}

Measured memory_bytes: 24020
/*____________________________Definitions__________________________*/
#include <bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(0); cin.tie(0);
typedef long long ll;
typedef vector<int> vi;
#define Rep(i, a, b) for (int i=a; i<(b); i++)
#define trav(a,x) for(auto& a : x)
#define nl '\n'
#define ri(n) int n; scanf("%d", &n);
#define rll(n) ll n; scanf("%lld", &n);
/*__________________________________________________________________*/


int main() {

	fastIO
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int T = 1;
	while (T--) {
		/*_____________________Code Here____________________________*/

		string s , t ; cin >> s >> t ;
		int  sl = s.length();
		int  tl = t.length();
		int csum ;
		int sum = 0;

		for (int i = 0 ; i <= sl - tl ; i++) {
			csum = 0 ;
			for (int j = 0; j < tl; j++)
			{
				//cout << t[j] << s[i + j] << " ";
				if (t[j] == s[i + j]) {
					csum++;
				}
			}

			sum = max(sum , csum);
			//cout << " " << csum << nl;
		}

		cout << tl - sum << endl;


		/*_____________________End Here____________________________*/
	}
	return 0;
}



Measured memory_bytes: 3652
#include <stdio.h>
#define N 500000
#define SENTINEL 1000000000
int count=0;
void Merge( int*, int, int, int );
void MergeSort( int*, int, int);

 int main(){
	 int i;
	 int n;
	 int S[N];
	 scanf("%d", &n);
	 for( i=0; i<n; i++ ){
		 scanf("%d", &S[i]);
	 }
	 MergeSort(S, 0, n);
	 for( i=0; i<n; i++ ){
		 printf("%d",S[i]);
		 if( i+1 != n) printf(" ");
	 }
	 printf("\n%d\n",count);
	 return 0;
 }
 void Merge( int *A, int left, int mid, int right ){
	 int n1 = mid-left;
	 int n2 = right-mid;
	 int L[n1];
	 int R[n2];
	 int i, j, k;
	 for( i=0; i<n1; i++ ) L[i] = A[ left+i ];
	 for( i=0; i<n2; i++ ) R[i] = A[ mid+i ];
	 L[n1] = SENTINEL;
	 R[n2] = SENTINEL;
	 i = 0;
	 j = 0;
	 for( k=left; k<right; k++ ){
		 count++;
		 if( L[i] <= R[j] ){
			 A[k] = L[i];
			 i++;
		 }
		 else{
			 A[k] = R[j];
			 j++;
		 }
	 }
 }

 void MergeSort( int *A, int left, int right ){
	 int mid;
	 if( left+1 < right){
		 mid = ( left+right )/2;
		 MergeSort(A, left, mid);
		 MergeSort(A, mid, right);
		 Merge(A, left, mid, right);
	 }
 }

Measured memory_bytes: 4508
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#define int long long
#define mod 1000000007
#define for0(i, n) for(int i = 0; i < (n); i++)
#define for1(i, n) for(int i = 1; i <= (n);i++)
#define mp make_pair
using namespace std;
int get() { int r; cin >> r; return r; }
int n, m, key, p, ans;
int t[60][60], nm[30][60];
vector<int>v[60];
bool b[60];
bool f(int nd) {
	if (nd == key)return 1;
	b[nd] = 1;
	for (int i : v[nd]) {
		if (!b[i]) {
			if (f(i)) {
				nm[p][t[nd][i]] = 1;
				return 1;
			}
		}
	}
	b[nd] = 0;
	return 0;
}

signed main() {
	n = get();
	for1(i, n - 1) {
		int a, b; cin >> a >> b;
		t[a][b] = i; t[b][a] = i;
		v[a].push_back(b);
		v[b].push_back(a);
	}
	m = get();
	for1(i, m) {
		int u; cin >> u >> key; p = i; f(u);
		for1(j, n) { b[j] = 0; }
	}
	int l = 1;
	for1(i, m)l *= 2;
	for0(i, l) {
		int ii = i, cnt = 0;
		for1(hoge, m) {
			if (ii % 2 == 1) {
				cnt++;
				for1(j, n - 1)if (nm[hoge][j])b[j] = 1;
			}
			ii /= 2;
		}
		p = 1;
		for1(j, n - 1) { if (b[j])b[j] = 0; else p *= 2; }
		if (cnt % 2)ans -= p;
		else ans += p;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1LL << 30;
int MOD = 1e9+7;
main(){
    ll N,K;
    cin >> N >> K;
    vector<pair<int,int>   > num(N);
    for(int i = 0;i < N;i++){
        int a,b;
        cin >> a >> b;
        num[i] = make_pair(a,b);
    }
    sort(num.begin(),num.end());
    ll sum = 0;
    for(int i = 0;i < N;i++){
        sum += num[i].second;
        if(sum >= K){
            cout << num[i].first << endl;
            return 0;
        }
    }
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
const int MOD = 1000000007;
  
int main() {
  int N,A,B;
  cin >> N >> A >> B;
  cout << min(A*N,B) << endl;
  return 0;
}

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

#define debug_input freopen("stdin.in", "r", stdin)
#define debug_output freopen("stdout.out", "w", stdout)
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define FORALL(i, n) for(int i = 0; i < n; i++)
#define FORD(i, a, b) for(int i = a; i >= b; i--)
#define SORT(a) sort(a.begin(), a.end())
#define REV(a) reverse(a.begin(), a.end())
#define NP(a) next_permutation(a.begin(), a.end())
#define endl "\n"
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

int n, m;
int a, b;
int par[200005];
int cnt[200005];

int findParent(int a) {
	if(par[a] == -1) {
		return a;
	}
	return par[a] = findParent(par[a]);
}

void merge(int a, int b) {
	int pa = findParent(a);
	int pb = findParent(b);

	if(pa != pb) {
		par[pa] = pb;
	}

	return;
}

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

	cin >> n >> m;
	FOR(i, 0, n + 1) par[i] = -1;

	FORALL(i, m) {
		cin >> a >> b;
		merge(a, b);
	}

	FORALL(i, n + 1) {
		cnt[findParent(i)]++;
	}

	int maxi = 0;
	FOR(i, 1, n) {
		maxi = max(maxi, cnt[i]);
	}

	cout << maxi << endl;

	return 0;
}

Measured memory_bytes: 10524
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=500500;
int n,m,k;
ll r,D,X;
int a[maxn];
int main()
{
	cin>>n>>m;
	for(int i=1,u,v;i<=m;i++)
	{
		cin>>u>>v;
		a[u]+=1,a[v+1]-=1;
	}
	for(int i=1;i<=n;i++)a[i]=a[i]+a[i-1];
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		if(a[i]==m)ans++;
	}cout<<ans<<endl;
}


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

int main(){
  string S; cin >> S;
  string ans = "";
  for(auto s: S){
    if(s == '0') ans += '0';
    else if(s == '1') ans += '1';
    else if(!ans.empty()) ans.erase(ans.size()-1);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
n = int(input())
a = map(int, input().split())
num4 = 0
num1 = 0
for i in a:
    if i % 4 == 0:
        num4 += 1
        continue
    if i % 2 == 1:
        num1 += 1
plus, minus = num4 + num1, num4 - num1
if minus >= 0 or minus == -1 and plus % 2 == 1 and n - plus == 0:
    print("Yes")
else:
    print("No")


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

#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
// pll pp; -> (pp.first,pp.second)
// vector<vl> pp(n,vl(2)); sort(pp.begin(),pp.end(),[](vl a,vl b){return a[0]<b[0];});

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define RREP(i,n) for(ll (i)=(n)-1;(i)>=0;(i)--)
#define FOR(i,a,b) for(ll (i)=(a);(i)<(b);(i)++)
#define FORR(i,a,b) for(ll (i)=(b)-1;(i)>=(a);(i)--)
#define DEBUG(x) cout << #x << ": " << x << endl
#define CHMAX(a,b) a=max((a),(b))
#define CHMIN(a,b) a=min((a),(b))
/*}}}*/
int main() {
  ll x,a;
  cin >> x >> a;
  ll ans;
  if(x<a){
    ans = 0;
  }else{
    ans = 10;
  }
  cout << ans<< endl;
  return 0;
}


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

for i in range(1,3501):
    for j in range(1,3501):
        if (4*i*j-n*i-n*j)>0 and float((n*i*j)/(4*i*j-n*i-n*j)).is_integer():
            print(i,j,int((n*i*j)/(4*i*j-n*i-n*j)))
            exit()









Measured memory_bytes: 40684
#include<bits/stdc++.h>
using namespace std;
bool cmp(string x,string y){
	return x<y;
}
int main(){
	int n,l;
	string x[105];
	scanf("%d%d",&n,&l);
	for(int i=1;i<=n;i++) cin>>x[i];
	sort(x+1,x+n+1,cmp);
	for(int i=1;i<=n;i++) cout<<x[i];
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define pb push_back
#define ff first
#define ss second
#define endl '\n'
#define fast ios::sync_with_stdio(false); cin.tie(NULL);
const double eps = 1e-6;

/////////////////////////////////////////////

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

////////////////////////////////

#define int long long
const int N = 1e5 + 10;
int n,k;
int a[N];
int dp[N];

int calc(int pos){

    if(pos < 0)
        return 1e10;
    if(pos==0)
        return 0;

    int &ans = dp[pos];

    if(ans!=-1)
        return ans;
    ans = 1e17;
    for(int i = 1 ; i <= k ; ++i){

        ans = min(ans , abs(a[pos]-a[pos-i]) + calc(pos-i));
    }

    return ans;


}

void solve(){

    cin>>n>>k;
    for(int i = 0 ; i < n;  ++i)
        cin>>a[i];

    memset(dp , -1,sizeof dp);

    int ans = calc(n-1);

    cout<<ans<<endl;
}
signed main(){

    fast;
    int t = 1;
    //cin>>t;
    while(t--)
        solve();
}


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

namespace ConsoleApp1
{
    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            B();
        }

        static void B()
        {
            var N = ReadInt();
            var K = ReadInt();
            var ans = 1;
            for (int i = 0; i < N; i++)
            {
                ans = Math.Min(ans * 2, ans + K);
            }
            Console.WriteLine(ans);
        }

        public static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0)
                throw new Exception("0未満");

            if (start > stop || (start == 0 && stop == 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        public static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        public static int DigitsSum(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        public static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        public static string Read()
        {
            return Console.ReadLine();
        }

        public static IList<int> ReadIntInputs()
        {
            return Read().Split(' ').Select(int.Parse).ToList();
        }

        public static int ReadInt()
        {
            return int.Parse(Read());
        }

        public static IList<string> ReadInputs()
        {
            return Read().Split(' ').ToList();
        }
    }
}

Measured memory_bytes: 11092
#include <iostream>
#include <string>

using namespace std;

int main() {
    string str;
    cin >> str;


    
    if(str=="Sunny") cout << "Cloudy" << endl;
    else if(str=="Cloudy") cout << "Rainy" << endl;
    else cout << "Sunny" << endl;

    return 0;
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
using namespace std;
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;

// 最大公約数
ll gcd(ll a, ll b)
{
   if (a%b == 0) {
       return(b);
   } else {
       return(gcd(b, a%b));
   }
}

// 最小公倍数
ll lcm(ll a, ll b){
   return a / gcd(a, b) * b;
}

//素数判定
bool is_prime(const unsigned n){
    switch(n){
        case 0: // fall-through
        case 1: return false;
        case 2: // fall-through
        case 3: return true;
    } // n > 3 が保証された
    if(n % 2 == 0 || n % 3 == 0) return false;
    for(unsigned i = 5; i * i <= n; i += 6) {
        if(n % i     == 0) return false; // (6の倍数)-1
        if(n % (i+2) == 0) return false; // (6の倍数)+1
    }
    return true;
}

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; }

/*   *   *   *   *   *   *   *   *   *   *   */

// dp[i+1][j] : i日目までで得られる最大の幸福度
// j : 0:A 1:B 2:C 
ll dp[100010][3];

void solve() {
    ll n; cin >> n;
    Vl a(n+1), b(n+1), c(n+1);
    Rep(i, 1, n) cin >> a[i] >> b[i] >> c[i];
    rep(j, 0, 3) dp[0][j] = 0;
    rep(i, 1, n+1){
        dp[i][0] = max(dp[i-1][1]+a[i], dp[i-1][2]+a[i]);
        dp[i][1] = max(dp[i-1][2]+b[i], dp[i-1][0]+b[i]);
        dp[i][2] = max(dp[i-1][0]+c[i], dp[i-1][1]+c[i]);
    }
    cout << max({dp[n][0], dp[n][1], dp[n][2]}) << endl;
}

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

    solve();
    return 0;
}


Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
long long d,ans,p[20]={1},dx1[20],dx2[20];
vector<long long> v;
void dfs(int nw,int num,vector<pair<long long,long long> >&w,long long val,long long cnt)
{
	if(nw==num)
	{
		w.push_back(make_pair(val,cnt));
		return;
	}
	for(int i=-9;i<10;++i)
	 if(nw==0) dfs(nw+1,num,w,val+v[nw]*i,cnt*dx2[i+10]);
	 else dfs(nw+1,num,w,val+v[nw]*i,cnt*dx1[i+10]);
}
long long solve(int l)
{
	v.clear();
	for(int i=0;l-1-i>i;++i)
	 v.push_back(p[l-1-i]-p[i]);
	vector<pair<long long,long long> > v1,v2;
	dfs(0,(v.size()+1)/2,v1,0,1);
	dfs((v.size()+1)/2,v.size(),v2,0,1);
	long long tot=0;
	map<long long,long long> mp;
	for(int i=0;i<v2.size();++i)
	 mp[v2[i].first]+=v2[i].second;
	for(int i=0;i<v1.size();++i)
	 tot+=mp[v1[i].first+d]*v1[i].second;
	if(l%2) tot*=10;
	return tot;
}
int main()
{
	cin>>d;
	for(int i=1;i<20;++i) p[i]=p[i-1]*10;
	for(int i=0;i<10;++i)
	 for(int j=0;j<10;++j)
	 {
	 	++dx1[i-j+10];
	 	if(i) ++dx2[i-j+10];
	 }
	for(int i=2;i<=18;++i)
	 ans+=solve(i);
	cout<<ans;
	return 0;
}

Measured memory_bytes: 207024
#include<bits/stdc++.h>
#include<algorithm>
using namespace std;
typedef long long unsigned int ll;



int main(){
    int n;
    cin>>n;
    ll m;
    cin>>m;
    ll a[100005];
    for(int i=0;i<n;i++){
        cin>>a[i];
        a[i]%=m;
    }
    
    
    map<ll,ll> mod;
    ll sum[100005]={0};
    mod[0]=1;
    for(int i=0;i<n;i++){
        sum[i+1]=a[i]+sum[i];
        sum[i+1]%=m;
        mod[sum[i+1]]++;
    }
    
    /*for(int i=1;i<=n;i++){
        mod[sum[i]]++;
    }*/
    ll ans=0;
    for(auto i : mod){
        ans += (i.second*(i.second - 1)) / 2;
    }
    
    cout<<ans<<endl;
    return 0;
}



Measured memory_bytes: 4992
#include <stdio.h>

int main(){
  int k,i,j=0;
  long list[100005],l;
  scanf("%d",&k);
  for(i=0;i<9;i++){
    list[i]=i+1;
    j++;
  }
  if(k<9){
    printf("%d",k);
  }else{
    for(i=0;j<k;i++){
      l=list[i]%10;
      switch(l){
        case 0:
          list[j]=list[i]*10;
          list[j+1]=list[i]*10+1;
          break;
        case 9:
          list[j]=list[i]*10+8;
          list[j+1]=list[i]*10+9;
          break;
        default:
          list[j]=list[i]*10+l-1;
          list[j+1]=list[i]*10+l;
          list[j+2]=list[i]*10+l+1;
          j++;
          break;
      }
      j+=2;
    }
    printf("%ld",list[k-1]);
  }
  return(0);
}

Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
typedef vector <int> vi;
typedef map<int,int> mii;
typedef pair<int,int> pii;
#define ll long long int
#define pb push_back
#define PI 3.1415926535897932384626
#define boost ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define MOD 4294967296
#define MAX 100001
#define forn(i,n) for(int i=0;i<n;i++)
#define F first
#define S second
#define mset(x,v) memset(x, v, sizeof(x))
const int lim=1e7;
vector<ll> v1[3];
ll ans(ll x)
{
	ll d=0;
	while(x%100==0)
	{
		d++;
		x=x/100;
	}
	return d;
}
int main()
{   
      ll d,n;
      cin>>d>>n;
	for(int i=1;i<=lim;i++)
	{
	            ll xx=ans(i);
		if(xx==0)
		v1[0].pb(i);  //
		else if(xx==1)
		v1[1].pb(i);
		else if(xx==2)
		v1[2].pb(i);
	}
	cout<<v1[d][n-1];
}

Measured memory_bytes: 135004
//
//  main.cpp
//  compeitive_coding
//
//  Created by Ajay Chauhan
//  Copyright © 2020 Ajay Chauhan. All rights reserved.
//
//         **
//        *  *
//       *    *
//      *      *
//     *        *
//    ************
//   *            *
//  *              *
// *                *
//*                  *

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ldo;
#define endl            "\n"
#define pi              3.1415926535897932384626433832795
#define mod             (ll)1000000009
#define pp              pair<ll,ll>
#define vii             vector<int>
#define vll             vector<ll>
#define vpp             vector<pp>
#define vss             vector<string>
#define pb              push_back
#define pob             pop_back
#define mp              make_pair
#define pf              push_front
#define pof             pop_front
#define eb              emplace_back
#define ff              first
#define ss              second
#define bs(v,x)         binary_search(v.begin(),v.end(),x)
#define ub(v,x)       upper_bound(v.begin(),v.end(),x)
#define lb(v,x)       lower_bound(v.begin(),v.end(),x)
#define print(A,n)      for(ll i=0;i<n;++i)cout<<A[i]<<' ';cout<<endl;
#define take(A,n)       for(ll i=0;i<n;++i)cin>>A[i];
#define set(x)          memset(x,0,sizeof(x));
#define Sort(x)         sort(x.begin(),x.end())
#define fast            ios_base::sync_with_stdio(false);cin.tie(NULL);
#define setd(s,s1,S1)   set_difference(s.begin(),s.end(),s1.begin(),s1.end(),inserter(S1,S1.end())); //set and multi set
#define trace1(x)                cout<<#x<<": "<<x<<endl
#define trace2(x, y)             cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define trace(f) for(auto it=f.begin();it!=f.end();it++)cout<<*it<<" ";cout<<endl;



long double logn(long double a,long double n)
{
    return(log(n)/log(a));
}
vll prime_factors(ll n){
    vll ret;
    ll c1=0;
    while(n%2==0){
        c1++;
        n=n/2;
    }
    if(c1)
        ret.pb(c1);
    for(ll i=3;i<=sqrt(n);i++){
        ll c2=0;
        while(n%i==0)
        {
            c2++;
            n=n/i;
        }
        if(c2)
            ret.pb(c2);
    }
    if(n>2)
        ret.pb(1);
    return ret;
}
int main()
{
    fast;
    ll L=1;
//    cin>>L;
    while(L--){
        ll n;
        cin>>n;
        vll p;
        p=prime_factors(n);
        ll ans=0;
        for(ll i=0;i<p.size();i++){
            ll x=p[i];
            ll z=pow(1+8*x,0.5);
            ans+=(z-1)/2;
        }
        cout<<ans<<endl;
    }
    return 0;
}








Measured memory_bytes: 4092