akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;

namespace c
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var xList = Console.ReadLine().Split().Select(i => int.Parse(i)).ToArray();

            var minValue = int.MaxValue;
            foreach(var p in Enumerable.Range(1, 100)){
                var sum = 0;
                foreach(var x in xList){
                    sum += ((x - p) * (x - p));
                }
                minValue = Math.Min(minValue, sum);
            }

            Console.WriteLine(minValue);
        }
    }
}


Measured memory_bytes: 11348
// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
// ぜったいあきらめない
#if defined(DAIJOBU)
#include "/home/ichigo/includes.hpp"
#include "/home/ichigo/debug.hpp"
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#include <bits/stdc++.h>
#define deb(x...)
#endif
#define FIO {ios::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr);}

using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());


int main(){
	FIO
	
	int n;
	cin >> n;
	if(n / 10 == 9 || n % 10 == 9)puts("Yes");
	else puts("No");
 	return 0; 
}


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

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

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    cout << count(all(s), '+') * 2 - 4 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define f(i,n) for(int i=0;i<n;i++)
#define P pair<int,int>
#define F first
#define S second
#define int long long
#define mod 1000000007
#define mmod 998244353
#define all(v) v.begin(), v.end()
#define INF LLONG_MAX/3
#define PI 3.14159265359
using namespace std;
int mypow(int fa, int fb, int fc) {
	if (fb == 0)return 1;
	if (fb % 2)return mypow(fa, fb - 1, fc)*fa%fc;
	int z = mypow(fa, fb / 2, fc);
	return z * z%fc;
}
int k(int fa) {
	int x = 0;
	while (fa) {
		x++;
		fa /= 10;
	}
	return x;
}
int gcd(int fa, int fb) {
	if (fb == 0)return fa;
	return gcd(fb, fa%fb);
}
int x[3000];
int dp[3001][3001];
signed main() {
	int a, b;
	cin >> a >> b;
	f(i, a)cin >> x[i];
	dp[0][0] = 1;
	f(i, a) {
		f(j, b + 1) {
			if (j >= x[i])dp[i + 1][j] += dp[i][j - x[i]];
			dp[i + 1][j] += dp[i][j] * 2;
			dp[i + 1][j] %= mmod;
		}
	}
	cout << dp[a][b] << endl;
}


Measured memory_bytes: 73956
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF=1e9,MOD=1e9+7,ohara=1e6+10;
const ll LINF=1e18;
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl
#define doublecout(a) cout<<fixed<<setprecision(15)<<a<<endl;
#define Cerr(x) cerr<<(x)<<endl
#define fi first
#define se second
#define P pair<ll,ll> 
#define m_p make_pair
#define V vector<ll> 

ll n,cnt,ans=LINF,a,b,c,d,tmp,tmpp,m,h,w,x,y,sum,pos,k;
ld doua;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
//int dy[]={-1,0,1,-1,1,-1,0,1};
//int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

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

    vector<ll> p(5);
    rep(i,5)cin>>p[i];
    do{
        ll now=0;
        rep(i,5){
            if(now%10==0)now+=p[i];
            else{
                while(1){
                    now++;
                    if(now%10==0)break;
                }
                now+=p[i];
            }
        }
        ans=min(ans,now);
    }while(next_permutation(all(p)));
    Cout(ans);
    return 0;
}


Measured memory_bytes: 256
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//イテレータあるけど順序保持しないmap
#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define INF 1000000000000 //10^12
#define MOD 10000007 //10^9+7
#define PB push_back

template<typename T, typename U, typename Comp=less<>>
bool chmax(T& xmax, const U& x, Comp comp={}) {
    if(comp(xmax, x)) {
        xmax = x;
        return true;
    }
    return false;
}

