akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <boost/range/irange.hpp>

using namespace std;
using namespace boost;

void visit(vector<vector<int64_t>>& in_links, vector<vector<int64_t>>& out_links, vector<int64_t>& num_in_links, int64_t idx, vector<int64_t>& parents) {
    vector<int64_t> children;
    for (auto c : out_links[idx]) {
        --num_in_links[c];
        if (num_in_links[c] == 0) {
            children.push_back(c);
        }
    }

    for (auto c : children) {
        parents[c] = idx;
        visit(in_links, out_links, num_in_links, c, parents);
    }
}

main() {
    int64_t n, m;
    cin >> n >> m;

    auto k = n - 1 + m;

    vector<int64_t> num_in_links(n + 1);
    vector<vector<int64_t>> out_links(n + 1);
    vector<vector<int64_t>> in_links(n + 1);
    for (auto i : irange(0L, k)) {
        int64_t dep, arv;
        cin >> dep >> arv;
        ++num_in_links[arv];
        out_links[dep].push_back(arv);
        in_links[arv].push_back(dep);
    }

    int64_t root;
    for (auto i : irange(1L, n + 1)) {
        if (num_in_links[i] == 0) {
            root = i;
            break;
        }
    }

    vector<int64_t> parents(n + 1);
    visit(in_links, out_links, num_in_links, root, parents);

    for (auto i : irange(1L, n + 1)) {
        cout << parents[i] << endl;
    }
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int R, D, X;
    cin >> R >> D >> X;
    for (int i = 0; i < 10; i++) {
        X = R * X - D;
        cout << X << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;

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

	vector<long long> a(N);
	vector<long long> b(N);
	for (auto i = 0; i < N; ++i)
	{
		cin >> a[i];
	}
	for (auto i = 0; i < N; ++i)
	{
		cin >> b[i];
	}

	sort(a.begin(), a.end());
	sort(b.begin(), b.end());

	auto result = 1ll;
	auto ia = 0;
	auto ib = 0;
	auto count = 0;
	auto mod = (long long)1e9 + 7;
	while (ia < N || ib < N)
	{
		auto isPlus = false;
		if (ia < N && ib < N)
		{
			if (a[ia] < b[ib])
			{
				++ia;
				isPlus = true;
			}
			else
			{
				++ib;
				isPlus = false;
			}
		}
		else if (ia < N)
		{
			++ia;
			isPlus = true;
		}
		else
		{
			++ib;
			isPlus = false;
		}

		if (isPlus)
		{
			if (count < 0)
			{
				result = result * abs(count) % mod;
			}
			++count;
		}
		else
		{
			if (count > 0)
			{
				result = result * abs(count) % mod;
			}
			--count;
		}
	}

	cout << result << endl;

	return 0;
}

Measured memory_bytes: 1792
#include <stdio.h>

int main(){
    int i, n;
    int arr[100];
    scanf("%d", &n);
    for(i=0;i<n;i++){
        scanf(" %d", &arr[i]);
    }
    for(i=0;i<n;i++){
        if(i)printf(" ");
        printf("%d", arr[n-i-1]);
    }
    printf("\n");
    return 0;
}


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

using namespace std;
const int maxn = 3010;
const int mod = 1e9 + 7;

int f[maxn][maxn * 2];
int g[maxn][maxn * 2];
int n, m;

int main() {
	scanf("%d%d", &n, &m);
	--m; --n;
	g[0][0] = 1;
	for(int j = 1; j <= n; ++j) f[0][j] = 1;
	for(int i = 1; i <= m; ++i) {
		g[i][0] = (2ll * g[i-1][0] + g[i-1][1] + f[i-1][1]) % mod;
		for(int j = 1; j <= n; ++j) {
			f[i][j] = (2ll * f[i-1][j] + f[i-1][j-1] + f[i-1][j+1]) % mod;
			g[i][j] = (2ll * g[i-1][j] + g[i-1][j-1] + g[i-1][j+1]) % mod;
		}
	}
	int ans = 0;
	for(int j = 0; j <= n; ++j) ans = (ans + g[m][j]) % mod;
	ans = (ans << 1) % mod;
	ans = (ans << 1) % mod;
	printf("%d\n",ans);
	return 0;
}


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

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< pair<int,int> > vpii;
typedef vector< pair<ll,ll> > vpll;
typedef vector< vector<int> > matrix;

#define SET(Ar,val) memset(Ar,val,sizeof(Ar))
#define rep(i,val,n)  for(int i=val;i<n;i++)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define LMAX LONG_LONG_MAX
#define LMIN LONG_LONG_MIN
#define IMAX INT_MAX
#define IMIN INT_MIN
#define M 1000000007

/*--------------------------------------------------------------------------------------------------------------------------------*/

template <class T> T modpower(T a,T b,T MOD)
{
    T ans=1;
    while(b!=0)
    {
        if(b%2==1)
        ans=(ans*a)%MOD;
        a=(a*a)%MOD;
        b/=2;
    }
    return ans;
}

int f(int x)
{
    int ans = 0;
    while(x)
    {
        ans += (x%10);
        x /= 10;
    }
    return ans;
}

void init()
{
    int N;
    cin >> N;
    int re = 1e9;
    for(int i=1;i<=N-i;i++)
    {
        re = min(re,f(i) + f(N-i));
    }
    cout << re;
}


int main()
{
    clock_t time1 = clock();
//	#ifndef ONLINE_JUDGE
	//freopen("input1.txt","r",stdin);
//	#else
	//ONLINE_JUDGE
//	#endif
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
    init();
    clock_t time2 = clock();
    cerr <<"Time: " <<(double)(time2-time1)/CLOCKS_PER_SEC * 100000 <<" seconds" <<endl;
	return 0;
    }


Measured memory_bytes: 256
// https://atcoder.jp/contests/abc147/tasks/abc147_d
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define DIV(a, b) ((a - 1) / b + 1)

template <int MOD> struct ModInt {
    static const int Mod = MOD;
    unsigned x;
    ModInt() : x(0) {}
    ModInt(signed sig) { x = sig < 0 ? sig % MOD + MOD : sig % MOD; }
    ModInt(signed long long sig) { x = sig < 0 ? sig % MOD + MOD : sig % MOD; }
    int get() const { return (int)x; }
    ModInt &operator+=(ModInt that) {
        if ((x += that.x) >= MOD)
            x -= MOD;
        return *this;
    }
    ModInt &operator-=(ModInt that) {
        if ((x += MOD - that.x) >= MOD)
            x -= MOD;
        return *this;
    }
    ModInt &operator*=(ModInt that) {
        x = (unsigned long long)x * that.x % MOD;
        return *this;
    }
    ModInt &operator/=(ModInt that) { return *this *= that.inverse(); }
    ModInt operator+(ModInt that) const { return ModInt(*this) += that; }
    ModInt operator-(ModInt that) const { return ModInt(*this) -= that; }
    ModInt operator*(ModInt that) const { return ModInt(*this) *= that; }
    ModInt operator/(ModInt that) const { return ModInt(*this) /= that; }
    ModInt inverse() const {
        long long a = x, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b;
            std::swap(a, b);
            u -= t * v;
            std::swap(u, v);
        }
        return ModInt(u);
    }
    bool operator==(ModInt that) const { return x == that.x; }
    bool operator!=(ModInt that) const { return x != that.x; }
    ModInt operator-() const {
        ModInt t;
        t.x = x == 0 ? 0 : Mod - x;
        return t;
    }
};
template <int MOD> ostream &operator<<(ostream &st, const ModInt<MOD> a) {
    st << a.get();
    return st;
};
template <int MOD> ModInt<MOD> operator^(ModInt<MOD> a, unsigned long long k) {
    ModInt<MOD> r = 1;
    while (k) {
        if (k & 1)
            r *= a;
        a *= a;
        k >>= 1;
    }
    return r;
}
typedef ModInt<1000000007> mint;

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin >> N;
    vector<int> v(N);
    for (auto &x : v) {
        cin >> x;
    }

    mint res = 0;
    REP(d, 60) {
        int n0 = 0, n1 = 0;
        for (auto &x : v) {
            if (x >> d & 1) {
                n1++;
            } else {
                n0++;
            }
        }
        mint msk = (1LL << d);
        res += mint(msk) * n0 * n1;
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REP(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  int sx, sy, tx, ty;
  cin >> sx >> sy >> tx >> ty;
  int dx = tx - sx;
  int dy = ty - sy;
  rep(i, abs(dx)) cout << (dx > 0 ? 'R' : 'L');
  rep(i, abs(dy)) cout << (dy > 0 ? 'U' : 'D');
  rep(i, abs(dx)) cout << (dx < 0 ? 'R' : 'L');
  rep(i, abs(dy)) cout << (dy < 0 ? 'U' : 'D');
  cout << (dy > 0 ? 'D' : 'U');
  rep(i, abs(dx)+1) cout << (dx > 0 ? 'R' : 'L');
  rep(i, abs(dy)+1) cout << (dy > 0 ? 'U' : 'D');
  cout << (dx > 0 ? 'L' : 'R');
  cout << (dy < 0 ? 'D' : 'U');
  rep(i, abs(dx)+1) cout << (dx < 0 ? 'R' : 'L');
  rep(i, abs(dy)+1) cout << (dy < 0 ? 'U' : 'D');
  cout << (dx < 0 ? 'L' : 'R');
  cout << endl;
  return 0;
}



Measured memory_bytes: 256
use proconio::input;
use std::collections::HashMap;

fn main() {
    input! {
        n: usize,
    }
    let m = 1000000007;
    let mut map = HashMap::new();
    for i in 2..=n {
        let v = prime_factorize(i);
        for &nv in &v {
            let entry = map.entry(nv.0).or_insert(0);
            *entry += nv.1;
        }
    }
    let mut ans = 1;
    for (_, &value) in &map {
        ans = ans * (value + 1) % m;
    }
    println!("{}", ans);
}

fn prime_factorize(mut n: usize) -> Vec<(usize, usize)> {
    let mut res = vec![];
    let mut a = 2;
    while a * a <= n {
        if n % a != 0 {
            a += 1;
            continue;
        }
        let mut ex = 0;

        while n % a == 0 {
            ex += 1;
            n /= a;
        }

        res.push((a, ex));
        a += 1;
    }
    if n != 1 {
        res.push((n, 1));
    }

    res
}

Measured memory_bytes: 2124
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
const ll INF = 1LL<<60;

/* RMQ：[0,n-1] について、区間ごとの最小値を管理する構造体
    update(i,x): i 番目の要素を x に更新。O(log(n))
    query(a,b): [a,b) での最小の要素を取得。O(log(n))
*/
template <typename T>
struct RMQ {
    //const T INF = numeric_limits<T>::max();
    ll n;         // 葉の数
    vector<T> dat; // 完全二分木の配列
    RMQ(ll n_) : n(), dat(n_ * 4, INF) { // 葉の数は 2^x の形
        ll x = 1;
        while (n_ > x) {
            x *= 2;
        }
        n = x;
    }
    void update(ll i, T x) {
        i += n - 1;
        dat[i] = x;
        while (i > 0) {
            i = (i - 1) / 2;  // parent
            dat[i] = min(dat[i * 2 + 1], dat[i * 2 + 2]);
        }
    }
    // the minimum element of [a,b)
    T query(ll a, ll b) { return query_sub(a, b, 0, 0, n); }
    T query_sub(ll a, ll b, ll k, ll l, ll r) {
        if (r <= a || b <= l) {
            return INF;
        } else if (a <= l && r <= b) {
            return dat[k];
        } else {
            T vl = query_sub(a, b, k * 2 + 1, l, (l + r) / 2);
            T vr = query_sub(a, b, k * 2 + 2, (l + r) / 2, r);
            return min(vl, vr);
        }
    }
};


int main(){

  ll N,Q;
  cin>>N>>Q;
  //vector<ll> tx(N+1,N-2),ty(N+1,N-2);
  RMQ<ll> rmqtx(N+1);
  RMQ<ll> rmqty(N+1);
  rmqtx.update(N,N-2);
  rmqty.update(N,N-2);
  
  ll ans=(N-2)*(N-2);
  //ll TY=N;
  //ll TX=N;
rep(i,Q){
  ll Qtype,Qnum;
  cin>>Qtype>>Qnum;
  if(Qtype==1){
    ll numX=rmqtx.query(Qnum-2,N+1);
    ans=ans-numX;
    //cout<<ans<<endl;
    rmqty.update(numX,min(Qnum-2,rmqty.query(numX,N+1)));
  }
  if(Qtype==2){
    ll numY=rmqty.query(Qnum-2,N+1);
    ans=ans-numY;
    //cout<<ans<<endl;
    rmqtx.update(numY,min(Qnum-2,rmqtx.query(numY,N+1)));
  }
  
/*  ll Qtype,Qnum;
  cin>>Qtype>>Qnum;
  if(Qtype==1){
    ans=ans-tx[Qnum];
    if(Qnum<=TX){
    //cout<<ans<<endl;
    rep(j,tx[Qnum]+2){
      if(ty[j]<=Qnum-2){break;}
     ty[j]=Qnum-2;
    } 
      TX=Qnum;
    }
  }
  if(Qtype==2){
    ans=ans-ty[Qnum];
        //cout<<ans<<endl;
    if(Qnum<TY){
    rep(j,ty[Qnum]+2){
      if(tx[j]<=Qnum-2){break;}
     tx[j]=Qnum-2;
    }
      TY=Qnum;
    }
  }*/
  
}
  
 
  cout<<ans<<endl;
}


Measured memory_bytes: 15688
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define pf push_front
#define mod 1000000007
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

int main()
{
   fast
   ll n;
   cin>>n;
   ll arr[n],i;
   for(i=0;i<n;i++)
   {
       cin>>arr[i];
   }
   double ans=0;
   for(i=0;i<n;i++)
   {
       ans = ans + (double)1/(double)arr[i];
   }
   ans = (double)1/(double)ans;
   cout<<ans<<endl;
}


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

int main(){
	int n,m;
	cin>>n>>m;

	string a[n];
	string b[m];

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

   for(int k=0;k<=n-m;k++){
	for(int i=0;i<=n-m;i++){
		int j;
		for(j=0;j<m;j++){
			if(b[j]!=a[j+k].substr(i,m)) break;
			//cout<<b[j]<<" "<<a[j+k].substr(i,m)<<endl;
		}
		if(j==m){
		 cout<<"Yes";
		 return 0;
		}
	}
}
	cout<<"No";

}

Measured memory_bytes: 256
//code by lynmisakura.wish to be accepted
/****************************/
#include<bits/stdc++.h>
using namespace std;
/***************************/
typedef long long ll;
typedef pair<int,int> pi;
typedef vector<pair<int,int>> vpi;

const long long Mod = 998244353;
const long long mod = 1000000007;
const long long INF = 10000000000000;

#define pb push_back
#define mp make_pair
#define mins(x,y) x = min(x,y)
#define maxs(x,y) x = max(x,y)
#define all(x) (x).begin(),(x).end()
#define Rep(n) for(int i = 0;i < n;i++)
#define rep(i,n) for(int i = 0;i < n;i++)
	
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll qp(ll a, ll b) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; }
ll qp(ll a, ll b, int mo) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a%mo; a = 1ll * a*a%mo; } while (b >>= 1); return ans; }
 
