akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formax=(b);i>=i##formax;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bitComb(a,n,k) for(int a##x,a##y,a=(1<<k)-1;a<(1<<n);a##x=a&-a,a##y=a+a##x,a=(((a&~a##y)/a##x)>>1)|a##y)
#define uniq(v) sort(all(v));v.erase(unique(all(v)), v.end())
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))
#define dout(d) printf("%.12f\n",d)

typedef long long ll;
typedef __int128_t lll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>ostream& operator<<(ostream& o,const pair<T,Y>& p){return o<<"("<<p.fi<<", "<<p.se<<")";}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return (x%m+m)%m;}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 1e5+1;
int n, s[200], x;
ll DP[N], DP2[N];
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> x;
  FOR(i, 0, n) cin >> s[i];
  sort(s, s+n);
  FOR(i, 0, x+1) DP[i] = i;
  FOR(i, 0, n){
    FOR(j, 0, x+1) DP2[j] = (DP[j%s[i]] + DP[j]*i) % MOD;
    swap(DP, DP2);
  }
  cout << DP[x] << endl;
}

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

public class Main {
	
	public static void main(String[] args) {
		try {
			BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));

			String str = reader.readLine();
			String[] arr = str.split(" ");
			int a = Integer.parseInt(arr[0]);
			int b = Integer.parseInt(arr[1]);
			int d = a / b;
			int r = a % b;
			String f = String.format("%.5f", 1.0 * a / b);
			System.out.println(d + " " + r + " " + f);
			
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

}

Measured memory_bytes: 24752
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<string>
#include<queue>
#include<utility>
#include<cmath>
#include<sstream>
#include<istream>

using namespace std;


int main()
{
  string S;

  cin >> S;

  int N = S.length();

  string Srev = S;
  reverse(Srev.begin(), Srev.end());
  if(S != Srev){
    cout << "No" << endl;
    return 0;
  }

  string S2 = S;
  S2.erase((N-1)/2);
  string S2rev = S2;
  reverse(S2rev.begin(), S2rev.end());
  if(S2 != S2rev){
    cout << "No" << endl;
    return 0;
  }

  string S3 = S;
  S3.substr((N+3)/2);
  string S3rev = S3;
  reverse(S3rev.begin(), S3rev.end());
  if(S3 != S3rev){
    cout << "No" << endl;
    return 0;
  }

  cout << "Yes" << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

typedef long long ll;
typedef uint64_t ull;
typedef pair<int, int> P;
constexpr double EPS = 1e-9;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

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

template<typename T>
struct BinaryIndexedTree{
    vector<T> data;
    int sz;

    BinaryIndexedTree(int n){
        sz = n + 1;
        data.assign(sz, 0);
    }

    void add(int i, T x){
        ++i;
        while(i < sz){
            data[i] += x;
            i += i & -i;
        }
    }

    // [0, i] の区間和
    T sum(int i){
        T res = 0;
        ++i;
        while(i > 0){
            res += data[i];
            i -= i & -i;
        }
        return res;
    }

    T sum(int l, int r){
        return sum(r - 1) - sum(l - 1);
    }

    // val 以上を満たす 0-indexed の位置を返す
    int lower_bound(T val){
        // if(val <= 0)    return -1;
        int res = 0;
        int n = 1;
        while(n < sz)   n <<= 1;
        for(int k = n >> 1; k > 0; k >>= 1){
            if(res + k < sz && data[res + k] < val){
                val -= data[res + k];
                res += k;
            }
        }
        return res;     // 1-indexed であれば、res + 1 を返す
    }
};

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

    int n, m, q;
    cin >> n >> m >> q;
    vector<tuple<int, int, int>> table;
    for(int i = 0; i < m; ++i){
        int l, r;
        cin >> l >> r;
        table.emplace_back(l, q, r);
    }
    for(int i = 0; i < q; ++i){
        int l, r;
        cin >> l >> r;
        table.emplace_back(l, i, r);
    }
    sort(table.begin(), table.end());
    // for(auto tup : table){
    //     cout << get<0>(tup) << ' ' << get<1>(tup) << ' ' << get<2>(tup) << endl;
    // }
    BinaryIndexedTree<int> bit(n + 1);
    for(auto tup : table){
        if(get<1>(tup) < q) continue;
        bit.add(get<2>(tup), 1);
    }
    vector<int> ans(q);
    for(auto tup : table){
        int i = get<1>(tup);
        if(i == q)  bit.add(get<2>(tup), -1);
        else{
            int l = get<0>(tup), r = get<2>(tup);
            ans[i] = bit.sum(l, r + 1);
        }
    }
    for(int x : ans)    cout << x << '\n';
}

Measured memory_bytes: 9488
n=input()
g=0
l=[0]*(10**6+1)
from math import gcd
for i in map(int,input().split()):
    l[i]+=1;g=gcd(i,g)
if g!=1:print('not coprime')
elif all(sum(l[d::d])<=1 for d in range(2,10**6+1)):print("pairwise coprime")
else:print("setwise coprime")

Measured memory_bytes: 173196
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>

using namespace std;

typedef long long ll;

int main(){
    string a;
    getline(cin, a);
    vector<ll> x(500, 0);
    for (int i = 0; i < a.size(); i++)
        x[a[i]]++;
    
    ll res = a.size()*(a.size() + 1)/2 + 1;
    for (int i = 0; i < 500; i++)
        res -= x[i]*(x[i] + 1)/2;
    
    cout << res << endl;
    return 0;
}


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

int main() {
  int a, b;
  cin >> a >> b;
  if(a > b) {
    for(int i = 0; i < a; i++) {
      cout << b;
    }
    cout << endl;
  }
  else {
    for(int i = 0; i < b; i++) {
      cout << a;
    }
    cout << endl;
  }
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
	
	int a,b,c,d;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	
	int ra = a/d;
	if( a%d != 0 ) ra++;
	int rc = c/b;
	if( c%b != 0 ) rc++;
	if( rc > ra ) printf("No");
	else printf("Yes");
	
}

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

using namespace std;