template<typename T, typename U, typename Comp=less<>>
bool chmin(T& xmin, const U& x, Comp comp={}) {
    if(comp(x, xmin)) {
        xmin = x;
        return true;
    }
    return false;
}
int main(){
    int S, W;
    scanf("%d %d", &S, &W);
    if(S <= W){
       printf("unsafe"); 
    }
    else{
       printf("safe"); 
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 3828
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <queue>
#include <stack>
#include <cmath>

using namespace std;
using ll = long long;
using ull = unsigned long long;

void ARC072D()
{
	ull X, Y;
	cin >> X >> Y;
	if (X > Y)
	{
		swap(X, Y);
	}
	bool isA = Y - X >= 2;

	if (isA)
	{
		cout << "Alice" << endl;
		return;
	}
	else
	{
		cout << "Brown" << endl;
		return;
	}
}
int main()
{
	ARC072D();
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mod 1000000007
#define ff first
#define ss second
#define endl '\n'
using namespace std;
const ll inf=1e18+7 ;
/*ll power(ll x,ll y)
{
    ll res=1;
    while(y>0)
    {
        if(y%2==1)
            res=(res*x)%mod;
        x=(x*x)%mod;
        y=y/2;
    }
    return res;
}*/
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
   ll n,c=0,m,i,s=0,j;
   cin>>n;
   vector<ll>v;
   for(i=0;i<n;i++)
   {
       cin>>m;
       v.pb(m);
   }
   sort(v.begin(),v.end());
   for(i=0;i<n;i++)
   {
       for(j=i+1;j<n;j++)
       {
           c=v[i]+v[j];
           ll p=lower_bound(v.begin(),v.end(),c)-v.begin();
           p=p-j-1;
           s=s+max(p,0LL);
       }
   }
   cout<<s<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<l_l> vpl;
typedef vector<string> vs;
typedef pair<l_l,ll> lll;
#define pb push_back
#define sz(x) (int)(x).size()
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=1;i<=(n);i++)
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=10100100100100100;
const ll dx[4]={1,-1,0,0};
const ll dy[4]={0,0,1,-1};
template<class T> inline bool chmin(T& a,T b){
if(a>b){
a=b;
return true;
}
return false;
}
template<class T> inline bool chmax(T& a,T b){
if(a<b){
a=b;
return true;
}
return false;
}
ll d[110][110];
int main(){
    ll v,e;cin>>v>>e;
    rep(i,110){
        rep(j,110){
            d[i][j]=LINF;
        }
        d[i][i]=0;
    }
    rep(i,e){
        ll u,v,x;cin>>u>>v>>x;
        d[u][v]=x;
    }
    rep(k,v){
        rep(j,v){
            rep(i,v){
                d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
            }
        }
    }
    rep(i,v){
        if(d[i][i]<0){
            cout<<"NEGATIVE CYCLE"<<endl;
            return 0;
        }
    }
    rep(i,v){
        rep(j,v){
            if(j!=0)cout<<" ";
            if(d[i][j]>2000000000)cout<<"INF";
            else cout<<d[i][j];
        }
        cout<<endl;
    }
    return 0;
}


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

#define int ll
#define rep(i,n) for(int i=0,i##_cond=(n);i<i##_cond;++i)
#define FOR(i,a,b) for(int i=(a),i##_cond=(b);i<i##_cond;++i)
#define ROF(i,a,b) for(int i=(a)-1,i##_cond=(b);i>=i##_cond;--i)
#define all(a) (a).begin(),(a).end()
#define pb push_back
using ll  = long long;
using vi  = vector<int>;

int k;
vi small;

bool solve(int mid){ // small[mid]を使わない
  vector<bool> dp(k,false);
  dp[0] = true;
  rep(i,small.size())
    if(i != mid)
      ROF(j,k-small[i],0)
	dp[j+small[i]] = dp[j+small[i]] or dp[j];

  bool res = false;
  FOR(i,k-small[mid],k) res |= dp[i];
  return res;
}

int bs(int _ok, int _ng){
  int ok = _ok;
  int ng = _ng;

  while(abs(ok - ng) > 1){
    int mid = (ok + ng) / 2;
    if(solve(mid)){
      ok = mid;
    }else{
      ng = mid;
    }
  }
  return ok;
}

main(){
  int n; cin >> n >> k;
  vi a(n); rep(i,n) cin >> a[i];

  // k以上の数は全て必要
  // a[i] < kが必要 <=> a[i]を使って[k,k+a[i])が作れる
  rep(i,n) if(a[i] < k) small.pb(a[i]);
  sort(all(small));

  cout << bs(small.size(),-1) << endl;
}

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


int main() {
  string s , t ;
  cin >> s >> t ;
  
  string a ;
  int n=s.size()+t.size();
  int m=s.size();
  if(n%2==0){
    for(int i=0 ; i<n/2 ; i++ ){
      a+=s.at(i);
      a+=t.at(i);
    }
    
    cout << a << endl;
    
  }
  
  if(n%2==1){
    for(int i=0 ; i<n/2 ; i++ ){
      a+=s.at(i);
      a+=t.at(i);
    }
    a+=s.at(m-1);
    
    cout << a << endl;
    
    
  }
  
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main( String[] args ){

        Scanner in = new Scanner(System.in);

        String[] params = in.nextLine().split(" ");
        int n = Integer.parseInt(params[0]);
        int a = Integer.parseInt(params[1]);
        int b = Integer.parseInt(params[2]);

        System.out.println((n*a<b)?(n*a):b);

        return;

    }
}

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

using namespace std;
typedef long long int ll;

const int INF = 1e9+9;

// ????????????????????±
template <typename T, T INIT>
struct node {
	T v, lazy;
	node(){
		v = INIT;
		lazy = 0;
	}
	// ????????????????????´??°
	void merge(T vl, T vr){
		v = min(vl, vr);
	}
	// ????????????????????´??°(lazy?????¨)
	T add(int l, int r, T _v=0){
		T sum = lazy + _v;
		v += sum;
		lazy = 0;
		return sum;
	}
	// ?????¶???????????´(??????)
	void addLazy(T v){
		lazy += v;
	}
};

template <typename T, typename NODE=node<T,INF> >
class SegTree{
	// ?????¶??????????????¨??????(?????¨??????????????????????¢?????????????Lazy????????¬?????????)
	void propLazy(int a, int b, int k, T v=0){
		T lazy = data[k].add(a, b, v);
		if( k < N ){
			data[k*2+0].addLazy(lazy);
			data[k*2+1].addLazy(lazy);
		}
	}
	// ?????°??????????????????????????????
	T prop(int l, int r, T v, int a, int b, int k=1){
		// ????????????????????????????¢?????????????
		propLazy(a, b, k);
		// ?????????
		NODE nd;	// ??????????????¨(??????????????´????????????????????????)
		if( l <= a && b <= r ){
			// ?????¨?????????????????´???
			propLazy(a, b, k, v);
			return data[k].v;
		}else if( l < b && a < r ){
			// ?????????????????????????????´???
			int m = (a+b) / 2;
			T vl = prop(l,r,v, a, m, k*2);
			T vr = prop(l,r,v, m, b, k*2+1);
			data[k].merge( data[k*2].v, data[k*2+1].v );
			nd.merge( vl, vr );
		}
		return nd.v;
	}

public:
	vector<NODE> data;
	int N;
	SegTree(int _N){
		// _N <= (N = 2^k) ????????????N???????????????
		N = 1;
		while( N < _N ) N<<=1;
		data.resize(N*2);
	}
	// ?????°???????????????????????´??°(??????????????´????????????v????????´)
	void update(int l, T v){
		prop(l, l+1, v-get(l), 0, N);
	}
	// ?????°???????????????????????´??°(???????????????)
	T add(int l, int r, T v){
		return prop(l,r,v,0,N);
	}
	// ???????????? [l,r)
	T get(int l, int r){
		return prop(l,r,0,0,N);
	}
	// ???????????? [l,l+1)
	T get(int l){
		return prop(l,l+1,0,0,N);
	}
};



// ?¢????

#include <algorithm>
#include <set>
#define rep(i,n) for(int i=0; i<(n); i++)
#define rrep(i,n) for(int i=(n)-1; i>=0; i--)
#define all(X) (X).begin(),(X).end()

typedef pair<int,int> pii;


// AOJ DSL_2_A
const ll INF2 = ((ll)1<<31) - (ll)1;
SegTree<ll,node<ll,INF2> > sg(100005);
int main(){
	int n, q;
	cin >> n >> q;
	rep(i,q){
		int c, x, y;
		cin >> c >> x >> y;
		if( c == 0 ){
			sg.update(x, y);
		}else{
			y++;
			cout << sg.get(x, y) << endl;
		}
		//rep(j,18) cout << sg.data[j].get() << " "; cout << endl;
	}
	return 0;
}

Measured memory_bytes: 7056
N = int(input())
S = input()
C = [chr(i) for i in range(97, 123)]
ans = 0
for i in range(0, N - 1):
  count = 0
  a = S[:i + 1]
  b = S[i + 1:]
  for c in C:
    if c in a and c in b:
      count += 1
  ans = max(count, ans)
print(ans)

Measured memory_bytes: 65496
#include<iostream>
#include<cstdlib>
#include<cstdio>
#include<string>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<math.h>
using namespace std;

int n, m;
int res = 0;

int main(){
    cin >> n >> m;
    vector<int> a(m);
    vector<int> b(m);
    vector<long long int> h(n);
    vector <bool> good(n);


    for(int i=0;i<n;i++){
        cin >> h[i];
        good[i] = true;
    }
    for(int i=0;i<m;i++){
        cin >> a[i] >> b[i];
    }

    for(int i=0;i<m;i++){
        if(h[a[i]-1] == h[b[i]-1]){
            good[a[i]-1] = false;
            good[b[i]-1] = false;
        }
        else if(h[a[i]-1] > h[b[i]-1]) good[b[i]-1] = false;
        else good[a[i]-1] = false;
    }

    for(int i=0;i<n;i++){
        if(good[i]) res++;
    }

    cout << res << endl;
}

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

#define rep(i,s,n) for (int i = (int)s; i < (int)n; i++)
#define ll long long
#define pb push_back
#define All(x) x.begin(), x.end()
#define Range(x, i, j) x.begin() + i, x.begin() + j
#define lbidx(x, y) lower_bound(x.begin(), x.end(), y) - x.begin()
#define ubidx(x, y) upper_bound(x.begin(), x.end(), y) - x.begin()
#define BiSearchRangeNum(x, y, z) lower_bound(x.begin(), x.end(), z) - lower_bound(x.begin(), x.end(), y)turn idx;
#define deg_to_rad(deg) ((((double)deg)/((double)360)*2*M_PI))
#define rad_to_deg(rad) ((((double)rad)/(double)2/M_PI)*(double)360)

template<class T>
inline bool chmax(T &a, T b) {
  if(a < b) {
    a = b;
    return true;
  }
  return false;
};

template<class T>
inline bool chmin(T &a, T b) {
  if(a > b) {
    a = b;
    return true;
  }
  return false;
};

int main() {
  string S;
  cin >> S;
  if (S == "SUN") {
    cout << 7 << endl;
  } else if (S == "MON") {
    cout << 6 << endl;
  } else if (S == "TUE") {
    cout << 5 << endl;
  }else if (S == "WED") {
    cout << 4 << endl;
  }else if (S == "THU") {
    cout << 3 << endl;
  }else if (S == "FRI") {
    cout << 2 << endl;
  }else if (S == "SAT") {
    cout << 1 << endl;
  }
  return 0;
};


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

int p[10],q[10];

int main(void){
	int a,b,n,i,j,ans=0;
	bool flag;
	cin >> n;
	for(i=0; i<n; ++i){
		cin >> p[i];
		--p[i];
	}
	for(i=0; i<n; ++i){
		cin >> q[i];
		--q[i];
	}
	for(i=0; i<n; ++i){
		if(p[i]<q[i]){
			break;
		}else if(p[i]>q[i]){
			for(i=0; i<n; ++i){
				swap(p[i],q[i]);
			}
			break;
		}
	}
	do{
		flag = true;
		for(i=0; i<n; ++i){
			if(p[i]!=q[i]){
				flag =false;
				break;
			}
		}
		if(flag){
			break;
		}
		++ans;
	}while(next_permutation(p,p+n));
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define REP1(i, n) for(int i = 1; i <= (n); i++)
#define REPD(i,a,b) for (int i=(a);i<=(b);i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef set<int> si;
typedef vector<si> vsi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<int, int> pi;
typedef queue<int> qi;
typedef queue<pi> qpi;
typedef pair<ll, ll> pll;
typedef queue<pll> qpll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
const int mod = 1000000007;
const int INF = 1001001001;
// 小数点　<< fixed << setprecision(0) <<
// sort降順　sort(ALL(),greater<int>());
// 円周率　M_PI
// 文字判定　isupper islower
// 文字変換　
// 順列　do {} while(next_permutation(ALL(X)));
// 最大値　LLONG_MAX
// a内でx以上　auto iter = lower_bound(ALL(a), x);
// a内でxより大きい　auto iter = upper_bound(ALL(a), x);
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
struct edge {
    int from; //出発点
    int to;   //到達点
    int cost; //移動コスト
};
typedef struct edge se;
typedef vector<edge> ve;
unsigned Euclidean_gcd(unsigned a, unsigned b) {
  if(a < b) return Euclidean_gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

int digit_sum(int n) {
  int sum=n%10;
  while(n!=0) {
    n/=10;
    sum+=n%10;
  }
  return sum;
}

vpll PrimeFactorization(ll n) {
  vpll res;
  for (ll i=2; i*i<=n; i++) {
    if(n%i!=0) continue;
    ll ex=0;
    while(n%i==0) {
      ex++;
      n/=i;
    }
    res.push_back(pll(i,ex));
  }
  if(n!=1) res.push_back(pll(n,1));
  return res;
}

int main() {
  int k;
  cin >> k;
  if(k%2==0) {
    cout << "-1" << endl;
    return 0;
  }
  int w=7%k;
  int x=w;
  int cnt=1;
  while(w!=0) {
    w=(w*10+x)%k;
    cnt++;
    if(cnt>k) {
      cout << "-1" << endl;
      return 0;
    }
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 3628
#include<stdio.h>
int main(void){
char s[4];
  scanf("%s",&s);

	
      if(s[0]==s[1]){
		if(s[2]==s[3]&&s[0]!=s[2])
          printf("Yes");
        else printf("No");
        return 0;
      }
if(s[0]==s[2]){
if(s[1]==s[3]&&s[0]!=s[1])
          printf("Yes");
        else printf("No");
  return 0;
}
      if(s[0]==s[3]){
        if(s[1]==s[2]&&s[0]!=s[1])
          printf("Yes");
        else printf("No");
        return 0;
      }
      
      printf("No");
      return 0;

    }

Measured memory_bytes: 128
# AISing Programming Contest 2019 / エイシング プログラミング コンテスト 2019: B – Contests
N = int(input())
A, B = [int(s) for s in input().split()]
P = [int(s) for s in input().split()]

leA = [p for p in P if p <= A]
gtAleB = [p for p in P if A < p <= B]
gtB = [p for p in P if p > B]

print(min(len(leA), len(gtAleB), len(gtB)))

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
 
#define P(p) cout<<(p)<<endl
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return
#define lb(v,n) lower_bound(v.begin(),v.end(),n)
#define ub(v,n) upper_bound(v.begin(),v.end(),n)
#define mae(v) max_element(v.begin(),v.end())
#define mie(v) min_element(v.begin(),v.end())
#define INF 0x7FFFFFFF
#define mod 1000000007
typedef long long ll;
////////////////////////////////////////////////////////////

#define MAX 100000

//vector<int> dp( 100010 , INF );
int dp[MAX+10];
int h6[7];
int h9[6];
int n;
void solve( int i ){
	//cout << i << " " << dp[i] << endl;
	if( i > n )
		ret;
	rrep(j,6,0){
		if( i + h6[j] < MAX+1 && dp[i] + 1 < dp[i+h6[j]]){
			dp[i + h6[j]] = dp[i] + 1;
		}
	}
	rrep(j,5,0){
		if( i + h9[j] < MAX+1 &&  dp[i] + 1 < dp[i+h9[j]]){
			dp[i + h9[j]] = dp[i] + 1;
		}
	}
	if( i + 1 < MAX+1 && dp[i] + 1 < dp[i+1] ){
		dp[i+1] = dp[i] + 1;
	}
	solve( i + 1 );
	ret;
}

int main(){
	cin >> n;

	rep(i,0,MAX+5) dp[i] = INF;
	rep(i,0,7)
		h6[i] = pow( 6 , i );

	rep(i,0,6)
		h9[i] = pow( 9 , i );

	dp[0] = 0;
	solve(0);

	cout << dp[n] << endl;

	ret 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long

const long long MOD = 1000000007;

int main(){
  int a,b,t;
  cin >> a >> b >> t;
  int ans=(t/a)*b;
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
	string t;int n[5];cin>>t;
	for(int i=1;i<=4;i++)n[i]=t[i-1]-'0';
	if(n[1]+n[2]+n[3]+n[4]==7)printf("%d+%d+%d+%d=7",n[1],n[2],n[3],n[4]);
	else if(n[1]+n[2]+n[3]-n[4]==7)printf("%d+%d+%d-%d=7",n[1],n[2],n[3],n[4]);
	else if(n[1]+n[2]-n[3]+n[4]==7)printf("%d+%d-%d+%d=7",n[1],n[2],n[3],n[4]);
	else if(n[1]-n[2]+n[3]+n[4]==7)printf("%d-%d+%d+%d=7",n[1],n[2],n[3],n[4]);
	else if(n[1]+n[2]-n[3]-n[4]==7)printf("%d+%d-%d-%d=7",n[1],n[2],n[3],n[4]);
	else if(n[1]-n[2]-n[3]+n[4]==7)printf("%d-%d-%d+%d=7",n[1],n[2],n[3],n[4]);
	else if(n[1]-n[2]-n[3]-n[4]==7)printf("%d-%d-%d-%d=7",n[1],n[2],n[3],n[4]);
	else if(n[1]-n[2]+n[3]-n[4]==7)printf("%d-%d+%d-%d=7",n[1],n[2],n[3],n[4]);
	return 0;
}

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

using namespace std;

typedef long long ll;

const int N = 2010;

vector<vector<int>> v(N, vector<int>(N)), up(N, vector<int>(N)), lft(N, vector<int>(N));

int s[N][N];

void add(vector<vector<int>> &a, int x, int y) {
    for (int i = x; i < N; i |= i + 1) {
        for (int j = y; j < N; j |= j + 1) {
            ++a[i][j];
        }
    }
}

int get(vector<vector<int>> &a, int x, int y) {
    int s = 0;
    for (int i = x; i >= 0; i = (i & (i + 1)) - 1) {
        for (int j = y; j >= 0; j = (j & (j + 1)) - 1) {
            s += a[i][j];
        }
    }
    return s;
}

int get(vector<vector<int>> &a, int x1, int y1, int x2, int y2) {
    return get(a, x2, y2) + get(a, x1 - 1, y1 - 1) - get(a, x2, y1 - 1) - get(a, x1 - 1, y2);
}

int main() {
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, m, q;
    cin >> n >> m >> q;
    char c;
    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= m; ++j) {
            cin >> c;
            s[i][j] = c - '0';
            if (s[i][j]) {
                add(v, i, j);
            }
        }
    }
    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= m; ++j) {
            if (s[i][j] + s[i][j - 1] == 2) {
                add(lft, i, j);
            }
        }
    }
    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= m; ++j) {
            if (s[i][j] + s[i - 1][j] == 2) {
                add(up, i, j);
            }
        }
    }
    while (q--) {
        int x1, y1, x2, y2;
        cin >> x1 >> y1 >> x2 >> y2;
        cout << get(v, x1, y1, x2, y2) - get(up, x1 + 1, y1, x2, y2) - get(lft, x1, y1 + 1, x2, y2) << '\n';
    }
    return 0;
}

Measured memory_bytes: 65024
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
using namespace std;

#define ll         long long
#define PI         acos(-1.0)
#define FOR(I,A,B) for(int I = (A); I < (B); ++I)

int main(){
    double x1, x2, y1, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    printf("%.04lf\n", sqrt( pow( (x1-x2), 2) + pow( (y1-y2), 2) ) );
}

Measured memory_bytes: 3280
#include <stdio.h>
int p[101];
int m[101][101];

void mco(int p[],int n){
  int i,l,j,k,q;

  for(i=1;i<=n;i++){
    m[i][i]=0;
  }

  for(l=2;l<=n;l++){
    for(i=1;i<=n-l+1;i++){
      j=i+l-1;
      m[i][j] = 1000000000;
      for(k=i;k<=j-1;k++){
	q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
	if(m[i][j]>q){
	  m[i][j]=q;
	}
      }
    }
  }
  printf("%d\n",m[1][n]);
}

int main(){
  int n,i;
  int r,c;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d %d",&r,&c);
    if(i==0){
      p[0]=r;
      p[1]=c;
    }else {
      p[i+1]=c;
    }
  }
  mco(p,n);

  return 0;
}

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