#define _GLIBCXX_DEBUG
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
long long dp[150010];
/***************************/

int n;

long long X[1010],Y[1010];
long long dx[] = {1,0,-1,0};
long long dy[] = {0,1,0,-1};
char direct[] = {'L','D','R','U'};

int main(void){
	scanf("%d",&n);
	bool odd;
	bool check = true;
	rep(i,n){
		scanf("%d%d",&X[i],&Y[i]);
		
		if((X[0] + Y[0])%2!=0)odd = true;
		else odd = false;
		
		if(odd != ((X[i]+Y[i])%2 != 0)){
			check = false;
		}
	}
	if(!check){
		cout << -1 << endl;
		return 0;
	}
	
	/*vector<ll> a;
	if(odd){
		rep(i,31) a.push_back(qp(2,i));
	}else{
		//a.push_back(1);
		rep(i,31) a.push_back(qp(2,i));
		rep(i,n){X[i]--;} //1左に平行移動しておく、あとはoddの場合と一緒
	}*/
	
	if(!odd) rep(i,n) X[i]--;
	
	if(odd)cout << 31; else cout << 32;cout << endl;
	if(!odd) cout << 1 << endl;
	rep(i,31) cout << qp(2,i) << endl;
	
	for(int i = 0;i < n;i++){
		string ans = "";
		int x = X[i],y = Y[i];
		for(int j = 30;j >= 0;j--){
			long long l = qp(2,j);
			for(int k = 0;k < 4;k++){
				long long nx = x + dx[k]*l,ny = y + dy[k]*l;
				if(abs(nx) + abs(ny) <= l - 1){
					x = nx,y = ny;
					ans.push_back(direct[k]);
					break;
				}
			}
		}
		reverse(all(ans));
		if(!odd)cout << 'R';
		cout << ans << endl;
	}
}