int main()
{
	int n;
	cin >> n;
	int *array1 = new int[n];
	for (int i = 0;i < n;i++) {
		cin >> array1[i];
	}

	int m;
	cin >> m;
	int *array2 = new int[m];
	for (int i = 0;i < m;i++) {
		cin >> array2[i];
	}

	int count=0;
	for (int i = 0;i < m;i++) {
		int left = 0;
		int right = n;
		while (left<right)
		{
			int mid = (left + right) / 2;
			if (array1[mid] == array2[i]) {
				count++;
				break;
			}
			else if (array2[i] < array1[mid])right = mid;
			else left = mid + 1;
		}

	}
	cout << count<<endl;


    return 0;
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
#define pb              push_back
#define mp              make_pair

#define fast_in_out     ios_base::sync_with_stdio(false);cin.tie(0);
using namespace std;
int main()
{
    fast_in_out
    int t,l;cin>>t>>l;
    string s;
    vector<string>con;
    while(t--){
        cin>>s;
        con.pb(s);
    }
    sort(con.begin(),con.end());
    for(auto it=con.begin();it!=con.end();it++)cout<<*it;
    return 0;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define chmax(x,y) x = max(x,y)

const int K = 43;

ll dp[K][2][2];

int main() {
  int n;
  cin >> n;
  vector<ll> _a(n);
  rep(i,n) cin >> _a[i];
  ll x = 0;
  rep(i,n) x ^= _a[i];
  ll a = _a[0], b = _a[1];
  x ^= a^b;
  ll s = a+b;

  vector<int> xs, ss, as;

  rep(i,K)rep(j,2)rep(k,2) dp[i][j][k] = -1;

  dp[0][0][0] = 0;
  ll v = 1;
  rep(i,K-1) {
    int cx = x&1;
    int cs = s&1;
    int ca = a&1;
    xs.push_back(cx);
    ss.push_back(cs);
    as.push_back(ca);
    rep(j,2)rep(k,2) {
      if (dp[i][j][k] == -1) continue;
      // printf("%d %d %d: %lld\n", i,j,k,dp[i][j][k]);
      rep(na,2)rep(nb,2) {
        int ni = i+1;
        int nj = 0, nk = k;
        if ((na^nb) != cx) continue;
        int ns = na+nb+j;
        if (ns%2 != cs) continue;
        if (ns >= 2) nj = 1;
        if (ca < na) {
          nk = 1;
        } else if (ca == na) {
          nk = k;
        } else { // ca > na
          nk = 0;
        }
        chmax(dp[ni][nj][nk], dp[i][j][k]|(v*na));
      }
    }
    x >>= 1;
    s >>= 1;
    a >>= 1;
    v <<= 1;
  }

  a = dp[K-1][0][0];
  if (a == -1 || a == 0) {
    cout << -1 << endl;
    return 0;
  }

  ll ans = _a[0]-a;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3608
#include<iostream>
#include<vector>
#include<algorithm>
#define MAX_V 100
#define INF 1e9
using namespace std;
int cost[MAX_V][MAX_V];
int d[MAX_V];
bool used[MAX_V];
int V;
void dijkstra(int s) {
	for (int i = 0; i < V; i++) {
		d[i] = INF;
		used[i] = false;
	}
	d[s] = 0;
	while (true) {
		int v = -1;
		for (int u = 0; u < V; u++) {
			if (!used[u] && ((v == -1) || d[u] < d[v])) {
				v = u;
			}
		}
		//全ての頂点が到達済み
		if (v == -1) {
			break;
		}
		//集合に新たに頂点を追加
		used[v] = true;
		for (int u = 0; u < V; u++) {
			d[u] = min(d[u], d[v] + cost[v][u]);
		}
	}
}

int main() {
	for (int i = 0; i < MAX_V; i++) {
		for (int j = 0; j < MAX_V; j++) {
			cost[i][j] = INF;
		}
	}
	cin >> V;
	for (int i = 0; i < V; i++) {
		int u;
		cin >> u;
		int k;
		cin >> k;
		for (int j = 0; j < k; j++) {
			int v;
			cin >> v;
			int c;
			cin >> c;
			cost[u][v] = c;
		}
	}
	dijkstra(0);

	for (int i = 0; i < V; i++) {
		cout << i << " " << d[i] << endl;
	}
	return 0;
}



Measured memory_bytes: 3116
// Author: Harshdeep Sharma , IIT Indore
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
// #define MOD  998244353
#define ll long long
const double PI = atan(1.0) * 4;
// const ll INF = (int)1e9 ;
const int di[4] = { -1, 0, 1, 0} ;
const int dj[4] = {0, -1, 0, 1} ;
const ll INF = (ll)2e18 + 50;
const int maximum  = numeric_limits<int>::min();
const int minimum  = numeric_limits<int>::max();
const ll mod = 1e9 + 7 ;



ll power(ll a , ll e) {
	ll res = 1LL ;
	while (e > 0) {
		if (e % 2 == 1) res = res * a;
		a =  a * a  ;
		e /= 2 ;
	}
	return res ;
}
bool isBalanced(const string &exp)
{
	// Initialising Variables
	bool flag = true;
	int count = 0;

	// Traversing the Expression
	for (int i = 0; i < exp.length(); i++) {

		if (exp[i] == '(') {
			count++;
		}
		else {
			count--;
		}
		if (count < 0) {
			flag = false;
			break;
		}
	}
	if (count != 0) {
		flag = false;
	}

	return flag;
}

ll gcd (ll a, ll  b) {
	while (b) {
		a %= b;
		swap(a, b);
	}
	return a;
}

ll lcm (ll  a, ll  b) {
	return a / gcd(a, b) * b;
}



ll power(ll x, ll y, ll mod) {
	int res = 1;
	while (y) {
		if (y & 1)
			res = res * x % mod;
		x = x * x % mod;
		y >>= 1;
	}
	return res;
}




int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	// int t ;
	// cin >> t ;
	// while (t--) {
	int n , k ;
	cin >> n >> k ;
	vector<ll> a(n) ;
	for (int i = 0 ; i < n ; i++) {
		cin >> a[i] ;
	}
	k-- ;
	int lo = 0 , hi = k + 1 ;
	while (hi < n) {
		if (a[hi] > a[lo]) cout << "Yes\n";
		else cout << "No\n";
		lo += 1 ;
		hi += 1 ;
	}




	// }


	return 0 ;
}

Measured memory_bytes: 4780
import itertools
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

List = [i+1 for i in range(N)]

nums = list(itertools.permutations(List))

a = nums.index(P)
b = nums.index(Q)

print(abs(a-b))

Measured memory_bytes: 8052
#include<cstdio>
#include<cstdlib>

int main(){
    unsigned N;
    scanf("%u", &N);
    int A[N+2];
    A[0] = A[N+1] = 0;
    scanf("%d %d", A+1, A+2);
    unsigned answer = abs(A[2]);
    for(int i = 3; i <= N; ++i){
        scanf("%d", A + i);
        answer += abs(A[i] - A[i-1]);
    }
    answer += abs(A[N+1] - A[N]);
    printf("%u\n", answer);
    for (size_t i = 1; i < N; i++){
        printf("%u\n", answer = answer + abs(A[i] - A[i-1]) + abs(A[i] - A[i+2]) - abs(A[i+1] - A[i-1]) - abs(A[i+1] - A[i+2]));
    }
	return 0;
}

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

#define ll long long
#define Ok puts("OK");

using namespace std;

const int N = 1e5 + 7;

string s, t;

int nxt[N][26];
int n;
int lst[26];
ll ans;

int get(int a, int b) {
  if (a <= b) return b - a + 1;
  return n - a + b + 1;
}

main() {
  cin >> s >> t;
  n = s.size();
  memset(lst, -1, sizeof lst);
  for (int i = n - 1; i >= 0; i--) {
    lst[s[i] - 'a'] = i;
    for (int j = 0; j < 26; j++) {
      nxt[i][j] = lst[j];
    }
  }
  for (int i = n - 1; i >= 0; i--) {
    lst[s[i] - 'a'] = i;
    for (int j = 0; j < 26; j++) {
      nxt[i][j] = lst[j];
    }
  }
  int cur = 0;
  for (int i = 0; i < t.size(); i++) {
    if (nxt[cur][t[i] - 'a'] == -1) {
      cout << -1;
      return 0;
    }
    ans += get(cur, nxt[cur][t[i] - 'a']);
    cur = nxt[cur][t[i] - 'a'] + 1;
    if (cur >= n) {
      cur = 0;
    }
  }
  cout << ans;
}


Measured memory_bytes: 10752
#include <iostream>

using namespace std;

int main()
{
    int a, b, k;
    cin >> a >> b >> k;
    int x = (b < a + k) ? b : a + k;
    int y = b - k + 1;
    int z = (x > y) ? x : y;
    for (int i = a; i < x; ++i) {
        cout << i << endl;
    }
    for (int i = z; i <= b; ++i) {
        cout << i << endl;
    }

    return 0;
}

Measured memory_bytes: 384
const main = lines => {
  console.log(solve(lines));
};

const solve = (lines: string[]): string => {
  const S = parseLines(lines);

  const c = S.split('');
  let buf = '';
  let prev = '';
  let cnt = 0;

  for (let i = 0; i < c.length; i++) {
    buf += c[i];
    if (buf === prev) continue;

    prev = buf;
    buf = '';
    ++cnt;
  }

  return cnt.toString();
};

const parseLines = (lines: string[]) => {
  const obj = lines[0];
  debug(obj);
  return obj;
};

const debug = (message?: any, ...optionalParams: any[]) => {
  if (!!process.env.LOCAL_DEBUG) console.log(message, ...optionalParams);
};

if (!process.env.LOCAL_DEBUG) {
  const { stdin: input, stdout: output } = process;
  input.resume();
  input.setEncoding('utf8');
  const lines = [];
  require('readline')
    .createInterface({ input, output })
    .on('line', line => lines.push(line))
    .on('close', () => main(lines));
}

export default solve;


Measured memory_bytes: 11980
#include<stdio.h>

int main(void){
  char S[3],SY[3];
  int count = 0;
  scanf("%s",S);
  scanf("%s",SY);
  for(int i = 0;i < 3;i++){
    if(S[i] == SY[i])
      count++;
  }
  printf("%d",count);
  return 0;
}

Measured memory_bytes: 128
sx, sy, tx, ty = gets.split.map(&:to_i)
x = (tx - sx)
y = (ty - sy)

puts 'R'*x+'U'*y+'L'*x+'D'*y+'D'+'R'*(x+1)+'U'*(y+1)+'LU'+'L'*(x+1)+'D'*(y+1)+'R'

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

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

	string ans;
	for (int i = 0; i < N; i++) {
		if (S[i] != S[K - 1]) {
			S[i] = '*';
		}
	}
	cout << S << endl;
}

Measured memory_bytes: 384
num=int(input())
fig=list(map(int,input().split()))
 
Even_flag=0
count=0
 
while Even_flag==0:
  for i in range(num):
    if fig[i]%2==1:
      Even_flag=1
      break
    else:
      fig[i]=fig[i]/2
      if i==num-1:
        count+=1
        
print(count)

Measured memory_bytes: 3060
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <inttypes.h>
#include <string.h>
#include <math.h>

int main (int argc, char const *argv[])
{
    int64_t A, B, K;
    int64_t i, k = 0, ans = 0;

    scanf("%"PRId64"%"PRId64"%"PRId64, &A, &B, &K);

    i = A;

    while (k != K) {
        if ((A % i == 0) && (B % i == 0)) {
            k++;
            ans = i;
        }
        i--;
    }

    printf("%"PRId64"\n", ans);
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i,n) for(int i=n; i>-1; --i)
#define ALL(a) (a).begin(),(a).end()
#define INIT(a,n,x); REP(i,(n)){ (a)[i]=(x); }
#define CINA(a,n); REP(i,(n)){ cin >> (a)[i]; }
#define INIT2(a,n,m,x); REP(i,(n)){ REP(j,(m)){(a)[i][j]=(x);} }
#define CINA2(a,n,m); REP(i,(n)){ REP(j,(m)){cin >> (a)[i][j];} }
#define LINY "YES\n"
#define Liny "Yes\n"
#define LINN "NO\n"
#define Linn "No\n"
#define umap unordered_map
//cout << setfill('0') << right << setw(4) << 12; // "0012"

ll min(ll x,ll y){return (x<y ? x:y);}
ll max(ll x,ll y){return (x>y ? x:y);}
int keta(ll x){ if(x<10){return 1;} else{return keta(x/10) + 1;}}
int keta_wa(ll x){ if(x<10){return x;} else{return keta_wa(x/10) + x%10;} }
int ctoi(char c){ return ( (c>='0' && c<='9')? c - '0': 0 );}
ll gcd(ll a,ll b){if(a<b)swap(a,b); return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){if(a<b){swap(a,b);} return a*b /gcd(a,b);}

int main(){
  int N,M; cin>>N>>M;
  int l = 1, r=N;
  int l_temp,r_temp;
  REP(i,M){
    cin >> l_temp >> r_temp;
    if(l_temp>l){ l = l_temp;}
    if(r_temp<r){ r = r_temp;}
  }
  int result = r-l+1;
  if(result<0){result = 0;}
  cout << result <<"\n";
}

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

int main() {
  int N;
  cin >> N;
  double sum = 0;
  for (int i = 0; i < N; ++i) {
    double x;
    cin >> x;
    sum += 1 / x;
  }
  sum = 1 / sum;
  cout << sum << endl;
}


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

int main() {
  int n, k; cin >> n >> k;
  vector<ll> h(n);
  rep(i,n) cin >> h[i];
  sort(h.begin(), h.end(), greater<int>());
    
  ll sum = 0;
  for (int i=k; i<n; ++i) {
    sum += h[i];
  }
  
  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

int main(int argc, char const *argv[]) {
    char c; cin>>c;
    if ('A' <= c && c<='Z') {
        cout << 'A' << '\n';
    }
    else {
        cout << 'a' << '\n';
    }
    return 0;
}

Measured memory_bytes: 3632
a, b, k = map(int, input().split())
if (b - a + 1) > 2 * k:
  for i in range(a, a + k):
    print(i)
  for j in range(b - k + 1, b + 1):
    print(j)
else:
  for n in range(a, b + 1):
    print(n)

Measured memory_bytes: 3060
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4") 
#include <bits/stdc++.h> 
using namespace std;
 
typedef long long ll;
typedef long double ld;
#define PI 3.1415926535897932384626 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd; 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
 
#define Rep(i, a, b) for (int i=a; i<(b); i++)
#define rep(i, a) for (int i=0; i<(a); i++)
#define Dep(i,a,b) for (int i = (b)-1; i >= a; i--)
#define dep(i,a) for (int i = (a)-1; i >= 0; i--)
#define trav(a,x) for(auto& a : x)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define ins insert
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); // Random No.
 
const int MOD = 1000000007;
const char nl = '\n';

void sol() {
    ll x;
    cin >> x;

    vector<ll> v;
    int last  = x %26;
    if(last==0){last = 26;}
    x = x -last;
    v.pb(last);
    while(true){
        if(x<26){break;}
        x = (ll)(x/26);
        if(x%26 == 0){v.pb(26);
        x = x - 26;
        continue;}
        v.pb(x%26);
    }
    
    reverse(all(v));
    trav(y, v){
        char z = 'a' + y-1;
        cout << z;
    }


}               

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

    #ifndef ONLINE_JUDGE
    	//freopen("inputC.txt", "r", stdin);
	  #endif    
	
    int T=1;
    while(T--) {            
        sol();                
    }
	
	return 0;
}