using namespace std;

long long A, B;

int main() {
	cin >> A >> B;
	long long ans = 0, Gcd = __gcd(A, B);
	for(long long i = 2; i * i <= Gcd; ++i) {
		if(Gcd % i) continue;
		++ans;
		while(Gcd % i == 0) Gcd /= i;
	} if(Gcd != 1) ++ans;
	cout << ans + 1 << endl;
	return 0;
}

Measured memory_bytes: 256
import sys
import itertools

def one_step(lo,lis):
    nu = [ e for e in lis ]
    for j in xrange(len(nu)):
        if lo[0][j] == 1:
            nu[j],nu[j+1] = nu[j+1],nu[j]
    return lo[1:],nu

def solve(lo,lis):
    if len(lo) == 0:
        return lis
    nu = [ e for e in lis]
    lo2,nu2 = one_step(lo,nu)
    return solve(lo2,nu2)

while True:
    n = input()
    if n == 0: exit()
    m = input()
    star = input()
    d = input()
    lis = range(n+1)
    lots = []
    for i in xrange(d):
        lots.append( [0] + map(int,raw_input()) + [0])
    if solve(lots,lis)[star] == m: print 0;continue
    for i,j in itertools.product(xrange(d),xrange(1,n)):
        if lots[i][j-1] + lots[i][j] + lots[i][j+1] == 0:
            lots[i][j] = 1
            if solve(lots,lis)[star] == m: print i+1,j;break
            lots[i][j] = 0
    else: print 1

