akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int Inf = 1000000000;
constexpr ll INF= 1e18;
constexpr ll MOD = 1000000007;
const double PI = 3.1415926535897;
typedef pair<ll,ll> P;
typedef tuple<int,int,int> TP;

template<typename T>
T Pow(T a,T b) {
    T ret = 1;
    for(int i = 0;i < b;i++) {
        ret *= a;
    }
    return ret;
}
 
ll mod(ll val) {
    ll res = val % MOD;
    if(res < 0) {
        res += MOD;
    }
    return res;
}
 
ll RS(ll N, ll P, ll M){
    if(P==0) return 1;
    if(P < 0) {
        return 0;
    }
    if(P%2==0){
        ll t = RS(N, P/2, M);
        return t*t % M;
    }
    return N * RS(N, P-1, M) % M;
}

int main() {
    int N;
    cin >> N;
    vector<ll> vec(N + 1);
    for(int i = 0;i < N + 1;i++) {
        cin >> vec.at(i);
    }
    if(N == 0) {
        if(vec.at(0) == 1) {
            cout << 1 << endl;
        }
        else {
            cout << -1 << endl;
        }
        return 0;
    }
    if(vec.at(0) != 0) {
        cout << -1 << endl;
        return 0;
    }
    reverse(vec.begin(),vec.end());
    vector<P> cnt(N + 1);
    cnt.at(0) = P(0,0);
    for(int i = 0;i < N;i++) {
        ll cnt1 = (cnt.at(i).first + vec.at(i) + 1) / 2;
        ll cnt2 = cnt.at(i).second + vec.at(i);
        cnt.at(i + 1) = P(cnt1,cnt2);
    }
    ll ret = 0;
    ll cnt3 = 1;
    bool ret3 = true;
    reverse(vec.begin(),vec.end());
    reverse(cnt.begin(),cnt.end());
    for(ll i = 0;i < N;i++) {
        if(cnt3 <= 500000000000000000) {
            if(cnt3 < cnt.at(i).first) {
                ret3 = false;
                break;
            }
            ret += min(cnt3,cnt.at(i).second);
            cnt3 = cnt3 * 2 - vec.at(i + 1);
        }
        else {
            ret += cnt.at(i).second;
        }
    }
    for(int i = 0;i < N + 1;i++) {
        ret += vec.at(i);
    }
    if(ret3 == false) {
        cout << -1 << endl;
    }
    else {
        cout << ret << endl;
    }
}

Measured memory_bytes: 5548
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define int long long
#define endl "\n"
#define pii pair<int,int> 
#define ff first
#define ss second
#define mii map<int,int>
#define si set<int>
#define sti stack<int>
#define qi queue<int>
#define vi vector<int>
#define pq priority_queue<int>
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
const int M=1e9+7;
map<int,int> m;

void pre(){
	m.insert({1,1});
	int x=1;
	for(int i=2;i<=1e6;i++){
		x+=i;
		m.insert({x,i});
	}
}

void solve(){
	int n;
	cin>>n;
	int ans=0;
	int lim=sqrt(n);
	for(int i=2;i<=lim;i++){
		if(n%i==0){
			int cnt=0;
			while(n%i==0){
				n/=i;
				cnt++;
			}
			int x=m.upper_bound(cnt)->ss;
			x--;
			ans+=x;
		}
	}
	if(n>1) ans++;
	cout<<ans<<endl;
}

int32_t main(){
	IOS;
	pre();
	int t=1;
	//cin>>t;
	while(t--){
		solve();	
	}
}

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

using namespace std;
#define sqr(x) ((x)*(x))
#define cube(x) ((x)*(x)*(x))
#define GCD(a, b) __gcd(a, b)
#define LCM(a, b) ((a)*(b)/GCD(a,b))
#define PI (3.141592653589793238462643383279502884197169399375105820974944)
#define MP make_pair
#define n1 first
#define n2 second
#define ALL(x) (x).begin(), (x).end()
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define PDB pair<db,db>
#define SI set<int>
#define SL set<ll>
#define MS multiset
#define MSI multiset<int>
#define MSLL multiset<ll>
#define PB push_back
#define PF push_front
#define VI vector<int>
#define VPI vector<pair<int,int>>
#define VLL vector<ll>
#define VS vector<string>
#define SZ(x) ((int)x.size())

typedef long long ll;

typedef unsigned long long ull;
typedef long double ld;
typedef double db;
const db eps = 0.000001;
const int INF = 1000000007;
const ll LINF = 1000000000000000555;
const int N = 1850555;
const int M = 1155;
const int L = 20;

int a[N], b[N];
ll pra[N], prb[N];
void solve() {
    int n,m; ll k;
    cin >> n >> m >> k;

    for (int i = 1; i <= n; i++){
        cin >> a[i];
        pra[i] = pra[i-1] + a[i];
    }

    for (int i = 1; i <= m; i++){
        cin >> b[i];
        prb[i] = prb[i-1] + b[i];
    }

    int ans = 0;
    for (int i = 0; i <= n; i++){
        if (pra[i] > k) continue;
        int l = 0, r = m;
        int x = 0;
        while (l <= r){
            int mid = (l+r)/2;
            if (prb[mid] <= k - pra[i]) x = mid, l = mid+1; else
                r = mid-1;
        }
        ans = max(ans, i + x);
    }

    cout << ans;

}

int main() {
    ios_base::sync_with_stdio(false);
#ifdef dxz05
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else

#endif

    int T = 1;
    //cin >> T;

    while (T--) {
        solve();
    }

    return 0;
}

Measured memory_bytes: 8360
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <complex>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <iterator>

using namespace std;

#define dump(n) cout<<"# "<<#n<<"="<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define iter(c) __typeof__((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();++i)
#define all(c) (c).begin(),(c).end()
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;
typedef pair<int,int> pii;