Measured memory_bytes: 256
#include <stdio.h>
int A[1000000],a;
int search(int key);
int main(){
  int i,j,k,sum=0;
  scanf("%d",&a);
  for(i=0;i<a;i++){
    scanf("%d",&A[i]);
  }
  scanf("%d",&j);
  for(i=0;i<j;i++){
    scanf("%d",&k);
    if(search(k)){
      sum++;
    }
  }
  printf("%d\n",sum);
  return 0;
}
int search(int key){
  int l=0;
  int r=a;
  int mid;
  while(l<r){
    mid=(l+r)/2;
    if(key==A[mid]){
      return 1;
    }
    if(key>A[mid]){
      l=mid+1;
    }
    else if (key<A[mid]){
	r=mid;
    }
  }
  return 0;
}



Measured memory_bytes: 2128
from itertools import product

n, a, b, c = map(int, input().split())
ls = []
for _ in range(n):
    ls.append(int(input()))

ans = 1e9
for idxs in product(range(4), repeat=n):
    la, lb, lc = [], [], []
    for idx, l in zip(idxs, ls):
        if idx == 0:
            la.append(l)
        elif idx == 1:
            lb.append(l)
        elif idx == 2:
            lc.append(l)
    if len(la) and len(lb) and len(lc):
        mpa = max(len(la) - 1, 0) * 10 + abs(sum(la) - a)
        mpb = max(len(lb) - 1, 0) * 10 + abs(sum(lb) - b)
        mpc = max(len(lc) - 1, 0) * 10 + abs(sum(lc) - c)
        ans = min(ans, mpa + mpb + mpc)