Measured memory_bytes: 4460
#include <stdio.h>

int main() {

  int x;
  int y;

  scanf("%d %d",&x , &y);

  if(x < y){
    int tmp;
    tmp = x;
    x = y;
    y = tmp;
  }
  int r;
  r = x % y;
  while(r != 0){
    x = y;
    y = r;
    r = x % y;
  }

  printf("%d\n",y);


  return 0;
}



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

string trans(ll n, int d){
  if(n == 0)return "";

  ll a = abs(n)%10;
  if(n>0){
    if( (d&1) == 1 && a){
      a = 10 - a;
      n += a;
    }
  }else{
    if( (d&1) == 0 && a){
      a = 10 - a;
      n -= a;
    }
  }
  return trans(n/10,d+1) + (char)('0'+a);
}

int main(){
  ll n;
  while(cin >> n, n){
    cout << trans(n,0) << endl;
  }    
}

Measured memory_bytes: 3124
#include <bits/stdc++.h>
using ll = long long int;
using namespace std;
ll mod=1e9+7;
       


int main() {
  int n;
  cin >>n;
  ll sum=1;
  for(int i=1;i<=n;i++){
    sum*=i;
    if(sum>mod){sum=sum%mod;}
  }
  cout << sum << endl;
}


Measured memory_bytes: 256
//*************************************JAI SAI RAM*************************************//
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define endl '\n'
ll a[300001],q[300001];
ll P=998244353;
void solve()
{
    ll i,j,k,l,m,n,o,r;
    ll ans=0;
    set<ll> se;
    vector<ll> v;
    map<ll,ll> mp;   
    //cin>>i>>j>>k;
    //cout<<((i+j-1)/j)*k<<endl; 
    string a;
    cin>>a;
    r=0;
    for(i=0;i<a.length();i++)
    {
        r+=a[i]-'0';
    }
    if(r%9==0)
    {
        cout<<"Yes\n";
    }
    else 
    cout<<"No\n";
}
int main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(0);
     ll t=1;
   // cin>>t;
    ll o=1;
    while(t--)
    {

        solve();
        o++;
    }
     return 0;
}












