const int INFTY=1<<29;
const double EPS=1e-9;

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& a){
	os<<'[';
	rep(i,a.size()) os<<(i?" ":"")<<a[i];
	return os<<']';
}

typedef complex<int> Point;

struct Line{
	Point pos,dir;
	Line(){}
	Line(Point p,Point d):pos(p),dir(d){}
};
typedef Line Segment;

double Dot(Point a,Point b)
{
	return real(conj(a)*b);
}

double Cross(Point a,Point b)
{
	return imag(conj(a)*b);
}

int CCW(Point a,Point b,Point c)
{
	Point d1=b-a,d2=c-a;
	if(int sign=Cross(d1,d2))
		return sign/abs(sign);
	if(Dot(d1,d2)<0)
		return -2; // c-a-b
	if(norm(d1)<norm(d2))
		return 2;  // a-b-c
	return 0;      // a-c-b
}

bool InterLS(Line l,Segment s)
{
	Point a=l.pos,b=l.pos+l.dir;
	Point c=s.pos,d=s.pos+s.dir;
	return CCW(a,b,c)*CCW(a,b,d)<=0;
}
bool InterSS(Segment a,Segment b)
{
	return InterLS(a,b) && InterLS(b,a);
}

bool Inner(const vector<Point>& ps,Point p)
{
	bool res=true;
	rep(i,ps.size())
		res&=CCW(ps[i],ps[(i+1)%ps.size()],p)>=0;
	return res;
}

struct UnionFind{
	vi data;
	UnionFind(int size):data(size,-1){}
	int Find(int n){
		return data[n]<0?n:(data[n]=Find(data[n]));
	}
	void Unite(int a,int b){
		int ra=Find(a),rb=Find(b);
		if(ra!=rb){
			if(-data[ra]<-data[rb])
				swap(ra,rb);
			data[ra]+=data[rb];
			data[rb]=ra;
		}
	}
	int Size(int n){
		return -data[Find(n)];
	}
};

int main()
{
	for(int n;cin>>n,n;){
		while(n--){
			int m; cin>>m;
			vector<vector<Point> > qs(m,vector<Point>(4));
			rep(i,m){
				rep(j,4)
					cin>>real(qs[i][j])>>imag(qs[i][j]);
				reverse(all(qs[i]));
			}
			UnionFind uf(m);
			
			rep(i,m) repi(j,i+1,m){
				bool flg=false;
				rep(k,4){
					flg|=Inner(qs[i],qs[j][k]);
					flg|=Inner(qs[j],qs[i][k]);
				}
				rep(k,4) rep(l,4){
					Segment s1(qs[i][k],qs[i][(k+1)%4]-qs[i][k]);
					Segment s2(qs[j][l],qs[j][(l+1)%4]-qs[j][l]);
					flg|=InterSS(s1,s2);
				}
				if(flg)
					uf.Unite(i,j);
			}
			int res=0;
			rep(i,uf.data.size())
				if(uf.data[i]<0)
					res++;
			cout<<res<<endl;
		}
	}
	
	return 0;
}

Measured memory_bytes: 1204
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); i > (b); i--)
#define ALL(a) (a).begin(), (a).end()

int main() {
    int N, K;
    cin >> N >> K;
    if ((N + 1) / 2 >= K) cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}

Measured memory_bytes: 256
k, x =  STDIN.gets.chomp.split.map! do |i| i.to_i end

max = x + k - 1
min = x - k + 1

min = (min < -1000000 ? -1000000 : min)
max = (max > 1000000 ? 1000000 : max)

str = ""
for i in min..max
  str += "#{i} "
end
puts str.chomp

Measured memory_bytes: 1788
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)n; i++)
#define REPvec(itr, mp) for (auto itr = mp.begin(); itr != mp.end(); itr++)
#define all(x) x.begin(), x.end()
#define MOD 1000000007  // 1e9+7
using namespace std;
typedef long long ll;
typedef vector<bool> vecbool;
typedef vector<int> vecint;
typedef vector<ll> vecll;
typedef vector<string> vecstr;
typedef vector<vecint> vec2int;
typedef vector<vecbool> vec2bool;
int dx[4]{-1, +1, 0, 0};
int dy[4]{0, 0, -1, +1};
void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}
int n;
vecint a;
vector<vecll> memo;
ll dfs(int l, int r) {
  if (memo[l][r] != -1) return memo[l][r];
  ll res;
  if (r - l == 0) {
    res = a[r];
  } else if (r - l == 1) {
    res = max(a[l], a[r]);
  } else {
    // ll al, ar;
    // if (dfs(l + 2, r) <= dfs(l + 1, r - 1)) {
    //   al = dfs(l + 2, r);
    // } else {
    //   al = dfs(l + 1, r - 1);
    // }
    // if (dfs(l, r - 2) <= dfs(l + 1, r - 1)) {
    //   ar = dfs(l + 2, r);
    // } else {
    //   ar = dfs(l + 1, r - 1);
    // }
    ll al = min(dfs(l + 2, r), dfs(l + 1, r - 1));
    ll ar = min(dfs(l, r - 2), dfs(l + 1, r - 1));
    res = max(a[l] + al, a[r] + ar);
  }
  memo[l][r] = res;
  return res;
}
int main() {
  init();
  cin >> n;
  a.resize(n);
  ll sum = 0;
  for (auto& e : a) {
    cin >> e;
    sum += e;
  }
  memo = vector<vecll>(n, vecll(n, -1));
  ll x = dfs(0, n - 1);
  cout << 2 * x - sum << endl;
}