print(ans)


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

long long n, k;
bool memo[200] = {0};
long long solve();

int main() {
  cin >> n >> k;
  cout << solve() << endl;
  return 0;
}

long long solve() {
  long long ans = 0;
  for(int i = 0; i < n - 1; ++i) ans += 1 + ans / (k - 1);
  return ans;
}


Measured memory_bytes: 3104
#include <stdio.h>
#include <algorithm>
long long n, m, k;
long long ta[100000];
long long x[100000];
long long l[100000];
long long c[100000];
long long b[100000];
long long dp[100000];
long long le, ri, md, dpp;
int main() {
	scanf("%lld", &n);
	for (long long i = 0; i < n; i++) {
		scanf("%lld%lld", x + i, l + i);
		c[i] = x[i] + l[i];
		c[i] *= 1000000001;
		c[i] += l[i];
	}
	std::sort(c, c + n);
	for (long long i = 0; i < n; i++) {
		l[i] = c[i] % 1000000001;
		b[i] = c[i] / 1000000001;
		c[i] /= 1000000001;
	}
	m = n;
	for (long long i = 1; i < n; i++) {
		if (c[i] == c[i - 1]) {
			c[i - 1] = 100000;
			c[i - 1] *= 100000;
			m--;
		}
	}
	std::sort(c, c + n);
	for (long long i = 0; i < n; i++) {
		while (c[k] < b[i])k++;
		ta[i] = k;
	}
	for (long long i = 0; i < n; i++) {
		if (ta[i]) {
			if (dp[ta[i]] < dp[ta[i] - 1]) {
				dp[ta[i]] = dp[ta[i] - 1];
			}
		}
		le = -1;
		ri = m - 1;
		while (ri - le > 1) {
			md = (ri + le) / 2;
			if (c[md] <= b[i] - 2 * l[i])le = md;
			else ri = md;
		}
		dpp = 1;
		if (le != -1) {
			dpp += dp[le];
		}
		if (dp[ta[i]] < dpp)dp[ta[i]] = dpp;
	}
	printf("%lld\n", dp[m - 1]);
}

Measured memory_bytes: 4864
# -*- coding: utf-8 -*-
import sys

(N, X) = map(int, input().split(' '))
inputs = [int(x) for x in input().split(' ')]

result = 0
bound_count = 1
for i in range(N):
  result += inputs[i]
  if X < result:
    break
  bound_count += 1

print(bound_count)

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

int main(){

    int n;
    cin >> n;

    int thr;
    for (int x=1; x<n+1; x++){
        thr = (x*108.0)/100.0;
        if (thr == n){
            cout << x << endl;
            return 0;
        } 
    }
    cout << ":(" << endl;
    return 0;
}


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

#define ll long long
#define INF 99999999
#define rep(i,n) for(int i=0,temp=(int)(n);i<temp;++i) 
#define repi(i,start,end) for(int i=start,temp=(int)(end);i<end;++i)
#define rfor(v,x) for(const auto& x : v) //xは値を表す
#define all(x) (x).begin(),(x).end()
#define SORT(v, n) sort(v, v+n)
#define vsort(v) sort(v.begin(), v.end())
#define vfsort(v,lambda) sort(v.begin(),v.end(),lambda)
#define vint vector<int>
#define vvint vector<vector<int>>
#define vin(v) rep(i,v.size()) {cin >> v[i];}
//最終奥義
//#define int long long
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; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int ctoi(char c) {return c-'0';}
//(lambda (x y) (< x y)) => [](int x, int y) -> int { return x<y; }