Measured memory_bytes: 3652
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

/**
 * @author Pavel Mavrin
 */
public class Main {

    void init(int n, int m) {
        m *= 2;
        this.n = n;
        this.m = m;
        last = 0;
        head = new int[n];
        nx = new int[m];
        dst = new int[m];
        src = new int[m];
        Arrays.fill(head, -1);
    }

    void addEdge(int x, int y) {
        nx[last] = head[x];
        src[last] = x;
        dst[last] = y;
        head[x] = last;
        last++;
        nx[last] = head[y];
        src[last] = y;
        dst[last] = x;
        head[y] = last;
        last++;
    }

    int res = 0;
    boolean qqq = false;

    private boolean dfs(int x, int p) {
        int j = head[x];
        boolean s = false;
        int k = 0;
        while (j >= 0) {
            int y = dst[j];
            if (y != p) {
                if (!dfs(y, x))
                    k++;
                else
                    s = true;
            }
            j = nx[j];
        }
//        System.out.println(x + " " + k);
        if (k >= 2) {
            res += k - 1;
            s = true;
//            System.out.println(res);
        }
        qqq = k > 0;
        return s;
    }

    int n, m;
    int[] head;
    int[] nx;
    int[] src;
    int[] dst;
    int last;

    private void solve() throws IOException {
        int n = nextInt();
        init(n, n - 1);
        int[] d = new int[n];
        for (int i = 0; i < n - 1; i++) {
            int x = nextInt();
            int y = nextInt();
            d[x]++;
            d[y]++;
            addEdge(x, y);
        }
        res = 1;
        for (int i = 0; i < n; i++) {
            if (d[i] > 2) {
                res = 0;
                dfs(i, -1);
                break;
            }
        }
        out.println(res);
    }