Measured memory_bytes: 70912
#include<bits/stdc++.h>
using namespace std;
#define int long long
int dp[3000][52];
main(){
	int n,a[54];
	double m;
	cin>>n>>m;

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

	dp[0][0]=1;

	for(int i=0;i<n;i++){
		for(int j=2900;j>=0;j--){
			for(int k=51;k>=0;k--){
				dp[j+a[i]][k+1]+=dp[j][k];
			}
		}
	}
	int ans=0;
	for(int i=0;i<3000;i++){
		for(int j=1;j<52;j++)if(dp[i][j]){
			double t=(double)i/j;
			if(abs(t-m)<1e-9){
				ans+=dp[i][j];
			}
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 1408
#include<bits/stdc++.h>
using namespace std;
const int maxn=2e5+5;
int f[maxn],siz[maxn];
int find(int x)
{	return f[x]==x?x:f[x]=find(f[x]); }
int main()
{
	int n,m,u,v,ans=1;
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++) 
		f[i]=i,siz[i]=1;
	for(int i=1;i<=m;i++)
	{
		scanf("%d%d",&u,&v);
		int fu=find(u),fv=find(v);
		if(fu==fv) continue;
		f[fv]=fu,siz[fu]+=siz[fv];
		ans=max(ans,siz[fu]);
	}
	printf("%d\n",ans);
}

Measured memory_bytes: 5356
#include<bits/stdc++.h> 
//#define <- プログラムの文字列を置換する
//typedef <- 新しい型に名前を付けるためのキーワード

using namespace std;

#define MAX_N 1

typedef long long ll;

const double PI = 3.141592653589793;
const long long MOD = 1e9 + 7;
const long long INF = 1e15;


int main(){
    int N;
    cin >> N;
    double sum = 0;
    for(int i = 0; i < N; i++){
        double a;
        string s;
        cin >> a >> s;
        if(s == "JPY") sum += a;
        else{
            sum += a * 380000.0;
        }
    }
    printf("%.10lf\n",sum);
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-

import sys
import copy
import math

sys.setrecursionlimit(1000000)

# input = sys.stdin.readline

# ~~~~~~~~~~~~~~~~~~~~~_(＾～＾ ｣ ∠)_~~~~~~~~~~~~~~~~~~

N, K, Q = map(int, input().split())

a = [K - Q] * N

for i in range(Q):
    b = int(input())
    b -= 1
    a[b] += 1


for i in range(N):
    if a[i] > 0:
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 7072
#include<stdio.h>
#include<iostream>
#include<list>
using namespace std;
main(){
    int N;
    list<int> nums;
    scanf("%d",&N);
    int reverse = 0;//反転フラグ
    for(int i = 0;i < N;i++){
        int num;
        scanf("%d",&num);
        if(reverse){
            nums.push_front(num);
        }else{
            nums.push_back(num);
        }
        reverse = !reverse;
    }
    //出力
    list<int>::iterator itr;
    if(reverse){
        itr = nums.end();
        itr--;
    }else{
        itr = nums.begin();
    }
    for(int i = 0;i < N;i++){
        printf("%s%d",i!=0?" ":"",*itr);
        if(reverse){
            itr--;
        }else{
            itr++;
        }
    }
    printf("\n");
}

Measured memory_bytes: 8576
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using namespace std;
using uint = unsigned int;
using ll = long long;
const int M = 1e9 + 7;
const ll MLL = 1e18L + 9;
#pragma unused(M)
#pragma unused(MLL)
#ifdef LOCAL
#include"rprint.hpp"
#else
template <ostream& out = cout, class... T> void prints(T&&...){ }
template <ostream& out = cout, class... T> void printd(T&&...){ }
template <ostream& out = cout, class... T> void printb(T&&...){ }
template <ostream& out = cout, class... T> void printArr(T&&...){ }
#endif

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n, a, b;
    cin >> n >> a >> b;
    vector<int> hs(n);
    for(int i = 0; i < n; i++){
        cin >> hs[i];
        // scanf("%d", &hs[i]);
    }
    sort(hs.rbegin(), hs.rend());
    auto solve = [&](int num){
        int cnt = num;
        for(int i = 0; i < n; i++){
            ll hp = hs[i] - b * num;
            if(hp <= 0){ break; }
            cnt -= (hp + a - b - 1) / (a - b);
            if(cnt < 0){
                break;
            }
        }
        return cnt >= 0;
    };
    int l = 0, r = 1e9;
    while(l < r){
        int piv = (l + r) / 2;
        if(solve(piv)){
            r = piv;
        }else{
            l = piv + 1;
        }
        prints(l, r);
    }
    cout << l << '\n';
    return 0;
}


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


int main(){

  string s;
  cin >> s;
  int count = 0;

  for (int i = 0; i < s.size() - 1; i++) {
    if (s[i] != s[i+1]) {
      //cout << s[i] << "\t" << s[i+1] << endl;
      count++;
    }
  }

  cout << count << endl;

}


Measured memory_bytes: 512
import java.util.*;
public class Main{
    static Scanner kbd = new Scanner(System.in);
    public static void main(String[] args){
	int n = kbd.nextInt();
	int cnt = 0;
	int c = 0;
	while(n>=3){ 
	    while(n%3 != 0) {
		n++;
	    }
	    n = n/3;
	    cnt++;
	}
	if(n==2){
	    cnt++;
	}
	System.out.println(cnt);
    }
}

Measured memory_bytes: 17360
#include <bits/stdc++.h>
#include <math.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = 0; i <= (n); i++)
using namespace std;
typedef long long ll;
 
const ll INF = 1LL<<60;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using Graph = vector<vector<int>>;

typedef pair<int, int> P;
typedef priority_queue<int, vector<int>, greater<int>> PQ;
const int MOD = 1000000007;


int main(){
    ll N; cin >> N;
    string alpha = "abcdefghijklmnopqrstuvwxyz";

    string ans = "";
    while(N > 0){
        N--;
        ans = alpha[N%26] + ans;
        N /= 26;
    }

    cout << ans << endl;

}

Measured memory_bytes: 3628
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        mut m: i64,
        mut ab: [(i64, i64); n],
    }

    ab.sort_by_key(|&(a, _)| a);

    let mut ans = 0;

    for (a, b) in ab {
        let u = std::cmp::min(b, m);
        ans += a * u;
        m -= u;
    }

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


Measured memory_bytes: 6396
#include <bits/stdc++.h>
//#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#include "boost/multiprecision/cpp_int.hpp"
//typedef boost::multiprecision::cpp_int LL;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2

ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
//template<class T>void max(T a,T b){if(a<b)return b;else return a;}
//template<class T>void min(T a,T b){if(a>b)return b;else return a;}
//template<class T>bool Max(T&a, T b){if(a < b){a = b;return 1;}return 0;}
//template<class T>bool Min(T&a, T b){if(a > b){a = b;return 1;}return 0;}

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



ll po(ll i,ll p){
    if(p==0)return 1;
    else{
        i=mod(i);
        if(p==1)return i;
        if(p%2==0)return po(mod(i*i),p/2);
        return mod(i*po(i,p-1));
    }
}
ll bunbo(ll n){
    return po(n,i_5);
}




#define N (1<<20)
//#define N 16

int main(){fastio
    ll n;cin>>n;
    ll a[n];rep(i,0,n-1)cin>>a[i];
    ll s[n];
    s[0]=a[0];
    rep(i,1,n-1)s[i]=s[i-1]^a[i];
    
    ll dp[N][2];memset(dp,0,sizeof(dp));
    rep(i,1,N-1)dp[i][0]=1;
    ll cntsum=0;
    ll cnt[N];memset(cnt,0,sizeof(cnt));
    
    rep(i,0,n-1){
        if(s[i]==0){
            /*
            rep(x,1,N-1){
                if(i<=last[x]){
                    dp[x][0]+=dp[x][1];
                }
            }*/
            /*
            rep(x,1,N-1){
                cnt[x]++;
            }*/
            cntsum++;
        }else{
            ll x=s[i];
            //dp[x][1]+=dp[x][0];
            /*
            dp[x][0]+=cnt[x]*dp[x][1];
            cnt[x]=0;
            dp[x][1]+=dp[x][0];*/
            Add(dp[x][0],(cntsum-cnt[x])*dp[x][1]);
            cnt[x]=cntsum;
            Add(dp[x][1],dp[x][0]);
        }
    }
    
    //rep(i,0,n-1)cout<<s[i]<<" ";cout<<endl;
    //rep(i,1,N-1)cout<<i<<":"<<dp[i][0]<<" "<<dp[i][1]<<endl;
    
    if(s[n-1]==0){
        /*
        ll last[N];memset(last,-1,sizeof(last));
        rep(i,0,n-1){
            last[s[i]]=i;
        }*/
        
        
        ll ans=po(2,cntsum-1);
        rep(i,1,N-1){
            Add(ans,dp[i][1]);
        }
        cout<<mod(ans)<<endl;
        
    }else{
        cout<<mod(dp[s[n-1]][0])<<endl;
    }
    
    return 0;
}



Measured memory_bytes: 32640
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#define PI 3.14159265358979323846

int digit_sum(int N) {
	int sum = 0;

	while (N > 0) {
		sum += N % 10;
		N /= 10;
	}
	return sum;
}


int main(void) {
	
	int N, A, B;
	scanf("%d%d%d", &N, &A, &B);

	int a;
	int sum = 0;
	for (int i = 1; i <= N; i++) {
		a = digit_sum(i);
		if (A <= a && a <= B) {
			sum += i;
		}

	}

	printf("%d", sum);


	return 0;
}

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

// clang-format off
#define  range(i, l, r) for (int i = (int)(l); i < (int)(r); ++(i))
#define rrange(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); --(i))

#define  whole(f, x, ...) ([&](decltype((x)) container) { return (f)(  begin(container),  end(container), ## __VA_ARGS__); })(x)
#define rwhole(f, x, ...) ([&](decltype((x)) container) { return (f)( rbegin(container), rend(container), ## __VA_ARGS__); })(x)

#define endl '\n'
#define debug(x) cerr << "(" << __LINE__ << ")" << #x << ": " << (x) << endl

using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

// constexpr i32 mod   = 998244353;
constexpr i32 mod   = 1e9 + 7;
constexpr i32 inf   = 1001001001;
constexpr i64 infll = 1001001001001001001ll;

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

struct IoSetup { IoSetup(int x = 15){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(x); cerr << fixed << setprecision(x); } } iosetup;

template <typename T = i64> T input() { T x; cin >> x; return x; }

template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { range(i, 0, v.size()) { os << v[i] << (i + 1 != v.size() ? " " : ""); } return os; } 
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }

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