//manpreet.singh orz
//humane orz
//arnavvats orz
//leoamish300 orz
//cipher76 orz
//aug16arpit orz
//aayushindwan orz
//ig_monkey orz
//DeadlyCritic orz
//lucky_21 orz
//sak23 orz
//spookywooky orz
//supahotfire orz
//__FAILURE_orz
//Errichto orz
//tourist orz
//Um_nik orz
//300iq orz
//antontrygub_Oo orz
//boboniu orz
//MikeMirzayanov orz
//MiFaFaOvO orz
// Benq orz
//Radewoosh orz
//AshishGup orz
//Ashishchup orz
//aryanc403 orz
//ma_da_fa_ka orz
// Striver_79 orz
//Love babbar orz
// My Life of ultimate patience and hard work orz!!!!!!!


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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)

//int dxy[5] = {0, 1, 0, -1, 0};
// BIT avl cusum dijkstra dinic geo2 gin graph kruskal lca lcm matrix ncm next_combination segtree st tmp topcoder uf vi 

struct UnionFind {
    vector<int> parent;
    int size;
    UnionFind(int n) :parent(n, -1), size(n) {}
    bool unite(int x, int y) {
        x = root(x); y = root(y);
        if (x == y)return false;
        if (sizeOf(x) < sizeOf(y))swap(x, y);
        parent[x] += parent[y]; parent[y] = x; size--;
        return true;
    }
    bool same(int x, int y) { return root(x) == root(y); }
    int root(int x) { return parent[x] < 0 ? x : parent[x] = root(parent[x]); }
    int sizeOf(int x) { return -parent[root(x)]; }
};

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

    int2(n, m);
    vector<int> data(n);
    for (int i = 0; i < n; i++) {
        cin >> data[i];
        data[i]--;
    }

    UnionFind uf(n);
    rep(i, m) {
        int2(a, b);
        a--; b--;
        uf.unite(a, b);
    }

    int ans = 0;
    rep(i, n) {
        if (uf.same(data[i], i)) ans++;
    }

    cout << ans << endl;
    
    return 0;
}





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