signed main(void){
  int n;cin >> n;
  vint p(n);vin(p);
  int ans = 0;
  repi(i,1,n-1){
    if(p[i]>p[i-1]&&p[i]<p[i+1]||p[i]<p[i-1]&&p[i]>p[i+1])
      ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>
using namespace std;
int main(void){
    int n,d;
    int counter = 0;
    long long A[200020],B[200020];
    long double C[200020];
    cin >> n >> d;
    for(int i = 0;i<n;i++){
        cin >> A[i] >> B[i];
        C[i] = (double)((A[i]*A[i])+(B[i]*B[i]));
        //cout << C[i] << " " << sqrt(C[i]) << endl;
    }
    for(int i = 0;i<n;i++){
    if(sqrt(C[i])<=d){
        counter++;
    }
    }
    cout << counter << endl;
}


Measured memory_bytes: 9780
import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        int[] p = new int[3];
        p[0] = sc.nextInt();
        p[1] = sc.nextInt();
        p[2] = sc.nextInt();

        Arrays.sort(p);
        System.out.println(p[0] + p[1]);
    }

    private static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;

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

        private int readByte() {
            if (hasNextByte())
                return buffer[ptr++];
            else
                return -1;
        }

        private static boolean isPrintableChar(int c) {
            return 33 <= c && c <= 126;
        }

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

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

        public long nextLong() {
            if (!hasNext())
                throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while (true) {
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                } else if (b == -1 || !isPrintableChar(b)) {
                    return minus ? -n : n;
                } else {
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }

        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
                throw new NumberFormatException();
            return (int) nl;
        }

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



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

int main(){
    int n, i, a, c = 0;
    cin >> n;
    for(i=0; i<n; i++){
        cin >> a;
        if(a%2 == 1){
            c++;
        }
    }
    if(c%2 == 0){
        cout << "YES";
    }else{
        cout << "NO";
    }
    return 0;
}

Measured memory_bytes: 256
N = int(input())
XY = [tuple(map(int, input().split())) for _ in range(N)]

def dist(x, y, u, v):
    return ((x - u)**2 + (y - v)**2)**0.5

ans = 0
for i, (x, y) in enumerate(XY):
    for u, v in XY[i + 1:]:
        ans += dist(x, y, u, v)

print(2 * ans / N)

Measured memory_bytes: 3444
#include<iostream>

using namespace std;

int main()
{
    int x[4][13],y[4][13]={0};
    for(int i=0;i<4;i++){
        for(int j=0;j<13;j++){
            x[i][j] = j+1;
        }
    }
    int n,num[52];
    char mark[52];
    cin>>n;
    for(int i=0;i<n;i++)
        cin>>mark[i]>>num[i];

    for(int i=0;i<n;i++){
        switch(mark[i]){
            case 'S':y[0][num[i]-1] = num[i]; break;
            case 'H':y[1][num[i]-1] = num[i]; break;
            case 'C':y[2][num[i]-1] = num[i]; break;
            case 'D':y[3][num[i]-1] = num[i]; break;
        }
    }
    for(int i=0;i<4;i++){
        for(int j=0;j<13;j++){
            if(y[i][j]==0){
                switch(i){
                    case 0: cout<<"S "<<j+1<<'\n';  break;
                    case 1: cout<<"H "<<j+1<<'\n';  break;
                    case 2: cout<<"C "<<j+1<<'\n';  break;
                    case 3: cout<<"D "<<j+1<<'\n';  break;
                }
            }
        }
    }
}


Measured memory_bytes: 3088
require 'prime'

# 約数リスト
def divisors(n)
  n.prime_division.inject([1]) do |array, (k, v)|
    (0..v).map{ |i| k ** i }.product(array).map{ |a, b| a * b }
  end.sort
end

n, k = gets.split.map(&:to_i)
nums = gets.split.map(&:to_i)
sum = nums.inject(:+)
divisors = divisors(sum).reverse
divisors.each do |div|
  mods = nums.map { |n| n % div }.sort
  cumulative_mods = mods.inject([]) { |res, mod| res << (res.last || 0) + mod }
  cumulative_revs = mods.reverse.inject([]) { |res, mod| res << (res.last || 0) -(mod - div) }
  (n - 1).times do |index|
    rev_index = n - index - 2
    if cumulative_mods[index] == cumulative_revs[rev_index]
      break if cumulative_mods[index] > k
      puts div
      exit
    end
  end
end
puts 1


Measured memory_bytes: 19448
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
 
int main() {
  string S;
  cin >> S;
  bool judge = 1;
  
  for(int i = 0; i < S.size() / 2; i++) {
    if(S.at(i) != S.at(S.size() - i - 1)) judge = 0;
  }
  
  for(int i = 0; i < (S.size() - 1) / 2; i++) {
    if(S.at(i) != S.at((S.size() - 1) / 2 - i - 1)) judge = 0;
  }
  
  for(int i = (S.size() + 3) / 2; i < S.size(); i++) {
    if(S.at(i) != S.at(S.size() - i - 1)) judge = 0;
  }
  
  
  if(judge == 1) cout << "Yes" << endl;
  else cout << "No" << endl;
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define fr(i,a,b) for(int (i)=(int) a;(i)<=(int)(b);++(i))
#define li list<int>
#define ll long long
#define mp make_pair
#define mod 1000000007
#define pb push_back
#define pi pair<int ,int >
#define pr printf
#define vi vector<ll>
#define vpi vector< pi > 
int main()
{
	int n;
	cin>>n;
	vpi v;
	for(int i=1;i<=n;i++)
	{
		int x,y;
		cin>>x>>y;
		v.pb({x,y});
	}
	sort(v.begin(),v.end());
	int r=0,res=0;
	for(auto y: v)
	{
		r=max(r,y.first-1);
		if(r<y.second);
		{
			res+=(y.second-r);
			r=y.second;
		}
		//cout<<res<<" ";
	}
	cout<<res;
	return 0;
}

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

void solve(long long A, long long B, long long M, std::vector<long long> a, std::vector<long long> b, std::vector<long long> x, std::vector<long long> y, std::vector<long long> c){
    ll ans = *min_element(a.begin(), a.end()) + *min_element(b.begin(), b.end());
    ll cur = 0;
    for (int i = 0; i < M; ++i) {
        cur = a[x[i] - 1] + b[y[i] - 1] - c[i];
        ans = min(ans, cur);
    }
    cout << ans << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long A;
    scanf("%lld",&A);
    long long B;
    scanf("%lld",&B);
    long long M;
    scanf("%lld",&M);
    std::vector<long long> a(A);
    for(int i = 0 ; i < A ; i++){
        scanf("%lld",&a[i]);
    }
    std::vector<long long> b(B);
    for(int i = 0 ; i < B ; i++){
        scanf("%lld",&b[i]);
    }
    std::vector<long long> x(M);
    std::vector<long long> y(M);
    std::vector<long long> c(M);
    for(int i = 0 ; i < M ; i++){
        scanf("%lld",&x[i]);
        scanf("%lld",&y[i]);
        scanf("%lld",&c[i]);
    }
    solve(A, B, M, std::move(a), std::move(b), std::move(x), std::move(y), std::move(c));
    return 0;
}


Measured memory_bytes: 4224
#include <cstdio>
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) REP(i, 0, n)
bool p[50001];
int main()
{
	rep(i, 50001) p[i] = true;
	for (int i = 2; i * i <= 50000; ++i) {
		if (p[i]) for (int j = 2 * i; j <= 50000; j += i)
			if (p[j]) p[j] = false;
	}
	p[0] = p[1] = false;

	int n;
	while (scanf("%d", &n), n) {
		int c = 0;
		REP(i, 2, n/2+1) if (p[i] && p[n-i]) c++;
		printf("%d\n", c);
	}
	return 0;
}

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

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

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin >> N;
    map<int,int> mp;
    for (int i=N;i>1;i--){
        int n = i;
        for (int x=2;x*x<=i;x++){
            while (n%x==0){
                n/=x;
                mp[x]++;
            }
        }
        if (n > 1) mp[n]++;
    }
    mint ans = 1;
    for (auto p : mp){
        ans *= p.second + 1;
    }
    cout << ans << "\n";
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

ll n, m;
ll ans = 0;
vvl G;
vl visited;

void check() {
    ll ok = 1;
    rep(i, n) {
        if(visited[i] == 0) {
            ok = 0;
        }
    }
    if(ok) {
        ans++;
    }
}

void dfs(ll v) {
    check();
    for(auto u : G[v]) { 
        if(visited[u]) {
            continue;
        }
        visited[u] = 1;
        dfs(u);
        visited[u] = 0;
    }
}

int main() {
    
    cin >> n >> m;    

    G.resize(n);
    visited.resize(n);
    rep(i, m) {
        ll a, b;
        cin >> a >> b;
        a--;  b--;
        G[a].pb(b);
        G[b].pb(a);
    }

    visited[0] = 1;
    dfs(0);

    out(ans);
    re0;
}

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

using db = double;
const db eps = 1e-9;

int main() {
	ios :: sync_with_stdio(false);
	db maxv;
	while(cin >> maxv) {
		for(int i = 1; ; i ++) {
			db y = 5 * i - 5;
			db v = sqrt(y * 2 * 9.8);
			if(v + eps > maxv) {
				cout << i << '\n';
				break;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 3140
#include <iostream>
#include <cstdlib>

using namespace std;
#define N 500
#define C 150
#define CHANGE_RATE 0.9

int main()
{
    int d = 0;
    int c[26];
    int s[365][26];
    int t_c[C][365];
    int last[26] = {0};
    int score_c[C] = {0};
    int score = 0;
    int max_c = 0;

    cin >> d;

    for(int i = 0; i < 26; i++)
    {
        cin >> c[i];
    }

    for(int i = 0; i < d; i++)
    {
        for(int j = 0; j < 26; j++)
        {
            cin >> s[i][j];
        }
    }

    for(int i = 0; i < C; i++)
    {
        for(int j = 0; j < 365; j++)
        {
            t_c[i][j] = rand() % 26;
        }
    }

    for(int n = 0; n < N; n++)
    {
        score = 0;
        max_c = 0;
        for(int ca = 0; ca < C; ca++)
        {
            score_c[ca] = 0;
            for(int i = 0; i < 26; i++)
                last[i] = 0;

            for(int i = 0; i < d; i++)
            {
                for(int j = 0; j < 26; j++)
                {
                    if(t_c[ca][i] == j)
                    {
                        last[j] = 0;
                        score_c[ca] += s[i][j];
                    }
                    else
                    {
                        last[j]++;
                        score_c[ca] -= c[j] * last[j];
                    }
                }
            }
        }

        for(int ca = 0; ca < C; ca++)
        {
            if(score < score_c[ca])
            {
                score = score_c[ca];
                max_c = ca;
            }
        }
        //cout << score << endl;

        for(int ca = 0; ca < C; ca++)
        {
            if(ca == max_c) continue;
            for(int i = 0; i < d; i++)
            {
                if((rand() / (double)RAND_MAX) < CHANGE_RATE)
                {
                    t_c[ca][i] = rand() % 26;
                }
                else
                {
                    t_c[ca][i] = t_c[max_c][i];
                }
            }
        }
    }

    for(int i = 0; i < d; i++)
    {
        cout << ((t_c[max_c][i] % 26) + 1) << endl;
    }

    return 0;
}

Measured memory_bytes: 3932
#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair<ll, ll>
#define F first
#define S second
const int MOD = 1000000007;
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 (a>b) { a=b; return true; } return false; }
//sort(all(x))とするとソートできるよ
// 10^x は pow(10,(x)) 
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main(){
    LL X;cin >> X;
    LL ans = INF;
    bool ok = true;
    rep(i,200000){
        if(ok){
            LL tmp = (i+1)*(i+2)/2;
            if(tmp >= X){
                ans = i+1;
                break;
            }
        }
    }
    cout << ans << endl;
}


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


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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    using ll = long long;
    ll n, m;
    cin >> n >> m;
    if(n == 1 && m == 1)
    {
        cout << 1 << endl;
        return 0;
    }
    else if(n == 1)
    {
        cout << m - 2 << endl;
        return 0;
    }
    else if(m == 1)
    {
        cout << n - 2 << endl;
        return 0;
    }

    cout << n * m - 2 * (n-2) - 2*(m-2) - 4 << endl;
}


Measured memory_bytes: 256
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const ld eps = 1e-9;
const ld pi = acos((ld) -1);

mt19937 mrand(random_device{} ()); 

int rnd(int x) {
  return mrand() % x;
}

void precalc() {
}

const int maxn = (int) 1e5 + 5;
int n, c, k;
int t[maxn];

int read() {
  if (scanf("%d%d%d", &n, &c, &k) < 3) {
    return false;
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &t[i]);
  }
  return true;
}

void solve() {
  sort(t, t + n);
  int res = 0;
  for (int i = 0; i < n;) {
    int j = i;
    while (t[j] <= t[i] + k && j + 1 - i <= c) {
      j++;
    }
    res++;
    i = j;
  }
  printf("%d\n", res);
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen(TASK ".in", "r", stdin));
  assert(freopen(TASK ".out", "w", stdout));
#endif
  while (read()) {
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
using namespace std;
typedef long long ll;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

#define EPS (1e-7)
#define INF (1e15)
#define PI (acos(-1))
#define MOD 1000000007

#define REP(i,n) for(int i=0;i<n;i++)
#define REPS(i,f,n) for(int i=(f);i<(n);i++)
#define EACH(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)

#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define arrdump(n,a) for(int i=0;i<n;i++) {cout<<((i>0)? " ":"")<<a[i];}cout<<"\n";


typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy4[]={0, 0, 1, -1};
int dx4[]={1, -1, 0, 0};
int dx8[]={0, 0, 1, -1, 1, 1, -1, -1};
int dy8[]={1, -1, 0, 0, 1, -1, -1, 1};

// https://atcoder.jp/contests/sumitrust2019/tasks/sumitb2019_d

int cntmap[9];

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

    int ans = 0;
    for (int i = 0; i < 10; i++) {
        for (int j = 0; j < 10; j++) {
            for (int k = 0; k < 10; k++) {
                char a = '0' + i;
                char b = '0' + j;
                char c = '0' + k;

                bool ba = false;
                bool bb = false;
                bool bc = false;
                for (int l = 0; l < N; l++) {
                    if (!ba && S[l] == a) {
                        ba = true;
                        continue;
                    }
                    if (!bb && S[l] == b && ba) {
                        bb = true;
                        continue;
                    }
                    if (S[l] == c && ba && bb) {
                        bc = true;
                    }
                }
                if (bc) {
                    // string d = {a, b, c};
                    // dump(d);
                    ans++;
                }
            }
        }
    }

    cout << ans << "\n";

    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <limits.h>
#include <string>
#include <stdlib.h>
#include <iostream>
using namespace std;

int main() {
	int lop;
	for (cin >> lop; lop > 0; lop--) {
		string a; cin >> a;
		string b; cin >> b;
		string c, d;
		int dif = a.size() - b.size();
		bool kuri = 0;
		for (int lop = 0; lop < abs(dif); lop++) {
			d += '0';
		}
		if (dif > 0)
			b = d + b;
		if (dif < 0)
			a = d + a;
		for (int i = 0; i < a.size(); i++) {
			c += '\0';
		}
		for (int i = a.size()-1; i >= 0; i--) {
			c[i] = a[i] + b[i]+kuri-'0';
			//cout << "c["<<i<<"] = "<<c[i] << endl;
			kuri = 0;
			if (c[i] > '9') {
				c[i] -= 10;
				kuri = 1;
			}
			if (i == 0 && kuri == 1)
				c = '1' + c;
		}
		if (c.size() > 80)
			cout << "overflow\n";
		else
			cout << c << endl;
	}
	return 0;
}


Measured memory_bytes: 3152
use std::io::{self, BufRead};

fn main() {
  let stdin = io::stdin();
  let mut lines = stdin.lock().lines();
  let l1 = lines.next().unwrap();
  let v1: Vec<i32> = l1.unwrap().split(' ').map(|x| x.parse().unwrap()).collect();
  let l2 = lines.next().unwrap();
  let v2: Vec<i32> = l2.unwrap().split(' ').map(|x| x.parse().unwrap()).collect();
  let total = v2.iter().fold(0, |x, y| x + y);
  let ans = if v2.iter().filter(|x| **x * 4 * v1[1] >= total).count() >= (v1[1] as usize) { "Yes" } else { "No" };
  println!("{}", ans);
}

Measured memory_bytes: 4352
#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() {
  std::string s;
  std::cin >> s;
  int p = 0;
  for (const auto i : s) {
    if (i == 'o') {
      p++;
    }
  }
  if (8 <= p + 15 - s.size()) {
    std::cout << "YES" << std::endl;
  } else {
    std::cout << "NO" << std::endl;
  }
  return 0;
}


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

using ll = long long;
#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(n) n.begin(), n.end()
#define print(n) cout << n << endl
ll mods = 1000000007;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    //print(fixed << setprecision(10));
    
    int n,m;
    cin >> n >> m;

    vector<vector<int>> e(n+1);
    int a,b;
    
    rep(i,m){
        cin >> a >> b;
        e[a].push_back(b);
        e[b].push_back(a);
    }
    int x;
    bool flag = 1;

    vector<int> dist(n+1,n+1);
    unordered_set<int> s = {1};
    priority_queue<pair<int,int>,vector<pair<int,int>>,greater<pair<int,int>>> next;
    next.push(make_pair(0,1));
    dist[1] = 0;
    vector<int> prev(n+1);
    
    rep(i,n+1){
        if(next.size()==0){
            if(s.size()!=n) prev[0] = 0;
            else prev[0] = 1;
            goto END;
        }
        x = next.top().second;
        if(dist[x] < next.top().first){
            next.pop();
            continue;
        }
        next.pop();
        s.insert(x);
        for(auto j:e[x]){
            if(s.count(j)) continue;
            if(dist[x]+1 < dist[j]){
                prev[j] = x;
                dist[j] = dist[x]+1;
                next.push(make_pair(dist[j],j));
            }
        }
    }
    END:
    if(prev[0]==0) print("No");
    else{
        print("Yes");
        rep(i,n-1) print(prev[i+2]);
    }
    return 0;

}

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

int main()
{
    /* ------- 宣言と入力 ------- */

    int N;

    cin >> N;

    string S[N];

    for (int i = 0; i < N; i++)
    {
        cin >> S[i];
    }

    /* ------- 計算 ------- */

    map<string, int> mp;

    for (int i = 0; i < N; i++)
    {
        mp[S[i]]++;
    }

    int max = 0;

    for (auto x : mp)
    {
        if (x.second >= max)
        {
            max = x.second;
        }
    }

    for (auto x : mp)
    {
        if (x.second == max)
        {
            cout << x.first << endl;
        }
    }

    // for (map<string, int>::iterator i = mp.begin(); i != mp.end(); ++i) {
    //     if(mp[i]>max){
    //         max=
    //     }
    // }

    return 0;
}


Measured memory_bytes: 26752
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define fi first
#define se second 
#define pb push_back
#define all(x) (x).begin() , (x).end()
#define rep(i,a,b) for( ll i = a ; i < b ; i+=1 )
#define pp pair<ll,ll> 
#define sz(v) (ll)(v.size())
#define hell (ll)1000000007 
#define slld(x) scanf("%lld",&x)
ll t = 1 ;
void solve()
{
    string s , sa ;
    cin >> s >> sa ;
    ll ans = 0 ;
    rep( i , 0 , sz(s) )
        ans += (s[i]==sa[i]);
    cout<<ans;
}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //cin >> t ;
    while(t--){
        solve();
    }
    return 0 ;
}