template <typename T> vector<T> make_vector(size_t a, T b) { return vector<T>(a, b); }
template <typename... Ts> auto make_vector(size_t a, Ts... ts) { return vector<decltype(make_vector(ts...))>(a, make_vector(ts...)); }

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// clang-format on

void solver() {
    string s = input< string >();
    
    cout << (s[2] == s[3] && s[4] == s[5] ? "Yes" : "No") << endl;
}

signed main(int argc, char *argv[]) {
    solver();
}


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

int main() {
    int N,K; cin >> N >> K;
    int l[60]; REP(i,N) cin >> l[i];
    int ans=0;
    sort(l,l+N,greater<int>());
    REP(i,K) ans += l[i];
    cout << ans << endl;

    return 0;
}

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

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

	int i = 0, ans = 0;

	while (i < s.length()) {
		ans++;
		while (i + 1 < s.length() && s[i] == s[i + 1]) {
			i++;
		}
		i++;
	}

	cout << ans;
	return 0;
}

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

int main() {

    int A, B, C, D, E;
    cin >> A >> B >>C >>D >>E;

    if (A==0) {
        cout << 1 << endl;

    }
    else if (B==0) {
        cout << 2 << endl;

    }
    else if (C==0) {
        cout << 3 << endl;

    }
    else if (D==0) {
        cout << 4 << endl;

    }
    else {
        cout << 5 << endl;

    }

}

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