#define f first
#define s second
#define ins insert
#define eb emplace_back
#define endl '\n'
#define ll long long
#define ld long double
#define vl vector<ll>
#define no cout << "NO" << endl
#define yes cout << "YES" << endl
#define tc ll t; cin >> t; while (t--)
#define sz(c) (ll) (c).size()
#define trav(x,c) for(auto &x : c)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define _for(i,a,n) for(ll i = a ; i < n; ++i)
#define _rfor(i,a,n) for(ll i = n-1 ; i >= a; --i)
#define db(x) cout << #x << ": " << x << endl;
#define _db(c) trav(x,c) cout << x << " "; cout << endl;
#define godspeed ios::sync_with_stdio(0); cin.tie(0);
template<typename... T> void read(T&... x) {((cin >> x),...);}

int main() {
    godspeed;
    ll n; cin >> n;
    vl v(n);

    _for(i,0,n) cin >> v[i];

    sort(rall(v));
    ll sum = v[0];

    ll lim;
    if (n%2 == 0) {
    	lim = (n-2)/2;
    	for(ll i = 1 ; i <= lim ; ++i)
    		sum += v[i] + v[i];
    }
    else {
    	lim = (n-2)/2; ll i;
    	for(i = 1 ; i <= lim ; ++i)
    		sum += v[i] + v[i];
    	sum += v[i];

    }

    cout << sum;

}

Measured memory_bytes: 4700
#include<bits/stdc++.h>
using namespace std;
bool is_prime(int X){
  if(X <= 1){
    return false;
  }
  for(int i = 2;(i * i) <= X;i++){
    if(X % i == 0){
      return false;
    }
  }
  return true;
}
int main(){
  ios_base::sync_with_stdio(false);cin.tie(0);
  int X;
  cin>>X;
  int p = X;
  while(!is_prime(p)){
    p++;
  }
  cout<<p<<'\n';
}

Measured memory_bytes: 3644
use std::io;

fn main() {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v:Vec<Vec<char>> = Vec::new();
	for i in iter {
		v.push(i.chars().collect::<Vec<char>>());
	}
	let s1 = v[0].clone();
	let s1c = s1[0].to_uppercase().collect::<Vec<char>>();
	let s2 = v[1].clone();
	let s2c = s2[0].to_uppercase().collect::<Vec<char>>();
	let s3 = v[2].clone();
	let s3c = s3[0].to_uppercase().collect::<Vec<char>>();
	let s = format!("{}{}{}", s1c[0], s2c[0], s3c[0]);
	println!("{}", s);
}

Measured memory_bytes: 4352
#include <iostream>

int main(){
  int i, j;
  std::cin >> i >> j;
  long temp;
  for(int k = 0; k < 2*i-1; ++k){
    temp = j-i+1+k;
    if(-10000 < temp && temp < 10000)
      std::cout << temp << " ";
  }
  std::cout << std::endl;
  return 0;
}


Measured memory_bytes: 256
// OBツ嘉ッツ嘉債宿2011 Day3 D : Marathon Match

#include <iostream>
#include <queue>
#include <cstdio>
#include <cstring>

using namespace std;

int main(){
	int N, M, L;
	int P[100], T[100], V[100];
	// [P][M][lest]
	static double dp[101][101][101];
	for(int i=0;i<=100;i++){
		for(int j=0;j<=100;j++)
			for(int k=0;k<=100;k++) dp[i][j][k] = 0.0;
		dp[i][0][0] = 1.0;
		for(int j=0;j<100;j++){
			for(int k=0;k<=j;k++){
				dp[i][j+1][k  ] += dp[i][j][k]*(100-i)/100.0;
				dp[i][j+1][k+1] += dp[i][j][k]*i/100.0;
			}
		}
	}
	while(cin >> N >> M >> L){
		for(int i=0;i<N;i++) cin >> P[i] >> T[i] >> V[i];
		for(int i=0;i<N;i++){
			double res = 0.0;
			for(int j=0;j<=M;j++){
				double cur = dp[P[i]][M][j];
				if(V[i]==0) break;
				double time = (double)L/V[i] + j*T[i];
				for(int k=0;k<N;k++){
					if(i==k) continue;
					if(V[k]==0) continue;
					double sum = 0.0;
					for(int l=0;l<=M;l++){
						double otime = (double)L/V[k] + l*T[k];
						if(otime - time < 1e-8) continue;
						sum += dp[P[k]][M][l];
					}
					cur *= sum;
				}
				res += cur;
			}
			printf("%.8lf\n", res);
		}
	}
}

Measured memory_bytes: 8960
N = int(input())
list_W = list(map(int,input().split()))
sum_W = sum(list_W)
ans_sum = 0
ans = sum_W
for i in list_W:
    ans_sum += i
    if abs((sum_W-ans_sum) - ans_sum) < ans:
        ans = abs((sum_W-ans_sum) - ans_sum)