Measured memory_bytes: 256
/*
  Vivek Rathi
  CSE 2nd Year
  MNNIT
*/
#include<bits/stdc++.h>
using namespace std;
#define M 1000000007
#define ll long long int
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define debug1(x) cout<<#x<<" "<<x<<endl;
#define debug2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define present(c,x) ((c).find(x) != (c).end())
#define null NULL
#define mp make_pair
#define fi first
#define se second
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define inf 1e17
ll fact[1000001];
ll ifact[1000001];
long long int modpower(long long int a,long long int b,long long int c)
{
    if(b==0)
    {
        return 1;
    }
    long long int m=modpower(a,b/2,c)%c;
    if(b%2==0)
    {
        return (m*m)%c;
    }
    else
    {
        return (((m*m)%c)*a)%c;
    }
}
ll calc(ll px,ll py,ll sx,ll sy)
{
    if(px-sx<0||py-sy<0) return 0;
    return (((fact[px-sx+py-sy]*ifact[px-sx])%M)*ifact[py-sy])%M;
}
int main()
{
    boost
    fact[0]=1;
    ifact[0]=1;
    for(ll i=1;i<1000001;i++)
    {
        fact[i]=(fact[i-1]*i)%M;
        ifact[i]=modpower(fact[i],M-2,M);
    }
    ll n,m,k;
    cin>>m>>n>>k;
    pair<ll,ll> p[k+1];
    ll dp[k+1]={0};   
    ll total=((((fact[n+m-2])*(ifact[n-1]))%M)*ifact[m-1])%M;
    for(ll i=0;i<k;i++)
    {
        cin>>p[i].fi>>p[i].se;
    }
    p[k]=mp(m,n);
    sort(p,p+k+1);
    for(ll i=0;i<=k;i++)
    {
        dp[i]=calc(p[i].fi,p[i].se,1,1);
    }
    for(ll i=0;i<=k;i++)
    {
        for(ll j=0;j<i;j++)
        {
            dp[i] = (dp[i] - (calc(p[i].fi,p[i].se,p[j].fi,p[j].se)*dp[j])%M + M)%M;
            //debug3(i,j,(calc(p[i].fi,p[i].se,p[j].fi,p[j].se)*dp[j])%M);
        }
        //debug2(i,dp[i]);
    }
    cout<<(dp[k])<<endl;
    return 0;
}