int n, s = 0, t = 0;
int a[200000];

int main()
{
	cin >> n;

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

		if (a[i] > s) {
			if (a[i] > t)
				t = a[i];
			else
				s = a[i];
		}
	}

	for (int i = 0; i < n; i++) {
		if (a[i] == t)
			cout << s << endl;
		else
			cout << t << endl;
	}

	return 0;
}

Measured memory_bytes: 2432
#include <iostream> 
#include <bits/stdc++.h>
#include <vector> 
#include <algorithm> 
#include <string>
#include <cmath>
#include <iomanip> 
#include<climits> 
#include <utility>   
#include <set>
#include <numeric> 
#include <iterator>
#include <map> 
using namespace std; 
#define ll long long int
//typedef pair<ll,ll> p; 
int main()
{
     ll n,m;
     cin>>n>>m;
     ll a[n],s=0,p=0,l;
     for(int i=0;i<n;i++)
     {
         cin>>a[i];
         s+=a[i];
     }
     l=(s/(4*m));
     if(l*4*m == s)
     s=l;
     else
     s=l+1;
     for(int i=0;i<n;i++)
     {
         if(a[i]>=s)
         p++;
     }
     if(p>=m)
     cout<<"Yes"<<endl;
     else
     cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan0
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














string T;
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> T;
	fore(c, T) if (c == '?') c = 'D';
	cout << T << endl;
}







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

int main() {
    ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    string s; cin>>s;
    int n=s.length(), ans=0;
    for (int i=0; i<n/2; ++i) {
        if (s[i]!=s[n-1-i]) ++ans;
    }
    cout<<ans;
    return 0;
}

Measured memory_bytes: 256
def Root(x, cnt):
  cnt += 1
  if L[x] == x:
    return x, cnt
  else:
    return Root(L[x], cnt)

N, M = list(map(int, input().split()))
p = list(map(int, input().split()))

Data = []
for i in range(M):
  Data.append(list(map(int, input().split())))

L = [i for i in range(N + 1)]
for i in Data:
  a = Root(i[0], 0)
  b = Root(i[1], 0)
  if a[1] > b[1]:
    L[b[0]] = L[a[0]]
  else:
    L[a[0]] = L[b[0]]
    
Ans = 0
for i in range(N):
  if Root(i + 1, 0)[0] == Root(p[i], 0)[0]:
    Ans += 1
print(Ans)

Measured memory_bytes: 35272
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

const int N=1e5+5;

int n, k, cur=0;
int a[N];

int32_t main()
{
	IOS;
	cin>>n>>k;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	for(int i=50;i>=0;i--)
	{
		int cnt=0;
		for(int j=1;j<=n;j++)
		{
			if((a[j]>>i)&1)
				cnt++;
		}
		if(cnt*2<n && (cur+(1LL<<i)<=k))
			cur+=(1LL<<i);
	}
	int ans=0;
	for(int i=1;i<=n;i++)
		ans+=(cur^a[i]);
	cout<<ans;
	return 0;
}


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

main(){
	while(true){
		int w;
		cin>>w;
		
		if(w<0){
			break;
		}
		
		int ans=1150;
		
		if(30<w){
			ans += (w-30)*160;
			w=30;
		}
		
		if(20<w){
			ans += (w-20)*140;
			w=20;
		}
		
		if(10<w){
			ans += (w-10)*125;
			w=10;
		}
		
		cout << (4280-ans) << endl;
	}
}


Measured memory_bytes: 3084
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
	
		while(true){
			String s = sc.nextLine();
			if(s.equals("END OF INPUT")) break;
			
			String[] array = s.split(" ");
			for(int i=0; i<array.length; i++){
				System.out.print(array[i].length());
			}
			System.out.println();
		}
	
	}
}

Measured memory_bytes: 17176
s = input()
s1 = int(s[:2])
s2 = int(s[2:4])

if s1 == 0 and s2 == 0:
    print("NA")
    exit()

if (s1 >= 13 or s1 <= 0) and (s2 >= 13 or s2 <= 0):
    print("NA")
elif s1 <= 12 and s1 >= 1 and s2 <= 12 and s2 >= 1:
    print("AMBIGUOUS")
elif s2 >= 13 or s2 == 0:
    print("MMYY")
else:
    print("YYMM")
    

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

typedef pair<int,int> P;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define sz(x) ((int)(x).size())
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
char head_char[] = {'M', 'A', 'R', 'C', 'H'};
int counter[5];

int main()
{
    int n;
    cin >> n;
    vector<string> name(n);
    rep(i, n) cin >> name[i];

    rep(i,n)
    {
        //cout << name[i][0] << endl;
        rep(j, 5)
        {
           if (head_char[j]==name[i][0])
           {
               counter[j]++;
           }
        }
    }
    ll ans = 0;
    int check = 0;
    rep(i,5)
    {
        if (counter[i]!=0)
        {
            check++;
        }
    }
    //cout << check << endl;

    ll add;
    for (int i = 0; i < 5; i++)
    {
        for (int j = i+1; j < 5; j++)
        {
            for (int k = j+1; k < 5; k++)
            {
                add = (ll)counter[i] * (ll)counter[j] * (ll)counter[k];
                //cout << add << endl;
                ans += add;
            }
        }
    }
    cout << ans << endl;
    return 0;

}