    // ------------------

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringTokenizer st;
    PrintWriter out = new PrintWriter(System.out);

    String next() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

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

    public static void main(String[] args) throws IOException {
        new Main().run();
    }

    private void run() throws IOException {
        solve();
        out.close();
    }

}


Measured memory_bytes: 48304
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]

use std::str::FromStr;
use std::io::*;
use std::collections::*;
use std::cmp::*;

struct Scanner<I: Iterator<Item = char>> {
    iter: std::iter::Peekable<I>,
}

macro_rules! exit {
    () => {{
        exit!(0)
    }};
    ($code:expr) => {{
        if cfg!(local) {
            writeln!(std::io::stderr(), "===== Terminated =====")
                .expect("failed printing to stderr");
        }
        std::process::exit($code);
    }}
}

impl<I: Iterator<Item = char>> Scanner<I> {
    pub fn new(iter: I) -> Scanner<I> {
        Scanner {
            iter: iter.peekable(),
        }
    }

    pub fn safe_get_token(&mut self) -> Option<String> {
        let token = self.iter
            .by_ref()
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            Some(token)
        }
    }

    pub fn token(&mut self) -> String {
        self.safe_get_token().unwrap_or_else(|| exit!())
    }

    pub fn get<T: FromStr>(&mut self) -> T {
        self.token().parse::<T>().unwrap_or_else(|_| exit!())
    }

    pub fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.get()).collect()
    }

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }

    pub fn char(&mut self) -> char {
        self.iter.next().unwrap_or_else(|| exit!())
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.get::<String>().chars().collect()
    }

    pub fn line(&mut self) -> String {
        if self.peek().is_some() {
            self.iter
                .by_ref()
                .take_while(|&c| !(c == '\n' || c == '\r'))
                .collect::<String>()
        } else {
            exit!();
        }
    }

    pub fn peek(&mut self) -> Option<&char> {
        self.iter.peek()
    }
}