Measured memory_bytes: 16000
a,b,c,d = map(int,input().split())

def f(x,y,p):
    res = 0
    if x%p == 0:
        start = x+1
        res += 1
    else:
        start = (x//p+1)*p
        if start > y:
            return 0
        if start == y:
            return 1
        start += 1
        res += 1
    return res+(y-start+1)//p

#a,bの最大公約数
def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)

#リスト l の最大公約数
def gcdlist(l):
    a = l[0]
    for i in range(len(l)):
        a = gcd(a,l[i])
    return a

#互いに素なa,bについて、a*x+b*y=1の一つの解
def extgcd(a,b):
    r = [1,0,a]
    w = [0,1,b]
    while w[2]!=1:
        q = r[2]//w[2]
        r2 = w
        w2 = [r[0]-q*w[0],r[1]-q*w[1],r[2]-q*w[2]]
        r = r2
        w = w2
    #[x,y]
    return [w[0],w[1]]

#a*x+b*y=gcd(a,b)の一つの解
def extgcd_2(a,b):    
    g = gcd(a,b)
    a = a//g
    b = b//g
    return extgcd(a,b)

#a,bの最小公倍数
def lcm(a, b):
	return a * b // gcd (a, b)

print(b-a+1-f(a,b,c)-f(a,b,d)+f(a,b,lcm(c,d)))

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

int main() {
  int a,b,c;
  cin >>a>>b>>c;
  vector <int> x={a,b,c};
  sort(x.begin(),x.end());
   cout<<x.at(2)*10+x.at(1)+x.at(0)<<endl;
 
}


Measured memory_bytes: 256