Measured memory_bytes: 6144
N,K = list(map(int,input().split()))

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

maxK = min(50,K)
t = 1
while t<=maxK:
    nextA = [0]*N
    for i in range(N):
        l = max(0,i-A[i])
        r = min(N-1,i+A[i])
        nextA[l] += 1
        if r+1<=N-1:
            nextA[r+1] += -1
    for i in range(1,N):
        nextA[i] = nextA[i-1] + nextA[i]
    A = nextA[:]
    t+=1
print(*nextA)

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

using namespace std;

int main(){
  int N, ketasuu,a ,b , sum =0;
  int kurai;
  kurai = 0;
  cin >> N;
  a = N;
  b = N;
  for(int i = 0;N != 0;i++){
    N  = N / 10;
    ketasuu = i + 1;
  }

  
  for(int i = 0;i < ketasuu ;i++){;
    sum = sum + a % 10;
    a = a / 10;
  }

  if(b % sum == 0){
    cout << "Yes" << endl;
  }else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 3548
#include <iostream>
using namespace std;
int main(void){
    int a=0;
    int b=0;
    int c=0;
    int d=0;
    int e=0;
    int cold=0;
    int f=0;
    int g=0;
    cin>>a>>b>>c>>d>>e;
    if(a<=0){
      if(a==0){
         f=d+b*e;
         cout<<f<<endl;
      }else{
        while(a<0){
            a++;
            cold++;
        }
        f=cold*c+d+b*e;
        cout<<f<<endl;
      }    
    }else{
        g=b-a;
        f=g*e;
        cout<<f<<endl;
    }
    
}



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

using namespace std;

typedef pair<int, int> PII;
typedef long long ll;

bool cmp1(PII p1, PII p2) {
	if (p1.first < p2.first) return true;
	if (p1.first > p2.first) return false;
	return p1.second < p2.second;
}

bool cmp2(PII p1, PII p2) {
	if (p1.first > p2.first) return true;
	if (p1.first < p2.first) return false;
	return p1.second > p2.second;
}

ll mul(PII p1, PII p2, PII o) {
	return 1LL * (p1.first - o.first) * (p2.second - o.second) - 1LL * (p2.first - o.first) * (p1.second - o.second);
}

vector<PII> getHalf(vector<PII> &p) {
	vector<PII> res;
	res.push_back(p.front());
	for (int i = 1; i < p.size(); i++) {
		while (res.size() > 1 && mul(res[res.size() - 1], p[i], res[res.size() - 2]) <= 0) res.pop_back();
		res.push_back(p[i]);
	}
	return res;
}

vector<PII> getConvex(vector<PII> &p) {
	sort(p.begin(), p.end(), cmp1);
	vector<PII> res=getHalf(p);
	res.pop_back();
	sort(p.begin(), p.end(), cmp2);
	vector<PII> h=getHalf(p);
	h.pop_back();
	for (int i=0;i<h.size(); i++) res.push_back(h[i]);
	return res;
}

int main() {
	vector<PII> p;
	p.push_back(make_pair(0, 0));
	int n;
	cin>>n;
	for (int i=0; i<n; i++) {
		int x,y;
		cin>>x>>y;
		vector<PII> np;
		for (int j=0;j<p.size();j++) {
			PII e=p[j];
			np.push_back(e);
			np.push_back(make_pair(e.first + x, e.second + y));
		}
		p=getConvex(np);
		// for (auto e: p) {
		// 	cout << e.first << " " << e.second << endl;
		// }
		// cout << endl;
	}
	ll ans = 0;
	for (int j=0;j<p.size();j++) {
		PII e=p[j];
		ans = max(1LL * e.first * e.first + 1LL * e.second * e.second, ans);
	}
	cout << setprecision(15) << sqrt(ans) << endl;
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
import java.util.Arrays;
import java.lang.Integer;
import java.lang.Math;

class Main {
  public static void main (String[] args) {
    	Scanner scanner = new Scanner(System.in);
		String tokens1[] = scanner.nextLine().split(" ");
		String tokens2[] = scanner.nextLine().split(" ");
		int min = Integer.parseInt(tokens2[0]);
		int count = 1;
		for ( int i = 1; i < tokens2.length; i++) {
			int val = Integer.parseInt(tokens2[i]);
			if (val <= min) {
				count++;
			}
			min = Math.min(min, val);
		}
		System.out.print(count);
		

        
  }
}


Measured memory_bytes: 57000
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;

#define REP(i, n) for (int i = 0; i < (n); i++)
#define REP1(i, n) for (int i = 1; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; 0 <= i; i--)
#define CIN(A) int A; cin >> A;
#define CIN2(A, B) int A, B; cin >> A >> B;
#define CIN3(A, B, C) int A, B, C; cin >> A >> B >> C;
#define CINVEC(A, N) vector<int> A; REP(i, N) { int a; cin >> a; A.emplace_back(a); }
#define ANS(ans) cout << (ans) << endl
#define SORT(V) sort(V.begin(), V.end())
#define RSORT(V) sort(V.rbegin(), V.rend())

#define DEBUGV(V) REP(i, V.size()) cout << V.at(i) << " "; cout << endl 

int
main()
{
  CIN3(A, B, C); CIN(X);

  int ans = 0;
  REP(i, A+1) REP(j, B+1) REP(k, C+1) {
    if (i * 500 + j * 100 + k * 50 == X) ++ans;
  }

  ANS(ans);

  return 0;
}


Measured memory_bytes: 256
#include <iostream>

int main(int argc, char const *argv[]) {
  int a,b,c;
  int count = 0;
  std::cin >> a >> b >> c;
  for(int i = a; i <= b; i++) {
    if ((c%i) == 0){
      count++;
    }
  }
  std::cout << count << '\n';
  return 0;
}

Measured memory_bytes: 3104
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int x, y, a, b, c, z = 0, cnt = 0;
    long long ans = 0;
    cin >> x >> y >> a >> b >> c;
    int rd[a], gr[b], cl[c], mix[x + y + c];
    for(int i = 0; i < a; i++)
    {
        cin >> rd[i];
    }
    for(int i = 0; i <b; i++)
    {
        cin >> gr[i];
    }
    for(int i = 0; i< c; i++)
    {
        cin >> cl[i];
    }
    sort(rd, rd + a);
    sort(gr, gr + b);
    sort(cl, cl + c);
    for(int i = a - 1; i >= a - x; i--)
    {
        mix[z++] = rd[i];
    }
    for(int i = b - 1; i >= b - y; i--)
    {
        mix[z++] = gr[i];
    }
    for(int i = c - 1; i >= 0; i--)
    {
        mix[z++] = cl[i];
    }
    sort(mix, mix + z);
    for(int i = z - 1; i >= z - x - y; i--)
    {
        ans += mix[i];
    }
    cout << ans << endl;
}




Measured memory_bytes: 5872
#include <bits/stdc++.h>
using namespace std; 
typedef long long ll;
#pragma GCC optimize("O3")
#define pb push_back
ll dp[101][(int)2e5];
int32_t main()  {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n , w;
    cin >> n >> w;
    ll mx = n * 1000;
    vector<ll> dp(mx+1,w+1);
    dp[0]=0;
    while ( n-- ) {
        int a , b;
        cin >> a >> b;
        for( int i  = mx-b ; i>=0 ;i--) {
            dp[i+b]=min(dp[i+b],dp[i]+a);
        }
    }
    ll ans=-1;
    for ( int i  = 1 ; i <= mx ; ++i) {
        if(dp[i] <=w) ans= i >= ans ? i : ans;
    }
    cout << ans ;
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
    int N, tmpIndex = 0, tmpMax = 0, answer = 0;

    cin >> N;
    vector<int> a(N);
    for (int count = 0; count < a.size(); count++)
    {
        cin >> a.at(count);
    }
    for (int count = 0; count < a.size(); count++)
    {
        for (int index = 0; index < a.size(); index++)
        {
            if (a.at(index) > tmpMax)
            {
                tmpMax = a.at(index);
                tmpIndex = index;
            }
        }
        if (count % 2 == 0)
        {
            answer += tmpMax;
            tmpMax = 0;
            a.at(tmpIndex) = 0;
        }
        else
        {
            answer -= tmpMax;
            tmpMax = 0;
            a.at(tmpIndex) = 0;
        }
        
    }

    cout << answer << endl;
}

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;

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

    double x;
    if(d == 0) {
        x = n;
    }
    else {
        x = 2.0*(n-d);
    }
    
    exout(x*(m-1)/(n*n));
    re0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll dp[3001][3001];
ll a[3001];
ll n;
ll solve(ll l, ll r){
    if(l > r){
        return 0;
    }
    if(dp[l][r] != -1){
        return dp[l][r];
    }
    dp[l][r] = max(a[l] - solve(l+1,r), a[r] - solve(l,r-1));

return dp[l][r];
}
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    memset(dp,-1,sizeof(dp));
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
    }
    cout<<solve(1,n)<<"\n";
}