print(ans)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
typedef int LL;
const LL maxn=1e6+9;
inline LL Read(){
	LL x(0),f(1); char c=getchar();
	while(c<'0' || c>'9'){
		if(c=='-') f=-1; c=getchar();
	}
	while(c>='0' && c<='9'){
		x=(x<<3)+(x<<1)+c-'0'; c=getchar();
	}return x*f;
}
LL T,n;
char s[maxn];
LL ans[2][maxn],sum[maxn];
int main(){
//	n=Read();
	scanf(" %s",s+1);
	n=strlen(s+1);
//	for(LL i=1;i<n;++i){
//		if(s[i]=='L' && s[i+1]=='R') a[i]=0;
//	}
	for(LL i=1;i<=n;++i){
		if(s[i]=='L'){
			ans[0][i]=ans[0][i-1];
		}else ans[0][i]=i;
	}
	for(LL i=n;i>=1;--i){
		if(s[i]=='R'){
			ans[1][i]=ans[1][i+1];
		}else ans[1][i]=i;
	}
	for(LL i=1;i<=n;++i){
		if(s[i]=='L'){
			LL ret(i-ans[0][i]);
			if(ret&1){
//				printf("%d ",);
				++sum[ans[0][i]+1];
			}else{
				++sum[ans[0][i]];
//				printf("%d ",);
			}
		}else{
			LL ret(ans[1][i]-i);
			if(ret&1){
				++sum[ans[1][i]-1];
//				printf("%d ",);
			}else{
				++sum[ans[1][i]];
//				printf("%d ",);
			}
		}
	}
	for(LL i=1;i<=n;++i) printf("%d ",sum[i]);
	return 0;
}

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

#define MIN_INT -2147483648
#define MAX_INT 2147483647
#define MIN_LONG -9223372036854775808L
#define MAX_LONG 9223372036854775807L

#define long long long int

using namespace std;

// @author: pashka

int main() {
    ios::sync_with_stdio(false);

    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    int s = 0;
    for (int i = 0; i < n; i++) s += a[i];
    vector<int> d;
    for (int i = 1; i * i <= s; i++) {
        if (s % i == 0) {
            d.push_back(i);
            d.push_back(s / i);
        }
    }
    int res = 1;
    for (int x : d) {
        vector<int> b(n);
        for (int i = 0; i < n; i++) {
            b[i] = a[i] % x;
        }
        sort(b.begin(), b.end());
        int i = 0;
        int j = n - 1;
        long c = 0;
        while (i < j) {
            if (b[i] == 0) i++;
            else if (b[j] == x) j--;
            else {
                int q = min(b[i], x - b[j]);
                b[i] -= q;
                b[j] += q;
                c += q;
            }
        }
//        cout << x << " " << c << "\n";
        if (c <= k) {
            res = max(res, x);
        }
    }
    cout << res << "\n";

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <string>
#include <iomanip>
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define FOR(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define All(v) (v).begin(),(v).end()
typedef long long ll;

int main(){
    int P,Q,R;cin >> P >> Q >> R;
    cout << min(P+Q,min(P+R,Q+R)) << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.next().split("/");
        if (Integer.parseInt(s[0]) >= 2019
                && Integer.parseInt(s[1]) >= 5) {
            System.out.println("TBD");
            return;
        }
        System.out.println("Heisei");
    }

}


Measured memory_bytes: 23764
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

int32_t nextint(void){ char c=getchar_unlocked(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar_unlocked(); bool s=false; if(c=='-'){s=true;c=getchar_unlocked();} uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return s?-x:x; }
int64_t nextlong(void){ char c=getchar_unlocked(); while(c!='-'&&(c<'0'||'9'<c)) c=getchar_unlocked(); int s=0; if(c=='-'){s=1;c=getchar_unlocked();} uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar_unlocked(); } return s?-x:x; }

int a[40]={0,1,1,2,2,2,3,3,3,3,4,4,4,4,4,5,5,5,5,5,5,6,6,6,6,6,6,6,7,7,7,7,7,7,7,7,8,8,8,8};
int main(void){
	long n=nextlong();
	int m=sqrt(n);
	int ans=0;
	for(int i=2; i<m; i++){
		int b=0;
		while(n%i==0){
			n/=i;
			b++;
		}
		ans+=a[b];
	}
	printf("%d\n", ans+(n>1));
}


Measured memory_bytes: 2016
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>; // グラフ型
typedef long long ll;
#define _GLIBCXX_DEBUG


int main() {
  ll N,M;
  cin >> N >> M;
  //vector<ll> a(N);
  //vector<vector<int>> data(3, vector<int>(4));
  if(N==M) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}


Measured memory_bytes: 3580
N = int(input())
ps = [tuple(map(int,input().split())) for i in range(2*N)]

es = [[] for i in range(2*N)]
for ri,(rx,ry) in enumerate(ps[:N]):
    for bi,(bx,by) in enumerate(ps[N:]):
        bi += N
        if rx < bx and ry < by:
            es[ri].append(bi)
            es[bi].append(ri)

used = [False] * (2*N)
match = [-1] * (2*N)

def _dfs(v):
    global used, match
    used[v] = True
    for u in es[v]:
        w = match[u]
        if w < 0 or not used[w] and _dfs(w):
            match[v] = u
            match[u] = v
            return True
    return False

def bipartite_matching():
    global used, match
    ret = 0
    for v in range(2*N):
        if match[v] < 0:
            used = [False] * (2*N)
            if _dfs(v):
                ret += 1
    return ret

print(bipartite_matching())


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define l_ength size
const int inf = (1<<30);
const int mod = 1000000007;
using ll = long long;
using namespace std;

int main(){
	int x, a; cin >> x >> a;
	if( x < a ) cout << "0" << endl;
	else cout << "10" << endl;
	return 0;
}

Measured memory_bytes: 256
N = int(input())
W_list = [input() for _ in range(N)]
appeared_words = set()

previous_word = W_list[0]
appeared_words.add(previous_word)
for word in W_list[1:]:
    if previous_word[-1] != word[0]:
        print("No")
        exit(0)
    elif word in appeared_words:
        print("No")
        exit(0)
    else:
        previous_word = word
        appeared_words.add(word)
else:
    print("Yes")


Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INFLL LLONG_MAX // 9223372036854775807
#define EPS 1e-9
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
template<class T>bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
using namespace std;

int main(){
    Init();
    ll n; cin >> n;
    ll s = ceil(1.0*n/1.08)-2;
    for(ll i=s; i<s+4; i++){
        if((ll)(floor(i*1.08)) == n){
            cout << i << endl;
            return 0;
        }
    }
    cout << ":(" << endl;
}

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

#define mod 1000000007
#define all(x) (x).begin(), (x).end()
#define pb push_back

const long double PI = acos(-1);
 
ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}
ll GetDigit(ll num) {return log10(num)+1;}