trait Joinable {
    fn join(self, sep: &str) -> String;
}

impl<U: ToString, T: Iterator<Item = U>> Joinable for T {
    fn join(self, sep: &str) -> String {
        self.map(|x| x.to_string()).collect::<Vec<_>>().join(sep)
    }
}
fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin.bytes().map(|c| c.unwrap() as char));
    let r: usize = sc.get();
    println!("{}", r * r);
}


Measured memory_bytes: 4352
h,w = map(int,input().split())
L = []
for i in range(h):
    L.append(list(input()))
L = [x for x in L if "#" in x]
L = [x for x in zip(*L)]
L = [x for x in L if "#" in x]
L = [x for x in zip(*L)]
for i in range(len(L)):
    print(*L[i],sep = "")

Measured memory_bytes: 4596
#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>
#include <bitset>
#include <math.h>
#include <list>

auto& in = std::cin;
auto& out = std::cout;
#define all(C) std::begin(C), std::end(C)
const double PI = 3.141592653589793238462643383279502884197169399375105820974944;


int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);
	in.tie(nullptr);
	out.tie(nullptr);
	int Q;
	in >> Q;
	while (Q--)
	{
		int64_t A, B;
		in >> A >> B;
		if (B < A) {
			std::swap(A, B);
		}

		int64_t res = 0;
		int64_t max_v = A * B;
		auto sqrt_ = int64_t(sqrt(max_v)+0.5);
		if (max_v <= sqrt_ * sqrt_) {
			--sqrt_;
		}
		if (A <= sqrt_) {
			--res;
		}
		if (sqrt_ * (sqrt_+1) >= max_v) {
			--res;
		}
		out << sqrt_*2+res << endl;
	}

	return 0;
}
#endif


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

int main() {
    int n, k, r, s, p;
    cin >> n >> k >> r >> s >> p;
    string t;
    cin >> t;
    for (int i = k; i < n; i++) {
        if (t[i] == t[i-k]) t[i] = 'a';
    }
    int numr, nums, nump;
    numr = 0;
    nums = 0;
    nump = 0;
    for (int i = 0; i < n; i++) {
        if (t[i] == 'r') numr++;
            else if (t[i] == 's') nums++;
                else if (t[i] == 'p') nump++;
    }
    int ans = numr*p + nums*r + nump*s;
	cout << ans << endl;
}

Measured memory_bytes: 3736
#include<bits/stdc++.h>
using namespace std;
int ara[100005],dp[100005];

int main()
{
    int n,m,i,j,k,a,b,c,x,y,z;
    cin>>n>>m;
    for(i=0;i<n;i++){
        scanf("%d",&ara[i]);
    }
    for(i=n-1;i>=0;i--){
        for(j=1,k=0;j<=m&&i+j<n;j++){
            if(j==1){
                k=dp[j+i]+abs(ara[i]-ara[i+j]);
            }
            else{
                k=min(k,dp[j+i]+abs(ara[i]-ara[i+j]));
            }
            //cout<<i<< "  "<<j<< "  "<<k<<endl;

        }
        //cout<<i<<"   "<<k<<endl;
        dp[i]=k;
    }
    cout<<dp[0]<<endl;
}


Measured memory_bytes: 1024
program main
  
  implicit none
  integer(4) :: n, i, j
  integer(8) :: nr, ng, nb
  integer(8) :: ans
  character(4000) :: s
  
  read(*,*) n
  read(*,*) s
  
  nr = 0
  ng = 0
  nb = 0
  do i = 1, n
    if( s(i:i) == "R" ) then
      nr = nr + 1
    else if( s(i:i) == "G" ) then
      ng = ng + 1
    else
      nb = nb + 1
    end if
  end do
  ans = nr * ng * nb
  do i = 1, n-2
    do j = i+1, n-1
    if( 2*j-i > n ) cycle
    if( s(i:i) == "R" ) then
      if( s(j:j) == "G" ) then
        if( s(2*j-i:2*j-i) == "B"  ) ans = ans - 1
      end if
    end if
    if( s(i:i) == "R" ) then
      if( s(j:j) == "B" ) then
        if( s(2*j-i:2*j-i) == "G" ) ans = ans - 1
      end if
    end if
    if( s(i:i) == "G" ) then
      if( s(j:j) == "R" ) then
        if( s(2*j-i:2*j-i) == "B" ) ans = ans - 1
      end if
    end if
    if( s(i:i) == "G" ) then
      if( s(j:j) == "B" ) then
        if( s(2*j-i:2*j-i) == "R" ) ans = ans - 1
      end if
    end if
    if( s(i:i) == "B" ) then
      if( s(j:j) == "R" ) then
        if( s(2*j-i:2*j-i) == "G" ) ans = ans - 1
      end if
    end if
    if( s(i:i) == "B" ) then
      if( s(j:j) == "G" ) then
        if( s(2*j-i:2*j-i) == "R" ) ans = ans - 1
      end if
    end if
    end do
  end do

  print*, ans 