Measured memory_bytes: 70784
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vd=vector<double>;
using vvd=vector<vd>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using vs=vector<string>;
#define rep(i,n) range(i,0,n)
#define range(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define LINF    	((ll)1ll<<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI			3.141592653589793

template<class S,class T>ostream& operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s; a=0;} return os;}

int main(){
	cin.tie(0);
   	ios::sync_with_stdio(false);
	
	int t,d,l;
	while(cin>>t>>d>>l,t){
	    int ans=0,r=0,p;
		rep(i,t){
		    cin>>p;
		    if(p>=l)r=d;
		    if(i+1!=t and r>0){
		        ans++;
		        r--;
		    }
		}
		cout<<ans<<endl;
		
	}
	return 0;
}



Measured memory_bytes: 3116
from itertools import product

N, M = map(int, input().split())
S, C = [0] * M, [0] * M
for i in range(M):
    S[i], C[i] = map(int, input().split())

match = []
for digits in product(range(10), repeat=N):
    for i in range(M):
        if digits[S[i] - 1] != C[i]:
            break
    else:
        s = "".join(str(d) for d in digits)
        num = int(s)
        if len(str(num)) == N:
            match.append(num)

print(-1 if len(match) == 0 else min(match))

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

//#define DEBUG

using namespace std;

template <class T>
void print_vect(std::vector<T> v){
    for(int i = 0 ; i < v .size(); i++) cout << v[i] << " ";
    cout << endl;
}


void func_to_create(){
    uint64_t A ;
    cin >> A;
    std::string B;
    cin >> B;
    uint64_t C = (B[0] - '0') * 100 + (B[2] - '0') * 10 + (B[3] - '0');
    // cout << "C is " << C << endl;
    uint64_t ans = A * C / 100;
    cout << ans << endl;
}
int main()
{
    //making data IO Fast
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(NULL);
    /****************************/

    #ifdef DEBUG
    int TEST_CASES = 3;
    while(TEST_CASES--){
    #endif // DEBBUG

    func_to_create();

    #ifdef DEBUG
    }
    #endif // DEBUG
    
    return 0;
}


Measured memory_bytes: 3640
H, W, K=map(int,input().split())
board=[input() for i in range(H)]
ans=0

for i in range(2**H-1):
  for j in range(2**W-1):
    h=list(str(format(i,"b").zfill(H)))
    w=list(str(format(j,"b").zfill(W)))
    black=0
    for l in range(H):
      for m in range(W):
        if h[l]=="0" and w[m]=="0":
          if board[l][m]=="#":
            black+=1
    if black==K:
      ans+=1