int main(){
    ll n, k;
    cin >> n >> k;
    vector<ll> h(n);
    for(ll i = 0; i < n; i++){
        cin >> h[i];
    }
    sort(all(h), greater<int>());

    ll ans = 0;
    for(ll i = 0; i < n; i++){
        if(k != 0){
            k--;
        }else{
            ans += h[i];
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
#include <cstdio>
typedef long long ll;

#include <queue>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

#include <iostream>
#include <set>

using namespace std;

const ll mod = 998244353;
int n;
int a[2000];

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

  n = s.size();
  REP(i,n) a[i] = s[i] - '0';

  vector<ll> dp(n + n + 1);
  dp[a[0]] = 1;

  REP(i,n+n){
    const int tot = 2 * min(i + 1, n) - i;
    const int add = (i + 1 < n) ? a[i + 1] : 0;
    //printf("%d %d\n", tot, add);

    vector<ll> next(n + n + 1);
    REP(j,n+n+1){
      if(j > 0) next[j + add - 1] = (next[j + add - 1] + dp[j]) % mod;
      if(j != tot) next[j + add] = (next[j + add] + dp[j]) % mod;
    }

    dp.swap(next);
    //REP(j,n+n+1) printf("%lld ", dp[j]); puts("");
  }

  printf("%lld\n", dp[0]);

  return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <vector>
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<=n;++i)
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if(a < b){ a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if(a > b){ a = b; return 1; } return 0; }
int main()
{
  int d[1000000000000];
  int a,b; cin >> a >> b;
  cout << max(a - 2*b, 0) << "\n";
  return 0;
}


Measured memory_bytes: 256
###template###
import sys
def input(): return sys.stdin.readline().rstrip()
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt, ceil, floor
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
import heapq
INF = float("inf")
sys.setrecursionlimit(10**7)
# 4近傍（右, 下, 左, 上）
dy = [0, -1, 0, 1]
dx = [1, 0, -1, 0]
def inside(y: int, x: int, H: int, W: int) -> bool: return 0 <= y < H and 0 <= x < W
def mi(): return map(int, input().split())
def ii(): return int(input())
###template###

N, L = mi()
tastes = [L+i for i in range(N)]
absmintaste = 10**9
for t in tastes:
  if abs(absmintaste) > abs(t):
    absmintaste = t

print(sum(tastes)-absmintaste)




Measured memory_bytes: 38640
#include<stdio.h>
main(){
  int a=0;
  int W,H,x,y,r=0;
  scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
  if(x-r>=0&&x+r<=W){
    if(y-r>=0&&y+r<=H){
      a=1;
    }
  }
  else{
    a=0;
  }
  if(a==1){
    printf("Yes\n");
  }
  else if(a==0){
    printf("No\n");
  }
  return 0;
}

Measured memory_bytes: 580
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define FOR(i,n,j) for(int i=(j);i<(n);++i)
#define ssort(n) sort((n).begin(),(n).end())
#define rsort(n) sort((n).begin(),(n).end(),greater<int>())
#define mp make_pair
using ll=long long;
using ld=long double;
typedef pair<int,int> P;
typedef pair<P,int> COST;
#define repl(i,n) for(ll i=0;i<(n);++i)
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl

using Graf_char=vector<vector<char>>;
using Graf_int=vector<vector<int>>;
#define MAX 10000000

int main()
{
    int n;
    int m;
    cin >> n >> m;
    if(n==m){
        Yes;
    }else{
        No;
    }
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ll long long int
const int INF = 2147483647;

using namespace std;

struct edge
{
  int to, cap, rev;
};
typedef std::vector<std::vector<edge>> graph;

bool used[202] = {};

void addEdge(int from, int to, int cap, graph &g)
{
  g[from].push_back({to, cap, (int)g[to].size()});
  g[to].push_back({from, 0, (int)g[from].size() - 1});
}

// t:sink
int dfs(int v, int t, int f, graph &g)
{
  if (v == t)
    return f;
  used[v] = true;
  for (auto &e : g[v])
  {
    if (!used[e.to] && e.cap > 0)
    {
      int d = dfs(e.to, t, min(f, e.cap), g);
      if (d > 0)
      {
        e.cap -= d;
        g[e.to][e.rev].cap += d;
        return d;
      }
    }
  }
  return 0;
}

int fordFulkerson(int s, int t, graph &g)
{
  int flow = 0;
  while (true)
  {
    REP(i, g.size())
    {
      used[i] = false;
    }
    int f = dfs(s, t, INF, g);
    if (f == 0)
      return flow;
    flow += f;
  }
}

int main()
{
  int n;
  cin >> n;
  pair<int, int> ab[100], cd[100];
  REP(i, n)
  {
    int a, b;
    cin >> a >> b;
    ab[i] = make_pair(a, b);
  }

  REP(i, n)
  {
    int c, d;
    cin >> c >> d;
    cd[i] = make_pair(c, d);
  }
  graph g(2 * n + 2);

  REP(i, n)
  {
    REP(j, n)
    {
      if (ab[i].first < cd[j].first && ab[i].second < cd[j].second)
      {
        addEdge(i, j + n, 1, g);
      }
    }
  }

  REP(i, n)
  {
    addEdge(2 * n, i, 1, g);
    addEdge(i + n, 2 * n + 1, 1, g);
  }

  cout << fordFulkerson(2 * n, 2 * n + 1, g) << endl;
}


Measured memory_bytes: 384
from collections import defaultdict
# A, B, C = [int(n) for n in input().split()]
while(True):
    N = int(input())
    if N == 0:
        break
    k = [int(n) for n in input().split()]
    dic = dict(zip([ i for i in range(len(k))], k))
    ans = 0
    for i in range(len(k)):
        if k[i] > 0:
            k[i] -= 1
            ans += 1
    print(ans + 1 if max(k) > 0 else "NA")



Measured memory_bytes: 9036