end program main


Measured memory_bytes: 2804
#include <bits/stdc++.h>
#define ll long long
#define fast cin.tie(0);cout.tie(0);
#define order ios::sync_with_stdio(0);
using namespace std;
int t;
ll a,b,c;
int main()
{
    cin>>a>>b>>c;
    cout<<c<<" "<<a<<" "<<b;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (ll i = (ll)(a); i < (ll)(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ll long long
#define lld long double
#define ALL(x) x.begin(), x.end()
using namespace std;

int main(int argc, char const *argv[])
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    string ans = "";
    int cur = 0;
    int front = 0;
    int rear = 0;
    rep(i, n)
    {

        if (s[i] == '(')
        {
            ans += "(";
            cur++;
        }
        else
        {
            cur--;
            if (cur < 0)
            {
                cur++;
                front++;
            }
            ans += ")";
        }
    }
    rep(i, cur) ans += ")";
    rep(i, front) ans = "(" + ans;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>
#include <map>
#include <unordered_map>
#include <string.h>
#include<iomanip>
#include <iterator>

#define all(a) a.begin(),a.end()
#define VV(T) vector<vector< T > >
#define rep(i,N) for(int i = 0; i <N; i++)
#define fill(x,y) memset(x,y,sizeof(x))
#define name(x) #x
using namespace std;


const int INF = INT_MAX-100;
const int MOD = pow(10,9)+7;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

typedef long long ll,LL;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
typedef pair<int,int> pii;
typedef pair<LL, LL> pLL;


// vector入力
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
    for(T& x: vec) is >> x;
    return is;
}
// vector出力
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec){
    for(int i=0; i<vec.size(); i++){
        os << vec[i] << ( i+1 == vec.size() ? "" : " " );
    }
    return os;
}

struct UnionFind {
    // UnionFind u(n) 宣言
    // u.unionSet(x,y) 併合
    // u.findSet(x,y) -> {true, false}
    // u.root(x) xのroot. data[x]を参照。併合前はxそのもの、併合後は同一union
    vector<int> data;
    UnionFind(int size) : data(size, -1) { }
    bool unionSet(int x, int y) {
        x = root(x); y = root(y);
        if (x != y) {
            if (data[y] < data[x]) swap(x, y);
            data[x] += data[y];
            data[y] = x;
        }
        return x != y;
    }
    bool findSet(int x, int y) {
        return root(x) == root(y);
    }
    int root(int x) {
        return data[x] < 0 ? x : data[x] = root(data[x]);
    }
    int size(int x) {
        return -data[root(x)];
    }
};

int main() {
    int N, K, L;
    cin >> N >> K >> L;
    
    UnionFind nk(N+1);
    UnionFind nl(N+1);
    
    int a, b;
    for(auto i = 0; i<K; i++){
        cin >> a >> b;
        nk.unionSet(a,b);
    }
    
    for(auto i = 0; i<L; i++){
        cin >> a >> b;
        nl.unionSet(a,b);
    }
    
    map<pair<int,int>,int> mp;
    
    for(auto i = 1; i<=N; i++){
        
        mp[make_pair(nk.root(i),nl.root(i))]++;
        
    }
    
    for(auto i = 1; i<N; i++){
        
        cout << mp[make_pair(nk.root(i),nl.root(i))] << " ";
        
    }
    cout <<mp[make_pair(nk.root(N),nl.root(N))]  << endl;
    
    
    return 0;
}




Measured memory_bytes: 13568
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
using namespace std;

char data[4][1000001];
int cnt[4][1000001];
int len[4];
int main(void){
	for(int i=0;i<3;i++){
		while(1){
			scanf("%c%*c",&data[i][len[i]]);
			if(data[i][len[i]]=='$'){
				len[i]++;
				break;
			}
			scanf("%d%*c",&cnt[i][len[i]]);
			len[i]++;
		}
	}
	int i;
	for(i=0;i<=len[0]-len[1];i++){
		int j;
		for(j=0;j<len[1]-1;j++){
			if(data[0][i+j]!=data[1][j])break;
			if(j==0 && cnt[0][i+j]>cnt[1][j])continue;
			if(cnt[0][i+j]==cnt[1][j])continue;
			if(j==len[1]-2 && cnt[0][i+j]>cnt[1][j])continue;
			break;
		}
		if(j==len[1]-1){
			for(int j=0;j<len[0];j++){
				if(j<i){
					data[3][len[3]]=data[0][j];
					cnt[3][len[3]]=cnt[0][j];
					len[3]++;
				}else if(i==j){
					if(len[1]==2){
						for(int k=0;k<len[2]-1;k++){
							if(len[3]>0 && data[3][len[3]-1]==data[2][k])cnt[3][len[3]-1]+=cnt[2][k];
							else{
								data[3][len[3]]=data[2][k];
								cnt[3][len[3]]=cnt[2][k];
								len[3]++;
							}
						}
						if(cnt[0][j]>cnt[1][0]){
							if(len[3]>0 && data[3][len[3]-1]==data[0][j])cnt[3][len[3]-1]+=cnt[0][j]-cnt[1][0];
							else{
								data[3][len[3]]=data[0][j];
								cnt[3][len[3]]=cnt[0][j]-cnt[1][0];
								len[3]++;
							}
						}
					}else{
						if(cnt[0][j]>cnt[1][0]){
							data[3][len[3]]=data[0][j];
							cnt[3][len[3]]=cnt[0][j]-cnt[1][0];
							len[3]++;
						}
						for(int k=0;k<len[2]-1;k++){
							if(len[3]>0 && data[3][len[3]-1]==data[2][k])cnt[3][len[3]-1]+=cnt[2][k];
							else{
								data[3][len[3]]=data[2][k];
								cnt[3][len[3]]=cnt[2][k];
								len[3]++;
							}
						}
					}
				}else if(len[1]>2 && j==i+len[1]-2){
					if(cnt[0][j]>cnt[1][len[1]-2]){
						if(len[3]>0 && data[3][len[3]-1]==data[0][j])cnt[3][len[3]-1]+=cnt[0][j]-cnt[1][len[1]-2];
						else{
							data[3][len[3]]=data[0][j];
							cnt[3][len[3]]=cnt[0][j]-cnt[1][len[1]-2];
							len[3]++;
						}
					}
				}else if(j>=i+len[1]-1){
					if(len[3]>0 && data[3][len[3]-1]==data[0][j])cnt[3][len[3]-1]+=cnt[0][j];
					else{
						data[3][len[3]]=data[0][j];
						cnt[3][len[3]]=cnt[0][j];
						len[3]++;
					}
				}
			}
			break;
		}
	}
	if(i==len[0]-len[1]+1 || len[0]<len[1]){
		for(int j=0;j<len[0];j++){
			printf("%c",data[0][j]);
			if(data[0][j]=='$'){
				printf("\n");
				return 0;
			}
			printf(" %d ",cnt[0][j]);
		}
	}
	for(i=0;i<len[3];i++){
		printf("%c",data[3][i]);
		if(data[3][i]=='$'){
			printf("\n");
			break;
		}
		printf(" %d ",cnt[3][i]);
	}
	return 0;
}

Measured memory_bytes: 11444
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def rls(): return list(map(str, input().split()))
def pl(a): print(" ".join(list(map(str, a))))
def ma():return map(int,input().split())
"""
k=ri()

n,k=ma()
for i in range(n):
    for

n=int(input())
s=input()
r=[0]*n
b=[0]*n
g=[0]*n

for i in range(n):
    if s[i]=="R":
"""

"""
from itertools import accumulate as acc
import operator as op
import copy as cp
import math; import numpy
from bisect import bisect_left as bisl
from bisect import bisect_right as bisr
###
"""



"""
import math
k=int(input())

cnt=0
for a in range(1,k+1):
    for b in range(1,k+1):
        ct=math.gcd(a,b)
        for c in range(1,k+1):
            cnt+=math.gcd(ct,c)

print(cnt)
"""
"""
n,k=map(int,input().split())
mod=10**9+7

import math
dj0=[[i for i in range(1,k+1)] for j in range(k)]
dj1=[i for i in range(1,k+1)]
dj2=[0]*k
for i in dj1:
    for j in range(1,k):
        dj0[i-1][j-1]=math.gcd(i,j)
        dj2[math.gcd(i,j)]+=1
"""
n=ri()
s=input()
ans = s.count("R")*s.count("G")*s.count("B")
for i in range(n):
    for j in range(i+1,n):
        k=2*j-i
        if k>=n:
            break
        ans-=s[k]!=s[i]!=s[j]!=s[k]

print(ans)

Measured memory_bytes: 9252
#include<iostream>
#include<vector>
#include<memory>

// 基本的には引くべきではない
// 必要なときのみ引くべきだ
// 途中で減少可能かどうかをフラグ管理
//
// いや、差が1だったら常に引いておく、でどうだ
// 差が2の場所を潰せるかどうか問題になる

// 2以上跳ねたときにベースが変わるとしてベースのみ管理

int main(void)
{
        int N;
        std::cin >> N;
        auto H = std::make_unique<int[]>(N+1);

        for(auto i = 1; i < N+1; i++)
        {
                int input;
                std::cin >> input;
                H.get()[i] = input;
        }

        int base_value = H.get()[1] - 1;
        for(auto i = 2; i < N+1; i++)
        {
                const int new_value = H.get()[i];
                if(base_value > new_value) // base_valueより小さいなら対処できない
                {
                        std::cout << "No" << std::endl;
                        return 0;
                }
                else if(base_value + 2 < new_value) // new_valueが大きいならbaseを更新
                {
                        base_value = new_value - 1;
                }
        }

        std::cout << "Yes"  << std::endl;
        return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <cmath>
#include <iomanip>

using namespace std;
static const double pi = 3.141592653589793;

typedef struct __zahyou
{
        double x;
        double y;
} zahyou_t;

zahyou_t calc_spoint( zahyou_t p1, zahyou_t p2 )
{
        zahyou_t s;
        s.x = ( 2*p1.x + 1*p2.x ) / 3;
        s.y = ( 2*p1.y + 1*p2.y ) / 3;

        return s;
}

zahyou_t calc_tpoint( zahyou_t p1, zahyou_t p2 )
{
        zahyou_t t;
        t.x = ( 1*p1.x + 2*p2.x ) / 3;
        t.y = ( 1*p1.y + 2*p2.y ) / 3;

        return t;
}

zahyou_t calc_upoint( zahyou_t s, zahyou_t t )
{
        zahyou_t u;
        u.x = ( t.x - s.x ) * cos( pi / 3 ) -
                ( t.y - s.y ) * sin( pi / 3 ) + s.x;
        u.y = ( t.x - s.x ) * sin( pi / 3 ) +
                ( t.y - s.y ) * cos( pi / 3 ) + s.y;
        return u;
}

void printpoint( zahyou_t p )
{
        cout << showpoint << p.x << " "
                << showpoint << p.y << endl;
}

int kock( int n, zahyou_t p1, zahyou_t p2 )
{
        if ( n == 0 )
                return 0;

        zahyou_t s = calc_spoint( p1, p2 );
        zahyou_t t = calc_tpoint( p1, p2 );
        zahyou_t u = calc_upoint( s, t );

        kock( n-1, p1, s );
        printpoint( s );
        kock( n-1, s, u );
        printpoint( u );
        kock( n-1, u, t );
        printpoint( t );
        kock( n-1, t, p2 );

        return 0;
}

int main()
{
        zahyou_t p1, p2;
        p1.x = 0, p1.y = 0;
        p2.x = 100, p2.y = 0;

        int set_num;
        cin >> set_num;
        printpoint( p1 );
        kock( set_num, p1, p2 );
        printpoint( p2 );

        return 0;
}

Measured memory_bytes: 3288
from __future__ import print_function

import sys
sys.setrecursionlimit(500000)

import re
import array
import copy
import functools
import operator

import math
import string
import fractions
from fractions import Fraction

import collections
import itertools
import bisect

import random
import time

import heapq
from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace
from queue import PriorityQueue as pq
from queue import Queue

from itertools import accumulate

from collections import deque
from collections import Counter

from operator import mul
from functools import reduce

input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

# from fractions import gcd
# from math import gcd

# def lcm(n, m):
#     return int(n * m / gcd(n, m))


# def coprimize(p, q):
#     common = gcd(p, q)
#     return (p // common, q // common)


# def find_gcd(list_l):
#     x = reduce(gcd, list_l)
#     return x


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def main():
    S = input().strip()
    T = input().strip()
    n=len(S)
    for i in range(n):
        if S[i]!=T[i]:
            print("No")
            return
    print("Yes")

if __name__ == '__main__':
    main()

Measured memory_bytes: 78172
#include <iostream>

int main(){
    int w, h, x, y, r;
    std::cin >> w >> h >> x >> y >> r;

    if (r <= x && x <= w - r && r <= y && y <= h - r) std::cout << "Yes" << std::endl;
    else std::cout << "No" << std::endl;

    return 0;
}

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

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int a, b;
	cin >> a >> b;
	int res = b - a;
	int ans = 0;
	for (int i = 1; i <= b - a; ++i) {
		ans += i;
	}
	cout << ans - b << endl;
	return 0;
}

Measured memory_bytes: 256
mod = 10**9+7
n, k = [ int(v) for v in input().split() ]
num = sorted([ int(v) for v in input().split() ])


max_list2 = [ (i, i-k+1) for i in range(n) ]
max_list = []
for a, b in max_list2:
    if b < 0:
        max_list.append(0)
    elif b == 0:
        max_list.append(1)
    else:
        s = max_list[-1]
        s *= a * pow(b, mod-2, mod)
        max_list.append(s%mod)

min_list = list(reversed(max_list))

max_min_list = [ (max_list[i] - min_list[i]) * num[i] for i in range(n) ] 
print(sum(max_min_list) % mod)

Measured memory_bytes: 82088
MOD = 10**9 + 7

N, A, B = map(int, input().split())

def getComb(n, k, MOD):
    if n < k:
        return 0
    if n-k < k:
        k = n-k
    comb = 1
    for x in range(n-k+1, n+1):
        comb = (comb * x) % MOD
    d = 1
    for x in range(1, k+1):
        d = (d * x) % MOD
    comb *= pow(d, MOD-2, MOD)
    return comb % MOD

ans = pow(2, N, MOD) - 1
ans -= getComb(N, A, MOD)
ans -= getComb(N, B, MOD)
ans %= MOD

print(ans)


Measured memory_bytes: 9148
#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

typedef int64_t  ll;
typedef uint64_t ull;

#define rep(i,n)   for (int i = 0; i < (n); i++)
#define rrep(i,n)  for (int i = (n)-1; i >= 0; i--)
#define rep1(i,n)  for (int i = 1; i <= (n); i++)
#define rrep1(i,n) for (int i = (n); i > 0; i--)

int main(void) {
    int n, a;
    cin >> n;
    a = n/2+1;
    if (n == 1) {
        cout << 1 << endl;
    } else if (n%2==0) {
        cout << 0.5 << endl;
    } else {
        cout << a/(double)n << endl;
    }
    return 0;
}


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;
const ll mod =  1000000007;
vector<ll> saisyo = {ll(1)};

vector<ll>  makecomb(int n){
  if(n == 0) return saisyo;
  vector<ll> comblist(n+1);
  vector<ll> prev = makecomb(n-1);
  comblist[0] = 1; comblist[n] = 1;
  for(int i =1; i<n; i++)
    comblist[i] = (prev[i-1] + prev[i]) % mod;
  return comblist;
}
  
int main() {
  int n, k;
  cin >> n >> k;  
  vector<ll> clist1 = makecomb(k-1);
  vector<ll> clist2 = makecomb(n-k+1);
  for(int i = 1; i<k+1; i++) {
    if(n-k+1 < i)
      cout << "0" << endl;
    else
      cout << clist1[i-1] * clist2[i] % mod <<endl;
  }
  return 0;
}


Measured memory_bytes: 16000
#include <iostream>

using namespace std;
string s1,s2,u;
int a,b;
int main()
{
    cin>>s1>>s2;
    cin>>a>>b;
    cin>>u;
    if(u==s1)
        cout<<a-1<<' '<<b;
    else
        cout<<a<<' '<<b-1;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
using namespace std;

long long power(long long a, long long b) {
    //a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
    }
  ll int binomial(ll int n, ll int k) 
{ 
    ll int C[k+1]; 
    memset(C, 0, sizeof(C)); 
  
    C[0] = 1;  // nC0 is 1 
  
    for (ll int i = 1; i <= n; i++) 
    { 
        // Compute next row of pascal triangle using 
        // the previous row 
        for (int j = min(i, k); j > 0; j--) 
            C[j] = C[j] + C[j-1]; 
    } 
    return C[k]; 
} 
  vector<int> pr;
void Sieve(ll int n) 
{ 
    bool prime[10000000];
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        if (prime[p] == true) 
        { 
            pr.push_back(p);
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
}
 




//It reurns Fn,Fn+1
pair<int, int> fib (int n) {
    if (n == 0)
        return {0, 1};

    auto p = fib(n >> 1);
    int c = p.first * (2 * p.second - p.first);
    int d = p.first * p.first + p.second * p.second;
    if (n & 1)
        return {d, c + d};
    else
        return {c, d};
}


  
int main() {
   ll int n;
    cin>>n;
    ll int a[n];
    ll int s=0;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        s=s^a[i];
    }
    for(int i=0;i<n;i++)
    {
        int l=s^a[i];
        cout<<l<<" ";
    }
    cout<<endl;
}


Measured memory_bytes: 5148