print(ans)

Measured memory_bytes: 9152
#include <iostream>
#include <map>
#include <vector>
#include <cstring>

using namespace std;

const int L = 80;

int main(){
	int p, q, d;
	char a[L];
	while(cin >> p >> q){
		map<int, int> t;
		memset(a, 0, sizeof(a));
		d = 0;
		p *= 10;
		while(p != 0 && !t.count(p)){
			int x = p / q;
			t[p] = d;
			a[d] = (char)(x + '0');
			p -= x * q;
			p *= 10;
			++d;
		}
		cout << a << endl;

		if(p != 0){
			for(int i = 0;i < t[p];++i){
				cout << " ";
			}
			for(int i = t[p];i < d;++i){
				cout << "^";
			}
			cout << endl;
		}
	}
	return 0;
}

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

int main(void)
{
	int b[512];
	int friends[512][512];
	int i, j;
	int n, m;
	int from, to;
	int ans;
	
	while (1){
		memset(b, 0, sizeof(b));
		memset(friends, 0, sizeof(friends));

		scanf("%d %d", &n, &m);
		if (n == 0) break;
		
		for (i = 0; i < m; i++){
			scanf("%d %d", &from, &to);
			friends[from][to] = 1;
			friends[to][from] = 1;
		}

		for (i = 1; i <= n; i++){
			if (friends[1][i] == 1){
				b[i] = 1;
				for (j = 1; j <= n; j++){
					if (friends[i][j] == 1){
						b[j] = 1;
					}
				}
			}
		}

		ans = 0;
		for (i = 2; i <= n; i++){
			ans += b[i];
		}

		printf("%d\n", ans);
	}
	return (0);
}

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

int main(){
	string S;
	cin >> S;
	int L=S.size();
	vector<int> ans(L);
	
	int pos=0;
	while(pos<L){
		int r=0,l=0;
		bool l_flag=false;
		int i;
		for(i=pos;i<L;i++){
			if(S[i]=='L'){
				l++;
				l_flag=true;
			}
			else{
				if(l_flag)break;
				r++;
			}
		}
		ans[pos+r]=(l+1)/2+r/2;
		ans[pos+r-1]=l/2+(r+1)/2;
		pos=i;
	}
	
	for(int i=0;i<L;i++){
		cout << ans[i];
		if(i<L-1)cout << " ";
		else cout << endl;
	}
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std ;
 
/*                        [Template]                        */
#define async ios_base::sync_with_stdio(false); cin.tie(NULL);
#define int long long int
#define let auto
#define of :
#define all(y) y.begin(), y.end()
#define present( x, y ) x.find( y ) != x.end()
#define _matrix(T) vector<vector<T>>
template<class T>
auto matrix( int r, int c, T v ){
	return vector<vector<T>>( r, vector<T>( c, v ) ) ;
}
const int mod = (int)1e9 + 7 ;
const int inf = (int)1e9 ;
/************************************************************/

 
signed main(){
	int X, K, D ;
	cin >> X >> K >> D ;
	int n = min(abs(X) / D, K) ;
	int leftMoves = K - n ;
	// cerr << leftMoves << endl ;
	int curCord ;
	if( X <= 0 ){
		curCord = X + n*D ;
	}
	else{
		curCord = X - n*D ;
	}
	if( leftMoves % 2 == 0 ){
		cout << abs(curCord) ;
	}
	else{
		// cerr << curCord << endl ;
		cout << min( D + abs(curCord), abs( D - abs(curCord) ) ) ;
	}

	return 0 ;
}
  


Measured memory_bytes: 3636
no_snukes, types_snacks = list(map(int, input().split()))

snukes_arr = [0 for i in range(no_snukes)]


for i in range(types_snacks):
    snack = int(input())
    snukes_who_have = list(map(int, input().split()))
    for s in snukes_who_have:
        snukes_arr[s-1] += 1

dead_boy = 0

for i in range(len(snukes_arr)):
    if snukes_arr[i] == 0:
        dead_boy += 1

print(dead_boy)


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

int main() {
    string s;
    cin >> s;
    int len = s.length();
    for(int i = 0; i < len; i++) {
        if(s[i] == '9') {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<fstream>
#include<algorithm>
using namespace std;
using ll = long long;

int main(){
    string str;
    cin >> str;
    for(int i=0;i<str.size();i++)   cout << 'x';
}

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

an = list(map(int, input().split()) )
bn = list(map(int, input().split()) )


count = 0
for i in range(n):

    if an[i] + an[i+1] <= bn[i]:
        count += an[i] + an[i+1]
        an[i] = an[i+1] = 0

    else:
        
        dis = bn[i] - an[i]

    
        if dis > 0 :#まだ倒せるとき
            count += an[i] + dis
            an[i+1] -= dis
        else:#an[i+1]は無理
            count += bn[i]

#    print(bn[i],an[i],dis,count,an)


print(count)


Measured memory_bytes: 18476
//   _/                _/                 _/_/_/   _/
//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
// _/     _/    _/   _/     _/    _/  _/_/_/     _/
//_/     _/    _/   _/     _/    _/  _/    _/   _/
// _/_/   _/_/       _/_/   _/_/      _/_/     _/
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=1e9;
const ll INF=1e18;
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  int n,p;
  string s;
  vector<pair<pair<string,int>,int>> vpp;
  cin >> n;
  for(int i=0; i<n; i++) {
    cin >> s >> p;
    vpp.push_back({{s,-p},i+1});
  }
  sort(vpp.begin(),vpp.end());
  for(int i=0; i<n; i++) {
    cout << vpp[i].second << endl;
  }
}



Measured memory_bytes: 256